/* ════════════════════════════════════════
 * YKI Supply Hub — 样式表
 * 拆分自 cucina.html (v2.7.89)
 * ════════════════════════════════════════ */

/* ══ 设计说明：仅调整视觉 token 与样式层，不改变 DOM/脚本逻辑 ══ */
:root {
  /* 金棕主色（全局品牌色，替代原企业蓝） */
  --bg: #f0ebe3;
  --bg-accent: #e8e2d8;
  --surface: #FFFFFF;
  --surface2: #f7f3ec;
  --border: #e5ddd0;
  --primary: #a67c2d;
  --primary-light: #faf6ec;
  --primary-dark: #6b4f1a;
  --accent-panel: #f2e6d4;
  --accent-panel-deep: #e5d2b8;
  --danger: #E53E3E;
  --danger-light: #FFF5F5;
  --warn: #D97706;
  --warn-light: #FFFBEB;
  --ok: #059669;
  --ok-light: #ECFDF5;
  --text: #1A202C;
  --text2: #4A5568;
  --text3: #8b96a8;
  --shadow: 0 1px 2px rgba(45, 36, 22, 0.06), 0 4px 12px rgba(45, 36, 22, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 36, 22, 0.09), 0 2px 6px rgba(45, 36, 22, 0.04);
  --shadow-nav: 0 -1px 0 rgba(45, 36, 22, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 56px;
  --bottom-h: 64px;
  --ring: 0 0 0 3px rgba(166, 124, 45, 0.28);
  --primary-shadow: rgba(107, 79, 26, 0.32);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 55%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SCREENS ── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ── TOP NAV ── */
.top-nav {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 4px 20px rgba(15, 23, 42, 0.04);
}
.nav-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.nav-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; color: var(--text2); font-size: 18px; transition: background 0.18s, color 0.18s; }
.nav-icon:hover { background: var(--surface2); color: var(--text); }
.nav-icon:focus-visible { outline: none; box-shadow: var(--ring); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--bottom-h);
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border);
  display: flex; z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  box-shadow: var(--shadow-nav), 0 -12px 32px rgba(15, 23, 42, 0.05);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; color: var(--text3); transition: color 0.2s, transform 0.15s ease;
  padding: 6px 0;
  border-radius: 12px;
  margin: 4px 2px;
}
.nav-item.active { color: var(--primary); }
.nav-item:active { transform: scale(0.96); }
.nav-item svg { width: 22px; height: 22px; stroke-width: 2; }
.nav-item span { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.nav-item:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-badge {
  position: absolute; top: 6px; right: calc(50% - 20px);
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

/* ── PAGE CONTENT ── */
.page-content {
  padding-top: calc(var(--nav-h) + 12px);
  padding-bottom: calc(var(--bottom-h) + 16px);
  padding-left: 16px; padding-right: 16px;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad { padding: 16px; }

/* ── STAT CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
@media (hover: none) {
  .stat-card:hover { box-shadow: var(--shadow); transform: none; }
}
.stat-val { font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500; line-height: 1.2; }
.stat-lbl { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ── SEARCH ── */
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap:focus-within {
  border-color: rgba(166, 124, 45, 0.55);
  box-shadow: var(--ring);
}
.search-wrap input {
  flex: 1; border: none; outline: none; font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  background: transparent; color: var(--text);
}
.search-wrap input::placeholder { color: var(--text3); }

/* ── CATEGORY TABS ── */
.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px;
  scrollbar-width: none; padding-bottom: 2px;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--text2); background: var(--surface);
  border: 1px solid var(--border); transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cat-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px var(--primary-shadow);
}
.cat-tab:focus-visible { outline: none; box-shadow: var(--ring); }

/* ── INVENTORY TABLE ── */
.inv-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.inv-table th {
  font-size: 11px; color: var(--text3); font-weight: 500;
  padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border);
  background: var(--surface2); white-space: nowrap;
}
.inv-table td { padding: 11px 6px; font-size: 13px; border-bottom: 1px solid var(--border); }
/* 列宽:复选框 / 食材名(自适应) / 现有 / 安全 / 状态 */
.inv-table th:nth-child(1), .inv-table td:nth-child(1) { width: 30px; padding-left: 8px; padding-right: 2px; }
.inv-table th:nth-child(2), .inv-table td:nth-child(2) { width: auto; }
.inv-table th:nth-child(3), .inv-table td:nth-child(3) { width: 42px; text-align: center; }
.inv-table th:nth-child(4), .inv-table td:nth-child(4) { width: 42px; text-align: center; }
.inv-table th:nth-child(5), .inv-table td:nth-child(5) { width: 52px; text-align: center; padding-right: 8px; }
.item-name-cell { word-break: break-word; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-table tr { cursor: pointer; transition: background 0.15s; }
.inv-table tr:hover td { background: var(--surface2); }
.item-name-cell .name { font-weight: 500; font-size: 13px; }
.item-name-cell .sub  { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600; padding: 3px 6px;
  border-radius: 20px; white-space: nowrap;
}
.badge-ok   { background: var(--ok-light); color: var(--ok); }
.badge-low  { background: var(--danger-light); color: var(--danger); }
.badge-warn { background: var(--warn-light); color: var(--warn); }
.badge-pending  { background: #FFF7E6; color: #B7791F; }
.badge-done     { background: var(--ok-light); color: var(--ok); }
.badge-cancel   { background: var(--danger-light); color: var(--danger); }

/* ── ORDERING SCREEN ── */
.order-hint {
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 12px; color: #92400E; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.order-item-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 231, 240, 0.9);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.order-item-card:hover { box-shadow: var(--shadow-md); }
@media (hover: none) {
  .order-item-card:hover { box-shadow: var(--shadow); }
}
.order-item-card.selected { border: 1.5px solid #4caf50; background: #e8f5e9; }
/* 排序模式 SortableJS 视觉反馈 */
.sort-chosen { background: #fff4d6 !important; box-shadow: 0 6px 20px rgba(201,169,97,0.35); }
.sort-ghost { opacity: 0.35; }
.sort-cat-header:active, .sort-item-card:active { cursor: grabbing; }
.order-item-card.selected-low { border: 1.5px solid #4caf50; background: #c8e6c9; }
.order-item-thumb {
  position: absolute; top: 14px; left: 14px;
  width: 44px; height: 44px;
  border-radius: 10px; object-fit: cover;
  background: linear-gradient(145deg, #eef2f7, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--text3);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.order-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-check { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.order-item-info { min-width: 0; }
.order-item-info .name  { font-weight: 600; font-size: 14px; }
.order-item-info .sub   { font-size: 11px; color: var(--text3); margin-top: 2px; }
.order-item-info .stock-line { font-size: 12px; color: var(--text2); margin-top: 4px; }
.order-item-info .stock-line .low { color: var(--danger); font-weight: 600; }
.order-qty-wrap {
  position: absolute; top: 10px; right: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 115px;
}
.order-qty-lbl { font-size: 11px; color: var(--text3); }
.order-qty-row { display: flex; align-items: center; gap: 6px; }
.qty-input {
  width: 72px; padding: 6px 8px; text-align: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500;
  background: var(--surface2); color: var(--text); outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.qty-input:focus { border-color: var(--primary); background: #fff; }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 所有number输入框去掉上下箭头 */
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-unit { font-size: 12px; color: var(--text3); }

/* ════════════════════════════════════════
   订货卡片 Grid 布局 (v2.7.62 重构)
   ════════════════════════════════════════ */
.oic-top {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: flex-start;
}
.oic-thumb {
  width: 80px; height: 80px;
  border-radius: 10px;
  background: linear-gradient(145deg, #eef2f7, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--text3);
  overflow: hidden; cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.oic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oic-info { min-width: 0; cursor: pointer; }
.oic-info .oic-code { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.oic-info .oic-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.oic-info .oic-chef { font-size: 11px; color: var(--primary); margin-top: 3px; }
.oic-info .oic-status { font-size: 11px; margin-top: 3px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.oic-check { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; margin-top: 2px; }
.oic-last {
  font-size: 11px; color: #6b4f1a;
  background: #f2e6d4;
  padding: 4px 8px; border-radius: 6px;
  display: inline-block;
  max-width: max-content;
}
.oic-stock {
  font-size: 12px; color: var(--text2);
}
.oic-stock .low { color: var(--danger); font-weight: 600; }
.oic-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.oic-bottom.full { grid-template-columns: 1fr; justify-items: end; }
.oic-consume, .oic-order { display: flex; flex-direction: column; gap: 3px; }
.oic-order { align-items: center; }
.oic-lbl { font-size: 11px; color: var(--text3); }
.oic-ctrl { display: flex; align-items: center; gap: 4px; }
.oic-ctrl button {
  width: 36px; height: 36px;
  border: 1px solid #ddd; border-radius: 8px;
  background: #f5f5f5; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.oic-ctrl .qty-input,
.oic-ctrl input[type=number] {
  width: 48px; padding: 6px 2px; text-align: center;
  border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  background: #f5f5f5; color: var(--text); outline: none;
}
.oic-ctrl .qty-input { cursor: pointer; }
.oic-unit { font-size: 11px; color: var(--text3); margin-top: 2px; }
.forecast-tag {
  font-size: 10px; font-weight: 600; color: var(--ok); background: var(--ok-light);
  padding: 2px 6px; border-radius: 6px;
}
.order-footer {
  position: fixed; bottom: var(--bottom-h); left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
  padding: 12px 16px; z-index: 90;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}
.order-footer-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.order-footer-info .count { color: var(--text2); }
.order-footer-info .total { color: var(--primary); font-weight: 600; font-family: 'DM Mono', monospace; }

/* ── ORDERS LIST ── */
.order-filter-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.order-filter-tab {
  flex: 1; padding: 8px 4px; text-align: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); color: var(--text2);
  background: var(--surface); border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.order-filter-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px var(--primary-shadow);
}
.order-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(226, 231, 240, 0.85);
  padding: 16px; margin-bottom: 10px;
  cursor: pointer; transition: box-shadow 0.2s, transform 0.18s;
}
.order-card:hover { box-shadow: var(--shadow-md); }
.order-card:active { transform: scale(0.98); }
@media (hover: none) {
  .order-card:hover { box-shadow: var(--shadow); }
}
.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.order-no { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--primary); font-weight: 500; }
.order-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; font-size: 12px; color: var(--text2); }
.order-meta .icon { color: var(--text3); }
.order-footer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.order-detail-link { font-size: 12px; color: var(--primary); font-weight: 500; display: flex; align-items: center; gap: 2px; }

/* ── REPORT SCREEN ── */
.report-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.report-tab {
  flex: 1; padding: 10px 4px; text-align: center;
  font-size: 12px; font-weight: 500; color: var(--text3);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s; white-space: nowrap;
}
.report-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 14px; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
@media (hover: none) {
  .kpi-card:hover { box-shadow: var(--shadow); }
}
.kpi-val { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; color: var(--text); }
.kpi-val.primary { color: var(--primary); }
.kpi-val.warn    { color: var(--warn); }
.kpi-val.ok      { color: var(--ok); }
.kpi-lbl   { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.kpi-trend { font-size: 11px; margin-top: 4px; display: flex; align-items: center; gap: 3px; }
.kpi-trend.up   { color: var(--ok); }
.kpi-trend.down { color: var(--danger); }
.chart-wrap {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(226, 231, 240, 0.85);
  padding: 16px; margin-bottom: 16px;
}
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.chart-sub   { font-size: 11px; color: var(--text3); margin-bottom: 16px; }
.chart-area { position: relative; }

/* SVG Chart */
.chart-svg { width: 100%; overflow: visible; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area-fill { fill: url(#areaGrad); opacity: 0.6; }
.chart-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2; r: 4; transition: r 0.2s; }
.chart-dot:hover { r: 6; }
.chart-label { font-size: 10px; fill: var(--text3); font-family: 'Noto Sans SC', sans-serif; }
.chart-axis-line { stroke: var(--border); stroke-width: 1; }

/* Pie chart */
.pie-wrap { display: flex; align-items: center; gap: 16px; }
.pie-legend { flex: 1; }
.pie-legend-item { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.pie-legend-item:last-child { border-bottom: none; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-right: 6px; }
.pie-name { display: flex; align-items: center; flex: 1; }
.pie-pct { color: var(--text2); font-family: 'DM Mono', monospace; font-size: 12px; }

/* Inventory warning table */
.warn-table { width: 100%; border-collapse: collapse; }
.warn-table th { font-size: 11px; color: var(--text3); padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.warn-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.warn-table tr:last-child td { border-bottom: none; }

/* ── MY PROFILE ── */
.profile-header {
  background: linear-gradient(145deg, #c9a24a 0%, var(--primary) 45%, var(--primary-dark) 100%);
  border-radius: var(--radius); padding: 24px 16px 20px;
  text-align: center; color: #fff; margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.22); margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-role { font-size: 13px; opacity: 0.8; margin-top: 3px; }
.menu-section { margin-bottom: 16px; }
.menu-section-title { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 0 4px; margin-bottom: 8px; }
.menu-item {
  background: var(--surface); display: flex; align-items: center;
  padding: 14px 16px; gap: 12px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.menu-item:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.menu-item:last-of-type  { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.menu-item:hover { background: var(--surface2); }
.menu-item-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.menu-item-text .title { font-size: 14px; font-weight: 500; }
.menu-item-text .sub   { font-size: 12px; color: var(--text3); margin-top: 1px; }
.menu-item-arrow { margin-left: auto; color: var(--text3); font-size: 16px; }

/* ── LOGIN ── */
.login-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(165deg, #faf6ec 0%, #f0ebe3 45%, #e8dcc8 100%);
}
.login-logo { margin-bottom: 12px; display:flex; justify-content:center; align-items:center; }
.login-title { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-sub   { font-size: 14px; color: var(--text2); margin-bottom: 32px; text-align: center; }
.login-card  { background: var(--surface); border-radius: 20px; padding: 24px; width: 100%; max-width: 360px; box-shadow: var(--shadow-md); border: 1px solid rgba(255, 255, 255, 0.75); }
.form-group  { margin-bottom: 16px; }
.form-label  { font-size: 12px; font-weight: 600; color: var(--text2); display: block; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Noto Sans SC', sans-serif;
  background: var(--surface2); color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--primary); background: #fff; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }

/* ── WEEKDAY BUTTONS ── */
.weekday-btn {
  padding: 4px 10px; font-size: 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer; transition: all 0.15s;
}
.weekday-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.weekday-btn.today-day { border-color: #27ae60; color: #27ae60; font-weight: 600; }
.weekday-btn.today-day.active { background: #27ae60; border-color: #27ae60; color: #fff; }

/* ── PASSWORD EYE TOGGLE ── */
.pass-wrap { position: relative; display: flex; align-items: center; }
.pass-wrap .form-control { padding-right: 42px; width: 100%; }
.pass-eye {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 0; display: flex;
  align-items: center; justify-content: center;
  transition: color 0.2s;
}
.pass-eye:hover { color: var(--text2); }

/* ── BUTTONS ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; outline: none; font-family: 'Noto Sans SC', sans-serif;
  transition: all 0.2s; width: 100%;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; box-shadow: 0 4px 14px var(--primary-shadow); }
.btn-primary:active:not(:disabled) { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(107, 79, 26, 0.22); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-ghost   { background: var(--surface2); color: var(--text2); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; border-radius: var(--radius-sm); }
.btn-green { background: #059669; color: #fff; }
.btn-green:active { background: #047857; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42);
  z-index: 200; display: none; align-items: flex-end;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.25s ease-out;
  position: relative;
  margin-top: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: calc(var(--bottom-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1A202C; color: #fff;
  padding: 10px 20px; border-radius: 30px;
  font-size: 13px; font-weight: 500;
  opacity: 0; transition: all 0.3s; z-index: 999;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err  { background: var(--danger); }

/* ── ADMIN BADGE ── */
.admin-section-title {
  font-size: 12px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

/* ── MISC ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 6px; border-radius: 4px; margin-right: 4px;
}
.tag-dept { background: var(--primary-light); color: var(--primary-dark); }
.tag-cat  { background: #FFF7E6; color: var(--warn); }

.section-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(226, 231, 240, 0.85);
  margin-bottom: 12px; overflow: hidden;
}
.section-card-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.section-card-header .title { font-size: 14px; font-weight: 600; }

/* Lang selector */
.lang-btn {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; background: var(--surface2); color: var(--text2);
  cursor: pointer; font-family: 'Noto Sans SC', sans-serif;
  transition: border-color 0.2s, background 0.2s;
}
.lang-btn:focus-visible { outline: none; box-shadow: var(--ring); }
