/* ============================================================
   笨小孩 PC 管理后台 — Premium Design System + Mobile Responsive
   品牌色锁定 --brand (#FFBE00)，VI 确定后仅改此处即可整体换肤
   ============================================================ */
:root {
  --brand: #FFBE00;
  --brand-2: #FFD870;
  --brand-ink: #050505;
  --accent-pink: #FFD4CA;
  --accent-blue: #3b82f6;

  --bg: #f6f4ef;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #fff6e0 0%, transparent 60%),
             radial-gradient(900px 500px at -10% 110%, #ffe9ef 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-brd: rgba(255, 255, 255, 0.7);
  --text: #2b2620;
  --text-2: #6f675c;
  --text-3: #9a9183;
  --border: #ece7dd;
  --border-2: #f1ece3;
  --shadow: 0 18px 50px -24px rgba(80, 60, 20, 0.35);
  --shadow-sm: 0 6px 18px -10px rgba(80, 60, 20, 0.3);
  --radius: 18px;
  --radius-sm: 12px;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
}
[data-theme="dark"] {
  --bg: #15130f;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #3a2c08 0%, transparent 60%),
             radial-gradient(900px 500px at -10% 110%, #3a1820 0%, transparent 55%);
  --surface: #1f1c16;
  --surface-2: #262219;
  --glass: rgba(40, 35, 25, 0.55);
  --glass-brd: rgba(255, 255, 255, 0.08);
  --text: #f3efe6;
  --text-2: #b9b0a1;
  --text-3: #7d7568;
  --border: #3a342a;
  --border-2: #2c281f;
  --shadow: 0 22px 60px -28px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 8px 22px -12px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .3s ease;
}
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- 玻璃拟态 ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow);
}

