/* ============================================================
   SOKGO Internal Operations System — design system
   ============================================================ */
:root {
  --ink: #15241e;
  --ink-2: #46554e;
  --ink-3: #7c8982;
  --ink-4: #a4afa9;
  --green-950: #062e23;
  --green-900: #083d2f;
  --green-800: #0a4a39;
  --green-700: #0b5d45;
  --green-600: #0e7256;
  --green-500: #19916f;
  --green-100: #e7f3ec;
  --green-50: #f1f8f4;
  --sand: #f4f1ea;
  --sand-2: #ece7db;
  --card: #fffdf9;
  --line: #e5dfd3;
  --line-2: #d7d0c1;
  --amber: #d99a3d;
  --amber-600: #b97c25;
  --amber-100: #fbf1df;
  --red: #c2483c;
  --red-600: #a63a30;
  --red-100: #fbe9e6;
  --blue: #2d6cdf;
  --blue-100: #e8effc;
  --purple: #7357b8;
  --purple-100: #efeafb;
  --slate: #64716a;
  --slate-100: #eef0ee;
  --shadow-sm: 0 1px 2px rgba(18, 36, 28, .05);
  --shadow: 0 1px 2px rgba(18, 36, 28, .05), 0 18px 36px -28px rgba(18, 36, 28, .42);
  --shadow-lg: 0 30px 70px -30px rgba(8, 40, 30, .45);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --sidebar: 254px;
  --sans: "Segoe UI", "Inter", "Helvetica Neue", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--sand);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: var(--green-700); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #cfe8da; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }
