/* OrderPro Modern Clear — shared additions for the PHP admin.
   Load order: tokens.css → bundle.css → base.css → <page>.css (all in admin/css/clear)
   - tokens.css / bundle.css are copies of the design system. Never edit them here.
   - This file holds what the design system does not ship yet: the font file, the page
     background, small pieces the approved canvas boards add on top of bundle.css
     (list template v3), the profile menu and the date picker theme.
   - Anything here that turns out to be shared by every screen should move into the
     design system (bundle.css) and be removed from this file. */

/* Font: Pretendard Variable from the CDN (dynamic subset), loaded by the layout. */

html, body { margin: 0; padding: 0; }
body { background: var(--backdrop); }
.app.shell { min-height: 100vh; }

/* Module colours are in tokens.json but not yet in the generated tokens.css. */
:root, [data-theme] {
  --shadow-card: 0 1px 2px rgba(0,27,55,.06), 0 12px 32px -12px rgba(0,27,55,.20);
}
[data-theme$="dark"] {
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.7);
}

/* ── Sidebar: closed submenus (bundle.css sets .nsub to flex, which beats [hidden]) ── */
.nsub[hidden] { display: none; }

/* ── Sidebar: scope card is information only (no scope switch yet) ── */
.store.is-static { cursor: default; }
.store.is-static:hover { background: var(--surface-2); }

/* ── Topbar: profile button + menu ── */
.me-wrap { position: relative; display: inline-flex; }
button.me { cursor: pointer; }
.me[aria-expanded="true"] { background: var(--fill); }
.me-pop {
  position: absolute; top: calc(100% + 10px); right: -6px; z-index: 120;
  min-width: 232px; padding: 8px; border-radius: var(--radius-pop);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-pop);
  display: flex; flex-direction: column; gap: 2px;
}
.me-pop[hidden] { display: none; }
.me-pop .me-id { padding: 10px 12px 8px; font-size: 14px; color: var(--t4); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.me-pop .me-id b { display: block; font-size: 16px; color: var(--t1); font-weight: 700; }
.me-pop a, .me-pop button {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; color: var(--t2); text-align: left;
}
.me-pop a:hover, .me-pop button:hover { background: var(--fill); color: var(--t1); }
.me-pop .ico { color: var(--t4); }
.me-pop .me-lang { display: none; }
@media (max-width: 720px) { .me-pop .me-lang { display: flex; } }

/* ── Topbar: session time (admin-session.js updates [data-session-header]) ── */
.sess[data-state="warning"] b, .sess[data-state="expired"] b { color: var(--red-text); }
.sess button[disabled] { opacity: .5; cursor: default; }

/* ── Topbar: notifications ── */
.noti-wrap { position: relative; display: inline-flex; }
.noti-pop {
  position: absolute; top: calc(100% + 10px); right: -6px; z-index: 120; width: 360px; max-height: min(520px, calc(100vh - 96px));
  display: flex; flex-direction: column; border-radius: var(--radius-pop); background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-pop); overflow: hidden;
}
.noti-pop[hidden] { display: none; }
.noti-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); }
.noti-hd b { font-size: 17px; font-weight: 700; color: var(--t1); }
.noti-hd button { height: 32px; padding: 0 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--blue-text); }
.noti-hd button:hover { background: var(--blue-weak); }
.noti-list { overflow-y: auto; padding: 6px 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.noti-i { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; }
.noti-i.is-new { background: var(--surface-2); }
.noti-i .nt { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 600; color: var(--t1); }
.noti-i .nt time { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--t4); white-space: nowrap; }
.noti-i p { font-size: 14px; line-height: 1.5; color: var(--t3); overflow-wrap: anywhere; }
.noti-i a { color: var(--blue-text); font-weight: 600; }
.noti-empty { padding: 32px 16px; text-align: center; font-size: 15px; color: var(--t4); }
@media (max-width: 860px) { .noti-pop { position: fixed; top: 72px; left: 12px; right: 12px; width: auto; } }

/* ── Session dialog (includes/session_dialog.php) in Clear colours; admin-session.css does the layout ── */
.op-session-dialog .op-session-card { background: var(--surface); color: var(--t1); border-radius: var(--radius-card); padding: 28px; font-family: var(--font-sans); }
.op-session-dialog .op-session-card h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.op-session-dialog .op-session-card p { color: var(--t3); font-size: 16px; }
.op-session-dialog .op-session-card .op-session-countdown { color: var(--t1); }
.op-session-dialog .op-session-card button { height: 48px; border: 0; border-radius: var(--radius-md); background: var(--btn); color: var(--pon); font: inherit; font-size: 16px; font-weight: 600; }
.op-session-dialog .op-session-card button:hover { background: var(--btn-hover); }
.op-session-dialog .nl-head, .op-session-dialog .nl-body, .op-session-dialog .nl-bottom { padding: 0; border: 0; }