/* ---------- 登录 ---------- */
.login-screen {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); background-image: var(--bg-grad); z-index: 50;
}
.login-card { width: 360px; padding: 38px 34px; border-radius: 24px; text-align: center; animation: rise .6s cubic-bezier(.16,1,.3,1); }
.login-logo { width: 58px; height: 58px; display: block; margin: 0 auto; filter: drop-shadow(0 8px 18px rgba(255,190,0,.3)); }
.login-title { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: 1px; }
.login-title span { color: var(--brand); }
.login-sub { color: var(--text-3); font-size: 12px; letter-spacing: 2px; margin: 4px 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form label { font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.login-hint { color: var(--text-3); font-size: 11px; margin-top: 16px; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand-logo { font-size: 28px; filter: drop-shadow(0 4px 10px rgba(255,190,0,.35)); }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: 1px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: all .25s cubic-bezier(.16,1,.3,1); position: relative;
}
.nav-item .nav-ic { font-size: 17px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  color: #050505; box-shadow: 0 10px 24px -12px rgba(255,190,0,.7);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 4px; background: var(--brand);
}
.sidebar-foot { margin-top: auto; color: var(--text-3); font-size: 11px; padding: 10px; }

/* 侧边栏遮罩层 (移动端) */
.sidebar-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 39; opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
body.sidebar-open .sidebar-mask { opacity: 1; pointer-events: auto; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 18px; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 17px; transition: all .25s;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* 汉堡菜单按钮 */
.hamburger-btn {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 18px; transition: all .25s;
}
.hamburger-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.admin-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.admin-avatar { font-size: 18px; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }

.view { padding: 26px; overflow-y: auto; flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .25s cubic-bezier(.16,1,.3,1); display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  background: linear-gradient(100deg, var(--brand), var(--brand-2)); color: #050505; border: none;
  box-shadow: 0 10px 24px -12px rgba(255,190,0,.7);
}
.btn-ghost { background: transparent; }
.btn-danger { color: #fff; background: var(--danger); border: none; }
.btn-danger:hover { box-shadow: 0 10px 24px -12px rgba(220,38,38,.6); }
.btn-warn { color: #7a4a00; background: #fff2cf; border-color: #f1cf7d; }
.btn-warn:hover { background: #ffe7a2; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.magnetic { will-change: transform; transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .25s; }

/* ---------- 卡片 / KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.grid { display: grid; gap: 18px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.kpi { position: relative; overflow: hidden; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .3s cubic-bezier(.16,1,.3,1); }
.kpi:hover { transform: translateY(-4px); }
.kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(255,190,0,.22), transparent 70%); }
.kpi-label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: .5px; }
.kpi-value .unit { font-size: 14px; color: var(--text-3); font-weight: 600; margin-left: 3px; }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.section-title { font-size: 15px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.section-sub { font-size: 12px; color: var(--text-3); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--text-2); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .thumb { width: 40px; height: 40px; flex: 0 0 40px; overflow: hidden; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; border: 1px solid var(--border); }
.nowrap { white-space: nowrap; }
.amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- 徽章 / 标签 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; }
.badge-ok { background: rgba(22,163,74,.14); color: var(--ok); }
.badge-warn { background: rgba(217,119,6,.16); color: var(--warn); }
.badge-info { background: rgba(37,99,235,.14); color: var(--info); }
.badge-danger { background: rgba(220,38,38,.14); color: var(--danger); }
.badge-mute { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; background: rgba(255,190,0,.16); color: var(--brand-ink); margin-right: 5px; }
.switch { position: relative; width: 42px; height: 24px; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .25s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .25s; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.input, .select, textarea.input {
  box-sizing:border-box; width: 100%; min-height:42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; transition: border .2s, box-shadow .2s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,190,0,.14); }
textarea.input { min-height:72px; resize:vertical; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.thumb img, .product-image-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.image-file-input { padding:7px 10px; font-size:12px; }
.image-upload-hint { margin-top:5px; color:var(--text-3); font-size:11px; line-height:1.45; }
.product-image-preview { width:90px; height:90px; display:grid; place-items:center; overflow:hidden; margin:-2px 0 14px; border:1px dashed var(--border); border-radius:12px; background:var(--surface-2); color:var(--text-3); font-size:11px; }
.product-picker { position:relative; }
.category-checks,.icon-options,.package-products { display:flex; flex-wrap:wrap; gap:8px; }
.category-checks label { display:flex; gap:5px; align-items:center; padding:7px 9px; border:1px solid var(--border); border-radius:9px; font-size:12px; color:var(--text-2); cursor:pointer; }.category-checks input{accent-color:var(--brand)}
.category-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(310px,1fr)); gap:12px; }.category-card{display:flex;align-items:center;gap:10px;padding:16px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-sm);transition:opacity .16s ease,transform .16s ease,border-color .16s ease}.category-card.dragging{opacity:.42;transform:scale(.985)}.category-card.drop-target{border-color:#D49A39;box-shadow:0 0 0 3px rgba(212,154,57,.14),var(--shadow-sm)}.category-grip{width:20px;height:34px;display:grid;grid-template-columns:repeat(2,4px);grid-template-rows:repeat(3,4px);gap:3px;place-content:center;flex:0 0 auto;padding:0;border:0;background:transparent;cursor:grab}.category-grip:active{cursor:grabbing}.category-grip span{width:4px;height:4px;border-radius:50%;background:#B9AD9D}.category-symbol{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#FFF2DF}.warm-category-icon{width:28px;height:28px;display:block}.category-card .btn-sm{padding:6px 9px}.icon-option{display:grid;place-items:center;width:46px;height:46px;border:1px solid var(--border);border-radius:12px;background:#FFF9F1;color:var(--text);cursor:pointer}.icon-option .warm-category-icon{width:27px;height:27px}.icon-option.selected{border-color:#C79145;background:#FFE8CC;box-shadow:0 0 0 2px rgba(199,145,69,.16)}
.package-products{max-height:260px;overflow:auto;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.package-products label{display:flex;align-items:center;gap:7px;padding:7px;border-bottom:1px solid var(--border-2);font-size:12px}.package-products label span{flex:1}.pkg-qty{width:46px;padding:5px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text)}
.delivery-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:16px}.delivery-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:18px;border-bottom:1px solid var(--border)}.delivery-head h3{font-size:18px;margin-bottom:6px}.switch-lg .track{transform:scale(1.14);transform-origin:right center}.delivery-fields{margin-top:20px}.delivery-preview{display:flex;align-items:center;gap:12px;margin:8px 0 18px;padding:14px;border-radius:12px;background:var(--surface-2)}.delivery-preview-label{font-size:12px;color:var(--text-3)}.delivery-preview-chip{padding:8px 12px;border-radius:999px;background:#F1EFEB;color:#8B857B;font-size:12px}.delivery-preview-chip.on{background:#FFF0BC;color:#765500}.delivery-note{height:max-content;line-height:1.7}.delivery-note p{margin-top:9px;color:var(--text-2);font-size:13px}@media(max-width:860px){.delivery-layout{grid-template-columns:1fr}}
.product-suggestions { display:none; position:absolute; z-index:5; top:calc(100% + 5px); left:0; right:0; overflow:hidden; border:1px solid var(--border); border-radius:10px; background:var(--surface); box-shadow:var(--shadow); }
.product-suggestions.open { display:block; }
.product-suggestions button { display:flex; width:100%; align-items:baseline; justify-content:space-between; gap:12px; padding:10px 12px; border:0; border-bottom:1px solid var(--border-2); background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.product-suggestions button:last-child { border-bottom:0; }
.product-suggestions button:hover { background:var(--surface-2); }
.product-suggestions b { font-size:13px; }
.product-suggestions span, .product-empty { color:var(--text-3); font-size:11px; }
.ad-card-thumb { width:42px; height:42px; display:grid; place-items:center; overflow:hidden; border-radius:10px; background:var(--surface-2); color:var(--text-3); font-size:12px; }
.ad-card-thumb img, .ad-preview img { width:100%; height:100%; display:block; object-fit:cover; }
.ad-preview-wrap { display:flex; justify-content:center; margin:2px 0 14px; padding:14px; border-radius:12px; background:var(--surface-2); }
.ad-preview { display:grid; width:min(100%, 420px); place-items:center; overflow:hidden; border:1px dashed var(--border); border-radius:10px; background:var(--surface); color:var(--text-3); font-size:12px; }
.ad-slot-groups { display:flex; flex-direction:column; gap:22px; }
.ads-page-tabs { display:flex; align-items:center; gap:22px; margin:0 0 18px; border-bottom:1px solid var(--border-2); }
.ads-page-tabs button { padding:0 0 11px; color:var(--text-3); background:transparent; border:0; font-size:14px; font-weight:700; cursor:pointer; }
.ads-page-tabs button.active { color:var(--ink); border-bottom:2px solid var(--brand); }
.ad-slot-group { padding-top:2px; }
.ad-slot-head { display:flex; align-items:end; justify-content:space-between; margin:0 0 10px; padding:0 2px; }
.ad-slot-head b { font-size:15px; }
.ad-slot-head span { margin-left:8px; color:var(--text-3); font-size:11px; }
.ad-slot-head small { color:var(--text-3); font-size:11px; }
.ad-slot-empty { padding:20px; border:1px dashed var(--border); border-radius:12px; color:var(--text-3); font-size:12px; text-align:center; }

/* ---------- 出餐台 ---------- */
.kitchen-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.kitchen-toolbar b { font-size:17px; }
.kitchen-toolbar .muted { margin-left:9px; font-size:12px; }
.kitchen-board { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; align-items:start; }
.kitchen-column { min-height:calc(100vh - 170px); padding:12px; border:1px solid var(--border); border-radius:16px; background:rgba(255,255,255,.42); }
.kitchen-column-head { display:flex; align-items:center; justify-content:space-between; padding:3px 4px 12px; }
.kitchen-column-head b { font-size:15px; }
.kitchen-column-head span { display:grid; width:24px; height:24px; place-items:center; border-radius:999px; background:var(--surface-2); color:var(--text-2); font-size:12px; font-weight:700; }
.kitchen-list { display:flex; flex-direction:column; gap:12px; }
.kitchen-card { padding:14px; border:1px solid var(--border); border-radius:14px; background:var(--surface); box-shadow:var(--shadow-sm); }
.kitchen-card.pending { border-top:3px solid #d97706; }.kitchen-card.making { border-top:3px solid #2563eb; }.kitchen-card.ready { border-top:3px solid #16a34a; }
.kitchen-card-head { display:flex; align-items:center; justify-content:space-between; }
.kitchen-store { color:var(--text-2); font-size:11px; }.kitchen-time { margin-left:7px; color:var(--text-3); font-size:11px; }.kitchen-order-id { color:var(--text-3); font-size:11px; }
.pickup-code { margin:12px 0 10px; font-size:38px; font-weight:800; letter-spacing:3px; line-height:1; }
.kitchen-items { display:flex; flex-direction:column; gap:7px; padding:10px 0; border-top:1px solid var(--border-2); border-bottom:1px solid var(--border-2); font-size:13px; }
.kitchen-items div { display:flex; justify-content:space-between; gap:8px; }.kitchen-items b { flex-shrink:0; }
.kitchen-remark { margin-top:9px; padding:7px 8px; border-radius:7px; background:#fff8df; color:#7b5c13; font-size:11px; }
.kitchen-actions { display:flex; gap:8px; margin-top:12px; }.kitchen-actions .btn { flex:1; justify-content:center; font-size:12px; padding:9px 8px; }
.kitchen-empty { padding:42px 12px; color:var(--text-3); text-align:center; font-size:12px; }
.product-empty { padding:11px 12px; }

/* ---------- 模态 ---------- */
.modal-host { position: fixed; inset: 0; background: rgba(20,15,5,.38); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 60; padding: 20px; animation: fade .2s; }
.modal { display:flex; flex-direction:column; width: min(520px, 96vw); max-height:82vh; overflow:hidden; border-radius:18px; padding:0; animation: rise .25s cubic-bezier(.16,1,.3,1); }
.modal.wide { width: min(640px, 96vw); }
.modal-head { flex-shrink:0; display: flex; align-items: center; justify-content: space-between; margin:0; padding:20px 22px 14px; border-bottom:1px solid var(--border-2); }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-x { width:30px; height:30px; border-radius:50%; background:var(--surface-2); border: none; font-size:20px; line-height:1; cursor: pointer; color: var(--text-3); }
.modal-body { overflow-y:auto; padding:18px 22px 2px; }
.modal-foot { flex-shrink:0; display: flex; justify-content: flex-end; gap: 9px; margin:0; padding:14px 22px 18px; border-top:1px solid var(--border-2); background:var(--surface); }
.modal-helper { margin-bottom:14px; padding:9px 11px; border-radius:9px; background:#fff8df; color:#7b5c13; font-size:12px; line-height:1.5; }
.advanced-settings { margin:3px 0 10px; border-top:1px solid var(--border-2); }
.advanced-settings summary { display:flex; justify-content:space-between; padding:13px 0; color:var(--text-2); font-size:13px; font-weight:700; cursor:pointer; list-style:none; }
.advanced-settings summary::-webkit-details-marker { display:none; }
.advanced-settings summary::after { content:'⌄'; color:var(--text-3); margin-left:8px; }
.advanced-settings[open] summary::after { transform:rotate(180deg); }
.advanced-settings summary span { margin-left:auto; margin-right:7px; color:var(--text-3); font-size:11px; font-weight:400; }
.advanced-body { padding-top:2px; }

/* ---------- 抽屉 ---------- */
.drawer-host { position: fixed; inset: 0; background: rgba(20,15,5,.4); z-index: 55; display: flex; justify-content: flex-end; animation: fade .25s; }
.drawer { width: min(460px, 94vw); height: 100%; background: var(--surface); box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); padding: 24px; overflow-y: auto; animation: slideIn .35s cubic-bezier(.16,1,.3,1); }
.drawer h3 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-2); font-size: 13px; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 700; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { padding: 12px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; animation: rise .3s; display: flex; gap: 8px; align-items: center; }
.toast.ok { border-left: 4px solid var(--ok); }
.toast.err { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

/* ---------- 图表 ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.chart-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 14px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); transition: height .6s cubic-bezier(.16,1,.3,1); min-height: 4px; }
.bar-col .bl { font-size: 10px; color: var(--text-3); }
.bar-col .bv { font-size: 11px; font-weight: 700; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.status-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border-2); }
.status-bar > span { display: block; height: 100%; transition: width .6s cubic-bezier(.16,1,.3,1); }
.legend-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 4px 0; }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty .em { font-size: 40px; }

/* ---------- 移动端卡片列表 (替代表格) ---------- */
.mobile-card-list { display: none; flex-direction: column; gap: 10px; padding: 12px; }
.mcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm);
}
.mcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mcard-head .thumb { width: 44px; height: 44px; font-size: 24px; }
.mcard-title { font-weight: 700; font-size: 15px; }
.mcard-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.mcard-body { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mcard-row { display: flex; justify-content: space-between; align-items: center; }
.mcard-row .k { color: var(--text-2); font-size: 12px; }
.mcard-row .v { font-weight: 600; }
.mcard-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-2); }
.mcard-actions .btn { flex: 1; justify-content: center; }

/* 移动端筛选面板 */
.filter-panel {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 45; display: none; align-items: flex-end;
}
.filter-panel.open { display: flex; }
.filter-panel-inner {
  width: 100%; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 20px;
  animation: slideUpMobile .35s cubic-bezier(.16,1,.3,1);
  max-height: 80vh; overflow-y: auto;
}
.filter-panel h3 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.filter-panel .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
.filter-panel .toolbar > * { width: 100%; }
.filter-panel-actions { display: flex; gap: 10px; margin-top: 16px; }
.filter-panel-actions .btn { flex: 1; justify-content: center; }

/* ---------- 动画 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideUpMobile { from { transform: translateY(100%); } to { transform: translateY(0); } }
.view-enter { animation: rise .4s cubic-bezier(.16,1,.3,1); }

/* ---------- 响应式：平板 (≤980px) ---------- */
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .app { grid-template-columns: 68px 1fr; }
  .brand-name, .nav-item span:not(.nav-ic), .sidebar-foot { display: none; }
  .nav-item { justify-content: center; }
  .topbar { padding: 0 16px; }
  .view { padding: 16px; }
  .chart-card { padding: 16px; }
  .card { padding: 16px; }
  .kitchen-board { grid-template-columns:1fr; }
  .kitchen-column { min-height:auto; }
}

/* ---------- 响应式：手机 (≤640px) ---------- */
@media (max-width: 640px) {
  /* 显示汉堡按钮 */
  .hamburger-btn { display: flex !important; }

  /* 布局骨架 */
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px;
    z-index: 40; transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    box-shadow: 8px 0 30px rgba(0,0,0,.15);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar .brand-name { display: inline; }
  .sidebar .sidebar-foot { display: block; }
  .sidebar .nav-item { justify-content: flex-start; }
  .sidebar .nav-item span:not(.nav-ic) { display: inline; }

  /* 顶栏 */
  .topbar { height: 56px; padding: 0 12px; }
  .topbar-title { font-size: 16px; }
  .admin-chip span:not(.admin-avatar) { display: none; }
  .icon-btn { width: 40px; height: 40px; font-size: 18px; }

  /* 视图区 */
  .view { padding: 12px; }

  /* KPI */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-label { font-size: 12px; }

  /* 图表区 */
  .grid > .chart-card, .grid > .card { padding: 14px; }
  .donut-wrap { flex-direction: column; align-items: center; }
  .bars { height: 110px; }

  /* 表单 */
  .form-2 { grid-template-columns: 1fr; gap: 10px; }
  .field { margin-bottom: 10px; }

  /* 工具栏 */
  .toolbar { gap: 8px; }
  .toolbar .input, .toolbar .select { width: 100% !important; }
  .toolbar .btn { padding: 10px 14px; font-size: 13px; }

  /* 表格 → 卡片视图 */
  .card .table { display: none; }
  .card .mobile-card-list { display: flex; }
  .card { overflow: visible; }

  /* 模态框全屏 */
  .modal-host { padding: 0; }
  .modal {
    width: 100vw !important; max-height: 100vh; height: 100vh;
    border-radius: 0; padding: 0;
    display: flex; flex-direction: column;
  }
  .modal-head { padding: 18px 18px 14px; }
  .modal-body { padding: 16px 18px 2px; }
  .modal-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .modal.wide { width: 100vw !important; }
  .modal-body { flex: 1; overflow-y: auto; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; justify-content: center; padding: 14px; }

  /* 抽屉全屏 */
  .drawer-host { justify-content: center; align-items: flex-end; }
  .drawer {
    width: 100% !important; height: 92vh;
    border-radius: 20px 20px 0 0;
    animation: slideUpMobile .35s cubic-bezier(.16,1,.3,1);
  }

  /* 按钮触摸区 */
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn-sm { min-height: 36px; padding: 6px 11px; }
  .switch { width: 48px; height: 28px; }
  .switch input:checked + .track::after { transform: translateX(20px); }

  /* Toast 位置 */
  .toast-host { top: auto; bottom: 20px; right: 12px; left: 12px; }
  .toast { width: 100%; }

  /* 导出卡片 */
  .grid[style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr; }

  /* 订单/商品双栏 */
  .grid[style*="grid-template-columns:1.4fr"] { grid-template-columns: 1fr; }
  .grid[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr; }

  /* 移动端过滤按钮 */
  .filter-toggle-btn { display: flex !important; }
}

/* ============================================================
   v3 运营管理台视觉层
   目标：高密度但不压迫；品牌黄只承担「行动与聚焦」，不充当大面积背景。
   ============================================================ */
:root {
  --brand: #f6b800;
  --brand-2: #ffcf45;
  --brand-ink: #211a0c;
  --bg: #f7f7f5;
  --bg-grad: none;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --glass: rgba(255,255,255,.96);
  --glass-brd: #e9e8e3;
  --text: #232321;
  --text-2: #6f706c;
  --text-3: #a1a19b;
  --border: #e9e8e3;
  --border-2: #f1f0ec;
  --shadow: 0 18px 38px -28px rgba(30, 29, 25, .28);
  --shadow-sm: 0 8px 18px -17px rgba(30, 29, 25, .30);
  --radius: 16px;
  --radius-sm: 10px;
}

body { font-size: 14px; letter-spacing: .01em; }
.app { grid-template-columns: 252px 1fr; }
.sidebar { padding: 18px 12px 14px; border-right: 1px solid var(--border); }
.brand { gap: 10px; padding: 4px 10px 23px; }
.brand-logo { width: 32px; height: 32px; display: grid; place-items: center; filter: none; }
.brand-logo img { display:block; width:30px; height:30px; object-fit:contain; }
.brand-name { display: flex; flex-direction: column; gap: 2px; color: var(--text); font-size: 17px; line-height: 1.1; letter-spacing: .03em; }
.brand-name small { color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.nav { gap: 2px; }
.nav-label { margin: 18px 10px 6px; color: #a6a59e; font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.nav-label:first-child { margin-top: 0; }
.nav-item { min-height: 42px; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #686963; font-size: 13px; font-weight: 650; }
.nav-item .nav-ic { display: grid; width: 20px; height: 20px; place-items: center; color: #8a8a83; }
.nav-item .nav-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.nav-item[data-view="dashboard"] .nav-ic svg { fill: none; }
.nav-item:hover { background: #f3f3ef; transform: none; }
.nav-item.active { background: #fff4c9; color: #2b2618; box-shadow: none; }
.nav-item.active .nav-ic { color: #a87500; }
.nav-item.active::before { left: -12px; width: 3px; height: 20px; border-radius: 3px; background: var(--brand); }
.sidebar-foot { padding: 10px; color: #aaa9a3; font-size: 10px; }

.topbar { height: 68px; padding: 0 30px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); }
.topbar-title { font-size: 16px; font-weight: 750; letter-spacing: .02em; }
.topbar-title::before { content: '运营 / '; color: var(--text-3); font-size: 12px; font-weight: 600; }
.topbar-actions { gap: 12px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--text-2); font-size: 17px; box-shadow: none; }
.icon-btn:hover { transform: none; background: #f7f7f3; box-shadow: none; }
.admin-chip { gap: 9px; color: var(--text-2); font-size: 12px; }
.admin-chip > span:last-of-type { display:flex; flex-direction:column; gap:2px; line-height:1.1; }
.admin-chip b { font-size: 12px; color: var(--text); font-weight: 700; }
.admin-chip small { color: var(--text-3); font-size: 10px; }
.admin-avatar { display:grid; width:32px; height:32px; place-items:center; border-radius:10px; background:#2f302d; color:#fff; font-size:12px; font-weight:800; }
.link-btn { color:#8d6b15; }
.view { padding: 26px 30px 36px; }
.page-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:0 0 22px; }
.page-intro .eyebrow { margin-bottom:7px; color:#a97808; font-size:10px; font-weight:800; letter-spacing:.12em; }
.page-intro h1 { margin:0; color:var(--text); font-size:25px; font-weight:780; letter-spacing:-.035em; }
.page-intro p { margin-top:7px; color:var(--text-2); font-size:12px; line-height:1.55; }
.page-intro.compact { margin-bottom:18px; }
.page-intro.compact h1 { font-size:22px; }
.dashboard-intro { padding:4px 0 1px; }
.filter-toolbar { padding:11px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.section-toolbar { margin-top:4px; }

.btn { min-height: 38px; border-radius: 9px; padding: 8px 13px; border-color: #e4e3de; background: #fff; box-shadow: none; font-size: 12px; font-weight: 700; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 12px -10px rgba(0,0,0,.32); }
.btn-primary { background: #f6b800; color: #211a0c; box-shadow: none; }
.btn-primary:hover { background: #ffca2e; }
.btn-danger { background: #e74a4a; }
.btn-warn { border-color: #f2deb1; background: #fffaf0; color: #9b6200; }
.btn-ghost { background: transparent; }
.input, .select, textarea.input { min-height: 40px; border-radius: 9px; border-color: #e4e3de; background: #fff; font-size: 13px; }
.input:focus, .select:focus, textarea.input:focus { border-color: #dca500; box-shadow: 0 0 0 3px rgba(246,184,0,.14); }

.toolbar { min-height: 42px; margin-bottom: 18px; gap: 9px; }
.card, .chart-card { border-radius: 14px; border-color: var(--border); box-shadow: none; }
.card { padding: 18px; }
.chart-card { padding: 18px; }
.kpi-grid { gap: 14px; }
.kpi { min-height: 124px; padding: 18px; border-radius: 14px; border-color: var(--border); box-shadow: none; }
.kpi:hover { transform: translateY(-2px); border-color: #dedbd2; }
.kpi::after { right: 14px; top: 15px; width: 9px; height: 9px; background: #f6b800; }
.kpi-label { color: var(--text-2); font-size: 12px; font-weight: 650; }
.kpi-value { margin-top: 10px; color: var(--text); font-size: 29px; letter-spacing: -.025em; }
.kpi-sub { color: var(--text-3); font-size: 11px; }
.section-title, .chart-card h4 { font-size: 14px; font-weight: 760; }
.section-sub { font-size: 11px; }

.table { font-size: 13px; }
.table th { height: 48px; padding: 12px 16px; color: #8e8d87; background: #fbfbfa; font-size: 11px; font-weight: 700; }
.table td { padding: 12px 16px; }
.table tbody tr:hover { background: #fffdf6; }
.table .thumb { width: 42px; height: 42px; border: 0; border-radius: 10px; background: #f5f4f0; }
.badge { padding: 3px 8px; font-size: 11px; font-weight: 700; }
.badge-ok { background: #eaf7ed; color: #258448; }
.badge-warn { background: #fff4d8; color: #a26800; }
.badge-info { background: #edf4ff; color: #3370bc; }
.badge-danger { background: #fff0ef; color: #ca3e3c; }
.badge-mute { background: #f6f6f4; color: #8b8b86; border: 0; }
.tag { padding: 3px 8px; border-radius: 999px; background: #fff4d8; color: #8c6208; }
.switch .track { background: #d9d9d3; }
.switch input:checked + .track { background: #f6b800; }

.kitchen-toolbar { margin-bottom: 16px; }
.kitchen-toolbar b { font-size: 18px; }
.kitchen-board { gap: 14px; }
.kitchen-column { min-height: calc(100vh - 190px); padding: 10px; border-radius: 14px; border: 1px solid #ecebe6; background: #f8f8f6; }
.kitchen-column-head { padding: 7px 6px 12px; }
.kitchen-column-head b { font-size: 13px; }
.kitchen-column-head span { width: 22px; height: 22px; background:#fff; color: var(--text-2); }
.kitchen-card { padding: 14px; border-radius: 12px; border: 1px solid #e9e8e3; box-shadow: none; }
.kitchen-card.pending { border-top: 3px solid #e6ac2a; }.kitchen-card.making { border-top: 3px solid #5a90cf; }.kitchen-card.ready { border-top: 3px solid #56a66c; }
.pickup-code { font-size: 34px; }

.scan-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 10px 12px; border: 1px dashed #e2ddc8; border-radius: 12px; background: #fffdf6; }
.scan-status-panel { min-width: 0; padding: 2px 0; color: #4f483a; font-size: 13px; }
.scan-status-panel b { display: block; }
.scan-status-panel p { margin: 2px 0 0; color: #847a67; font-size: 11px; }
.scan-mode-switch { display: flex; flex: 0 0 auto; gap: 8px; }

.camera-scan { display: flex; flex-direction: column; gap: 12px; }
.camera-stage { position: relative; overflow: hidden; border-radius: 12px; background: #111; aspect-ratio: 4 / 3; }
.camera-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-frame { position: absolute; top: 50%; left: 50%; width: min(58%, 220px); aspect-ratio: 1; border: 3px solid rgba(255, 214, 102, .95); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); transform: translate(-50%, -50%); pointer-events: none; }
.camera-hint { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; text-align: center; }
.camera-canvas.hidden { display: none; }

.modal-host { background: rgba(28,28,25,.32); backdrop-filter: blur(3px); }
.modal { width: min(560px, 96vw); border-radius: 16px; border: 1px solid #e6e4dc; box-shadow: 0 28px 70px -28px rgba(0,0,0,.34); }
.modal.wide { width: min(720px, 96vw); }
.modal-head { padding: 18px 22px 14px; }
.modal-head h3 { font-size: 16px; letter-spacing: .01em; }
.modal-x { width: 30px; height: 30px; border-radius: 8px; background: #f7f7f4; font-size: 19px; }
.modal-body { padding: 18px 22px 4px; }
.modal-foot { padding: 14px 22px 18px; background: #fff; }
.modal-helper { border-left: 3px solid #f6b800; border-radius: 7px; background: #fffaf0; color: #85651d; }
.advanced-settings summary { padding: 14px 0; }
.drawer { width: min(500px,94vw); padding: 24px; }
.toast { border-radius: 10px; box-shadow: 0 12px 30px -15px rgba(0,0,0,.3); }

@media (max-width: 980px) {
  .app { grid-template-columns: 72px 1fr; }
  .brand { padding-left: 8px; padding-right: 8px; justify-content: center; }
  .nav-label { display:none; }
  .nav-item { padding: 10px; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { width: 268px; }
  .nav-label { display:block; }
  .brand { justify-content:flex-start; }
  .topbar { height: 58px; padding: 0 14px; }
  .topbar-title::before { display:none; }
  .admin-chip > span:last-of-type { display:none; }
  .view { padding: 16px 14px 24px; }
  .page-intro { align-items:flex-start; flex-direction:column; gap:13px; margin-bottom:16px; }
  .page-intro .btn { width:100%; justify-content:center; }
  .page-intro h1 { font-size:22px; }
  .filter-toolbar { padding:8px; }
  .kpi-grid { gap: 10px; }
  .kpi { min-height: 106px; padding: 14px; }
  .kpi-value { font-size: 23px; }
}

/* ============================================================
   v4 轻量企业后台完善：登录、层级、状态与可访问性
   ============================================================ */
.login-screen {
  padding: 28px;
  background:
    radial-gradient(circle at 12% 18%, rgba(246,184,0,.16), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(255,215,101,.18), transparent 26%),
    #f6f6f3;
}
.login-shell {
  width: min(940px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid #e7e5de;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px -45px rgba(36,34,26,.42);
}
.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  overflow: hidden;
  background: #24241f;
  color: #fff;
}
.login-brand-panel::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 300px;
  height: 300px;
  border: 64px solid rgba(246,184,0,.9);
  border-radius: 50%;
}
.login-brand-mark { width: 54px; height: 54px; margin-bottom: 34px; position: relative; z-index: 1; }
.login-eyebrow { margin: 0 0 13px; color: #f6b800; font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.login-brand-panel h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.18; letter-spacing: -.045em; }
.login-brand-panel > p:not(.login-eyebrow) { position: relative; z-index: 1; max-width: 390px; margin: 22px 0 30px; color: #c9c9c1; font-size: 14px; line-height: 1.8; }
.login-features { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.login-features span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #deded6; font-size: 11px; }
.login-card { width: auto; padding: 66px 52px; border: 0; border-radius: 0; text-align: left; box-shadow: none; animation: rise .5s cubic-bezier(.16,1,.3,1); }
.login-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-logo { width: 46px; height: 46px; margin: 0; filter: none; }
.login-heading h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.025em; }
.login-heading p { margin: 0; color: var(--text-3); font-size: 12px; }
.login-form { gap: 18px; }
.login-form label { color: var(--text-2); font-weight: 650; gap: 8px; }
.login-form input { min-height: 46px; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.login-form input:focus { border-color: #d7a300; box-shadow: 0 0 0 3px rgba(246,184,0,.14); }
.login-form .btn { margin-top: 2px; min-height: 46px; }
.login-form .btn:disabled { cursor: wait; opacity: .68; transform: none; }
.login-feedback { padding: 10px 12px; border: 1px solid #f0c7c5; border-radius: 9px; background: #fff5f4; color: #b63b38; font-size: 12px; line-height: 1.5; }
.login-hint { margin-top: 20px; line-height: 1.6; text-align: center; }
.login-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.5;
}
.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  text-decoration: none;
}
.beian-link:hover,
.beian-link:focus-visible { color: var(--text); text-decoration: underline; }
.beian-badge { width: 13px; height: 13px; flex: 0 0 13px; fill: currentColor; }
.icp-placeholder { overflow-wrap: anywhere; }

.topbar-context { display: flex; flex-direction: column; gap: 2px; }
.topbar-breadcrumb { color: var(--text-3); font-size: 10px; font-weight: 600; }
.topbar-breadcrumb b { color: var(--text-2); font-weight: 650; }
.topbar-title::before { display: none; }
.data-source-chip { padding: 5px 9px; border: 1px solid #efd78d; border-radius: 999px; background: #fff9e8; color: #8a6511; font-size: 10px; font-weight: 750; letter-spacing: .03em; }
.inventory-source-banner { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; padding:12px 14px; border:1px solid #eadfbd; border-radius:12px; background:#fffaf0; color:#4e4636; }
.inventory-source-banner b { display:block; font-size:13px; color:#2f2b24; }
.inventory-source-banner p { margin:4px 0 0; font-size:12px; line-height:1.55; color:#746a58; }
.catalog-mapping-banner { border-color:#cddbf2; background:#f5f8fd; color:#334155; }
.catalog-mapping-banner b { color:#172033; }
.catalog-mapping-banner p { color:#596a84; }
.mapping-workspace { max-width:1120px; margin:0 auto; min-width:0; }
.mapping-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.mapping-scope { padding:20px; }
.mapping-scope h3,.mapping-section h3 { font-size:16px; margin:0 0 12px; }
.mapping-scope p { font-size:12px; line-height:1.6; }
.mapping-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.mapping-field { display:flex; flex-direction:column; gap:7px; min-width:0; font-size:12px; color:var(--text-2); }
.mapping-field .input,.mapping-field .select { width:100%; min-width:0; }
.mapping-section { margin-top:24px; }
.mapping-section h3 small { font-size:12px; font-weight:400; color:var(--text-3); margin-left:8px; }
.mapping-product { padding:0; margin-bottom:10px; overflow:hidden; }
.mapping-product>summary { padding:17px 20px; cursor:pointer; display:flex; align-items:center; gap:12px; justify-content:space-between; }
.mapping-product>summary::before { content:'›'; color:var(--text-3); }
.mapping-product[open]>summary::before { transform:rotate(90deg); }
.mapping-product>summary b { flex:1; }
.mapping-product>summary span { font-size:12px; color:var(--text-3); }
.mapping-product-body { padding:0 20px 20px; border-top:1px solid var(--border); }
.mapping-product-body>.mapping-field { max-width:260px; margin-top:16px; }
.mapping-variant { margin-top:14px; padding:14px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2); }
.mapping-variant summary { cursor:pointer; font-size:13px; }
.mapping-variant .mapping-grid { margin-top:14px; }
.mapping-variant h4 { margin:0; font-size:13px; }
.mapping-result { padding:18px 20px; margin:20px 0; font-size:12px; line-height:1.7; }
.mapping-result-head { display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:14px; }
.mapping-result ul { padding-left:18px; max-height:260px; overflow:auto; }
.mapping-result li { margin-bottom:8px; }
.mapping-result code { margin-right:10px; color:var(--text-3); }
.mapping-footer { position:sticky; bottom:0; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; padding:14px 18px; background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 -3px 14px #00000008; z-index:2; }
.mapping-footer>span { font-size:12px; color:var(--text-2); overflow-wrap:anywhere; }
.mapping-workspace button:disabled { opacity:.55; cursor:wait; }
@media(max-width:760px) {
  .mapping-grid { grid-template-columns:1fr; }
  .mapping-product>summary { align-items:flex-start; flex-wrap:wrap; }
  .mapping-product>summary span { width:100%; padding-left:22px; }
  .mapping-footer { position:static; padding:14px; }
  .mapping-actions .btn { flex:1 1 45%; }
  .mapping-workspace .inventory-source-banner { flex-wrap:wrap; }
}
.store-switcher { display:flex; align-items:center; gap:8px; color:var(--text-3); font-size:11px; font-weight:650; white-space:nowrap; }
.store-switcher .select { width:min(230px, 24vw); min-height:36px; padding:7px 30px 7px 10px; font-size:12px; }
.readonly-input:disabled { cursor:not-allowed; border-style:dashed; background:#f5f5f1; color:var(--text-3); opacity:1; }

.printer-template-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,.7fr); gap:16px; align-items:start; }
.printer-template-grid .field-label { display:block; margin-bottom:7px; font-size:12px; font-weight:650; color:var(--text-3); }
.printer-template-checks { display:flex; flex-wrap:wrap; gap:7px; }
.printer-template-checks .category-checks-item { display:inline-flex; align-items:center; gap:5px; padding:6px 9px; border:1px solid var(--border); border-radius:8px; font-size:12px; color:var(--text-2); cursor:pointer; }
.printer-template-checks input { accent-color:var(--brand); }
.printer-preview { min-height:260px; max-height:360px; margin:0; padding:14px; overflow:auto; border:1px dashed var(--border); border-radius:10px; background:var(--surface-2); color:var(--text-2); font:12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace; white-space:pre-wrap; }
@media(max-width:760px) { .printer-template-grid { grid-template-columns:1fr; } }

.toast { min-width: 280px; max-width: 420px; line-height: 1.45; }
.toast-icon { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; }
.toast-icon svg, .ui-state-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.toast.ok .toast-icon { color: var(--ok); }
.toast.err .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }
.ui-state { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px 20px; color: var(--text-2); text-align: center; }
.ui-state-icon { display: grid; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 14px; background: var(--surface-2); color: var(--text-3); place-items: center; }
.ui-state b { color: var(--text); font-size: 14px; }
.ui-state p { max-width: 440px; margin: 7px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.state-spinner { width: 20px; height: 20px; border: 2px solid #dddcd7; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

:focus-visible { outline: 3px solid rgba(246,184,0,.34); outline-offset: 2px; }
.table thead { position: sticky; top: 0; z-index: 1; }
.card { overflow: auto; }

@media (max-width: 760px) {
  .login-screen { padding: 14px; align-items: flex-start; overflow-y: auto; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; margin: max(14px, env(safe-area-inset-top)) 0 max(14px, env(safe-area-inset-bottom)); }
  .login-brand-panel { min-height: 230px; padding: 34px 28px; }
  .login-brand-mark { width: 42px; height: 42px; margin-bottom: 18px; }
  .login-brand-panel h1 { font-size: 30px; }
  .login-brand-panel > p:not(.login-eyebrow) { margin: 14px 0 18px; font-size: 12px; }
  .login-card { padding: 34px 26px; }
  .topbar-breadcrumb { display: none; }
  .store-switcher span { display:none; }
  .store-switcher .select { width:126px; }
  .data-source-chip { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .toast { min-width: 0; max-width: none; }
}
