:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #e5eaee;
  --line-strong: #d8e0e6;
  --text: #17242f;
  --muted: #70808e;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e4f4f1;
  --navy: #142b3a;
  --danger: #d94848;
  --danger-soft: #fff0ef;
  --warning: #d48316;
  --warning-soft: #fff7e7;
  --success: #25875a;
  --success-soft: #eaf7f0;
  --info: #3578b5;
  --info-soft: #edf5fc;
  --shadow: 0 12px 34px rgba(24, 45, 59, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px; background: var(--bg); color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif; font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column;
  padding: 22px 16px 16px; color: #dce8ed; background: linear-gradient(180deg, #132b3a 0%, #10222e 100%);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 25px; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: white;
  font-size: 19px; font-weight: 800; background: linear-gradient(145deg, #24a99b, #0f766e);
  box-shadow: 0 8px 18px rgba(20, 175, 158, .24);
}
.brand strong { display: block; color: #fff; font-size: 18px; letter-spacing: .5px; }
.brand span { display: block; margin-top: 3px; color: #87a2b1; font-size: 10px; letter-spacing: .7px; text-transform: uppercase; }
.nav { display: grid; gap: 6px; }
.nav-item {
  display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 9px; width: 100%;
  padding: 11px 12px; border: 0; border-radius: 11px; color: #b8cbd5; background: transparent;
  text-align: left; transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .065); }
.nav-item.active { color: #fff; background: rgba(34, 184, 166, .17); box-shadow: inset 3px 0 #2fc1b1; }
.nav-icon {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #a9c4cf;
  background: rgba(255,255,255,.06); font-size: 12px; font-weight: 700;
}
.nav-item.active .nav-icon { color: #87eadb; background: rgba(47, 193, 177, .14); }
.nav-count { min-width: 20px; padding: 2px 6px; border-radius: 20px; color: #c9dae2; background: rgba(255,255,255,.08); font-size: 11px; text-align: center; }
.nav-count.danger:not(:empty) { color: #ffd1cb; background: rgba(217, 72, 72, .22); }
.sidebar-tip { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 13px 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.035); }
.sidebar-tip strong, .sidebar-tip small { display: block; }
.sidebar-tip strong { color: #d9e7ed; font-size: 12px; }
.sidebar-tip small { margin-top: 3px; color: #7894a3; font-size: 10px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #47d6a0; box-shadow: 0 0 0 5px rgba(71,214,160,.11); }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  min-height: 86px; padding: 17px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.91); backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; color: #162936; font-size: 21px; letter-spacing: -.3px; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.today { margin-right: 4px; color: var(--muted); font-size: 12px; }
.mobile-menu { display: none; border: 0; background: none; color: var(--text); font-size: 22px; }
.content { padding: 24px 28px 42px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 600; transition: .16s ease; white-space: nowrap; }
.btn.primary { color: #fff; background: var(--primary); box-shadow: 0 7px 16px rgba(15,118,110,.16); }
.btn.primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn.ghost { color: #425666; border-color: var(--line-strong); background: #fff; }
.btn.ghost:hover { color: var(--primary); border-color: #a9d7d1; background: #f8fdfc; }
.btn.soft { color: var(--primary); background: var(--primary-soft); }
.btn.soft:hover { background: #d8eeea; }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.small { min-height: 29px; padding: 5px 9px; border-radius: 7px; font-size: 12px; }
.btn.text { min-height: auto; padding: 0; color: var(--primary); background: transparent; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; color: #607483; background: #f1f4f6; font-size: 23px; line-height: 1; }
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }
.page-stack { display: grid; gap: 18px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.page-lead { color: var(--muted); font-size: 13px; line-height: 1.7; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 16px; }
.section-head h3 { font-size: 14px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.hero-card {
  position: relative; overflow: hidden; padding: 23px 25px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(120deg, #113441 0%, #0f625e 68%, #16867c 100%); box-shadow: 0 18px 40px rgba(16, 53, 65, .15);
}
.hero-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -65px; top: -105px; border: 34px solid rgba(255,255,255,.07); border-radius: 50%; }
.hero-card h2 { position: relative; margin: 0; font-size: 22px; letter-spacing: -.4px; }
.hero-card p { position: relative; max-width: 670px; margin: 9px 0 0; color: #cce4e4; line-height: 1.65; }
.hero-actions { position: relative; display: flex; gap: 9px; margin-top: 17px; }
.hero-card .btn.primary { color: #123a3a; background: #8ae1d3; box-shadow: none; }
.hero-card .btn.primary:hover { background: #a2ebdf; }
.hero-card .btn.ghost { color: #e6f7f5; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.06); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { position: relative; overflow: hidden; min-height: 132px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 22px rgba(24,45,59,.04); }
.kpi-card::after { content: ""; position: absolute; width: 66px; height: 66px; right: -22px; top: -18px; border-radius: 50%; background: var(--kpi-soft, var(--primary-soft)); }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.kpi-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--kpi-color, var(--primary)); background: var(--kpi-soft, var(--primary-soft)); font-weight: 700; }
.kpi-value { margin-top: 14px; font-size: 28px; font-weight: 800; letter-spacing: -.8px; }
.kpi-foot { margin-top: 7px; color: #8a99a5; font-size: 11px; }
.kpi-foot strong { color: var(--kpi-color, var(--primary)); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 16px; }
.grid-2.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(24,45,59,.035); }
.card-body { padding: 19px; }
.card-body.flush { padding: 0; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title-row h3 { margin: 0; font-size: 15px; }
.card-title-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.list { display: grid; gap: 3px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f0f3f5; }
.list-row:last-child { border-bottom: 0; }
.list-row-main { min-width: 0; flex: 1; }
.list-row-main strong { display: block; overflow: hidden; color: #263a48; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.list-row-main span { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.list-row-side { color: var(--muted); font-size: 11px; text-align: right; }
.list-row-side strong { display: block; margin-bottom: 4px; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.info { color: var(--info); background: var(--info-soft); }
.badge.neutral { color: #697a87; background: #eff3f5; }
.badge.no-dot::before { display: none; }
.progress { height: 7px; overflow: hidden; border-radius: 20px; background: #edf1f3; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.meter-list { display: grid; gap: 15px; }
.meter-head { display: flex; justify-content: space-between; margin-bottom: 7px; color: #405360; font-size: 12px; }
.meter-head strong { color: #263a48; }
.meter-list small { display: block; margin-top: 6px; color: #91a0ab; font-size: 10px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.search { position: relative; min-width: 240px; }
.search input { width: 100%; padding-left: 34px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 9px; color: #84949f; font-size: 17px; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; color: var(--text); background: #fff; transition: .15s ease; }
input, select { min-height: 38px; padding: 8px 11px; }
textarea { min-height: 86px; padding: 10px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #75beb5; box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.search input { min-width: 220px; }
.compact-select { width: auto; min-width: 120px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 13px; border-bottom: 1px solid #edf1f3; text-align: left; vertical-align: middle; }
th { color: #71818d; background: #fbfcfd; font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
td { color: #3b4e5b; font-size: 12px; }
tbody tr:hover { background: #fbfdfd; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #1f3442; }
.cell-title { display: block; color: #203744; font-weight: 700; }
.cell-sub { display: block; margin-top: 4px; color: #8a99a4; font-size: 10px; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: -.2px; }
.actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.actions button { border: 0; }
.empty { padding: 34px 20px; color: #8998a3; text-align: center; }
.empty strong { display: block; margin-bottom: 5px; color: #5d707d; font-size: 13px; }
.empty span { font-size: 11px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-tab { padding: 7px 11px; border: 1px solid var(--line); border-radius: 20px; color: #647681; background: #fff; font-size: 11px; }
.filter-tab.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.filter-tab:hover:not(.active) { border-color: #9dcec8; color: var(--primary); }
.alert-list { display: grid; gap: 9px; }
.alert-item { display: flex; gap: 11px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.alert-item.urgent { border-color: #f6cfcc; background: #fffafa; }
.alert-item.warn { border-color: #f4dfb7; background: #fffdf7; }
.alert-mark { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; color: var(--info); background: var(--info-soft); font-size: 12px; font-weight: 800; }
.alert-item.urgent .alert-mark { color: var(--danger); background: var(--danger-soft); }
.alert-item.warn .alert-mark { color: var(--warning); background: var(--warning-soft); }
.alert-content { min-width: 0; flex: 1; }
.alert-content strong { display: block; color: #263b49; font-size: 12px; }
.alert-content span { display: block; margin-top: 4px; color: #7c8c97; font-size: 11px; line-height: 1.45; }
.alert-side { display: flex; align-items: center; gap: 5px; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding-bottom: 15px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 17px; bottom: 0; width: 1px; background: #dfe7eb; }
.timeline-dot { z-index: 1; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 9px; }
.timeline-content strong { display: block; color: #304552; font-size: 12px; }
.timeline-content p { margin: 4px 0 0; color: #84949f; font-size: 10px; line-height: 1.5; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 16px; }
.setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid #edf1f3; }
.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { margin: 0; font-size: 13px; }
.setting-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.setting-control { flex: 0 0 auto; width: 170px; }
.setting-control.small { width: 110px; }
.data-stat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.data-stat div { padding: 13px; border-radius: 11px; background: var(--surface-soft); }
.data-stat strong { display: block; font-size: 19px; }
.data-stat span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(13, 30, 40, .5); backdrop-filter: blur(3px); }
.modal-backdrop.open { display: flex; animation: fadeIn .15s ease; }
.modal { width: min(680px, 100%); max-height: 90vh; overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 26px 70px rgba(9,24,34,.28); animation: slideUp .2s ease; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px 21px 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 20px 21px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #465a67; font-size: 12px; font-weight: 700; }
.field label span { color: var(--danger); }
.field small { color: #8c9ba5; font-size: 10px; }
.password-setup-box { padding: 10px; border: 2px solid #75beb5; border-radius: 10px; background: #f1fbf9; box-shadow: 0 0 0 3px rgba(15,118,110,.05); }
.purchase-product-tools { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; }
.product-picker-select { min-height: 210px; padding: 6px; }
.product-picker-select option { padding: 7px 8px; }
.purchase-product-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.purchase-item-picker { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 10px; }
.purchase-pending-fields { display: grid; gap: 8px; align-content: start; }
.purchase-pending-fields label { display: grid; gap: 4px; }
.purchase-pending-fields label span { color: var(--muted); font-size: 10px; }
.purchase-item-list { display: grid; gap: 8px; }
.purchase-item-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px auto; align-items: end; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; }
.purchase-item-row > label { display: grid; gap: 4px; }
.purchase-item-row > label span { color: var(--muted); font-size: 10px; }
.purchase-item-main { min-width: 0; }
.purchase-item-main strong, .purchase-item-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-item-main span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.purchase-empty-lines { padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.onboarding-card { border: 1px solid #b9ddd7; background: linear-gradient(180deg, #f5fbfa, #fff); }
.onboarding-progress { height: 7px; margin: 8px 0 14px; overflow: hidden; border-radius: 999px; background: #e4eeec; }
.onboarding-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f766e, #4fb5a8); }
.onboarding-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.onboarding-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.onboarding-item.done { background: #f4faf8; }
.onboarding-item strong, .onboarding-item small { display: block; }
.onboarding-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.onboarding-check { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: #c7d5d2; font-weight: 800; }
.onboarding-item.done .onboarding-check { background: #0f766e; }
@media (max-width: 900px) { .onboarding-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .onboarding-grid { grid-template-columns: 1fr; } }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick-action { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #fbfdfd; text-align: left; cursor: pointer; }
.quick-action:hover { border-color: #75beb5; box-shadow: 0 5px 15px rgba(15,118,110,.08); }
.quick-action > span { grid-row: 1 / 3; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; background: #0f766e; font-weight: 800; }
.quick-action strong, .quick-action small { display: block; }
.quick-action small { margin-top: 3px; color: var(--muted); font-size: 10px; }
@media (max-width: 900px) { .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .quick-actions { grid-template-columns: 1fr; } }
.schedule-group { display: grid; gap: 8px; }
.schedule-date { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #edf5fc; }
.schedule-date span { color: var(--muted); font-size: 11px; }
.schedule-date.overdue { background: #fdeeee; color: #a42b27; }
.schedule-date.today { background: #e4f4f1; color: #0f766e; }
.schedule-item { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-left: 4px solid #75beb5; border-radius: 10px; background: #fff; }
.schedule-item.urgent { border-left-color: #d94848; background: #fffafa; }
.schedule-type { color: var(--muted); font-size: 11px; font-weight: 700; }
.schedule-main { min-width: 0; }
.schedule-main strong, .schedule-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-main span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.schedule-side { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
@media (max-width: 680px) { .schedule-item { grid-template-columns: 1fr; } .schedule-side { justify-content: space-between; } }
.opp-board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.opp-column { min-height: 220px; border: 1px solid var(--line); border-radius: 12px; background: #f7fafb; }
.opp-column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.opp-column-head span { color: var(--muted); font-size: 10px; }
.opp-column-body { display: grid; gap: 8px; padding: 9px; }
.opp-column-empty { padding: 20px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.opp-card { display: grid; gap: 8px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; text-align: left; cursor: pointer; }
.opp-card:hover { border-color: #75beb5; box-shadow: 0 5px 15px rgba(15,118,110,.08); }
.opp-card-head, .opp-card-meta, .opp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opp-card-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-card > span, .opp-card-meta span, .opp-card-foot span { color: var(--muted); font-size: 10px; }
.opp-card-meta strong { color: #0f766e; }
@media (max-width: 900px) { .opp-board { grid-template-columns: repeat(6, 220px); } }
.route-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.route-stop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.route-stop-list { display: grid; gap: 8px; }
.route-stop-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; }
.route-stop-order { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: #0f766e; font-size: 11px; font-weight: 800; }
.route-stop-main { min-width: 0; }
.route-stop-main strong, .route-stop-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-stop-main span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.route-execute-list { display: grid; gap: 8px; }
.route-execute-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 180px; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; }
.route-execute-main { min-width: 0; }
.route-execute-main strong, .route-execute-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-execute-main span { margin-top: 4px; color: var(--muted); font-size: 10px; }
@media (max-width: 680px) { .route-execute-row { grid-template-columns: 1fr; } }
.route-weekday-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.purchase-suggest-grid { display: grid; gap: 12px; margin-top: 12px; }
.purchase-suggest-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.purchase-suggest-card .card-title-row { margin-bottom: 8px; }
.text-warning { color: #b35c00; }
.text-success { color: #0f766e; }
.purchase-receipt-list { display: grid; gap: 8px; }
.purchase-receipt-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 90px; align-items: end; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; }
.purchase-receipt-row > label { display: grid; gap: 4px; }
.purchase-receipt-row > label span, .purchase-receipt-remain span { color: var(--muted); font-size: 10px; }
.purchase-receipt-remain { text-align: right; }
.purchase-receipt-remain strong, .purchase-receipt-remain span { display: block; }
@media (max-width: 560px) { .purchase-receipt-row { grid-template-columns: 1fr; } .purchase-receipt-remain { text-align: left; } }
@media (max-width: 680px) { .purchase-item-picker { grid-template-columns: 1fr; } .purchase-item-row { grid-template-columns: minmax(0, 1fr) 70px; } .purchase-item-row > label:nth-of-type(2), .purchase-item-row > button { grid-column: auto; } }
@media (max-width: 560px) { .purchase-product-tools { grid-template-columns: 1fr; } .purchase-item-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.checkbox-row input { width: 17px; min-height: 17px; accent-color: var(--primary); }
.checkbox-row label { color: #465a67; font-size: 12px; }
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 9px; }
.toast { min-width: 230px; max-width: 350px; padding: 12px 14px; border-left: 4px solid var(--success); border-radius: 10px; color: #344c5a; background: #fff; box-shadow: 0 14px 36px rgba(18,39,52,.17); font-size: 12px; animation: slideLeft .2s ease; }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(12px); } }
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -250px; width: 238px; transition: left .2s ease; box-shadow: 18px 0 40px rgba(13,30,40,.2); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: block; margin-right: 4px; }
  .topbar { justify-content: flex-start; gap: 12px; padding: 14px 17px; }
  .topbar-actions { margin-left: auto; }
  .today, .topbar-actions .ghost { display: none; }
  .content { padding: 18px 16px 35px; }
}
@media (max-width: 620px) {
  .kpi-grid, .grid-2.equal { grid-template-columns: 1fr; }
  .topbar-actions .btn.primary { padding: 8px 10px; font-size: 0; }
  .topbar-actions .btn.primary::after { content: "+"; font-size: 21px; line-height: 1; }
  .hero-card { padding: 20px; }
  .hero-card h2 { font-size: 19px; }
  .toolbar { align-items: stretch; }
  .filters, .search, .search input { width: 100%; }
  .compact-select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .setting-row { display: grid; }
  .setting-control, .setting-control.small { width: 100%; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: 95vh; border-radius: 14px; }
  .modal-header, .modal-body { padding-left: 16px; padding-right: 16px; }
  .toast-wrap { right: 10px; bottom: 10px; left: 10px; }
  .toast { min-width: 0; max-width: none; }
}

/* V1 M0/M1 additions */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.detail-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-item strong { display: block; margin-top: 6px; color: #203744; font-size: 13px; line-height: 1.5; }
.detail-item.full { grid-column: 1 / -1; }
.entity-hero { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 13px; color: #fff; background: linear-gradient(120deg, #143644, #0f766e); }
.entity-hero .entity-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; color: #103b3b; background: #8ae1d3; font-size: 19px; font-weight: 800; }
.entity-hero h3 { margin: 1px 0 5px; font-size: 17px; }
.entity-hero p { margin: 0; color: #cce4e4; font-size: 11px; line-height: 1.55; }
.site-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.site-stats div { padding: 10px; border-radius: 10px; background: #f7fafb; }
.site-stats strong { display: block; font-size: 16px; }
.site-stats span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.qr-preview { display: grid; place-items: center; width: 150px; height: 150px; border: 1px dashed #b9c8d1; border-radius: 14px; background: repeating-conic-gradient(#203744 0 25%, #fff 0 50%) 0 / 10px 10px; box-shadow: inset 0 0 0 12px #fff; }
.qr-preview span { padding: 5px 8px; border-radius: 7px; color: #fff; background: rgba(20,43,58,.88); font-size: 10px; }
@media (max-width: 620px) { .detail-grid, .site-stats { grid-template-columns: 1fr; } .detail-item.full { grid-column: auto; } }

/* Role based access prototype */
.role-picker { display:flex; align-items:center; gap:8px; padding:5px 7px 5px 10px; border:1px solid var(--line); border-radius:10px; background:#f8fafb; }
.role-picker span { color:var(--muted); font-size:10px; white-space:nowrap; }
.role-picker select { width:132px; min-height:30px; padding:4px 8px; border:0; background:transparent; font-size:12px; font-weight:700; color:#334b59; box-shadow:none; }
.role-note { display:flex; gap:9px; align-items:flex-start; padding:12px 13px; border:1px solid #cfe7e2; border-radius:11px; color:#315f5a; background:#f0faf8; font-size:11px; line-height:1.55; }
.role-note strong { color:#0f766e; }
.permission-table { min-width:680px; }
@media (max-width: 900px) { .role-picker span { display:none; } .role-picker select { width:108px; } }
@media (max-width: 620px) { .role-picker { display:none; } }

/* M5 product picker */
.m5-picker-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:6px; }
.m5-product-chip { display:grid; gap:4px; padding:10px; border:1px solid var(--line); border-radius:10px; color:var(--text); background:#fff; text-align:left; }
.m5-product-chip:hover { border-color:#8bc9c1; background:#f4fbfa; }
.m5-product-chip strong { font-size:12px; }
.m5-product-chip span { color:var(--muted); font-size:10px; }
@media (max-width: 620px) { .m5-picker-grid { grid-template-columns:1fr; } }

/* M5B device replenishment template */
.m5b-floor { border:1px solid var(--line); border-radius:14px; background:#fff; overflow:hidden; }
.m5b-floor-title { display:flex; align-items:center; justify-content:space-between; padding:12px 15px; border-bottom:1px solid var(--line); background:#f8fbfc; }
.m5b-floor-title strong { font-size:15px; }
.m5b-floor-title span { color:var(--muted); font-size:11px; }
.m5b-slot-grid { display:grid; grid-template-columns:repeat(10,minmax(88px,1fr)); gap:8px; min-width:1080px; padding:12px; overflow-x:auto; }
.m5b-slot-card, .m5b-empty-slot { position:relative; min-height:150px; border:1px solid var(--line); border-radius:11px; background:#fff; padding:9px; }
.m5b-slot-card { display:flex; flex-direction:column; align-items:center; gap:5px; text-align:center; }
.m5b-slot-card > strong { width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.m5b-slot-card > span { color:var(--muted); font-size:10px; }
.m5b-product-image { display:grid; place-items:center; width:100%; height:62px; border-radius:8px; }
.m5b-product-image span { color:#5f6f78; font-size:14px; font-weight:800; }
.m5b-qty { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:10px; }
.m5b-qty input { width:50px; min-height:28px; padding:3px 6px; text-align:center; }
.m5b-remove { position:absolute; right:5px; top:5px; z-index:2; width:20px; height:20px; border:0; border-radius:50%; color:#fff; background:rgba(35,55,68,.55); line-height:1; }
.m5b-empty-slot { display:grid; place-items:center; align-content:center; gap:6px; color:#7f909a; border-style:dashed; background:#fafcfd; }
.m5b-empty-slot:hover { color:var(--primary); border-color:#79c4ba; background:#f2fbf9; }
.m5b-empty-slot strong { font-size:12px; }
.m5b-empty-slot span { font-size:10px; }
@media (max-width: 900px) { .m5b-slot-grid { grid-template-columns:repeat(5,minmax(100px,1fr)); min-width:620px; } }

/* Grouped navigation */
.nav { overflow-y:auto; padding-right:2px; }
.nav-section { display:grid; gap:4px; margin-top:10px; }
.nav-section-title { padding:8px 12px 3px; color:#6f8b99; font-size:10px; font-weight:700; letter-spacing:.8px; }
.nav-section .nav-item { padding-top:9px; padding-bottom:9px; }

/* Collapsible navigation */
.nav-section-toggle, .nav-subsection-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; padding:8px 12px 5px; border:0; color:#7d98a7; background:transparent; font-size:10px; font-weight:700; letter-spacing:.7px; text-align:left; }
.nav-section-toggle:hover, .nav-subsection-toggle:hover { color:#dbe9ee; }
.nav-section-content, .nav-subnav { display:grid; gap:4px; }
.nav-section.collapsed .nav-section-content, .nav-subsection.collapsed .nav-subnav { display:none; }
.nav-section.collapsed .nav-section-toggle .nav-arrow, .nav-subsection.collapsed .nav-subsection-toggle .nav-arrow { transform:rotate(-90deg); }
.nav-arrow { font-size:10px; transition:.15s ease; }
.nav-subsection { margin-top:5px; }
.nav-subsection-toggle { padding:7px 12px 4px 35px; color:#668492; }
.nav-subnav .nav-item { padding-left:25px; }

/* Navigation layout polish */
.app-shell { grid-template-columns:250px minmax(0,1fr); }
.sidebar { width:250px; padding:22px 14px 16px; }
.nav { gap:5px; }
.nav-section { margin-top:14px; padding-top:10px; border-top:1px solid rgba(255,255,255,.075); }
.nav-section-toggle { min-height:38px; padding:9px 11px; border-radius:9px; color:#d9e7ed; background:rgba(255,255,255,.035); font-size:12px; font-weight:800; letter-spacing:.5px; }
.nav-section-toggle:hover { color:#fff; background:rgba(255,255,255,.085); }
.nav-section-content { gap:5px; margin-top:6px; }
.nav-subsection { margin:6px 0 2px 7px; padding-left:7px; border-left:1px solid rgba(120,165,181,.2); }
.nav-subsection-toggle { min-height:34px; padding:8px 9px; border-radius:8px; color:#9eb8c4; background:transparent; font-size:11px; font-weight:700; letter-spacing:.35px; }
.nav-subsection-toggle:hover { color:#e8f3f5; background:rgba(255,255,255,.055); }
.nav-subnav { gap:4px; margin-top:5px; }
.nav-subnav .nav-item { min-height:38px; padding:9px 10px 9px 18px; }
.nav-item { min-height:40px; padding:9px 11px; font-size:13px; }
.nav-item > span:not(.nav-icon):not(.nav-count) { line-height:1.2; }
.nav-icon { width:27px; height:27px; }
.nav-count { font-size:10px; }
.nav-arrow { display:grid; place-items:center; width:20px; height:20px; border-radius:6px; background:rgba(255,255,255,.055); font-size:11px; }
.nav-section.collapsed, .nav-subsection.collapsed { background:transparent; }
@media (max-width:820px) { .app-shell { grid-template-columns:1fr; } .sidebar { width:258px; } }

/* Final navigation hierarchy */
.nav-section-toggle { min-height:40px; font-size:13px; }
.nav-subsection { margin:6px 0 2px; padding-left:0; border-left:0; }
.nav-subsection-toggle { display:grid; grid-template-columns:29px 1fr auto; align-items:center; gap:9px; min-height:44px; padding:10px 11px; border-radius:10px; color:#e3eef2; background:rgba(255,255,255,.035); font-size:14px; font-weight:700; letter-spacing:.1px; text-align:left; }
.nav-subsection-toggle:hover { color:#fff; background:rgba(255,255,255,.09); }
.nav-subsection-toggle .nav-icon { display:grid; place-items:center; width:29px; height:29px; border-radius:8px; color:#b8d5dd; background:rgba(255,255,255,.075); font-size:12px; font-weight:800; }
.nav-subsection.collapsed .nav-subsection-toggle { background:rgba(255,255,255,.022); }
.nav-subnav { margin:5px 0 4px 18px; padding-left:8px; border-left:1px solid rgba(120,165,181,.28); }
.nav-subnav .nav-item { min-height:38px; padding:8px 10px; color:#b9ced7; font-size:13px; background:transparent; }
.nav-subnav .nav-item:hover { color:#fff; background:rgba(255,255,255,.06); }
.nav-subnav .nav-item.active { color:#fff; background:rgba(34,184,166,.16); box-shadow:inset 3px 0 #2fc1b1; }
.nav-subnav .nav-icon { width:26px; height:26px; }

.m5b-product-image img { width:100%; height:100%; object-fit:contain; }

/* Global search */
.global-search-wrap { position:relative; width:260px; }
.global-search-wrap input { min-height:36px; padding-left:34px; background:#f8fafb; }
.global-search-wrap::before { content:'⌕'; position:absolute; left:11px; top:8px; z-index:2; color:#82939e; font-size:17px; pointer-events:none; }
.global-search-results { position:absolute; top:43px; left:0; right:0; z-index:80; display:none; max-height:480px; overflow-y:auto; padding:6px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 18px 46px rgba(18,39,52,.18); }
.global-search-results.open { display:block; }
.global-search-group { padding:8px 8px 3px; color:var(--muted); font-size:10px; font-weight:700; }
.global-search-item { display:grid; grid-template-columns:30px 1fr; gap:8px; width:100%; padding:9px 8px; border:0; border-radius:8px; background:transparent; text-align:left; }
.global-search-item:hover { background:#f3faf8; }
.global-search-item .search-type { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; color:var(--primary); background:var(--primary-soft); font-size:11px; font-weight:800; }
.global-search-item strong { display:block; overflow:hidden; color:#263a48; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.global-search-item span { display:block; overflow:hidden; margin-top:3px; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.global-search-empty { padding:24px 12px; color:var(--muted); text-align:center; font-size:11px; }
@media (max-width: 1120px) { .global-search-wrap { width:210px; } }
@media (max-width: 900px) { .global-search-wrap { display:none; } }

/* Login */
.login-screen { position:fixed; inset:0; z-index:500; display:grid; place-items:center; padding:20px; background:linear-gradient(135deg,#102633,#123b42 65%,#0f766e); }
.login-screen.hidden { display:none; }
.login-card { width:min(400px,100%); padding:28px; border-radius:20px; background:#fff; box-shadow:0 30px 80px rgba(7,24,32,.35); }
.login-brand { display:flex; align-items:center; gap:12px; margin-bottom:24px; }
.login-brand strong { display:block; font-size:20px; }
.login-brand span { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.login-submit { width:100%; margin-top:18px; min-height:42px; }
.login-tip { margin-top:14px; padding:10px; border-radius:9px; color:#617783; background:#f3f7f8; font-size:11px; text-align:center; }

/* Hidden must override component display styles */
[hidden] { display:none !important; }
