/*
 * QDing admin operations skin.
 * Keeps QPoint's calm, task-first shell while using QDing's bell, ticket and rhythm-line accents.
 */
:root {
  --bg: #f3f7fc;
  --surface: #ffffff;
  --surface-soft: #fffaf0;
  --ink: #17324d;
  --muted: #63778b;
  --line: #dce7f0;
  --primary: #1f57c3;
  --primary-dark: #17469d;
  --teal: #197e93;
  --orange: #e5742d;
  --orange-dark: #c95d1e;
  --amber: #f5b631;
  --green: #338664;
  --red: #b42318;
  --amber-bg: #fff3d4;
  --amber-ink: #89520a;
  --ok-bg: #e4f7ed;
  --ok-ink: #176345;
  --danger-bg: #fdebea;
  --shadow: 0 16px 38px rgba(23, 50, 77, 0.075);
  --shadow-soft: 0 8px 22px rgba(23, 50, 77, 0.055);
  --radius: 16px;
  --radius-control: 10px;
}

body { background: var(--bg); }
button, input, select { font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
*:focus-visible { outline: 3px solid rgba(31, 87, 195, .24); outline-offset: 3px; }

.app { grid-template-columns: 264px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  overflow: hidden;
  padding: 24px 13px;
  color: var(--ink);
  background: #fffdf8;
  border-right: 1px solid var(--line);
  gap: 26px;
}
.sidebar::before {
  content: "";
  position: absolute;
  right: -72px;
  top: 76px;
  width: 170px;
  height: 170px;
  border: 18px solid rgba(245, 182, 49, .14);
  border-radius: 50%;
  pointer-events: none;
}
.sidebar::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 172px;
  width: 62px;
  height: 18px;
  border-top: 2px solid rgba(229, 116, 45, .38);
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
}
.sidebar .brand,
.sidebar .nav,
.sidebar .side-note { position: relative; z-index: 1; }
.sidebar .brand { padding: 0 10px; gap: 0; }
.sidebar .brand-mark { width: 42px; height: 42px; filter: drop-shadow(0 8px 16px rgba(23, 50, 77, .14)); }
.sidebar .brand strong { font-size: 19px; letter-spacing: -.45px; }
.sidebar .brand span { color: var(--muted); }
.sidebar .brand-logo-wrap,
.login-card .brand-logo-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.sidebar .brand-logo-lockup,
.login-card .brand-logo-lockup {
  display: block;
  width: auto;
  filter: drop-shadow(0 8px 16px rgba(23, 50, 77, .12));
}
.sidebar .brand-logo-lockup { height: 34px; }
.login-card .brand-logo-lockup { height: 38px; }
.sidebar .brand-logo-mark,
.login-card .brand-logo-mark {
  display: none;
  flex: 0 0 auto;
  filter: drop-shadow(0 7px 13px rgba(23, 50, 77, .14));
}
.sidebar .brand-logo-context,
.login-card .brand-logo-context {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
/* Keep legacy inline artwork/copy untouched structurally while rendering the approved brand assets. */
.sidebar .brand > svg.brand-mark,
.sidebar .brand > span:not(.brand-logo-wrap),
.login-card .brand > svg.brand-mark,
.login-card .brand > span:not(.brand-logo-wrap) { display: none; }
.nav { gap: 5px; }
.nav a {
  position: relative;
  min-height: 41px;
  padding: 0 13px;
  border-radius: var(--radius-control);
  color: #536b81;
  font-size: 13px;
  font-weight: 800;
}
.nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .18s ease, transform .18s ease;
}
.nav a:hover,
.nav a.is-active { color: var(--primary); background: #edf4ff; }
.nav a.is-active::before { opacity: 1; transform: scale(1); }
.side-note {
  position: relative;
  margin: auto 10px 0;
  padding: 16px 15px 15px 19px;
  overflow: hidden;
  border: 1px solid #efd7a4;
  border-radius: 15px 15px 15px 4px;
  color: #725c3c;
  background: #fff8e9;
  line-height: 1.72;
}
.side-note::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--orange);
}
.side-note::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: -15px;
  width: 60px;
  height: 60px;
  border: 11px solid rgba(245, 182, 49, .2);
  border-radius: 50%;
}