.p-0 { padding: 0 !important; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------------- boot ---------------- */
.boot {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--green-900); color: #fff;
  transition: opacity .35s ease, visibility .35s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-mark {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(145deg, #e8b45a, #c8872c); color: var(--green-900);
  font-size: 34px; font-weight: 800; letter-spacing: -.04em;
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.6);
}
.boot-name { font-weight: 650; letter-spacing: .02em; font-size: 15px; }
.boot-name span { color: #a9c8ba; font-weight: 400; margin-left: 8px; }
.boot-bar { width: 160px; height: 3px; background: rgba(255,255,255,.14); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: #e8b45a; border-radius: 3px; animation: bootbar 1.2s infinite ease-in-out; }
@keyframes bootbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------------- shell ---------------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 60;
  background:
    radial-gradient(900px 400px at -20% -10%, rgba(35, 122, 92, .55), transparent 60%),
    radial-gradient(600px 300px at 120% 110%, rgba(217, 154, 61, .14), transparent 60%),
    linear-gradient(180deg, #0a4636 0%, #083b2e 55%, #062f25 100%);
  color: #eaf3ee;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255,255,255,.35) .5px, transparent .5px);
  background-size: 7px 7px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; position: relative; z-index: 1; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #eec272, #cf8f31); color: #12392c;
  font-weight: 800; font-size: 22px; letter-spacing: -.05em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 10px 20px -10px rgba(0,0,0,.5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: .14em; font-weight: 750; }
.brand-text span { font-size: 10.5px; color: #9fc0b1; letter-spacing: .13em; text-transform: uppercase; margin-top: 3px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 4px; }
.nav-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #6f9787; padding: 18px 12px 7px; font-weight: 650; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: #c8ddd2; font-size: 13.5px; font-weight: 500; cursor: pointer; position: relative;
  transition: background .15s, color .15s, transform .15s;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: rgba(255,255,255,.065); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: #e8b45a;
}
.nav-icon { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-badge { margin-left: auto; background: #e8b45a; color: #2b2411; font-size: 10px; font-weight: 750; border-radius: 20px; padding: 1px 7px; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); position: relative; z-index: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.user-chip:hover { background: rgba(255,255,255,.07); }
.user-chip .meta { min-width: 0; flex: 1; }
.user-chip .meta b { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta span { display: block; font-size: 11px; color: #91b3a4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .out { color: #8fb2a2; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.user-chip .out:hover { background: rgba(255,255,255,.1); color: #fff; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; min-height: 58px;
  display: flex; align-items: center; gap: 16px; padding: 8px 28px;
  background: rgba(244, 241, 234, .86); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(229, 223, 211, .8);
}
.topbar-title { flex: 1; min-width: 0; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); letter-spacing: .01em; }
.crumb .root { color: var(--ink-4); font-weight: 600; letter-spacing: .12em; font-size: 10px; }
.crumb b { font-weight: 650; color: var(--ink); }
.crumb svg { opacity: .45; }
.topbar-title h1 { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--ink-2); }
.topbar-title p { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.clock { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.55); }
.clock .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 3px rgba(25,145,111,.15); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.6);
  display: grid; place-items: center; color: var(--ink-2); cursor: pointer; position: relative; transition: .15s;
}
.icon-btn:hover { background: #fff; color: var(--ink); border-color: var(--line-2); }
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
  border: 2px solid var(--sand);
}
.lang-toggle { height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.6); color: var(--ink-2); font-size: 12px; font-weight: 650; cursor: pointer; }
.lang-toggle:hover { background: #fff; }
.content { padding: 24px 28px 48px; flex: 1; max-width: 1640px; width: 100%; margin: 0 auto; }

.mobile-nav { display: none; }

/* ---------------- page primitives ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-eyebrow { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--green-600); font-weight: 700; margin-bottom: 5px; }
.page-title { font-size: 27px; font-weight: 730; letter-spacing: -.025em; line-height: 1.15; }
.page-sub { font-size: 13px; color: var(--ink-3); margin-top: 5px; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; gap: 12px; }
.section-title { font-size: 15px; font-weight: 680; letter-spacing: -.01em; }
.section-link { font-size: 12px; color: var(--green-700); cursor: pointer; font-weight: 600; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-head { padding: 16px 18px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-size: 14px; font-weight: 680; letter-spacing: -.005em; }
.card-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 12px 14px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.card-flush { padding: 0; }

.stat { position: relative; padding: 16px 18px; overflow: hidden; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 11.5px; color: var(--ink-3); font-weight: 550; letter-spacing: .01em; }
.stat-value { font-size: 31px; font-weight: 720; letter-spacing: -.035em; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 3px; }
.stat-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--green-100); color: var(--green-700); flex: none; }
.stat-icon.amber { background: var(--amber-100); color: var(--amber-600); }
.stat-icon.blue { background: var(--blue-100); color: var(--blue); }
.stat-icon.red { background: var(--red-100); color: var(--red); }
.stat-icon.purple { background: var(--purple-100); color: var(--purple); }
.trend-up { color: var(--green-600); font-weight: 650; }
.trend-down { color: var(--red); font-weight: 650; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
  background: transparent; color: var(--ink); user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: 0 8px 18px -12px rgba(11,93,69,.8); }
.btn-primary:hover { background: var(--green-800); }
.btn-soft { background: var(--green-100); color: var(--green-800); }
.btn-soft:hover { background: #dbeee3; }
.btn-ghost { border-color: var(--line); background: var(--card); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--ink); background: #fff; }
.btn-danger { background: var(--red-100); color: var(--red-600); }
.btn-danger:hover { background: #f7dcd7; }
.btn-amber { background: var(--amber); color: #2b2411; }
.btn-amber:hover { background: #c98c31; }
.btn-sm { height: 31px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon-only { width: 34px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green-700); font-size: 12px; font-weight: 600; cursor: pointer; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none;
}
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c8982' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.textarea { height: auto; min-height: 82px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(25,145,111,.13); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:disabled, .select:disabled { background: #f6f3ec; color: var(--ink-3); }
.hint { font-size: 11px; color: var(--ink-3); }
.field-error { font-size: 11px; color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { margin: 2px 0 0; accent-color: var(--green-600); width: 15px; height: 15px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #d8d2c5; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--green-600); }
.switch input:checked + i::after { transform: translateX(16px); }
.seg { display: inline-flex; background: var(--sand-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------------- toolbar / filters ---------------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar > .select { width: auto; min-width: 148px; flex: 0 0 auto; }
.toolbar > .input { width: auto; flex: 0 0 auto; }
.toolbar > .search { flex: 1 1 240px; max-width: 360px; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 220px; max-width: 330px; flex: 1; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.search input { padding-left: 34px; height: 38px; background: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .select { width: auto; min-width: 120px; height: 38px; font-size: 12.5px; }

/* ---------------- table ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.table thead th {
  text-align: left; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  font-weight: 700; padding: 10px 12px; background: #faf8f3; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table thead th:first-child { border-top-left-radius: 10px; }
.table thead th:last-child { border-top-right-radius: 10px; }
.table tbody td { padding: 11px 12px; border-bottom: 1px solid #efeae0; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click:hover { background: #fbf9f3; cursor: pointer; }
.table tbody tr.selected { background: var(--green-50); }
.table .t-right { text-align: right; }
.table .t-center { text-align: center; }
.table .t-strong { font-weight: 620; color: var(--ink); }
.table .sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-variant-numeric: tabular-nums; }
.table.compact tbody td { padding: 8px 10px; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table-head .select { width: auto; min-width: 140px; height: 32px; font-size: 12px; }
.table-head h3 { font-size: 13.5px; font-weight: 680; }
.table-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--ink-3); }
.pager { display: flex; gap: 4px; align-items: center; }
.pager button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 11px; }
.pager button.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- pills / badges ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .015em; white-space: nowrap;
  background: var(--slate-100); color: var(--slate);
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill.green { background: var(--green-100); color: var(--green-700); }
.pill.amber { background: var(--amber-100); color: var(--amber-600); }
.pill.red { background: var(--red-100); color: var(--red-600); }
.pill.blue { background: var(--blue-100); color: var(--blue); }
.pill.purple { background: var(--purple-100); color: var(--purple); }
.pill.ink { background: #e9ece9; color: var(--ink-2); }
.pill.dark { background: #24352d; color: #fff; }
.pill.outline { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; background: #f3efe6; color: var(--ink-2); font-size: 11px; font-weight: 550; }
.chip-active { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.category-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbf9f4; transition: border-color .15s, background .15s; }
.category-tile:hover { border-color: var(--green-600); background: #fff; }
.selected-card { border-color: var(--green-600); box-shadow: 0 0 0 2px rgba(14,114,86,.08); }

/* ---------------- tabs ---------------- */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 13px 9px; font-size: 12.8px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; border-top: 0; border-left: 0; border-right: 0; background: none; font-family: inherit; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green-800); border-bottom-color: var(--green-700); }
.tab .count { font-size: 10px; background: var(--sand-2); border-radius: 10px; padding: 1px 6px; margin-left: 5px; color: var(--ink-3); }

/* ---------------- avatar ---------------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--green-100); color: var(--green-800); font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.amber { background: var(--amber-100); color: var(--amber-600); }
.avatar.blue { background: var(--blue-100); color: var(--blue); }
.avatar.purple { background: var(--purple-100); color: var(--purple); }
.avatar.red { background: var(--red-100); color: var(--red); }
.user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-cell .nm { font-weight: 620; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-cell .rl { font-size: 10.5px; color: var(--ink-3); }

/* ---------------- drawer / modal ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 30, 23, .42); backdrop-filter: blur(2px); z-index: 100; animation: fade .2s ease; }
.drawer-layer { position: fixed; inset: 0; z-index: 101; display: flex; justify-content: flex-end; }
.drawer {
  width: min(720px, 100vw); height: 100%; background: var(--sand); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .26s cubic-bezier(.22,.8,.3,1);
}
.drawer.narrow { width: min(520px, 100vw); }
.drawer.wide { width: min(920px, 100vw); }
.drawer-head { padding: 20px 24px 16px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 14px; }
.drawer-head h2 { font-size: 19px; font-weight: 710; letter-spacing: -.02em; }
.drawer-head p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.drawer-close { margin-left: auto; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 28px; }
.drawer-foot { padding: 14px 24px; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-layer { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px; }
.modal-card {
  width: min(560px, 100%); max-height: 90vh; background: var(--card); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); display: flex; flex-direction: column;
  animation: pop .22s cubic-bezier(.22,.8,.3,1); overflow: hidden;
}
.modal-card.lg { width: min(780px, 100%); }
.modal-card.sm { width: min(420px, 100%); }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.modal-head p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.modal-body { padding: 4px 22px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fcfaf5; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- toast ---------------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 380px; padding: 11px 14px; border-radius: 11px; background: #123c2f; color: #fff;
  font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 9px;
  animation: toastin .25s ease; pointer-events: auto; border: 1px solid rgba(255,255,255,.08);
}
.toast.error { background: #7a2a23; }
.toast.warn { background: #7d5717; }
.toast.success { background: #0d513d; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.out { animation: toastout .2s ease forwards; }
@keyframes toastin { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastout { to { transform: translateY(-6px); opacity: 0; } }

/* ---------------- charts ---------------- */
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid line { stroke: #ebe5d9; stroke-width: 1; }
.chart-axis { font-size: 9px; fill: var(--ink-3); font-family: var(--sans); }
.chart-legend { display: flex; gap: 16px; align-items: center; font-size: 11px; color: var(--ink-3); margin-top: 8px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.chart-tip { position: absolute; background: #12241d; color: #fff; padding: 5px 8px; border-radius: 7px; font-size: 10.5px; pointer-events: none; transform: translate(-50%, -120%); white-space: nowrap; z-index: 5; }
.bar-track { height: 6px; border-radius: 6px; background: #ede8de; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 6px; background: var(--green-600); }
.donut { position: relative; width: 92px; height: 92px; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-weight: 720; letter-spacing: -.02em; }

/* ---------------- map ---------------- */
.map-card { position: relative; background: #e9efe7; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.map-svg { display: block; width: 100%; height: 100%; background: #e9efe7; }
.map-pin { cursor: pointer; }
.map-pin circle.halo { opacity: 0; transition: opacity .15s; }
.map-pin:hover circle.halo { opacity: .28; }
.map-legend { position: absolute; left: 12px; bottom: 12px; background: rgba(255,253,249,.92); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; display: flex; gap: 10px; font-size: 10px; color: var(--ink-2); backdrop-filter: blur(6px); }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.map-tools { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 5px; }
.map-tools button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,253,249,.94); cursor: pointer; color: var(--ink-2); font-weight: 700; }
.map-label { font-size: 8px; fill: #64716a; font-family: var(--sans); }
.map-zone { fill: rgba(11,93,69,.06); stroke: rgba(11,93,69,.16); stroke-dasharray: 4 4; }

/* ---------------- timeline ---------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -21px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--green-600); box-shadow: 0 0 0 3px var(--sand); }
.tl-item.warn .tl-dot { border-color: var(--amber); }
.tl-item.danger .tl-dot { border-color: var(--red); }
.tl-item.muted .tl-dot { border-color: var(--ink-4); }
.tl-title { font-size: 12.5px; font-weight: 620; }
.tl-meta { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.tl-body { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ---------------- photos ---------------- */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; background: #e5e9e2; aspect-ratio: 4/3; border: 1px solid var(--line); cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.photo:hover img { transform: scale(1.03); }
.photo .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(10,30,23,.72); color: #fff; font-size: 9.5px; padding: 2px 6px; border-radius: 5px; backdrop-filter: blur(4px); }
.photo .flag { position: absolute; right: 6px; top: 6px; background: rgba(194,72,60,.92); color: #fff; font-size: 9px; padding: 2px 5px; border-radius: 4px; }
.photo-empty { display: grid; place-items: center; color: var(--ink-4); font-size: 11px; }

/* ---------------- misc ---------------- */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 18px; }
.kv .k { font-size: 10.5px; color: var(--ink-3); letter-spacing: .03em; text-transform: uppercase; font-weight: 600; }
.kv .v { font-size: 12.8px; font-weight: 550; margin-top: 2px; }
.kv.cols-1 { grid-template-columns: 1fr; }
.kv.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: 10px; background: var(--amber-100); color: #6a4a10; font-size: 12px; line-height: 1.5; border: 1px solid #f0dfc0; }
.notice.red { background: var(--red-100); color: #7d2b24; border-color: #f2d2cd; }
.notice.green { background: var(--green-100); color: var(--green-800); border-color: #cfe6d9; }
.notice.blue { background: var(--blue-100); color: #1f4a99; border-color: #d3e0f8; }
.notice svg { flex: none; margin-top: 1px; }
.empty { padding: 38px 18px; text-align: center; color: var(--ink-3); }
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); font-size: 13px; font-weight: 620; margin-bottom: 3px; }
.empty span { font-size: 11.5px; }
.skeleton { background: linear-gradient(90deg, #eee9df 25%, #f7f3ea 37%, #eee9df 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.section-sep { height: 1px; background: var(--line); margin: 20px 0; }
.badge-count { font-size: 10px; background: var(--red); color: #fff; border-radius: 10px; padding: 1px 6px; font-weight: 700; }
.code-card {
  background: linear-gradient(145deg, #0b5d45, #083d2f); color: #fff; border-radius: 14px; padding: 18px;
  position: relative; overflow: hidden;
}
.code-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 160px; height: 160px; border-radius: 50%; border: 30px solid rgba(255,255,255,.05); }
.code-card .code { font-family: var(--mono); font-size: 27px; letter-spacing: .16em; font-weight: 700; margin: 8px 0 2px; }
.code-card .meta { font-size: 11px; color: #a9c8ba; }
.code-dashes { border-top: 1px dashed rgba(255,255,255,.25); margin: 13px 0; }
.approval-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-step { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; background: #f3efe6; font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.flow-step.done { background: var(--green-100); color: var(--green-700); }
.flow-step.current { background: var(--amber-100); color: var(--amber-600); box-shadow: 0 0 0 1px #ecd6ae inset; }
.flow-arrow { color: var(--ink-4); font-size: 11px; }
.capture-grid, .photo-capture { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.capture-slot { border: 1.5px dashed var(--line-2); border-radius: 10px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 10.5px; cursor: pointer; background: #fffdf9; text-align: center; padding: 8px; }
.capture-slot:hover { border-color: var(--green-500); color: var(--green-700); background: var(--green-50); }
.capture-slot.done { border-style: solid; border-color: var(--green-500); padding: 0; overflow: hidden; position: relative; }
.capture-slot img { width: 100%; height: 100%; object-fit: cover; }
.capture-slot .retake { position: absolute; inset: auto 0 0 0; background: rgba(10,30,23,.72); color: #fff; font-size: 9.5px; padding: 3px; }
.field-photo { width: 100%; border-radius: 10px; display: block; }
.progress { height: 5px; background: #ebe6db; border-radius: 5px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green-600); border-radius: 5px; }
.print-btn { display: none; }
.report-sheet { background: #fff; max-width: 880px; margin: 0 auto; padding: 42px 48px; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); }
.report-sheet h1 { font-size: 25px; letter-spacing: -.02em; }
.report-brand { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--green-900); padding-bottom: 18px; margin-bottom: 26px; }
.report-brand .wordmark { font-weight: 800; letter-spacing: .14em; font-size: 20px; color: var(--green-900); }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.report-table th, .report-table td { border-bottom: 1px solid #e8e2d6; padding: 8px; text-align: left; }
.report-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #7c8982; }

/* ---------------- login ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: var(--sand); }
.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: 52px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(40, 133, 100, .55), transparent 55%),
    radial-gradient(700px 500px at 100% 100%, rgba(217, 154, 61, .16), transparent 55%),
    linear-gradient(155deg, #0a4636, #062f25 70%);
}
.login-brand::after {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background-image: radial-gradient(rgba(255,255,255,.4) .6px, transparent .6px); background-size: 8px 8px;
  mask-image: radial-gradient(700px 500px at 60% 40%, #000, transparent);
}
.login-brand .brand { padding: 0; margin-bottom: 12vh; position: relative; z-index: 2; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 25px; }
.login-brand .brand-text b { font-size: 19px; }
.login-brand .brand-text span { font-size: 10px; }
.login-copy { position: relative; z-index: 2; max-width: 540px; }
.login-kicker { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #e8b45a; font-weight: 700; margin-bottom: 16px; }
.login-copy h1 { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.08; letter-spacing: -.035em; font-weight: 720; }
.login-copy h1 em { font-style: normal; color: #e8b45a; }
.login-copy p { margin-top: 18px; font-size: 13.5px; line-height: 1.75; color: #b8d2c5; max-width: 460px; }
.login-facts { display: flex; gap: 30px; margin-top: 32px; position: relative; z-index: 2; flex-wrap: wrap; }
.login-fact b { display: block; font-size: 24px; letter-spacing: -.03em; font-weight: 720; color: #fff; font-variant-numeric: tabular-nums; }
.login-fact span { display: block; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: #86ab9a; margin-top: 2px; }
.login-art { position: absolute; right: -6%; bottom: -6%; width: 58%; opacity: .28; z-index: 1; pointer-events: none; }
.login-foot { margin-top: 0; position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #6f9787; padding-top: 28px; }
.login-flow { position: relative; z-index: 2; display: flex; gap: 0; margin-top: auto; margin-bottom: 8px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; max-width: 560px; }
.login-step { flex: 1; position: relative; padding-right: 12px; }
.login-step .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 9.5px; font-weight: 700; color: #e8b45a; border: 1px solid rgba(232,180,90,.45); background: rgba(232,180,90,.08); margin-bottom: 8px; }
.login-step b { display: block; font-size: 11.5px; font-weight: 650; color: #eaf3ee; }
.login-step span { display: block; font-size: 9.5px; color: #86ab9a; margin-top: 1px; }
.login-step:not(:last-child)::after { content: ""; position: absolute; left: 28px; right: 8px; top: 11px; height: 1px; background: linear-gradient(90deg, rgba(232,180,90,.28), rgba(255,255,255,.06)); }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 40px 6vw; position: relative; }
.login-card { width: 100%; max-width: 396px; margin: 0 auto; }
.login-card h2 { font-size: 26px; font-weight: 720; letter-spacing: -.03em; }
.login-card .lede { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 24px; }
.login-card .field { margin-bottom: 13px; }
.login-card .btn-lg { margin-top: 8px; }
.login-tools { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; font-size: 11.5px; color: var(--ink-3); }
.login-lang { position: absolute; top: 28px; right: 32px; }
.demo-box { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-title { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 9px; display: flex; justify-content: space-between; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.55); cursor: pointer; text-align: left; transition: .15s; }
.demo-item:hover { border-color: var(--green-500); background: #fff; }
.demo-item b { display: block; font-size: 11.5px; font-weight: 620; color: var(--ink); }
.demo-item span { display: block; font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.demo-item.admin { grid-column: span 2; border-color: #d8c9a8; background: var(--amber-100); }
.login-note { font-size: 10.5px; color: var(--ink-4); line-height: 1.6; margin-top: 16px; }

/* ---------------- agent mobile ---------------- */
.agent-hero {
  background: linear-gradient(145deg, #0b5d45, #083d2f); color: #fff; border-radius: 18px; padding: 20px;
  position: relative; overflow: hidden; margin-bottom: 16px;
}
.agent-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 200px; height: 200px; border-radius: 50%; border: 40px solid rgba(255,255,255,.05); }
.agent-hero .hello { font-size: 12px; color: #a9c8ba; }
.agent-hero h2 { font-size: 24px; font-weight: 720; letter-spacing: -.03em; margin-top: 2px; }
.agent-hero .stats { display: flex; gap: 24px; margin-top: 18px; }
.agent-hero .stats b { display: block; font-size: 22px; font-weight: 720; letter-spacing: -.02em; }
.agent-hero .stats span { font-size: 10px; color: #9fc0b1; letter-spacing: .06em; text-transform: uppercase; }
.task-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 15px; margin-bottom: 10px; }
.task-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-card .head b { font-size: 14px; font-weight: 680; }
.task-card .head span { font-size: 11px; color: var(--ink-3); }
.task-stops { margin-top: 12px; border-top: 1px solid var(--line); }
.task-stop { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1ece2; }
.task-stop:last-child { border-bottom: 0; }
.task-stop .idx { width: 22px; height: 22px; border-radius: 50%; background: var(--sand-2); color: var(--ink-2); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.task-stop.done .idx { background: var(--green-100); color: var(--green-700); }
.task-stop .info { flex: 1; min-width: 0; }
.task-stop .info b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-stop .info span { font-size: 10.5px; color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-tabs { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 3px; margin-bottom: 14px; }
.field-tabs button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.field-tabs button.active { background: var(--green-100); color: var(--green-800); }
.step-dots { display: flex; gap: 5px; align-items: center; }
.step-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.step-dots i.on { background: var(--green-600); width: 14px; border-radius: 3px; }
.camera-hint { font-size: 10.5px; color: var(--ink-3); line-height: 1.55; }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .cols-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1080px) {
  .split-2 { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: 272px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { padding: 9px 14px; min-height: 60px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .clock { display: none; }
  .content { padding: 16px 14px 92px; }
  .page-title { font-size: 22px; }
  .page-sub { display: none; }
  .page-head { margin-bottom: 14px; align-items: center; }
  .page-actions .btn span.lbl { display: none; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 25px; }
  .stat { padding: 13px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .drawer { width: 100vw; }
  .drawer-head { padding: 16px 18px 13px; }
  .drawer-body { padding: 16px 18px 24px; }
  .photos { grid-template-columns: repeat(3, 1fr); }
  .content { padding-bottom: 92px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: rgba(255,253,249,.96);
    border-top: 1px solid var(--line); backdrop-filter: blur(14px); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav button, .mobile-nav a {
    flex: 1; border: 0; background: none; padding: 5px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 9.5px; color: var(--ink-3); font-weight: 600; cursor: pointer; border-radius: 9px;
  }
  .mobile-nav button.active, .mobile-nav a.active { color: var(--green-800); background: var(--green-50); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .menu-btn { display: grid !important; }
  .report-sheet { padding: 22px 18px; }
  .login-lang { top: 16px; right: 16px; }
  .login-panel { padding: 60px 20px 32px; }
  .demo-list { grid-template-columns: 1fr; }
  .demo-item.admin { grid-column: span 1; }
}
@media (max-width: 560px) {
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .is-field .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 8px !important; }
  .is-field .stat { padding: 12px 13px; }
  .is-field .stat-value { font-size: 22px; margin-top: 4px; }
  .is-field .stat-meta { font-size: 10px; }
  .grid.cols-4.keep, .grid.cols-3.keep { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 20px; }
  .toolbar .search { max-width: none; min-width: 100%; }
  .toolbar { gap: 6px; }
  .filters .select { min-width: 0; flex: 1; }
  .table thead th, .table tbody td { padding: 9px 9px; }
  .hide-sm { display: none !important; }
  .modal-layer { padding: 0; align-items: flex-end; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: 94vh; width: 100%; }
  .toasts { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; }
  .kv.cols-3 { grid-template-columns: 1fr 1fr; }
  .photos { grid-template-columns: 1fr 1fr; }
}
@media print {
  .sidebar, .topbar, .mobile-nav, .page-actions, .toolbar, .tabs, .drawer-foot, .report-hide { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .report-sheet { border: 0; box-shadow: none; max-width: none; }
  body { background: #fff; }
  .print-btn { display: inline-flex; }
}

/* ---------------- BI cockpit ---------------- */
.bi-page { animation: fadeUp .35s ease both; }
.bi-topbar { display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.bi-range { display: inline-flex; padding: 3px; gap: 2px; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 10px; }
.bi-range-btn { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.bi-range-btn:hover { color: var(--green-700); background: var(--green-50); }
.bi-range-btn.active { color: #fff; background: var(--green-700); box-shadow: 0 4px 10px -6px rgba(8,61,47,.7); }
.bi-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.bi-metric { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 15px 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.bi-metric::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--green-600); }
.bi-metric.amber::before { background: var(--amber); } .bi-metric.blue::before { background: var(--blue); }
.bi-metric.purple::before { background: var(--purple); }
.bi-metric-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bi-metric-label { font-size: 11px; color: var(--ink-3); font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.bi-metric-value { font-size: 27px; font-weight: 730; letter-spacing: -.04em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.bi-metric-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; min-height: 30px; margin-top: 2px; }
.bi-spark { opacity: .9; }
.bi-delta { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 99px; white-space: nowrap; }
.bi-delta.up { color: var(--green-700); background: var(--green-100); }
.bi-delta.down { color: var(--red-600); background: var(--red-100); }
.bi-delta.flat { color: var(--ink-3); background: var(--slate-100); }
.bi-grid-main { display: grid; grid-template-columns: minmax(0,1.9fr) minmax(0,1fr); gap: 12px; margin-top: 12px; }
.bi-grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.bi-rev { margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.bi-rev-bars { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin-top: 6px; }
.bi-rev-bars i { flex: 1; min-width: 2px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #19916f, #bfe3d0); transition: height .3s ease; }
.bi-rev-bars i:hover { background: var(--amber); }
.bi-funnel { display: flex; flex-direction: column; gap: 11px; }
.bi-funnel-row { display: grid; grid-template-columns: 120px minmax(0,1fr) 42px; align-items: center; gap: 10px; }
.bi-funnel-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--ink-2); }
.bi-funnel-label b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bi-funnel-track { height: 9px; border-radius: 99px; background: var(--sand-2); overflow: hidden; }
.bi-funnel-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-700), var(--green-500)); }
.bi-funnel-row:nth-child(4) .bi-funnel-track i, .bi-funnel-row:nth-child(5) .bi-funnel-track i { background: linear-gradient(90deg, var(--amber-600), var(--amber)); }
.bi-funnel-pct { font-size: 10px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.bi-zone-table td { vertical-align: middle; }
.bi-mini-bar { height: 3px; width: 100%; background: var(--sand-2); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.bi-mini-bar i { display: block; height: 100%; background: var(--green-500); border-radius: inherit; }
.bi-mix { display: flex; flex-direction: column; gap: 11px; }
.bi-mix-row { display: flex; flex-direction: column; gap: 5px; }
.bi-mix-track { height: 7px; border-radius: 99px; background: var(--sand-2); overflow: hidden; }
.bi-mix-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b5d45, #64b99a); }
.bi-actions { display: flex; flex-direction: column; }
.bi-action { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: inherit; }
.bi-action:hover .bi-action-n { transform: scale(1.08); }
.bi-action-n { font-size: 16px; font-weight: 730; min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.bi-action-n.green { color: var(--green-700); } .bi-action-n.amber { color: var(--amber-600); }
.bi-action-n.red { color: var(--red-600); } .bi-action-n.blue { color: var(--blue); }
.bi-footnote { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--ink-3); font-size: 10px; }
@media (max-width: 1180px) {
  .bi-kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .bi-grid-main, .bi-grid-2 { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .bi-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bi-metric-value { font-size: 23px; }
  .bi-funnel-row { grid-template-columns: 96px minmax(0,1fr) 36px; }
  .bi-topbar { justify-content: flex-start; }
}

/* ---------------- UI polish ---------------- */
body {
  background:
    radial-gradient(1200px 620px at 78% -18%, rgba(255,255,255,.72), transparent 62%),
    radial-gradient(900px 520px at 0% 105%, rgba(231,243,236,.55), transparent 60%),
    var(--sand);
}
.page-title { text-wrap: balance; }
.card { transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
a.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.table thead th { position: sticky; top: 0; z-index: 2; }
.btn:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid rgba(14,114,86,.45); outline-offset: 2px; }
::selection { background: #cfe8da; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- field mobile ---------------- */
.task-summary { border-color: #dcd5c7; }
.task-filter-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 99px; padding: 6px 10px; font-size: 10.5px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.task-filter-btn:hover { border-color: var(--green-500); color: var(--green-700); }
.next-stop {
  width: 100%; margin-top: 12px; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #0a4a39, #0e7256); color: #fff;
  box-shadow: 0 12px 24px -18px rgba(6,46,35,.8);
}
.next-stop:hover { filter: brightness(1.04); }
.next-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.14); flex: none; }
.next-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-address { font-size: 10.5px; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-go { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.16); padding: 5px 8px; border-radius: 8px; flex: none; }
.task-card-done { opacity: .82; }
.dealer-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.dealer-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 4px; }
.dealer-stat b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.dealer-stat b.green { color: var(--green-600); } .dealer-stat b.amber { color: var(--amber-600); }
@media (max-width: 720px) {
  .mobile-nav { padding-top: 5px; box-shadow: 0 -12px 30px -26px rgba(8,40,30,.55); }
  .mobile-nav a { padding: 6px 2px 4px; gap: 2px; }
  .mobile-nav a.active { background: transparent; }
  .mobile-nav a.active svg { color: var(--green-700); transform: translateY(-1px); }
  .mobile-nav a.active span { color: var(--green-800); font-weight: 750; }
  .mobile-nav a.active::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--green-600); position: absolute; top: 0; }
  .mobile-nav a { position: relative; }
  .task-card { border-radius: 14px; }
  .task-card .head { padding-bottom: 2px; }
  .task-stop { min-height: 50px; padding: 8px 9px; }
  .task-stop .info b { font-size: 12.5px; }
  .task-stop .info span { font-size: 10.5px; }
  .task-summary { padding: 14px !important; }
  .task-summary .stat-value { font-size: 23px !important; }
  .next-stop { padding: 10px; }
  .dealer-stat b { font-size: 20px; }
  .page-head { margin-bottom: 14px; }
  .page-title { font-size: 24px; }
  .card-head { padding: 14px 14px 0; }
  .card-body { padding: 14px; }
}

/* ---------------- part-time recruitment ---------------- */
.join-wrap { min-height: 100vh; padding: 28px 18px 48px; max-width: 860px; margin: 0 auto; }
.join-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.join-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg,#e8b45a,#c8872c); color: var(--green-900); font-weight: 800; font-size: 22px; }
.join-brand b { display: block; letter-spacing: .08em; font-size: 15px; }
.join-brand span { font-size: 11px; color: var(--ink-3); }
.join-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.join-roles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.join-role { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbf9f4; }
.join-form { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.join-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 14px; color: var(--ink-3); font-size: 10.5px; }
.join-form .btn { margin-top: 12px; }
.chip.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
@media (max-width: 640px) {
  .join-wrap { padding: 18px 12px 32px; }
  .join-card { padding: 18px; border-radius: 16px; }
  .join-roles { grid-template-columns: 1fr; }
}

/* ---------------- config console ---------------- */
.icon-badge { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--green-50, #eef6f1); color: var(--green-700); flex: 0 0 auto; }
.input-affix { position: relative; }
.input-affix .input { padding-right: 34px; }
.input-affix .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); pointer-events: none; }
.input-xs { height: 30px; padding: 0 7px; font-size: 12px; border-radius: 7px; }
.code-block { margin: 6px 0 0; padding: 12px; border-radius: 10px; background: #faf8f2; border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; line-height: 1.55; max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fbfaf6; }

/* ---------------- SOKGO brand assets ---------------- */
.brand-mark, .boot-mark, .join-brand .brand-mark {
  background: #f4ecdc !important;
  color: transparent !important;
  overflow: hidden;
}
.brand-mark { padding: 3px; }
.boot-mark { padding: 7px; }
.join-brand .brand-mark { padding: 3px; }
.brand-mark img, .boot-mark img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.wordmark { letter-spacing: .1em; }

/* ---------------- Mobile role workspace ---------------- */
.mobile-hero {
  background: linear-gradient(135deg, #0b4a38, #0a3b2d 55%, #123b2e);
  color: #fff; border-radius: 18px; padding: 18px; margin-bottom: 14px;
  box-shadow: 0 16px 32px -22px rgba(0,0,0,.55);
}
.mobile-hero-title { font-size: 24px; font-weight: 760; letter-spacing: -.02em; margin-top: 3px; }
.mobile-tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mobile-tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 104px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
}
.mobile-tile:active { transform: scale(.985); }
.mobile-tile-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--green-50); color: var(--green-800); }
.mobile-tile.blue .mobile-tile-icon { background: #e8f1fb; color: #1e6091; }
.mobile-tile.amber .mobile-tile-icon { background: #fbf1dc; color: #a86a13; }
.mobile-tile.purple .mobile-tile-icon { background: #f0e9fb; color: #6f4aa8; }
.mobile-tile.slate .mobile-tile-icon { background: #eef1ef; color: #53685e; }
.mobile-tile-label { font-size: 14px; font-weight: 650; line-height: 1.25; }
.mobile-quick-links { display: flex; flex-wrap: wrap; gap: 6px; }
.mobile-quick-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--ink-2); text-decoration: none; background: #fff; }
@media (max-width: 380px) { .mobile-tile-grid { grid-template-columns: 1fr; } }

.mobile-scan-row { display: flex; gap: 6px; align-items: stretch; }
.mobile-scan-row .input { min-width: 0; flex: 1; }
.mobile-scan-row .btn { flex: none; white-space: nowrap; }
@media (max-width: 560px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 8px !important; }
  .grid.cols-4 .stat { padding: 12px 13px; }
  .grid.cols-4 .stat-value { font-size: 22px; }
  .modal-body video { max-height: 52vh; object-fit: cover; }
}
@media (max-width: 430px) {
  .mobile-scan-row { flex-wrap: wrap; }
  .mobile-scan-row .input { flex: 1 1 100%; }
  .mobile-scan-row .btn { flex: 1; justify-content: center; }
}

/* ================= Mobile role home redesign ================= */
.m-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 18px 18px 20px; color: #fff; box-shadow: 0 22px 40px -28px rgba(2, 36, 26, .75); }
.m-hero::before, .m-hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.m-hero::before { width: 210px; height: 210px; right: -80px; top: -100px; background: rgba(255,255,255,.10); }
.m-hero::after { width: 120px; height: 120px; right: 28px; bottom: -70px; background: rgba(255,255,255,.06); }
.m-theme-agent { background: linear-gradient(145deg, #0f6a50 0%, #0a4d3a 58%, #073427 100%); }
.m-theme-leader { background: linear-gradient(145deg, #0f6274 0%, #0a4554 58%, #062f3a 100%); }
.m-theme-dealer { background: linear-gradient(145deg, #8a5418 0%, #5f380e 58%, #3e2408 100%); }
.m-theme-brand { background: linear-gradient(145deg, #33468f 0%, #232f68 58%, #151d45 100%); }
.m-theme-admin { background: linear-gradient(145deg, #0c4a38 0%, #073326 58%, #041f17 100%); }
.m-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.m-role-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.m-role-dot { width: 6px; height: 6px; border-radius: 50%; background: #ffd27d; box-shadow: 0 0 0 3px rgba(255,210,125,.16); }
.m-hero-date { font-size: 10.5px; opacity: .68; white-space: nowrap; }
.m-hero-greeting { position: relative; z-index: 1; margin-top: 14px; font-size: 24px; line-height: 1.22; font-weight: 780; letter-spacing: -.025em; }
.m-hero-sub { position: relative; z-index: 1; margin-top: 5px; font-size: 11.5px; opacity: .72; }
.m-kpis { position: relative; z-index: 1; margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-kpi { display: flex; flex-direction: column; gap: 3px; padding: 9px 8px; border-radius: 13px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.m-kpi-value { font-size: 21px; font-weight: 780; line-height: 1; letter-spacing: -.02em; }
.m-kpi-label { font-size: 10px; opacity: .72; white-space: nowrap; }
.m-primary { display: flex; align-items: center; gap: 10px; margin: -18px 12px 14px; padding: 12px 14px; border-radius: 17px; background: #fff; color: var(--ink); text-decoration: none; border: 1px solid rgba(20,45,35,.07); box-shadow: 0 18px 28px -22px rgba(2,36,26,.45); position: relative; z-index: 2; }
.m-primary-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--green-50); color: var(--green-800); flex: none; }
.m-primary-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.m-primary-copy b { font-size: 14px; }
.m-primary-copy small { font-size: 10.5px; color: var(--ink-3); }
.m-primary-arrow { width: 28px; height: 28px; border-radius: 50%; background: var(--green-800); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }
.m-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 8px; }
.m-section-head b { font-size: 15px; letter-spacing: -.01em; }
.m-section-head span { font-size: 10.5px; color: var(--ink-3); }
.m-todo-list { display: flex; flex-direction: column; gap: 6px; }
.m-todo { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.m-todo-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.m-todo-copy { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.m-todo-copy b { font-size: 12.5px; }
.m-todo-copy small { font-size: 10px; color: var(--ink-3); }
.m-todo-value { font-size: 17px; font-weight: 780; color: var(--green-800); }
.m-banner { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 13px 14px; border-radius: 16px; background: linear-gradient(120deg, #fff6e5, #fffdf8); border: 1px solid #f0dfc0; color: #5c4114; text-decoration: none; }
.m-banner-icon { width: 38px; height: 38px; border-radius: 12px; background: #f7e3ba; color: #8a5b16; display: grid; place-items: center; flex: none; }
.m-banner-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.m-banner-copy b { font-size: 12.5px; }
.m-banner-copy small { font-size: 10px; color: #8a6b39; }
.m-banner-arrow { font-size: 18px; opacity: .6; }
.m-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-action { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 650; }
.m-action-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.m-tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-tile { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 62px; }
.m-tile-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.m-tile-label { font-size: 12px; font-weight: 650; line-height: 1.25; flex: 1; min-width: 0; }
.m-tile-arrow { font-size: 18px; color: var(--ink-3); opacity: .5; }
.tone-green .m-todo-icon, .tone-green.m-action-icon, .tone-green.m-tile-icon, .tone-green .m-action-icon { background: var(--green-50); color: var(--green-800); }
.tone-blue .m-todo-icon, .tone-blue .m-action-icon, .tone-blue .m-tile-icon { background: #e8f1fb; color: #1e6091; }
.tone-amber .m-todo-icon, .tone-amber .m-action-icon, .tone-amber .m-tile-icon { background: #fbf1dc; color: #a86a13; }
.tone-purple .m-todo-icon, .tone-purple .m-action-icon, .tone-purple .m-tile-icon { background: #f0e9fb; color: #6f4aa8; }
.tone-slate .m-todo-icon, .tone-slate .m-action-icon, .tone-slate .m-tile-icon { background: #eef1ef; color: #53685e; }
@media (max-width: 380px) {
  .m-hero-greeting { font-size: 21px; }
  .m-hero { padding: 16px 15px 18px; }
  .m-kpi-value { font-size: 19px; }
}
.m-page-kicker { display: flex; align-items: center; gap: 7px; margin: 2px 2px 9px; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase; }
.m-kicker-line { width: 18px; height: 2px; border-radius: 2px; background: var(--green-800); opacity: .55; }

/* ================= External partner portal ================= */
.ext-wrap { min-height: 100vh; background: radial-gradient(1200px 600px at 80% -10%, #dfeee4 0%, transparent 60%), #f7f4ec; color: var(--ink); padding: 0 0 40px; }
.ext-hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #0a4b39 0%, #073528 55%, #06261d 100%); color: #fff; padding: 28px clamp(20px, 6vw, 84px) 46px; border-radius: 0 0 36px 36px; }
.ext-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 42px; }
.ext-brand img { width: 38px; height: 38px; border-radius: 12px; background: #fff; object-fit: contain; padding: 3px; }
.ext-brand b { display: block; font-size: 18px; letter-spacing: .01em; }
.ext-brand span { display: block; font-size: 10px; opacity: .62; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.ext-eyebrow { font-size: 10px; letter-spacing: .24em; color: #e8c987; font-weight: 700; margin-bottom: 10px; }
.ext-hero h1 { font-size: clamp(28px, 4.6vw, 48px); line-height: 1.15; letter-spacing: -.035em; max-width: 720px; margin: 0; }
.ext-hero p { max-width: 620px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.7; margin: 12px 0 0; }
.ext-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 22px; position: relative; z-index: 2; }
.ext-hero-actions .btn-primary { background: #f5c96b; color: #33240c; border-color: transparent; }
.ext-internal-link { color: rgba(255,255,255,.72); font-size: 11px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.24); padding-bottom: 2px; }
.ext-orbit { position: absolute; right: 7%; top: 17%; width: 210px; height: 150px; opacity: .5; pointer-events: none; }
.ext-orbit span { position: absolute; border: 1px solid rgba(245,201,107,.35); border-radius: 50%; }
.ext-orbit span:nth-child(1) { inset: 0 30px 20px 0; }
.ext-orbit span:nth-child(2) { inset: 28px 0 0 50px; }
.ext-orbit span:nth-child(3) { width: 62px; height: 62px; right: 58px; top: 40px; background: radial-gradient(circle at 35% 30%, #f5c96b, #b47a2b); border: 0; box-shadow: 0 0 40px rgba(245,201,107,.3); }
.ext-section { max-width: 1120px; margin: 0 auto; padding: 30px clamp(20px, 5vw, 54px) 0; }
.ext-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ext-section-head h2 { font-size: 19px; letter-spacing: -.02em; margin: 0; }
.ext-section-head span { font-size: 11px; color: var(--ink-3); }
.ext-status { max-width: 1120px; margin: -24px auto 0; position: relative; z-index: 3; display: flex; align-items: center; gap: 13px; padding: 14px 18px; background: #fff; border: 1px solid #d9eadf; border-radius: 18px; box-shadow: 0 18px 34px -26px rgba(3,45,32,.45); }
.ext-status-icon { width: 42px; height: 42px; border-radius: 13px; background: var(--green-50); color: var(--green-800); display: grid; place-items: center; flex: none; }
.ext-status b { font-size: 13px; }
.ext-status p { font-size: 11px; color: var(--ink-3); margin: 3px 0 0; line-height: 1.5; }
.ext-role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ext-role { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-height: 180px; display: flex; flex-direction: column; }
.ext-role-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--green-50); color: var(--green-800); }
.ext-role.tone-blue .ext-role-icon { background: #e8f1fb; color: #1e6091; }
.ext-role.tone-amber .ext-role-icon { background: #fbf1dc; color: #a86a13; }
.ext-role.tone-purple .ext-role-icon { background: #f0e9fb; color: #6f4aa8; }
.ext-role h3 { font-size: 14px; margin: 13px 0 4px; }
.ext-role p { font-size: 11px; color: var(--ink-3); line-height: 1.55; margin: 0 0 12px; flex: 1; }
.ext-role-link { border: 0; background: none; color: var(--green-800); font-size: 11px; font-weight: 700; padding: 0; text-align: left; cursor: pointer; }
.ext-process { padding-bottom: 10px; }
.ext-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ext-step { background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 15px; padding: 13px 14px; display: flex; flex-direction: column; gap: 3px; }
.ext-step b { font-size: 10px; color: #b18432; letter-spacing: .1em; }
.ext-step strong { font-size: 12px; }
.ext-step span { font-size: 10px; color: var(--ink-3); line-height: 1.5; }
.ext-footer { max-width: 1120px; margin: 30px auto 0; padding: 16px clamp(20px, 5vw, 54px); border-top: 1px solid rgba(20,45,35,.1); display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-3); letter-spacing: .08em; }
.ext-footer a { color: var(--green-800); text-decoration: none; }
@media (max-width: 820px) {
  .ext-hero { padding: 22px 20px 38px; border-radius: 0 0 28px 28px; }
  .ext-brand { margin-bottom: 30px; }
  .ext-orbit { opacity: .24; right: -50px; top: 10%; }
  .ext-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ext-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ext-section { padding-left: 16px; padding-right: 16px; }
  .ext-status { margin: -18px 16px 0; align-items: flex-start; flex-wrap: wrap; }
  .ext-status .btn { margin-left: 55px; }
}
@media (max-width: 420px) {
  .ext-role-grid { grid-template-columns: 1fr; }
  .ext-role { min-height: 0; }
}

/* ================= Recruitment poster / WhatsApp ================= */
.ext-recruit-banner { max-width: 1120px; margin: -18px auto 0; position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #fff; border: 1px solid #ecd9b0; border-radius: 18px; box-shadow: 0 18px 34px -28px rgba(3,45,32,.45); text-decoration: none; color: var(--ink); }
.ext-recruit-icon { width: 42px; height: 42px; border-radius: 13px; background: #fbf0d8; color: #9a6718; display: grid; place-items: center; flex: none; }
.ext-recruit-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ext-recruit-copy b { font-size: 13px; }
.ext-recruit-copy small { font-size: 10.5px; color: var(--ink-3); }
.ext-recruit-arrow { font-size: 11px; font-weight: 700; color: #8a5b16; white-space: nowrap; }
.recruit-poster-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin: 16px 0; }
.recruit-poster-copy b { font-size: 14px; }
.recruit-poster-copy p { margin: 3px 0 10px; font-size: 11px; color: var(--ink-3); }
.recruit-poster-img { display: block; width: 100%; max-width: 380px; margin: 0 auto; border-radius: 12px; box-shadow: 0 16px 28px -24px rgba(3,45,32,.55); }
.recruit-modal-img { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; }
.recruit-modal .skeleton { width: 100%; }
@media (max-width: 820px) {
  .ext-recruit-banner { margin: -18px 16px 0; }
  .ext-recruit-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.pool-poster-img { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; }
.pool-poster-modal .skeleton { width: 100%; }

/* ================= Help center ================= */
.help-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.help-toolbar .input { max-width: 360px; }
.help-role-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.help-role-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 650; cursor: pointer; }
.help-role-tab.active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.help-hero { display: flex; align-items: center; gap: 13px; padding: 18px 20px; border-radius: 20px; color: #fff; margin-bottom: 14px; background: linear-gradient(135deg, #0f5c46, #083b2d); }
.help-theme-group_leader { background: linear-gradient(135deg, #0f6072, #083b48); }
.help-theme-dealer { background: linear-gradient(135deg, #7c4a15, #4d2b09); }
.help-theme-brand { background: linear-gradient(135deg, #33478f, #1e2b61); }
.help-theme-admin { background: linear-gradient(135deg, #0b4433, #05271d); }
.help-hero-icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: none; }
.help-hero b { font-size: 17px; }
.help-hero p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.6; color: rgba(255,255,255,.72); }
.help-hero .pill { background: rgba(255,255,255,.14); color: #fff; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.help-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; }
.help-card-head { display: flex; gap: 10px; align-items: flex-start; }
.help-card-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--green-50); color: var(--green-800); display: grid; place-items: center; flex: none; }
.help-card h3 { font-size: 14px; margin: 0; letter-spacing: -.01em; }
.help-card p { font-size: 11px; color: var(--ink-3); line-height: 1.55; margin: 3px 0 0; }
.help-step-count { font-size: 10px; color: var(--ink-3); white-space: nowrap; background: #f3f6f3; padding: 4px 7px; border-radius: 999px; }
.help-steps { margin: 12px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.help-steps li { font-size: 11.5px; line-height: 1.6; color: var(--ink-2); padding-left: 2px; }
.help-steps li::marker { color: var(--green-700); font-weight: 700; font-size: 10px; }
.help-use { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--green-800); text-decoration: none; font-size: 11px; font-weight: 700; }
@media (max-width: 760px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-hero { align-items: flex-start; flex-wrap: wrap; }
  .help-toolbar .input { max-width: none; width: 100%; }
  .help-role-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .help-role-tab { flex: none; }
}

/* Portal application / my onboarding */
.ext-brand-link { display: inline-flex; text-decoration: none; }
.ext-brand-link img { width: 38px; height: 38px; border-radius: 12px; background: #fff; object-fit: contain; padding: 3px; }
.my-panel { max-width: 760px; margin: -22px auto 0; position: relative; z-index: 3; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 18px 34px -28px rgba(3,45,32,.45); }
.my-panel-head { display: flex; align-items: center; gap: 11px; }
.my-role-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--green-50); color: var(--green-800); display: grid; place-items: center; flex: none; }
.my-panel-head b { font-size: 16px; }
.my-steps { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; padding-bottom: 2px; }
.my-step { flex: 1; min-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 9px; color: var(--ink-3); text-align: center; }
.my-step-dot { width: 22px; height: 22px; border-radius: 50%; background: #eef1ef; display: grid; place-items: center; font-size: 9px; color: var(--ink-3); }
.my-step.done .my-step-dot { background: var(--green-800); color: #fff; }
.my-step.done { color: var(--green-800); font-weight: 650; }
.my-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.my-panel .notice { margin-top: 12px; }
@media (max-width: 560px) { .my-panel { margin: -18px 16px 0; } .my-step { min-width: 52px; font-size: 8px; } }

/* ================= Referral / vouchers ================= */
.referral-hero { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; background: linear-gradient(135deg, #0f5c46, #073b2c); color: #fff; border-radius: 20px; padding: 18px 20px; margin-bottom: 14px; }
.referral-hero h2 { font-size: 26px; letter-spacing: .02em; margin: 4px 0 6px; }
.referral-hero p { font-size: 11px; line-height: 1.6; color: rgba(255,255,255,.7); margin: 0 0 12px; }
.referral-reward { min-width: 210px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.referral-reward > small { font-size: 10px; opacity: .65; }
.referral-reward > b { font-size: 24px; color: #f3c86e; }
.referral-reward > span { font-size: 12px; }
.voucher-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.voucher-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.voucher-top { display: flex; justify-content: space-between; align-items: center; }
.voucher-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--green-50); color: var(--green-800); display: grid; place-items: center; }
.voucher-card h3 { font-size: 14px; margin: 9px 0 4px; }
.voucher-code { font-size: 16px; letter-spacing: .06em; color: var(--green-800); margin: 4px 0 7px; }
.voucher-card .small { line-height: 1.7; }
@media (max-width: 600px) { .voucher-grid { grid-template-columns: 1fr; } .referral-hero { padding: 16px; } }
.recruit-poster-link { display: block; text-decoration: none; }
.recruit-poster-link .recruit-poster-img, .recruit-poster-link img { width: 100%; }
.recruit-enter-btn { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 10px; padding: 11px 14px; border-radius: 12px; background: var(--green-800); color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; }
.recruit-enter-btn:active { transform: scale(.99); }
.recruit-poster-url { margin-top: 7px; text-align: center; font-size: 9px; color: var(--ink-3); word-break: break-all; }
.recruit-poster-url a { color: var(--green-700); text-decoration: none; }

/* Poster modal responsive guard */
.recruit-modal { width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
.recruit-poster-link { display: block; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
.recruit-modal-img { width: 100%; max-width: 100%; height: auto; max-height: 68vh; object-fit: contain; }
@media (max-width: 820px) {
  .modal-card.sm { width: calc(100vw - 12px); max-width: calc(100vw - 12px); }
  .modal-card .modal-body { padding-left: 10px; padding-right: 10px; min-width: 0; }
  .recruit-modal-img { max-height: 64vh; }
  .recruit-enter-btn { font-size: 14px; padding: 13px 14px; }
}

/* Referral closed-loop visual */
.referral-flow-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 4px; }
.referral-flow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.referral-flow-head b { font-size: 14px; }
.referral-flow-head p { font-size: 10px; color: var(--ink-3); margin-top: 3px; }
.referral-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.referral-flow-step { position: relative; background: #f7faf7; border: 1px solid #e4eee7; border-radius: 12px; padding: 11px 26px 11px 11px; min-height: 67px; display: flex; flex-direction: column; gap: 6px; }
.referral-flow-num { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--green-700); letter-spacing: .08em; }
.referral-flow-step b { font-size: 11px; line-height: 1.45; font-weight: 650; }
.referral-flow-arrow { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--green-500); font-style: normal; font-size: 12px; }
.referral-flow-step:last-child .referral-flow-arrow { display: none; }
@media (max-width: 700px) { .referral-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .referral-flow-step { min-height: 62px; } }
.referral-flow-arrow { font-size: 14px !important; color: var(--green-600) !important; }
.referral-flow-arrow { display: flex; align-items: center; justify-content: center; }