/* ── List template v3 (order, item, coupon … lists): pieces the approved boards add ── */
.fdate {
  display: inline-flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 14px;
  border-radius: var(--radius-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--t4); cursor: text; min-width: 0;
}
.fdate:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.fdate.is-set { box-shadow: inset 0 0 0 1.5px var(--blue); color: var(--blue-text); }
.fdate input {
  flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent;
  font-size: 16px; font-weight: 500; color: var(--t2); font-variant-numeric: tabular-nums;
}
.fdate input::placeholder { color: var(--t2); font-weight: 500; }
/* the field draws the focus ring (:focus-within); the input inside does not draw a second one */
.fdate input:focus, .fdate input:focus-visible { outline: 0; box-shadow: none; }
.fgrid .fsel { font-weight: 500; }
.fgrid .fsel.is-set { font-weight: 600; }
.fgrid select.fsel { text-overflow: ellipsis; }
.fpick { text-align: left; }
.fpick .ico { color: var(--t4); }
.fpick.is-set .ico { color: var(--blue-text); }
.fpick .fp-x { margin-left: auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--t4); }
.fpick .fp-x:hover { background: var(--fill); color: var(--t1); }
.fgrid .search { order: 0; } /* bundle.css moves .search last on phones (topbar rule) */
.fgrid .search input { font-size: 16px; width: 100%; min-width: 0; }
/* The search box draws its own focus ring; no second outline on the input inside it. */
.fgrid .search input:focus-visible, .pick-q .search input:focus-visible { outline: 0; }
.fg-q3 { grid-column: span 3; }
.fcap .freset { height: 36px; }
@media (max-width: 860px) { .fg-q, .fg-q2, .fg-q3, .fg-act { grid-column: 1 / -1; } }

.pager > span { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager .pp { height: 36px; padding: 0 32px 0 12px; border: 0; border-radius: var(--radius-sm); background-color: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 600; color: var(--t2);
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--t4) 50%), linear-gradient(135deg, var(--t4) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.pg-gap { min-width: 24px; text-align: center; color: var(--t5); }
.pg[aria-current="page"] { box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--blue) 70%, transparent); }
@media (max-width: 720px) {
  .app .tabs { gap: 0; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .app .tabs::after { content: ""; flex: 0 0 24px; }
  .app .tab { padding: 0 12px; }
  .pager { justify-content: center; }
  .pager > span { flex: 1 1 100%; justify-content: center; }
  .pg { min-width: 36px; }
  .pages { flex-wrap: wrap; justify-content: center; }
}

/* ── Picker dialog (owner / shop search) ── */
.pick-q { display: flex; gap: 8px; }
.pick-q .search { flex: 1 1 auto; max-width: none; height: 48px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pick-q .search:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.pick-list { display: flex; flex-direction: column; gap: 2px; min-height: 120px; }
.pick-list button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  min-height: 56px; padding: 8px 14px; border-radius: var(--radius-md); text-align: left;
}
.pick-list button:hover, .pick-list button:focus-visible { background: var(--fill); }
.pick-list button[aria-selected="true"] { background: var(--blue-weak); }
.pick-list b { font-size: 16px; font-weight: 600; color: var(--t1); }
.pick-list small { font-size: 14px; color: var(--t4); }
.pick-list .pick-msg { padding: 24px 8px; text-align: center; color: var(--t4); font-size: 15px; }
.modal[hidden], .scrim[hidden], .toast[hidden], .dsp[hidden], .dsp-scrim[hidden] { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

/* ── Date picker (jQuery UI) in Clear colours ──
   jQuery UI adds an empty #ui-datepicker-div at the end of <body> on load; its own theme CSS (not
   loaded here) hides it until it opens, when it gets an inline display:block. Without this rule the
   empty box showed as a 24px strip under the page. */
.ui-datepicker {
  display: none;
  z-index: 130 !important; width: 296px; padding: 12px; border: 0 !important; border-radius: var(--radius-pop);
  background: var(--surface) !important; color: var(--t1) !important; box-shadow: 0 0 0 1px var(--line), var(--shadow-pop);
  font-family: var(--font-sans); font-size: 15px;
}
.ui-datepicker .ui-datepicker-header { position: relative; display: flex; align-items: center; justify-content: center; height: 40px; border: 0; background: none; color: var(--t1); font-weight: 700; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position: absolute; top: 2px; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.ui-datepicker .ui-datepicker-prev { left: 0; } .ui-datepicker .ui-datepicker-next { right: 0; }
.ui-datepicker .ui-datepicker-prev:hover, .ui-datepicker .ui-datepicker-next:hover { background: var(--fill); }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: none; }
.ui-datepicker .ui-datepicker-prev::before { content: "‹"; font-size: 22px; color: var(--t3); }
.ui-datepicker .ui-datepicker-next::before { content: "›"; font-size: 22px; color: var(--t3); }
.ui-datepicker table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.ui-datepicker th { padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--t4); }
.ui-datepicker td { padding: 1px; }
.ui-datepicker td a, .ui-datepicker td span {
  display: grid; place-items: center; height: 36px; border: 0 !important; border-radius: 10px;
  background: none !important; color: var(--t2) !important; text-decoration: none; font-variant-numeric: tabular-nums;
}
.ui-datepicker td a:hover { background: var(--fill) !important; }
.ui-datepicker td.ui-datepicker-today a { box-shadow: inset 0 0 0 1px var(--blue); }
.ui-datepicker td a.ui-state-active { background: var(--btn) !important; color: var(--pon) !important; font-weight: 700; }
.ui-datepicker td.ui-datepicker-other-month span { color: var(--t6) !important; }

@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { transition: none !important; animation: none !important; }
}
.me-form { display: contents; }