.main { padding: 0 30px 42px; }
.main > .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 92px;
  align-items: center;
  margin: 0 -30px 24px;
  padding: 0 30px;
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 18px rgba(23, 50, 77, .035);
  backdrop-filter: blur(14px);
}
.title { position: relative; padding-left: 16px; }
.title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 5px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(var(--amber), var(--orange));
}
.title h1 { color: var(--ink); font-size: clamp(28px, 3.2vw, 39px); letter-spacing: -1.4px; }
.title p { margin-top: 6px; font-size: 14px; }
.toolbar { gap: 8px; }
.btn {
  min-height: 40px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 800;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn-primary { box-shadow: 0 8px 18px rgba(31, 87, 195, .18); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { border-color: var(--line); }
.btn-secondary:hover { color: var(--primary); border-color: #bfd4f2; background: #f8fbff; }
.btn-danger { color: var(--red); border-color: #f1ccc7; }

/* Welcome band turns the landing state into an actual operations desk, not a generic dashboard header. */
.admin-welcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: center;
  gap: 26px;
  min-height: 128px;
  margin-bottom: 18px;
  padding: 24px 26px;
  overflow: hidden;
  border: 1px solid #d7e5f2;
  border-radius: 18px 18px 18px 6px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 12%, rgba(245, 182, 49, .34), transparent 9rem),
    linear-gradient(112deg, #17324d 0%, #204f99 100%);
  box-shadow: 0 16px 31px rgba(23, 50, 77, .13);
}
.admin-welcome::before {
  content: "";
  position: absolute;
  left: -56px;
  bottom: -82px;
  width: 220px;
  height: 220px;
  border: 24px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}
.admin-welcome-copy { position: relative; z-index: 1; max-width: 460px; }
.admin-welcome-copy > span { display: block; color: #ffd98b; font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.admin-welcome-copy p { margin: 9px 0 0; color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.75; }
.admin-welcome-rhythm { position: relative; z-index: 1; height: 78px; color: #ffd06b; }
.admin-welcome-rhythm svg { width: 184px; height: 68px; overflow: visible; }
.admin-welcome-rhythm path { stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-dasharray: .02 .045; }
.admin-welcome-rhythm circle { fill: var(--orange); stroke: #ffe9ad; stroke-width: 1.5; }
.admin-bell,
.admin-ticket { position: absolute; display: block; }
.admin-bell {
  top: 9px;
  right: 3px;
  width: 27px;
  height: 25px;
  border-radius: 16px 16px 7px 7px;
  background: #fff0c6;
  box-shadow: inset 0 -5px 0 #e5742d;
  transform: rotate(8deg);
}
.admin-bell::after { content: ""; position: absolute; left: 10px; bottom: -5px; width: 7px; height: 7px; border-radius: 50%; background: #e5742d; }
.admin-ticket {
  right: 35px;
  bottom: 0;
  width: 48px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 6px 13px 6px 13px;
  background: rgba(255,255,255,.08);
  transform: rotate(-7deg);
}
.admin-ticket::before,
.admin-ticket::after { content: ""; position: absolute; left: 9px; height: 2px; border-radius: 99px; background: rgba(255,255,255,.58); }
.admin-ticket::before { top: 10px; width: 25px; }
.admin-ticket::after { top: 16px; width: 16px; }
.admin-welcome-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(112px, 1fr)); gap: 8px; }
.quick-action {
  display: grid;
  gap: 4px;
  min-width: 117px;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.21);
  border-radius: 12px 12px 12px 4px;
  background: rgba(255,255,255,.1);
  transition: background .18s ease, transform .18s ease;
}
.quick-action:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.quick-action b { font-size: 13px; }
.quick-action small { color: rgba(255,255,255,.73); font-size: 11px; }

.metrics { gap: 15px; }
.metric,
.panel {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.metric {
  position: relative;
  min-height: 136px;
  padding: 18px;
  overflow: hidden;
  background: #fff;
}
.metric::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 58px;
  height: 58px;
  border: 12px solid #e9f1ff;
  border-radius: 0 0 0 50px;
}
.metric:nth-child(2)::before { border-color: #fff0d2; }
.metric:nth-child(3)::before { border-color: #e2f5f5; }
.metric:nth-child(4)::before { border-color: #fff0e7; }
.metric::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 17px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--primary);
  border-radius: 50%;
}
.metric:nth-child(2)::after { border-color: var(--amber); }
.metric:nth-child(3)::after { border-color: var(--teal); }
.metric:nth-child(4)::after { border-color: var(--orange); }
.metric span { position: relative; z-index: 1; font-size: 12px; }
.metric strong { position: relative; z-index: 1; margin-top: 14px; color: var(--ink); font-size: 34px; letter-spacing: -1.1px; }
.metric small { position: relative; z-index: 1; margin-top: 8px; font-size: 12px; }
.panel { overflow: hidden; background: #fff; }
.panel-head { min-height: 64px; padding: 16px 19px; }
.panel-head h2,
.panel-head h3 { font-size: 18px; letter-spacing: -.45px; }
.panel-body { padding: 19px; }
.product-card {
  position: relative;
  overflow: hidden;
  padding: 17px 18px 18px;
  border-color: #e3eaf2;
  border-radius: 13px 13px 13px 5px;
  background: #f9fbfe;
}
.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}
.product-card:nth-child(2)::before { background: var(--orange); }
.product-card h3 { font-size: 16px; }
.status { min-height: 27px; border-radius: 9px 9px 9px 3px; font-size: 11px; }
.empty {
  min-height: 136px;
  grid-auto-flow: row;
  gap: 10px;
  border: 1px dashed #c8d8e7;
  border-radius: 13px 13px 13px 5px;
  background: #f8fbff;
}
.empty::before {
  content: "";
  width: 29px;
  height: 27px;
  border-radius: 16px 16px 7px 7px;
  background: #fff0c6;
  box-shadow: inset 0 -5px 0 #e5742d, 0 7px 13px rgba(229,116,45,.12);
}
th { background: #f6f9fe; color: var(--muted); }
td, th { padding: 13px 14px; }
.toast { border-radius: 12px 12px 12px 4px; background: var(--ink); }

/* Login uses the same restaurant scene, cropped as a composed welcome panel rather than a generic gradient. */
.login {
  width: min(1160px, calc(100% - 48px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, .82fr);
  align-items: center;
  gap: 68px;
  max-width: 1160px;
  margin: 0 auto;
}
.login::before {
  content: "";
  min-height: 570px;
  border: 1px solid rgba(23, 50, 77, .1);
  border-radius: 37% 18% 31% 18% / 19% 24% 20% 32%;
  background-color: #fff3d8;
  background-image: url("/assets/qding-hero-operations-20260727.png");
  background-size: cover;
  background-position: 68% center;
  box-shadow: 0 25px 50px rgba(23, 50, 77, .15);
}
.login-card {
  padding: 34px;
  border-color: var(--line);
  border-radius: 19px 19px 19px 6px;
  box-shadow: var(--shadow);
}
.login-card .brand-mark { width: 43px; height: 43px; }
.login-card h1 { color: var(--ink); font-size: 34px; letter-spacing: -1.3px; }
.field input,
.field select { min-height: 46px; border-radius: 10px; border-color: var(--line); }
.field input:focus,
.field select:focus { border-color: var(--primary); outline: 3px solid rgba(31, 87, 195, .12); }

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}
.sidebar-toggle svg { width: 20px; height: 20px; }

@media (max-width: 1100px) {
  .login { gap: 38px; }
  .login::before { min-height: 515px; }
  .admin-welcome { grid-template-columns: 1fr auto; }
  .admin-welcome-rhythm { display: none; }
  .admin-welcome-actions { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    width: 264px;
    height: 100vh;
    transform: translateX(-102%);
    box-shadow: 14px 0 34px rgba(23, 50, 77, .14);
    transition: transform .22s ease;
  }
  .app.is-sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-toggle { display: inline-grid; place-items: center; }
  .main { padding: 0 16px 30px; }
  .main > .topbar { min-height: 69px; margin: 0 -16px 18px; padding: 0 16px; }
  .title { padding-left: 0; }
  .title::before { display: none; }
  .title h1 { font-size: 23px; }
  .title p,
  .toolbar { display: none; }
  .metrics,
  .two-col { grid-template-columns: 1fr; }
  .admin-welcome { grid-template-columns: 1fr; gap: 18px; padding: 22px 20px; }
  .admin-welcome-actions { width: 100%; grid-template-columns: 1fr 1fr; }
  .quick-action { min-width: 0; }
  .login { width: min(480px, calc(100% - 32px)); grid-template-columns: 1fr; gap: 0; }
  .login::before { display: none; }
  .login-card { padding: 26px 20px; }
}

@media (max-width: 430px) {
  .login-card .brand-logo-lockup { display: none; }
  .login-card .brand-logo-mark { display: block; width: 36px; height: 36px; }
  .admin-welcome-actions { grid-template-columns: 1fr; }
}
