/* =========================================================
   膜玩堂 · 门店内控系统（多人版）
   Aurora teal / deep sea / ice visual system
   ========================================================= */
:root {
  --bg: #eef4f7;
  --bg-deep: #e4eef3;
  --surface: #ffffff;
  --surface-2: #f6fafc;
  --surface-3: #edf5f8;
  --ink: #0d1c2b;
  --ink-2: #3b4d60;
  --muted: #6d7f90;
  --muted-2: #97a8b7;
  --line: #dce7ed;
  --line-strong: #c8d8e2;
  --brand: #0ea7a0;
  --brand-deep: #087f7a;
  --brand-soft: #e2f8f5;
  --gold: #4f7cff;
  --gold-soft: #eaf0ff;
  --dark: #071923;
  --dark-2: #0b2634;
  --dark-3: #123544;
  --green: #0f8f70;
  --green-soft: #e6f7f1;
  --red: #e05a4f;
  --red-soft: #fdeeed;
  --blue: #3b6fe0;
  --blue-soft: #ecf2ff;
  --violet: #7a5af8;
  --violet-soft: #f1edff;
  --coral: #ff6b57;
  --cyan: #45e0d0;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow-card: 0 1px 2px rgba(10, 30, 45, .035), 0 20px 46px -38px rgba(10, 30, 45, .45);
  --shadow-pop: 0 30px 80px -30px rgba(6, 25, 37, .36), 0 2px 8px rgba(6, 25, 37, .06);
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 86% -12%, #d9f3f1 0%, rgba(217, 243, 241, 0) 62%),
    radial-gradient(900px 620px at -8% 100%, #e6edff 0%, rgba(230, 237, 255, 0) 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #f3d8b4; color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- shared bits ---------- */
.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:hover { border-color: #c9bfae; background: #fffdf8; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { --btn-bg: var(--ink); --btn-fg: #fffaf0; --btn-bd: var(--ink); }
.btn.primary:hover { --btn-bg: #000; --btn-bd: #000; }
.btn.accent { --btn-bg: var(--brand); --btn-fg: #211407; --btn-bd: var(--brand); }
.btn.accent:hover { --btn-bg: #f59a43; }
.btn.ghost { --btn-bg: transparent; --btn-bd: var(--line-strong); }
.btn.ghost:hover { background: rgba(255, 255, 255, .6); }
.btn.danger { --btn-fg: var(--red); --btn-bd: #e8cfc6; --btn-bg: #fffaf7; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--brand-deep);
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); position: relative; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: #fff; border-color: var(--line-strong); }
.icon-btn .dot-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--brand); color: #241506; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px 0;
}
.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 18px 22px 22px; }
.empty {
  padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px;
}
.empty .empty-ico {
  width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px;
  color: var(--muted-2);
}
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; font-size: 13.5px; }

/* stage pills */
.stage-pill {
  --c: #6b6356; --bg: #f2eee5;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 700; color: var(--c); background: var(--bg);
  white-space: nowrap; letter-spacing: .01em;
}
.stage-pill::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85;
}
.tag {
  display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--muted); font-size: 10.5px; font-weight: 650;
  white-space: nowrap;
}
.level-badge {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  background: var(--gold-soft); color: #8a6424; border: 1px solid #eadbbf;
}
.level-badge.b { background: var(--blue-soft); color: var(--blue); border-color: #d8e4ee; }
.level-badge.c { background: #f1eee7; color: #7a7265; border-color: #e5dfd2; }

/* avatars */
.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  background: #f1e9d9; color: #8b6427; border: 1px solid #e8dcc4;
}
.avatar.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 19px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar.tech { background: #eaf0ee; color: #366454; border-color: #d9e6e0; }
.avatar.sales { background: #fbeee1; color: #a4601c; border-color: #f0dcc5; }

/* =========================================================
   LOGIN
   ========================================================= */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.04fr .96fr;
  background: var(--bg);
}
.login-left {
  position: relative; overflow: hidden; background:
    radial-gradient(120% 90% at 12% 8%, rgba(199, 160, 90, .18), transparent 55%),
    radial-gradient(80% 70% at 95% 88%, rgba(239, 138, 43, .14), transparent 60%),
    linear-gradient(155deg, #1d1a15 0%, #141210 58%, #100f0c 100%);
  color: #f5efe3; padding: 44px 54px 34px; display: flex; flex-direction: column;
}
.login-left::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(80% 80% at 70% 30%, #000, transparent 75%);
}
.login-left::after {
  content: ""; position: absolute; right: -140px; bottom: -180px; width: 460px; height: 460px;
  border-radius: 50%; border: 1px solid rgba(199, 160, 90, .18);
  box-shadow: 0 0 0 60px rgba(199, 160, 90, .035), 0 0 0 130px rgba(199, 160, 90, .025);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 21px; }
.login-brand b { font-size: 21px; letter-spacing: .06em; display: block; }
.login-brand span { font-size: 10px; letter-spacing: .28em; color: #a89d8b; text-transform: uppercase; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-family: "Songti SC", "STSong", serif;
  font-weight: 800; font-size: 20px; color: #241a0c;
  background: linear-gradient(145deg, #efd39a 0%, #c7a05a 52%, #a97d34 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 20px -8px rgba(199, 160, 90, .65);
}
.login-copy { margin: auto 0; padding: 48px 0 36px; position: relative; z-index: 1; max-width: 520px; }
.login-copy .eyebrow { color: #a5906d; margin-bottom: 18px; }
.login-copy h1 {
  font-size: clamp(34px, 3.35vw, 50px); line-height: 1.2; letter-spacing: -.035em;
  font-weight: 700; color: #fbf7ee;
}
.login-copy h1 em { font-style: normal; color: var(--gold); }
.login-copy > p:last-of-type {
  margin-top: 20px; color: #a9a094; font-size: 14px; line-height: 1.85; max-width: 430px;
}
.feature-list { margin-top: 30px; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 11px; align-items: center; color: #cabfae; font-size: 13px; }
.feature-list .fi {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(199, 160, 90, .4);
  color: var(--gold); display: grid; place-items: center; background: rgba(199, 160, 90, .07);
}
.feature-list svg { width: 11px; height: 11px; }
.login-stats {
  display: flex; gap: 36px; border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 22px; position: relative; z-index: 1;
}
.login-stats b { display: block; font-size: 22px; font-weight: 650; color: #f2e7d4; letter-spacing: -.02em; }
.login-stats span { font-size: 10.5px; color: #8f8576; letter-spacing: .06em; }
.login-foot { margin-top: 22px; font-size: 10.5px; color: #6f675b; letter-spacing: .04em; }
.login-right {
  display: flex; align-items: center; justify-content: center; padding: 40px;
  background:
    radial-gradient(70% 55% at 85% 0%, rgba(199, 160, 90, .1), transparent 70%),
    var(--bg);
}
.login-card { width: 100%; max-width: 548px; }
.login-card > .eyebrow { color: var(--brand-deep); margin-bottom: 10px; }
.login-card h2 { font-size: 29px; letter-spacing: -.025em; font-weight: 700; }
.login-sub { color: var(--muted); font-size: 13px; margin-top: 8px; margin-bottom: 24px; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line);
  background: rgba(255, 254, 250, .7); transition: border-color .15s, background .15s, transform .15s;
  position: relative;
}
.role-card:hover { border-color: #cdbfa7; background: var(--surface); }
.role-card.selected { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--ink) inset; }
.role-card .role-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-family: "Songti SC", serif; font-weight: 700; font-size: 16px; flex: 0 0 auto;
  color: var(--rc, #8a6424); background: var(--rbg, #f6edda);
}
.role-card b { display: block; font-size: 13.5px; letter-spacing: -.01em; }
.role-card em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.role-card .radio {
  margin-left: auto; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #cec3b1;
  flex: 0 0 auto; position: relative;
}
.role-card.selected .radio { border-color: var(--ink); background: var(--ink); }
.role-card.selected .radio::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff9ed;
}
.role-card.manager { grid-column: span 2; }
.role-card.manager .role-ico { color: #6d4d18; background: linear-gradient(145deg, #f2dfb6, #e8cb90); }
.pin-form { margin-top: 22px; }
.pin-form label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin-bottom: 7px; }
.pin-row { display: flex; gap: 9px; }
.pin-row .input { flex: 1; height: 44px; letter-spacing: .4em; font-family: var(--mono); }
.pin-row .btn { height: 44px; padding: 0 22px; }
.pin-form .btn[disabled] { background: #b3aa9a; border-color: #b3aa9a; }
.form-error {
  background: var(--red-soft); color: var(--red); border: 1px solid #f0d3c8;
  border-radius: 8px; padding: 8px 11px; font-size: 12px; margin-top: 10px;
}
.login-hint { margin-top: 14px; font-size: 11.5px; color: var(--muted); }
.login-hint b { color: var(--brand-deep); font-family: var(--mono); letter-spacing: .06em; }
.login-mobile-brand { display: none; }

/* =========================================================
   APP SHELL
   ========================================================= */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 40;
  background:
    radial-gradient(90% 55% at 0% 0%, rgba(199, 160, 90, .1), transparent 60%),
    linear-gradient(180deg, #1a1712 0%, #131210 100%);
  color: #ebe4d7; display: flex; flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 26px; }
.brand-text b { display: block; font-size: 19px; letter-spacing: .07em; color: #f8f1e3; line-height: 1.3; }
.brand-text span { display: block; font-size: 9.5px; letter-spacing: .24em; color: #8e8372; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 9.5px; letter-spacing: .18em; color: #746b5d; text-transform: uppercase;
  padding: 8px 10px 7px;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 43px; padding: 0 11px; border: 0; border-radius: 10px;
  background: transparent; color: #a79d8d; font-size: 13.5px; font-weight: 550;
  text-align: left; width: 100%; transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .045); color: #eee6d8; }
.nav-item.active { background: #2a251d; color: #fff8eb; }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav-item.active svg { color: #e6c88f; opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--brand); color: #241506; font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}
.nav-item .nav-text { white-space: nowrap; }
.sidebar-foot { margin-top: auto; }
.me-card {
  display: flex; align-items: center; gap: 10px; padding: 11px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 12px;
}
.me-avatar {
  width: 34px; height: 34px; border-radius: 10px; background: #332c21; color: #e5c185;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 auto;
  font-family: "Songti SC", serif;
}
.me-card b { display: block; font-size: 12.5px; color: #f1e9dc; font-weight: 600; }
.me-card span { display: block; font-size: 10px; color: #8f8474; margin-top: 1px; }
.me-card .logout-btn {
  margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: #8e8372; display: grid; place-items: center;
}
.me-card .logout-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sys-line { font-size: 9.5px; color: #5f574c; text-align: center; padding: 13px 0 0; letter-spacing: .04em; }

.main { margin-left: 236px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 74px;
  display: flex; align-items: center; gap: 20px;
  padding: 0 36px;
  background: rgba(244, 241, 233, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 218, 203, .8);
}
.topbar-title { min-width: 0; }
.topbar-title .crumb { font-size: 10px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.topbar-title h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px; width: 288px; height: 38px;
  border: 1px solid var(--line); background: rgba(255, 254, 250, .8); border-radius: 10px;
  padding: 0 11px; color: var(--muted); transition: border-color .15s, background .15s, box-shadow .15s;
}
.search:focus-within { border-color: #b9ab94; background: #fff; box-shadow: 0 0 0 3px rgba(199, 160, 90, .12); }
.search svg { width: 15px; height: 15px; flex: 0 0 auto; }
.search input {
  border: 0; background: transparent; outline: none; width: 100%; font-size: 12.5px;
  min-width: 0;
}
.search input::placeholder { color: #a79d8d; }
.search kbd {
  font-family: var(--mono); font-size: 9px; color: #9b9181; border: 1px solid var(--line);
  background: var(--surface-2); border-radius: 4px; padding: 2px 5px; white-space: nowrap;
}
.date-chip { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
.role-chip {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 254, 250, .75);
  font-size: 11.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap;
}
.role-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.mobile-logout { display: none; }

.page { padding: 26px 36px 64px; max-width: 1380px; margin: 0 auto; animation: pageIn .35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h1 { font-size: 29px; letter-spacing: -.035em; font-weight: 700; line-height: 1.2; }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.head-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.section-stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- dashboard hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #f7f1e6;
  background:
    radial-gradient(90% 160% at 100% 0%, rgba(239, 138, 43, .19), transparent 55%),
    radial-gradient(70% 120% at 10% 120%, rgba(199, 160, 90, .12), transparent 60%),
    linear-gradient(120deg, #1d1a15 0%, #161410 70%);
  display: flex; align-items: stretch; justify-content: space-between; gap: 26px;
  padding: 28px 32px; margin-bottom: 18px;
  box-shadow: 0 20px 50px -38px rgba(21, 18, 13, .8);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .11) .7px, transparent .7px);
  background-size: 17px 17px; opacity: .24;
  mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.hero-main { position: relative; z-index: 1; max-width: 580px; }
.hero .eyebrow { color: #a5906d; margin-bottom: 11px; }
.hero h1 { font-size: 28px; letter-spacing: -.03em; font-weight: 650; color: #fffaf0; }
.hero h1 .wave { color: var(--gold); }
.hero-sub { color: #aca294; font-size: 12.8px; margin-top: 8px; line-height: 1.7; }
.hero-sub b { color: #f2d9b1; font-weight: 700; }
.hero-btns { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }
.hero .btn.light { background: #fff9ee; border-color: #fff9ee; color: #1c1812; }
.hero .btn.light:hover { background: #fff; }
.hero .btn.hollow { background: rgba(255, 255, 255, .055); border-color: rgba(255, 255, 255, .16); color: #e8dfd0; }
.hero .btn.hollow:hover { background: rgba(255, 255, 255, .1); }
.hero-metrics {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 0;
  border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 24px; flex: 0 0 auto;
}
.hero-metric { padding: 0 22px; text-align: left; min-width: 96px; }
.hero-metric + .hero-metric { border-left: 1px solid rgba(255, 255, 255, .08); }
.hero-metric span { display: block; font-size: 10px; color: #93897a; letter-spacing: .08em; }
.hero-metric b { display: block; font-size: 30px; line-height: 1.25; font-weight: 600; color: #f2ddba; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-metric em { font-style: normal; font-size: 10.5px; color: #8f8577; margin-left: 4px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: 16px 17px 15px; box-shadow: var(--shadow-card); min-width: 0;
}
.kpi-top { display: flex; align-items: center; gap: 9px; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-deep); flex: 0 0 auto;
}
.kpi-ico svg { width: 15px; height: 15px; }
.kpi-ico.tone-blue { background: var(--blue-soft); color: var(--blue); }
.kpi-ico.tone-green { background: var(--green-soft); color: var(--green); }
.kpi-ico.tone-violet { background: var(--violet-soft); color: var(--violet); }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-val { font-size: 26px; font-weight: 650; letter-spacing: -.035em; margin-top: 11px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-val small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.kpi-sub { font-size: 10.5px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub b { color: var(--ink-2); font-weight: 650; }

/* ---------- layouts ---------- */
.grid-2 { display: grid; grid-template-columns: 1.14fr .86fr; gap: 16px; align-items: start; }
.grid-2.alt { grid-template-columns: .86fr 1.14fr; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- tasks ---------- */
.task-list { padding: 6px 22px 8px; }
.task {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.task:last-child { border-bottom: 0; }
.check {
  width: 18px; height: 18px; margin-top: 2px; border-radius: 6px;
  border: 1.5px solid #cfc4b2; background: transparent; flex: 0 0 auto;
  display: grid; place-items: center; color: transparent; transition: all .15s;
}
.check:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.check svg { width: 11px; height: 11px; stroke-width: 3; }
.task-body { min-width: 0; flex: 1; }
.task-title { font-size: 12.8px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.task-title .mini-tag {
  display: inline-block; margin-left: 6px; font-size: 9.5px; font-weight: 700;
  color: var(--brand-deep); background: var(--brand-soft); padding: 1px 5px; border-radius: 4px;
  vertical-align: 1px; white-space: nowrap;
}
.task-desc {
  font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 10px; color: var(--muted-2); }
.task-meta .alert-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.task .link-btn { align-self: center; font-size: 11.5px; }

/* ---------- schedule timeline ---------- */
.schedule-list { padding: 14px 22px 18px; display: flex; flex-direction: column; gap: 0; }
.sch-item {
  display: grid; grid-template-columns: 45px 12px 1fr; gap: 10px;
  padding: 9px 0; position: relative;
}
.sch-item:not(:last-child)::before {
  content: ""; position: absolute; left: 55px; top: 30px; bottom: -2px; width: 1px; background: var(--line);
}
.sch-time { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding-top: 5px; font-weight: 600; letter-spacing: -.02em; }
.sch-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 9px;
  box-shadow: 0 0 0 4px var(--brand-soft); z-index: 1;
}
.sch-dot.done { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.sch-card { min-width: 0; padding-bottom: 4px; }
.sch-card b { font-size: 12.5px; font-weight: 650; }
.sch-card p { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-card .sch-tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }

/* ---------- feed ---------- */
.feed { padding: 6px 22px 14px; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 6px; height: 6px; border-radius: 50%; background: #d4c6ad; margin-top: 7px; flex: 0 0 auto; }
.feed-dot.hot { background: var(--brand); }
.feed-main { min-width: 0; }
.feed-main p { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.feed-main p b { font-weight: 650; color: var(--ink); }
.feed-meta { font-size: 10px; color: var(--muted-2); margin-top: 2px; }

/* ---------- funnel ---------- */
.funnel { padding: 14px 22px 18px; display: flex; flex-direction: column; gap: 3px; }
.funnel-row {
  display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 10px;
  padding: 6px 4px; border: 0; background: transparent; border-radius: 7px; text-align: left;
}
.funnel-row:hover { background: var(--surface-2); }
.f-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.f-bar { height: 7px; border-radius: 99px; background: #f1ece1; overflow: hidden; }
.f-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); transition: width .4s ease; }
.f-count { text-align: right; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* =========================================================
   CUSTOMER LIST
   ========================================================= */
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-2); font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; transition: all .15s;
}
.chip:hover { border-color: #bfb29c; background: rgba(255, 254, 250, .7); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff9ee; }
.chip .n { font-size: 9.5px; opacity: .6; font-variant-numeric: tabular-nums; }
.chip.active .n { opacity: .7; }
.tools-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select {
  height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  padding: 0 30px 0 11px; font-size: 12px; color: var(--ink-2); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23867d6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer; outline: none;
}
.select:focus { border-color: #b9ab94; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { appearance: none; width: 30px; height: 17px; border-radius: 99px; background: #e0d7c7; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after {
  content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(13px); }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.data-table th {
  text-align: left; padding: 11px 18px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700;
  letter-spacing: .09em; color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr[data-act] { cursor: pointer; }
.data-table tbody tr:hover { background: #fbf8f1; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cust-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.cust-cell .cell-main { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.cust-cell .cell-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.contact-cell { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.contact-cell span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.intent-cell { max-width: 170px; }
.intent-cell span { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intent-cell em { display: block; font-style: normal; color: var(--muted); font-size: 10px; margin-top: 2px; }
.amount-cell { white-space: nowrap; }
.amount-cell .money { font-size: 12.5px; }
.amount-cell span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.owner-cell { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 11.5px; color: var(--ink-2); }
.owner-cell .avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.time-cell { font-size: 11px; color: var(--muted); white-space: nowrap; }
.time-cell.overdue { color: var(--red); font-weight: 650; }
.time-cell.today { color: var(--brand-deep); font-weight: 650; }
.row-chev { color: #c3b7a3; display: flex; justify-content: flex-end; }

/* =========================================================
   PIPELINE
   ========================================================= */
.board-wrap { margin-top: 4px; }
.board {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px;
  align-items: flex-start; scrollbar-width: thin;
}
.board-col {
  flex: 0 0 238px; width: 238px; background: rgba(255, 254, 250, .44);
  border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column;
  max-height: calc(100vh - 238px);
}
.board-head { padding: 13px 14px 10px; border-bottom: 1px solid var(--line-2); }
.board-head .bh-top { display: flex; align-items: center; gap: 7px; }
.board-head .dot { width: 7px; height: 7px; border-radius: 50%; }
.board-head b { font-size: 12px; font-weight: 700; }
.board-head .count {
  margin-left: auto; font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); height: 19px; min-width: 19px;
  border-radius: 99px; display: grid; place-items: center; padding: 0 5px;
}
.board-head .bh-sum { font-size: 10px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.board-body { padding: 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 70px; }
.deal-card {
  display: block; width: 100%; text-align: left; padding: 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.deal-card:hover { border-color: #cbbea8; transform: translateY(-1px); box-shadow: 0 8px 20px -16px rgba(40, 32, 18, .4); }
.dc-top { display: flex; align-items: center; gap: 8px; }
.dc-top .dc-name { min-width: 0; flex: 1; }
.dc-top b { display: block; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-top span { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.dc-item {
  font-size: 10.5px; color: var(--ink-2); margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 9.5px; color: var(--muted); }
.dc-meta .dc-time { display: flex; align-items: center; gap: 3px; }
.dc-meta svg { width: 10px; height: 10px; }
.dc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.dc-foot .money { font-size: 12px; }
.dc-foot em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.approval-flag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px;
  background: var(--red-soft); color: var(--red); font-size: 9px; font-weight: 700; white-space: nowrap;
}
.board-empty { font-size: 10.5px; color: var(--muted-2); text-align: center; padding: 20px 4px; }
.lost-strip { margin-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lost-strip .lost-label { font-size: 10px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.lost-chip {
  border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 5px 10px;
  font-size: 10.5px; color: var(--muted);
}
.lost-chip:hover { background: var(--surface); color: var(--ink-2); }

/* =========================================================
   FOLLOW UPS
   ========================================================= */
.follow-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; align-items: start; }
.follow-group + .follow-group { margin-top: 6px; }
.follow-date {
  display: flex; align-items: center; gap: 8px; padding: 12px 20px 8px;
  font-size: 10px; letter-spacing: .1em; color: var(--muted); font-weight: 700; text-transform: uppercase;
}
.follow-date .line { flex: 1; height: 1px; background: var(--line); }
.follow-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-top: 1px solid var(--line-2); cursor: pointer;
}
.follow-item:hover { background: #fbf8f1; }
.follow-item .fi-main { min-width: 0; flex: 1; }
.follow-item .fi-main b { font-size: 12.5px; font-weight: 650; }
.follow-item .fi-main p { font-size: 10.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-item .fi-date { font-size: 10.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.follow-item .fi-date.overdue { color: var(--red); font-weight: 650; }
.follow-item .fi-date.today { color: var(--brand-deep); font-weight: 650; }
.follow-item .btn { flex: 0 0 auto; }
.follow-tip { padding: 16px 20px; font-size: 11px; color: var(--muted); line-height: 1.7; }

/* =========================================================
   FINANCE
   ========================================================= */
.fin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.fin-block { padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.fin-block span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.fin-block b { display: block; font-size: 22px; margin-top: 5px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fin-block.balance b { color: var(--brand-deep); }
.pay-list { padding: 0 22px 12px; }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.pay-row:last-child { border-bottom: 0; }
.pay-row .pr-main { flex: 1; min-width: 0; }
.pay-row .pr-main b { font-size: 12px; font-weight: 650; }
.pay-row .pr-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.pay-row .pr-amount { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--green); }
.pay-row .pr-date { font-size: 10px; color: var(--muted); white-space: nowrap; width: 80px; text-align: right; }

/* =========================================================
   NOTIFICATIONS
   ========================================================= */
.notice-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.notice-tab {
  border: 0; background: transparent; padding: 10px 14px 12px; font-size: 12.5px;
  color: var(--muted); font-weight: 600; white-space: nowrap; position: relative;
}
.notice-tab.active { color: var(--ink); }
.notice-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--ink);
}
.notice-tab .n { font-size: 9.5px; color: var(--muted); margin-left: 4px; }
.notice-list { overflow: hidden; }
.notice {
  display: flex; gap: 13px; padding: 16px 20px; border-bottom: 1px solid var(--line-2);
  position: relative; transition: background .15s;
}
.notice:last-child { border-bottom: 0; }
.notice.unread { background: #fdf8ef; }
.notice.unread::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.notice-ico {
  width: 33px; height: 33px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-deep);
  display: grid; place-items: center; flex: 0 0 auto;
}
.notice-ico.info { background: var(--blue-soft); color: var(--blue); }
.notice-ico.alert { background: var(--red-soft); color: var(--red); }
.notice-main { flex: 1; min-width: 0; }
.notice-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.notice-title b { font-size: 12.5px; font-weight: 650; }
.notice-title .who {
  font-size: 9.5px; color: var(--brand-deep); background: var(--brand-soft);
  border-radius: 4px; padding: 1px 5px; font-weight: 700;
}
.notice-body { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.notice-meta { display: flex; align-items: center; gap: 9px; font-size: 9.5px; color: var(--muted-2); margin-top: 5px; }
.notice-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: 0 0 auto; }
.notice-done { font-size: 10px; color: var(--green); display: flex; align-items: center; gap: 3px; }
.notice-done svg { width: 11px; height: 11px; }

/* =========================================================
   SETTINGS
   ========================================================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .sr-main b { display: block; font-size: 12.5px; font-weight: 600; }
.setting-row .sr-main span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.setting-actions { display: flex; gap: 8px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.perm-table th { text-align: center; padding: 8px 6px; color: var(--muted); font-size: 9.5px; font-weight: 700; border-bottom: 1px solid var(--line); }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table td { padding: 8px 6px; border-bottom: 1px solid var(--line-2); text-align: center; color: var(--muted-2); }
.perm-table tr:last-child td { border-bottom: 0; }
.perm-table .yes { color: var(--green); font-weight: 800; }
.perm-table .no { color: #d3c8b7; }
.perm-table .me-col { background: #fdf8ef; }
.role-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.role-legend span { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.role-legend i { width: 6px; height: 6px; border-radius: 50%; }

/* =========================================================
   DRAWER
   ========================================================= */
.scrim {
  position: fixed; inset: 0; background: rgba(23, 20, 15, .38); z-index: 55;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 95vw); z-index: 56;
  background: var(--surface); display: flex; flex-direction: column;
  box-shadow: -30px 0 80px -40px rgba(20, 16, 10, .5);
  animation: slideIn .28s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .6; } to { transform: none; opacity: 1; } }
body.drawer-open { overflow: hidden; }
.drawer-head { padding: 20px 24px 0; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.dh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dh-top .dh-tools { display: flex; align-items: center; gap: 7px; }
.drawer-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; display: grid; place-items: center; color: var(--muted);
}
.drawer-close:hover { background: var(--surface-2); color: var(--ink); }
.dh-main { display: flex; align-items: center; gap: 13px; margin-top: 12px; padding-bottom: 14px; }
.dh-id { min-width: 0; flex: 1; }
.dh-id h2 { display: flex; align-items: center; gap: 7px; font-size: 22px; letter-spacing: -.025em; font-weight: 700; }
.dh-id p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dh-money { text-align: right; flex: 0 0 auto; }
.dh-money span { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .05em; }
.dh-money b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.02em; margin-top: 1px; }
.steps { display: flex; padding: 2px 0 14px; }
.step { flex: 1; text-align: center; font-size: 9px; color: var(--muted-2); position: relative; min-width: 0; }
.step::before {
  content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 1px; background: var(--line);
}
.step:first-child::before { left: 50%; }
.step:last-child::before { right: 50%; }
.step i {
  position: relative; z-index: 1; display: block; width: 8px; height: 8px; border-radius: 50%;
  background: #ded4c2; margin: 0 auto 7px; box-shadow: 0 0 0 2px var(--surface);
}
.step span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.step.done i { background: var(--gold); }
.step.current { color: var(--ink); font-weight: 650; }
.step.current i { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.step.lost i { background: #b9b0a1; }
.tabs { display: flex; gap: 2px; padding: 0 24px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; padding: 11px 12px 12px; font-size: 12px;
  color: var(--muted); font-weight: 600; position: relative; white-space: nowrap;
}
.tab.active { color: var(--ink); }
.tab.active::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; background: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 30px; }
.drawer-foot {
  flex: 0 0 auto; border-top: 1px solid var(--line); padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 254, 250, .92); backdrop-filter: blur(8px); flex-wrap: wrap;
}
.drawer-foot .foot-hint { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.drawer-foot .foot-hint b { color: var(--ink-2); font-weight: 650; }
.drawer-foot .foot-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.info-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; background: var(--surface-2); }
.info-card h4 { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.info-list { display: flex; flex-direction: column; gap: 7px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; }
.info-row dt { color: var(--muted); white-space: nowrap; }
.info-row dd { margin: 0; text-align: right; color: var(--ink-2); font-weight: 550; min-width: 0; word-break: break-all; }
.info-row dd.link { color: var(--brand-deep); }
.inner-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.inner-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 15px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.inner-head h4 { font-size: 12px; font-weight: 650; }
.inner-head .sub { font-size: 10px; color: var(--muted); }
.inner-body { padding: 14px 15px; }
.item-group { margin-bottom: 8px; }
.item-group:last-of-type { margin-bottom: 0; }
.item-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 2px 0 4px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em;
  color: var(--brand-deep); border-bottom: 1px solid var(--line-2);
}
.item-group-head em { font-style: normal; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.item-group.gift-group { margin-top: 9px; padding: 8px 10px 2px; border-radius: 9px; background: #fdf8ef; border: 1px solid #efe2cc; }
.item-group.gift-group .item-group-head { color: #98713b; border-bottom-color: #ead9be; }
.item-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-row .it-main b { display: block; font-size: 12px; font-weight: 600; }
.gift-tag {
  display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 4px;
  background: #f3e3c9; color: #8a663a; font-size: 8.5px; font-weight: 700;
  letter-spacing: .04em; vertical-align: 1px;
}
.item-row.gift .it-price { color: #98713b; font-size: 10.5px; font-weight: 600; }
.item-row .it-main span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.item-row .it-price { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.total-line { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.total-line b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.total-line.grand { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ink); }
.total-line.grand b { font-size: 16px; font-weight: 700; }
.note-box {
  background: #fdf8ee; border: 1px solid #efe3cc; border-radius: 11px;
  padding: 12px 14px; font-size: 11.5px; color: #6f5c3c; line-height: 1.7; margin-bottom: 14px;
}
.note-box b { display: block; font-size: 9.5px; letter-spacing: .1em; color: #9b835c; text-transform: uppercase; margin-bottom: 4px; }
.approval-banner {
  display: flex; align-items: center; gap: 10px; background: var(--red-soft); border: 1px solid #f0d3c8;
  border-radius: 11px; padding: 11px 13px; margin-bottom: 13px; font-size: 11.5px; color: #8e3b27;
}
.approval-banner svg { width: 16px; height: 16px; flex: 0 0 auto; }
.approval-banner .ab-main { flex: 1; }
.approval-banner b { display: block; font-size: 11.5px; }
.approval-banner span { display: block; font-size: 10px; color: #a5624f; margin-top: 1px; }
.approval-banner.approved { background: var(--green-soft); border-color: #cfe4d6; color: var(--green); }
.approval-banner.approved span { color: #5c8b6e; }
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.pay-summary .ps { padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.pay-summary .ps span { font-size: 9.5px; color: var(--muted); display: block; }
.pay-summary .ps b { font-size: 15px; font-weight: 650; display: block; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pay-summary .ps.due b { color: var(--brand-deep); }
.perm-note {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px dashed var(--line-strong);
  border-radius: 10px; padding: 10px 12px; font-size: 11px; color: var(--muted);
}
.perm-note svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--gold); }
.mini-timeline { display: flex; flex-direction: column; }
.mini-tl-item { display: flex; gap: 11px; padding: 8px 0; }
.mini-tl-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #d8cdbb; margin-top: 6px; flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--surface-2);
}
.mini-tl-dot.action { background: var(--brand); }
.mini-tl-body { min-width: 0; }
.mini-tl-body p { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }
.mini-tl-body span { font-size: 9.5px; color: var(--muted-2); display: block; margin-top: 1px; }
.workflow-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; background: var(--surface-2); margin-bottom: 14px; }
.workflow-card h4 { font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.wf-row { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; padding: 5px 0; }
.wf-row span { color: var(--muted); }
.wf-row b { font-weight: 600; color: var(--ink-2); }

/* =========================================================
   MODAL / FORMS
   ========================================================= */
.modal-root { position: relative; z-index: 80; }
.modal-scrim {
  position: fixed; inset: 0; background: rgba(23, 20, 15, .42); z-index: 80;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .18s ease both; display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 20px; overflow-y: auto;
}
.modal {
  width: 620px; max-width: 100%; background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-pop); animation: popIn .22s cubic-bezier(.22, .61, .36, 1) both;
  margin: auto; display: flex; flex-direction: column; max-height: 90vh;
}
.modal.wide { width: 760px; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 21px 24px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.modal-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--line); flex: 0 0 auto;
  background: var(--surface-2); border-radius: 0 0 18px 18px;
}
.modal-foot .foot-left { margin-right: auto; font-size: 10.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.field > label .req { color: var(--brand-deep); margin-left: 2px; }
.field .hint { font-size: 9.5px; color: var(--muted-2); }
.input, .textarea, select.input {
  width: 100%; height: 39px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; padding: 0 11px; font-size: 12.5px; outline: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus, select.input:focus {
  border-color: #b3a48c; box-shadow: 0 0 0 3px rgba(199, 160, 90, .13);
}
.input::placeholder, .textarea::placeholder { color: #b4aa9a; }
.form-section-label {
  grid-column: 1 / -1; font-size: 9.5px; font-weight: 800; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase; padding-top: 5px;
  border-top: 1px dashed var(--line); margin-top: 2px;
}
.form-section-label:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.quote-items { display: flex; flex-direction: column; gap: 8px; }
.quote-row { display: grid; grid-template-columns: 102px 1.2fr 1.2fr 86px 52px 28px; gap: 7px; align-items: center; }
.quote-row .input { height: 37px; min-width: 0; }
.quote-row .item-cat { padding-left: 8px; padding-right: 6px; font-size: 11px; }
.quote-row .gift-check { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.quote-row .gift-check input { width: 13px; height: 13px; accent-color: var(--brand-deep); }
.quote-row.gift .item-price { background: #f7f1e9; color: var(--muted); }
.quote-row .rm {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); display: grid; place-items: center; font-size: 15px;
}
.quote-row .rm:hover { background: var(--red-soft); color: var(--red); border-color: #efd3c9; }
.quote-add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-item {
  margin-top: 0; border: 1px dashed var(--line-strong); background: transparent;
  border-radius: 8px; height: 34px; font-size: 11.5px; color: var(--muted); width: 100%;
}
.add-item:hover { background: var(--surface-2); color: var(--ink); }
.add-item.gift { color: #8a663a; border-color: #e4d2b8; }
.add-item.gift:hover { background: #fdf6ec; }
.quote-add-row + .hint { display: block; margin-top: 7px; }
.quote-summary {
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.qs-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.qs-line label { color: var(--muted); font-size: 11.5px; }
.qs-line .input { width: 130px; height: 35px; text-align: right; }
.qs-line.total b { font-size: 18px; letter-spacing: -.02em; }
.qs-warn { font-size: 10.5px; color: var(--red); background: var(--red-soft); border-radius: 7px; padding: 6px 9px; display: none; }
.qs-warn.show { display: block; }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); }
.checkline input { accent-color: var(--ink); width: 14px; height: 14px; }
.radio-row { display: flex; gap: 7px; flex-wrap: wrap; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); font-size: 11.5px; color: var(--ink-2); cursor: pointer;
  background: #fff; transition: all .15s;
}
.radio-pill input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff9ee; }
.form-note { font-size: 10.5px; color: var(--muted); line-height: 1.65; background: var(--surface-2); border-radius: 8px; padding: 9px 11px; }
.amount-input-wrap { position: relative; }
.amount-input-wrap .input { padding-left: 26px; font-size: 16px; font-weight: 650; height: 45px; }
.amount-input-wrap::before {
  content: "¥"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; z-index: 1;
}

/* toast */
.toast-root {
  position: fixed; right: 24px; bottom: 92px; z-index: 120; display: flex;
  flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--ink); color: #fffaf0; border-radius: 10px; box-shadow: var(--shadow-pop);
  font-size: 12px; animation: toastIn .25s ease both; max-width: 340px;
}
.toast svg { width: 15px; height: 15px; color: #a7d8b9; flex: 0 0 auto; }
.toast.error svg { color: #f0a28c; }
.toast.out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px); } }

/* skeleton / misc */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.pointer { cursor: pointer; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1250px) {
  .hero { flex-direction: column; gap: 18px; }
  .hero-metrics { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); padding-left: 0; padding-top: 16px; }
  .hero-metric:first-child { padding-left: 0; }
  .search { width: 230px; }
  .date-chip { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1120px) {
  .sidebar { width: 82px; padding: 22px 12px 16px; }
  .brand { padding: 2px 6px 24px; justify-content: center; }
  .brand-text, .nav-label, .nav-item .nav-text, .sys-line { display: none; }
  .nav-item { justify-content: center; padding: 0; height: 44px; }
  .nav-item .nav-badge { position: absolute; top: 3px; right: 4px; margin: 0; min-width: 15px; height: 15px; font-size: 9px; }
  .nav-item.active::before { left: -12px; }
  .me-card { justify-content: center; padding: 9px 6px; background: transparent; border-color: transparent; }
  .me-card .me-text, .me-card .logout-btn { display: none; }
  .main { margin-left: 82px; }
  .topbar { padding: 0 24px; }
  .page { padding: 22px 24px 56px; }
  .grid-2, .grid-2.alt, .grid-2.equal { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .follow-layout { grid-template-columns: 1fr; }
  .mobile-logout { display: inline-flex; }
}
@media (max-width: 860px) {
  .sidebar {
    inset: auto 0 0 0; width: 100%; height: 62px; flex-direction: row;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); align-items: center;
    border-right: 0; border-top: 1px solid rgba(255, 255, 255, .08); z-index: 45;
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 2px; justify-content: space-around; }
  .nav-item { flex: 1; flex-direction: column; gap: 2px; height: 50px; border-radius: 9px; font-size: 9px; justify-content: center; }
  .nav-item .nav-text { display: block; font-size: 8.5px; letter-spacing: .02em; }
  .nav-item.active::before { display: none; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item .nav-badge { top: 2px; right: calc(50% - 20px); }
  .main { margin-left: 0; padding-bottom: 70px; }
  .topbar { height: 64px; padding: 0 16px; gap: 10px; }
  .topbar-title .crumb { display: none; }
  .topbar-title h2 { font-size: 15px; }
  .search { width: 180px; height: 36px; }
  .search kbd { display: none; }
  .role-chip { display: none; }
  .page { padding: 18px 16px 40px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 25px; }
  .hero { padding: 22px 20px; border-radius: 18px; }
  .hero h1 { font-size: 23px; }
  .hero-metric { padding: 0 14px; min-width: 0; flex: 1; }
  .hero-metric b { font-size: 25px; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-scrim { padding: 0; }
  .modal { max-height: 100dvh; min-height: 100dvh; border-radius: 0; width: 100%; }
  .modal-foot { border-radius: 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .drawer { width: 100%; }
  .drawer-body { padding: 16px 18px 24px; }
  .drawer-head, .tabs, .drawer-foot { padding-left: 18px; padding-right: 18px; }
  .tabs { overflow-x: auto; }
  .toast-root { left: 16px; right: 16px; bottom: 76px; align-items: stretch; }
  .toast { max-width: none; }
  .login { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { min-height: 100vh; padding: 26px 20px; align-items: flex-start; }
  .login-card { max-width: 520px; margin: auto 0; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
  .login-mobile-brand b { font-size: 17px; letter-spacing: .06em; }
  .board-col { max-height: none; }
  .board { align-items: stretch; }
  .board-col { max-height: 70vh; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { padding: 13px 13px 12px; }
  .kpi-val { font-size: 21px; }
  .kpi-label { font-size: 10.5px; }
  .kpi-ico { width: 26px; height: 26px; }
  .hero-metrics { gap: 0; overflow-x: auto; }
  .hero-metric span { font-size: 9px; }
  .hero-metric b { font-size: 22px; }
  .hero-btns .btn { flex: 1; }
  .search { width: 40px; padding: 0 10px; overflow: hidden; }
  .search input { opacity: 0; pointer-events: none; width: 0; min-width: 0; }
  .search:focus-within { position: absolute; left: 16px; right: 16px; top: 13px; width: auto; z-index: 5; overflow: visible; }
  .search:focus-within input { opacity: 1; pointer-events: auto; width: 100%; }
  .search:focus-within kbd { display: none; }
  .topbar-right { gap: 6px; }
  .page-head { flex-direction: column; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .tools-right { width: 100%; margin-left: 0; }
  .tools-right .switch { margin-left: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .quote-row { grid-template-columns: 1fr 1fr; gap: 7px; }
  .quote-row .item-cat { grid-column: span 1; }
  .quote-row .item-name, .quote-row .item-spec { grid-column: span 2; }
  .quote-row .item-price { grid-column: span 1; }
  .quote-row .gift-check { justify-content: flex-start; padding-left: 4px; }
  .quote-row .rm { justify-self: end; }
  .quote-add-row { flex-direction: column; }
  .pay-summary { grid-template-columns: 1fr; }
  .fin-summary { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .role-card.manager { grid-column: span 1; }
  .login-card h2 { font-size: 25px; }
  .drawer-foot { flex-direction: column; align-items: stretch; }
  .drawer-foot .foot-actions { margin-left: 0; }
  .drawer-foot .foot-actions .btn { flex: 1; }
  .dh-money b { font-size: 16px; }
  .dh-id h2 { font-size: 19px; }
  .step span { display: none; }
  .steps { padding-bottom: 10px; }
}
@media (max-width: 420px) {
  .hero { padding: 20px 17px; }
  .hero-sub { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- modal form layout (added) ---------- */
body.modal-open { overflow: hidden; }
.modal-form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-form .modal-body { flex: 1; min-height: 0; }

.mobile-table-hint { display: none; }
@media (max-width: 860px) {
  .mobile-table-hint {
    display: block; text-align: right; font-size: 10px; color: var(--muted);
    margin: -2px 2px 8px; letter-spacing: .02em;
  }
}

/* =========================================================
   AURORA THEME · multi-user edition
   ========================================================= */
body { color: var(--ink); }

::selection { background: #b9f4ec; color: #062a2d; }

.brand-mark {
  background: linear-gradient(145deg, #6cf5e3 0%, #0ea7a0 48%, #3b6fe0 100%);
  color: #04242b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 10px 26px -10px rgba(69, 224, 208, .7);
}

.sidebar {
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(69, 224, 208, .18), transparent 55%),
    radial-gradient(90% 65% at 100% 100%, rgba(79, 124, 255, .16), transparent 65%),
    linear-gradient(180deg, #071923 0%, #081e29 52%, #06151e 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.brand-text b { color: #f2fffd; }
.brand-text span { color: #6f94a3; letter-spacing: .21em; }
.nav-label { color: #577483; }
.nav-item { color: #8ba7b4; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #eafffb; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(14, 167, 160, .26), rgba(79, 124, 255, .10));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(122, 245, 231, .08);
}
.nav-item.active::before { background: var(--cyan); box-shadow: 0 0 12px rgba(69, 224, 208, .7); }
.nav-item.active svg { color: #7af5e7; }
.nav-item .nav-badge { background: var(--coral); color: #2b0b05; }
.me-card { background: rgba(255, 255, 255, .045); border-color: rgba(122, 245, 231, .12); }
.me-avatar { background: #0d3543; color: #7af5e7; }
.me-card b { color: #effffb; }
.me-card span { color: #7896a4; }
.sys-line { color: #4f6b78; }

.topbar {
  background: rgba(238, 244, 247, .82);
  border-bottom: 1px solid rgba(200, 216, 226, .75);
}
.topbar-title .crumb { color: #6d8696; }
.search {
  background: rgba(255, 255, 255, .82);
  border-color: #d5e3ea;
}
.search:focus-within { border-color: #6bc9c2; box-shadow: 0 0 0 3px rgba(14, 167, 160, .12); }
.role-chip { background: rgba(255, 255, 255, .82); border-color: #d5e3ea; color: #24465a; }
.role-chip .dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .11); }
.date-chip { color: #6d8696; }
.icon-btn .dot-badge { background: var(--coral); color: #2b0b05; border-color: var(--bg); }
.icon-btn { background: #ffffff; border-color: #d8e5eb; }

.hero {
  background:
    radial-gradient(80% 130% at 100% 0%, rgba(79, 124, 255, .30), transparent 55%),
    radial-gradient(70% 120% at 0% 100%, rgba(14, 167, 160, .28), transparent 62%),
    linear-gradient(120deg, #071923 0%, #092735 58%, #0b3340 100%);
  border: 1px solid rgba(122, 245, 231, .08);
  box-shadow: 0 26px 60px -42px rgba(6, 25, 37, .9);
}
.hero::before {
  content: ""; position: absolute; width: 430px; height: 430px; border-radius: 50%;
  right: -170px; top: -230px; border: 1px solid rgba(122, 245, 231, .16);
  box-shadow: 0 0 0 54px rgba(122, 245, 231, .035), 0 0 0 120px rgba(79, 124, 255, .028);
  pointer-events: none;
}
.hero .eyebrow { color: #63d6cb; }
.hero h1 { color: #f4fffd; }
.hero-sub { color: #a8c3cc; }
.hero-sub b { color: #8ff5e8; }
.hero .btn.light { background: #ecfffb; border-color: #ecfffb; color: #073239; }
.hero .btn.light:hover { background: #ffffff; border-color: #ffffff; }
.hero .btn.hollow { background: rgba(255, 255, 255, .06); border-color: rgba(122, 245, 231, .22); color: #d7f6f1; }
.hero .btn.hollow:hover { background: rgba(122, 245, 231, .13); }
.hero-metrics { border-left-color: rgba(122, 245, 231, .16); }
.hero-metric + .hero-metric { border-left-color: rgba(122, 245, 231, .12); }
.hero-metric span { color: #7d9aa7; }
.hero-metric b { color: #bcfff4; }
.hero-metric em { color: #6e8d9b; }

.btn.primary {
  --btn-bg: linear-gradient(135deg, #0ea7a0, #0b8a9e);
  --btn-fg: #ffffff;
  --btn-bd: transparent;
  box-shadow: 0 8px 18px -12px rgba(14, 167, 160, .8);
}
.btn.primary:hover { --btn-bg: linear-gradient(135deg, #0b938d, #087a8c); --btn-bd: transparent; }
.btn.accent { --btn-bg: #3b6fe0; --btn-bd: #3b6fe0; --btn-fg: #ffffff; }
.btn.accent:hover { --btn-bg: #2f5dca; }
.btn.ghost { --btn-bd: #d3e1e8; --btn-fg: #2c4c5e; }
.btn.ghost:hover { background: #f4fbfc; border-color: #b8d5dc; }
.link-btn { color: var(--brand-deep); }

.card { border-color: #dde8ee; background: #ffffff; }
.card-head .sub { color: var(--muted); }
.empty .empty-ico { background: #f3fafb; border-color: #e0edf1; color: #90a9b5; }
.tag { background: #f0f6f8; color: #687f8e; }

.avatar { background: #e3f7f4; color: #087f7a; border-color: #cdeee9; }
.avatar.sales { background: #eaf0ff; color: #345ec3; border-color: #dbe5ff; }
.avatar.tech { background: #e8f3f8; color: #2f6f8f; border-color: #d7e9f1; }
.level-badge { background: #eaf0ff; color: #375fc4; border-color: #d9e3ff; }
.level-badge.b { background: #e3f7f4; color: #087f7a; border-color: #cdeee9; }
.level-badge.c { background: #f0f4f6; color: #708594; border-color: #e1eaef; }

.kpi { border-color: #dde8ee; }
.kpi-ico { background: #e2f8f5; color: #087f7a; }
.kpi-ico.tone-blue { background: #ecf2ff; color: #3b6fe0; }
.kpi-ico.tone-green { background: #e6f7f1; color: #0f8f70; }
.kpi-ico.tone-violet { background: #f1edff; color: #7a5af8; }
.kpi-val { color: #0b2233; }
.kpi-sub { color: #7b8e9c; }

.data-table th { background: #f6fafc; color: #7a8f9d; border-color: #e2ecf1; }
.data-table td { border-color: #edf3f6; }
.data-table tbody tr:hover { background: #f8fcfd; }
.board-col { background: rgba(255, 255, 255, .5); border-color: #dde8ee; }
.board-head { border-color: #e8f0f3; }
.deal-card { border-color: #dfe9ef; }
.deal-card:hover { border-color: #a9d8d4; box-shadow: 0 12px 24px -18px rgba(7, 25, 35, .38); }
.board-empty { color: #9fb2bd; }
.lost-chip { border-color: #dfe9ef; color: #7c8f9c; }

.drawer { background: #ffffff; }
.drawer-head { border-color: #e2ecf1; }
.drawer-foot { background: rgba(255, 255, 255, .93); border-color: #e2ecf1; }
.tabs { border-color: #e2ecf1; }
.tab.active::after { background: var(--brand); }
.notice-tabs { border-color: #e2ecf1; }
.notice.unread { background: #f1fbf9; }
.notice.unread::before { background: var(--brand); }
.notice-ico.info { background: #ecf2ff; color: #3b6fe0; }
.note-box { background: #f2f9fb; border-color: #dcebf0; color: #476372; }
.note-box b { color: #7a96a3; }
.info-card { background: #f7fbfc; border-color: #e2edf1; }
.inner-head { background: #f7fbfc; border-color: #e4eef2; }
.qs-warn { background: #fdeeed; color: #b8463c; }
.approval-banner { background: #fdeeed; border-color: #f5d3cf; color: #a54339; }
.approval-banner.approved { background: #e9f8f2; border-color: #cceade; color: #0c7b5f; }
.approval-banner.approved span { color: #5ba58e; }

.step.done i { background: #7c9cff; }
.step.current i { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.f-bar i { background: var(--brand); }
.funnel-row:hover { background: #f5fbfc; }

.modal { border: 1px solid #e0ebef; }
.modal-scrim { background: rgba(5, 21, 30, .48); }
.modal-head { border-color: #e5eef2; }
.modal-foot { background: #f7fbfc; border-color: #e5eef2; }
.input:focus, .textarea:focus, select.input:focus { border-color: #6bc9c2; box-shadow: 0 0 0 3px rgba(14, 167, 160, .12); }
.radio-pill input:checked + span { background: var(--brand-deep); border-color: var(--brand-deep); }
.toast { background: #082532; color: #f1fffc; }
.toast svg { color: #7af5e7; }

.settings-grid .card { box-shadow: 0 18px 40px -38px rgba(7, 25, 35, .45); }
.setting-row { border-color: #edf3f6; }
.perm-table th { border-color: #e1ebf0; }
.perm-table td { border-color: #edf3f6; }
.perm-table .me-col { background: #effbf9; }
.perm-table .yes { color: #0f8f70; }

/* ---------- NEW: login / auth ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.04fr .96fr;
  background: var(--bg);
}
.auth-visual {
  position: relative; overflow: hidden; min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 38px 54px 26px;
  color: #ecfffb;
  background:
    radial-gradient(85% 75% at 18% 5%, rgba(69, 224, 208, .22), transparent 56%),
    radial-gradient(90% 80% at 95% 92%, rgba(79, 124, 255, .26), transparent 58%),
    linear-gradient(150deg, #061923 0%, #082836 55%, #061720 100%);
}
.auth-visual::before {
  content: ""; position: absolute; right: -190px; top: -220px;
  width: 560px; height: 560px; border-radius: 50%;
  border: 1px solid rgba(122, 245, 231, .18);
  box-shadow: 0 0 0 70px rgba(122, 245, 231, .035), 0 0 0 150px rgba(79, 124, 255, .03);
  pointer-events: none;
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .14) .7px, transparent .7px);
  background-size: 22px 22px; opacity: .18;
  mask-image: radial-gradient(80% 80% at 80% 30%, #000, transparent 75%);
}
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-mark { width: 46px; height: 46px; font-size: 21px; }
.auth-brand b { display: block; font-size: 21px; letter-spacing: .07em; color: #f2fffd; }
.auth-brand span { display: block; font-size: 9px; letter-spacing: .25em; color: #6f97a6; margin-top: 3px; }
.auth-copy { position: relative; z-index: 1; margin: auto 0; max-width: 560px; padding: 46px 0 34px; }
.auth-kicker {
  font-size: 10px; font-weight: 750; letter-spacing: .2em; color: #63d6cb;
  text-transform: uppercase; margin-bottom: 17px;
}
.auth-copy h1 {
  font-size: clamp(38px, 3.6vw, 54px); line-height: 1.16; letter-spacing: -.045em;
  font-weight: 700; color: #f4fffd;
}
.auth-copy h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #6cf5e3 0%, #8fb5ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-lead { margin-top: 20px; color: #a0bdc7; font-size: 13.5px; line-height: 1.9; max-width: 455px; }
.auth-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 27px; max-width: 420px; }
.auth-stack-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid rgba(122, 245, 231, .13); border-radius: 11px;
  background: rgba(255, 255, 255, .055); backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -24px rgba(0, 0, 0, .7);
}
.auth-stack-card.c1 { transform: translateX(0); animation: stackIn .7s ease both; }
.auth-stack-card.c2 { transform: translateX(16px); animation: stackIn .7s .1s ease both; }
.auth-stack-card.c3 { transform: translateX(32px); animation: stackIn .7s .2s ease both; }
@keyframes stackIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; } }
.auth-stack-card .st-avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-family: "Songti SC", serif;
  font-size: 13px; font-weight: 700; color: #03282c;
  background: linear-gradient(145deg, #8cf9eb, #4cbec5);
}
.auth-stack-card.c2 .st-avatar { background: linear-gradient(145deg, #bdd0ff, #7c99ef); }
.auth-stack-card.c3 .st-avatar { background: linear-gradient(145deg, #a6e9f7, #5aaac8); }
.auth-stack-card b { display: block; font-size: 11.5px; font-weight: 600; color: #edfffb; }
.auth-stack-card em { display: block; font-style: normal; font-size: 9.5px; color: #7fa0ab; margin-top: 1px; }
.auth-stack-card .st-dot { width: 6px; height: 6px; border-radius: 50%; background: #4be7c5; margin-left: auto; box-shadow: 0 0 0 4px rgba(75, 231, 197, .1); }
.auth-stack-card .st-check { margin-left: auto; color: #6cf5c9; display: flex; }
.auth-stack-card .st-check svg { width: 14px; height: 14px; }
.auth-points { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 23px; }
.auth-points span { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #8caab5; }
.auth-points svg { width: 13px; height: 13px; color: #63d6cb; }
.auth-foot {
  position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 16px;
  font-size: 9.5px; letter-spacing: .06em; color: #5f7d8a;
}
.auth-panel {
  display: flex; align-items: center; justify-content: center; padding: 38px;
  background:
    radial-gradient(70% 50% at 90% 0%, rgba(69, 224, 208, .11), transparent 65%),
    radial-gradient(60% 50% at 0% 100%, rgba(79, 124, 255, .09), transparent 65%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 468px; padding: 33px 34px 25px;
  background: rgba(255, 255, 255, .94); border: 1px solid #dce9ef;
  border-radius: 22px; box-shadow: 0 30px 70px -42px rgba(7, 25, 35, .46);
}
.auth-mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-mobile-brand .brand-mark { width: 38px; height: 38px; font-size: 17px; }
.auth-mobile-brand b { display: block; font-size: 16px; letter-spacing: .05em; }
.auth-mobile-brand span { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: .08em; }
.auth-card .auth-kicker { color: var(--brand-deep); margin-bottom: 9px; }
.auth-card h2 { font-size: 27px; letter-spacing: -.025em; font-weight: 700; color: #0b2233; }
.auth-sub { font-size: 12.5px; color: #7b8f9d; margin-top: 7px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: #5f7686; margin-bottom: 6px; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > svg { position: absolute; left: 13px; width: 16px; height: 16px; color: #8ca6b3; pointer-events: none; }
.auth-input-wrap input {
  width: 100%; height: 46px; border: 1px solid #d3e2e9; border-radius: 11px;
  background: #fbfdfe; padding: 0 13px 0 39px; font-size: 13px; color: #0b2233;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input-wrap input:focus { background: #fff; border-color: #66c8c1; box-shadow: 0 0 0 4px rgba(14, 167, 160, .10); }
.auth-input-wrap input::placeholder { color: #a7bac4; }
.auth-submit { width: 100%; height: 46px; margin-top: 4px; border: 0; border-radius: 11px; font-size: 13px; letter-spacing: .01em; }
.auth-submit svg { width: 15px; height: 15px; }
.auth-alert {
  display: flex; align-items: center; gap: 8px; padding: 10px 11px;
  border: 1px solid #f4d2cd; background: #fdf0ee; color: #a54339;
  border-radius: 9px; font-size: 11px; margin-bottom: 14px;
}
.auth-alert svg { width: 14px; height: 14px; flex: 0 0 auto; }
.auth-alert .link-btn { margin-left: auto; font-size: 10.5px; }
.auth-card .form-error { margin-top: 0; }
.demo-box {
  margin-top: 22px; padding: 13px; border: 1px solid #e0edf1; border-radius: 12px;
  background: #f7fbfc;
}
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.demo-head span { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #657f8e; text-transform: uppercase; }
.demo-head em { font-style: normal; font-size: 9.5px; color: #8aa0ac; }
.demo-head em b { color: var(--brand-deep); font-family: var(--mono); letter-spacing: .04em; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo-account {
  display: flex; align-items: center; gap: 7px; padding: 7px 8px;
  background: #ffffff; border: 1px solid #e2edf1; border-radius: 8px; text-align: left;
  transition: border-color .15s, transform .15s;
}
.demo-account:hover { border-color: #79cec6; transform: translateY(-1px); }
.demo-account .da-role {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  background: #f0faf8; color: var(--c);
  font-size: 10px; font-weight: 800; flex: 0 0 auto; font-family: "Songti SC", serif;
}
.demo-account b { display: block; font-size: 9.5px; color: #385364; font-weight: 650; }
.demo-account em { display: block; font-style: normal; font-size: 9px; color: #8aa0ac; font-family: var(--mono); margin-top: 1px; }
.demo-note { font-size: 9.5px; color: #8aa0ac; line-height: 1.55; margin-top: 8px; }
.auth-hint { margin-top: 17px; font-size: 9.5px; color: #8da2ad; display: flex; align-items: center; gap: 5px; }
.auth-hint svg { width: 11px; height: 11px; color: #7fb5ae; }
.auth-card .btn[disabled] { opacity: .6; }

/* ---------- NEW: loading ---------- */
.boot {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(65% 55% at 50% 10%, rgba(69, 224, 208, .20), transparent 60%),
    radial-gradient(55% 50% at 90% 100%, rgba(79, 124, 255, .18), transparent 65%),
    linear-gradient(150deg, #061923, #082b38 60%, #061720);
  color: #ecfffb;
}
.boot-mark {
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center;
  font-family: "Songti SC", serif; font-size: 27px; font-weight: 800; color: #04242b;
  background: linear-gradient(145deg, #6cf5e3, #0ea7a0 52%, #3b6fe0);
  box-shadow: 0 20px 45px -20px rgba(69, 224, 208, .65);
  animation: bootPulse 2s ease-in-out infinite;
}
@keyframes bootPulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.boot-eyebrow { font-size: 9px; letter-spacing: .22em; color: #5e8a96; margin-top: 26px; }
.boot h1 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; color: #effffb; }
.boot-sub { font-size: 11px; color: #7d9aa6; margin-top: 6px; }
.boot-bar { width: 180px; height: 3px; background: rgba(255, 255, 255, .09); border-radius: 99px; overflow: hidden; margin-top: 22px; }
.boot-bar i { display: block; width: 38%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #45e0d0, #7c9cff); animation: bootSlide 1.4s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }

/* ---------- NEW: team & settings ---------- */
.sync-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border: 1px solid #cfe6e1; background: #effbf8; color: #0c7b6b;
  border-radius: 99px; font-size: 10.5px; font-weight: 650; white-space: nowrap;
}
.online-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.online-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .12); }
.online-dot.off { background: #aab8c2; box-shadow: none; }
.team-table { min-width: 760px; }
.team-table td { padding-top: 11px; padding-bottom: 11px; }
.team-table .tag { margin-left: 6px; height: 18px; font-size: 9px; }
.mono-id { font-family: var(--mono); font-size: 10.5px; color: #627d8c; background: #f4f9fb; border: 1px solid #e3eef3; padding: 2px 6px; border-radius: 5px; }
.role-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  background: var(--bg); color: var(--c); font-size: 10.5px; font-weight: 650;
}
.percent-input { position: relative; display: flex; align-items: center; }
.percent-input .input { padding-right: 34px; }
.percent-input span { position: absolute; right: 13px; color: #8298a4; font-size: 12px; pointer-events: none; }
.settings-grid .table-wrap { border-top: 1px solid #e8f0f3; }
.settings-grid .card-head .btn.sm { height: 32px; }

/* ---------- responsive auth ---------- */
@media (max-width: 1040px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 26px 20px; align-items: flex-start; }
  .auth-card { margin: auto 0; }
  .auth-mobile-brand { display: flex; }
}
@media (max-width: 540px) {
  .auth-panel { padding: 14px; }
  .auth-card { padding: 25px 20px 20px; border-radius: 18px; }
  .auth-card h2 { font-size: 23px; }
  .auth-sub { margin-bottom: 18px; }
  .demo-grid { grid-template-columns: 1fr; }
  .auth-hint { line-height: 1.5; }
  .auth-foot { flex-direction: column; gap: 4px; }
}

/* grid children must be allowed to shrink; wide tables scroll inside their card */
.settings-grid { min-width: 0; }
.settings-grid > .card { min-width: 0; }
.settings-grid .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }

.demo-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border: 1px solid #f1d8b4; background: #fff6e8; color: #a96a12;
  border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  white-space: nowrap;
}
@media (max-width: 860px) { .demo-chip { display: none; } }
