/* ============================================================
   SalonHub — Design System
   Premium salon-chain CRM. Warm paper workspace + espresso sidebar.
   Fonts: Bricolage Grotesque (display) · Be Vietnam Pro (UI/body)
   ============================================================ */

:root {
  /* — Brand & accents (Champagne Gold) — */
  --accent:        #B8924A;   /* champagne gold — signature */
  --accent-ink:    #8A6A28;   /* deep antique gold (text on light) */
  --accent-soft:   #F3E9D2;   /* pale gold wash */
  --accent-glow:   rgba(184, 146, 74, .32);
  --plum:          #6E3B55;   /* secondary depth — wine */
  --gold:          #C9A24B;

  /* — Surfaces (warm ivory) — */
  --bg:            #F5F0E6;
  --bg-grain:      #F0EADD;
  --surface:       #FFFFFF;
  --surface-2:     #FBF7EF;
  --surface-3:     #F4EEE1;
  --line:          #E8DECD;
  --line-strong:   #D8CCB4;

  /* — Ink (text) — */
  --ink:           #1A140D;
  --ink-2:         #5A5044;
  --ink-3:         #968A75;
  --ink-inv:       #FBF6EC;

  /* — Sidebar (deep onyx) — */
  --side:          #14110B;
  --side-2:        #1E1810;
  --side-line:     rgba(255,255,255,.06);
  --side-ink:      #EAE0CD;
  --side-ink-2:    #9A8C76;
  --side-active:   rgba(184, 146, 74, .17);

  /* — Semantic — */
  --up:            #1F9D6B;
  --up-soft:       #E2F3EB;
  --down:          #E5484D;
  --down-soft:     #FBE7E7;
  --info:          #3B6FE0;
  --info-soft:     #E7EEFC;
  --warn:          #B8924A;
  --warn-soft:     #F4EAD2;

  /* — Channel brand colors — */
  --c-facebook:    #1877F2;
  --c-instagram:   #E1306C;
  --c-zalo:        #0068FF;
  --c-tiktok:      #111111;
  --c-web:         #0EA5A4;
  --c-google:      #34A853;

  /* — Geometry — */
  --r-xs: 7px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --sb-w: 256px;
  --top-h: 64px;

  /* — Shadows (warm-tinted) — */
  --sh-xs: 0 1px 2px rgba(56,38,24,.06);
  --sh-sm: 0 2px 6px rgba(56,38,24,.07), 0 1px 2px rgba(56,38,24,.05);
  --sh-md: 0 8px 24px -8px rgba(56,38,24,.16), 0 2px 6px rgba(56,38,24,.06);
  --sh-lg: 0 24px 60px -18px rgba(40,26,16,.30), 0 6px 16px -8px rgba(40,26,16,.12);
  --sh-pop: 0 20px 48px -12px rgba(40,26,16,.34);

  --font-display: 'Bricolage Grotesque', 'Be Vietnam Pro', system-ui, sans-serif;
  --font-sans:    'Be Vietnam Pro', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  /* — Luxury gold extras — */
  --grad-gold:      linear-gradient(135deg, #E0C173 0%, #B8924A 48%, #7E5F22 100%);
  --grad-gold-soft: linear-gradient(135deg, #FBF3DF, #F1E2C0);
  --gold-hair:      linear-gradient(90deg, transparent, rgba(184,146,74,.55), transparent);
  --accent-glow-2:  rgba(184,146,74,.46);
  --sh-gold:        0 16px 40px -14px rgba(184,146,74,.46), 0 5px 14px -7px rgba(56,38,24,.16);
  --sheen:          linear-gradient(105deg, transparent 32%, rgba(255,255,255,.62) 50%, transparent 68%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* subtle paper grain on workspace */
.workspace::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(120,90,60,.05) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .6; mask-image: linear-gradient(180deg, transparent, #000 120px);
}

::selection { background: var(--accent); color: #fff; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(120,100,80,.26); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(120,100,80,.42); background-clip: content-box; }
.side ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); background-clip: content-box; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.ico { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ============================================================
   Boot loader
   ============================================================ */
.app-loading { display: grid; place-items: center; height: 100vh; }
.boot { text-align: center; animation: fadeIn .4s var(--ease); }
.boot-logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 32px;
  background: linear-gradient(145deg, var(--accent), var(--accent-ink));
  box-shadow: 0 12px 30px -8px var(--accent-glow);
  animation: pulseLogo 1.4s var(--ease) infinite;
}
.boot-text { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.boot-bar { width: 160px; height: 4px; border-radius: 4px; background: var(--line); margin: 14px auto 0; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--accent); animation: bootSlide 1.1s var(--ease) infinite; }
@keyframes bootSlide { 0%{transform:translateX(-120%)} 100%{transform:translateX(360%)} }
@keyframes pulseLogo { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }

/* ============================================================
   Màn mở đầu GALAXY đen-bạc (5 cơ sở JUDY) — hiện ~3 giây
   ============================================================ */
.galaxy-splash {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  opacity: 0; transition: opacity .6s ease;
  background: radial-gradient(130% 130% at 50% 26%, #222942 0%, #0d101c 52%, #04050a 100%);
}
.galaxy-splash.show { opacity: 1; }
.galaxy-splash.out { opacity: 0; }
.gx-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.95), transparent),
    radial-gradient(1px 1px at 28% 64%, rgba(210,218,235,.8), transparent),
    radial-gradient(1.4px 1.4px at 48% 16%, rgba(245,235,205,.85), transparent),
    radial-gradient(1px 1px at 66% 48%, rgba(255,255,255,.85), transparent),
    radial-gradient(1.6px 1.6px at 82% 72%, rgba(200,210,235,.75), transparent),
    radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 38% 86%, rgba(230,225,240,.7), transparent),
    radial-gradient(1.2px 1.2px at 58% 82%, rgba(245,235,205,.7), transparent),
    radial-gradient(1px 1px at 8% 70%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.3px 1.3px at 74% 12%, rgba(220,225,240,.8), transparent);
  animation: gxTwinkle 2.6s ease-in-out infinite alternate;
}
.gx-glow { position: absolute; width: 64vw; height: 64vw; max-width: 640px; max-height: 640px; border-radius: 50%; background: radial-gradient(circle, rgba(232,201,138,.16), transparent 62%); filter: blur(10px); }
.gx-center { position: relative; z-index: 2; text-align: center; animation: gxRise 1.3s cubic-bezier(.22,1,.36,1) both; }
.gx-brand {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 6.4vw, 58px); letter-spacing: .01em; line-height: 1.05;
  background: linear-gradient(115deg, #d6b86a 0%, #ffffff 28%, #cfd3dd 52%, #f4e3b8 78%, #c9a455 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 2px 26px rgba(232,201,138,.22));
}
.gx-slogan { margin-top: 16px; font-family: var(--font-display); font-weight: 600; font-size: clamp(14px, 2.6vw, 20px); letter-spacing: .42em; text-transform: uppercase; color: #c2c8d6; padding-left: .42em; }
.gx-rule { width: 0; height: 1px; margin: 18px auto 0; background: linear-gradient(90deg, transparent, rgba(232,201,138,.75), transparent); animation: gxRule 1.5s .4s ease both; }
@keyframes gxTwinkle { from{opacity:.55} to{opacity:1} }
@keyframes gxRise { from{opacity:0; transform: translateY(16px) scale(.98)} to{opacity:1; transform:none} }
@keyframes gxRule { from{width:0} to{width:210px} }

/* ============================================================
   App shell
   ============================================================ */
.shell { display: grid; grid-template-columns: var(--sb-w) 1fr; height: 100vh; }

/* — Sidebar — */
.side {
  background: linear-gradient(180deg, var(--side-2) 0%, var(--side) 38%);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--side-line);
  position: relative; z-index: 5;
}
.side::after { /* warm top glow */
  content:""; position:absolute; top:0; left:0; right:0; height:240px; pointer-events:none;
  background: radial-gradient(120% 80% at 20% 0%, rgba(184,146,74,.16), transparent 60%);
}
.side-head { padding: 16px 16px 12px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 20px;
  background: linear-gradient(145deg, var(--accent), var(--accent-ink));
  box-shadow: 0 6px 18px -4px var(--accent-glow-2), 0 0 0 1px rgba(184,146,74,.3), inset 0 1px 0 rgba(255,255,255,.28);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: #fff; line-height: 1; }
.brand-sub { font-size: 11px; color: var(--side-ink-2); margin-top: 3px; letter-spacing: .01em; }

/* cơ sở switcher */
.branch-switch {
  margin: 12px 12px 4px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--side-2); border: 1px solid var(--side-line);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: border-color .2s, background .2s; position: relative; z-index: 1;
}
.branch-switch:hover { border-color: rgba(184,146,74,.45); }
.branch-dot { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 3px 9px -3px rgba(0,0,0,.45); }
.branch-dot::after { content:""; position:absolute; inset:0; background: linear-gradient(160deg, rgba(255,255,255,.26), transparent 58%); pointer-events:none; }
.branch-meta { flex: 1; min-width: 0; }
.branch-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-ink-2); }
.branch-name { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branch-switch .chev { color: var(--side-ink-2); transition: transform .2s; }

.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; position: relative; z-index: 1; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--side-ink-2); padding: 6px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--side-ink-2); font-weight: 500; font-size: 13.5px; position: relative;
  transition: color .18s, background .18s; width: 100%; text-align: left;
}
.nav-item .ico { width: 18px; height: 18px; opacity: .9; }
.nav-item:hover { color: var(--side-ink); background: rgba(255,255,255,.04); }
.nav-item.active { color: #fff; background: var(--side-active); }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-item .badge-n {
  margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 20px; display: grid; place-items: center;
}
.nav-item.active .badge-n { background: #fff; color: var(--accent-ink); }

.side-foot { padding: 10px 12px 14px; border-top: 1px solid var(--side-line); position: relative; z-index: 1; }

/* nút đóng menu (X) + lớp phủ tối — chỉ bật trên điện thoại (xem media ≤900px) */
.side-close { display: none; }
.side-backdrop { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: var(--r-sm); transition: background .2s; cursor: pointer; }
.user-chip:hover { background: rgba(255,255,255,.05); }
.user-chip .av { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.user-chip .avatar { box-shadow: 0 0 0 1.5px rgba(184,146,74,.42); }
.user-chip .nm { font-size: 13px; font-weight: 600; color: #fff; }
.user-chip .rl { font-size: 11px; color: var(--side-ink-2); }

/* ============================================================
   Workspace
   ============================================================ */
.workspace { display: flex; flex-direction: column; min-width: 0; background: radial-gradient(110% 70% at 100% 0%, rgba(184,146,74,.08), transparent 52%), var(--bg); position: relative; overflow: hidden; }

.topbar {
  height: var(--top-h); flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 22px; border-bottom: 1px solid var(--line);
  background: rgba(244,240,234,.82); backdrop-filter: blur(12px);
  position: relative; z-index: 4;
}
.topbar > .tb-title { flex: none; min-width: 0; max-width: 320px; }
.page-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.025em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search {
  display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 0 12px; height: 40px; flex: 1 1 300px; max-width: 320px; min-width: 120px; margin-left: 8px;
  transition: border-color .2s, box-shadow .2s; color: var(--ink-3);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search input { border: none; outline: none; background: none; flex: 1; font-size: 13.5px; color: var(--ink); }
.search kbd { font-family: var(--font-sans); font-size: 11px; color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }

.top-spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); position: relative;
  transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }

.date-pill {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 13px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: all .18s;
}
.date-pill:hover { border-color: var(--line-strong); box-shadow: var(--sh-sm); }

.view { flex: 1; overflow-y: auto; position: relative; z-index: 1; }
.view-pad { padding: 22px; max-width: 1480px; margin: 0 auto; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-md); font-weight: 600; font-size: 13.5px;
  transition: all .18s var(--ease); white-space: nowrap; border: 1px solid transparent;
}
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-primary { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--accent), var(--accent-ink)); color: #fff; box-shadow: 0 7px 18px -6px var(--accent-glow-2), inset 0 1px 0 rgba(255,255,255,.28); }
.btn-primary::after { content:""; position:absolute; inset:0; background: var(--sheen); transform: translateX(-130%); transition: transform .7s var(--ease-out); pointer-events:none; }
.btn-primary:hover::after { transform: translateX(130%); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -6px var(--accent-glow-2), inset 0 1px 0 rgba(255,255,255,.28); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: var(--sh-xs); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: #fbdccf; }
.btn-dark { background: var(--ink); color: var(--ink-inv); }
.btn-dark:hover { background: #322822; transform: translateY(-1px); }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); position: relative; transition: box-shadow .3s var(--ease-out); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--line); position: relative; }
.card-head::before { content:""; position:absolute; left:0; top:14px; bottom:14px; width:3px; border-radius:0 3px 3px 0; background: var(--grad-gold); }
.card-head h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ico { color: var(--accent); }
.card-head .sub { font-size: 12px; color: var(--ink-3); }
.card-head .spacer { flex: 1; }

.section-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -.015em; display: flex; align-items: center; gap: 9px; }
.section-title .ico { color: var(--accent); }

/* grid helpers */
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 16px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ============================================================
   KPI cards
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  background: linear-gradient(168deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 19px; position: relative; overflow: hidden; box-shadow: var(--sh-sm);
  transition: transform .32s var(--ease-out), box-shadow .32s var(--ease-out), border-color .3s;
}
.kpi::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; background: var(--grad-gold); opacity:.62; transition: opacity .3s; }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--sh-gold); border-color: rgba(184,146,74,.42); }
.kpi:hover::before { opacity:1; }
.kpi-click { cursor: pointer; font: inherit; text-align: left; }
.kpi-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow), var(--sh-md); }
.kpi::after { content:""; position:absolute; right:-34px; top:-34px; width:124px; height:124px; border-radius:50%; background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); opacity:.75; transition: transform .45s var(--ease-out); }
.kpi:hover::after { transform: scale(1.22); }
.kpi-top { display: flex; align-items: center; gap: 11px; position: relative; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 11px -5px rgba(56,38,24,.22); transition: transform .32s var(--ease-out); }
.kpi:hover .kpi-ico { transform: scale(1.09) rotate(-4deg); }
.kpi-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.kpi-val { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -.03em; margin-top: 13px; line-height: 1; position: relative; font-variant-numeric: tabular-nums; }
.kpi-val .unit { font-size: 17px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12.5px; position: relative; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 2px 7px 2px 5px; border-radius: 20px; font-size: 12px; }
.delta.up { color: var(--up); background: var(--up-soft); }
.delta.down { color: var(--down); background: var(--down-soft); }
.kpi-foot .muted { color: var(--ink-3); }

/* So sánh tháng này vs tháng trước (Tổng quan) */
.mom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mom-stat { border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 16px 15px 18px; background: linear-gradient(168deg, var(--surface) 0%, var(--surface-2) 100%); position: relative; overflow: hidden; transition: transform .26s var(--ease-out), box-shadow .26s, border-color .26s; }
.mom-stat::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--grad-gold); opacity:.55; }
.mom-stat:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); border-color: rgba(184,146,74,.4); }
.mom-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.mom-label .ico { color: var(--accent); }
.mom-val { font-family: var(--font-display); font-weight: 800; font-size: 27px; letter-spacing: -.025em; margin-top: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.mom-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 12px; flex-wrap: wrap; }
.mom-foot .muted { color: var(--ink-3); }

/* Thẻ tách kênh FB / TikTok (Tổng quan) */
.chan-card { background: linear-gradient(168deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px 14px; box-shadow: var(--sh-sm); position: relative; overflow: hidden; cursor: pointer; transition: box-shadow .3s var(--ease-out), border-color .3s, transform .3s var(--ease-out); }
.chan-card::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; }
.chan-card.fb::before { background: #1877F2; }
.chan-card.tt::before { background: linear-gradient(90deg, #25F4EE, #111, #FE2C55); }
.chan-card:hover { transform: translateY(-3px); box-shadow: var(--sh-gold); border-color: rgba(184,146,74,.4); }
.chan-head { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.chan-head img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: none; }
.chan-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chan-st .l { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.chan-st .v { font-family: var(--font-display); font-weight: 800; font-size: 27px; letter-spacing: -.025em; margin-top: 5px; line-height: 1; font-variant-numeric: tabular-nums; }
.chan-st .v.up { color: #1F9D6B; }
.chan-st .v.warn { color: #B8924A; }
.chan-st .v.mut { color: var(--ink-3); font-size: 15px; font-weight: 600; }
.chan-foot { font-size: 11px; color: var(--ink-3); margin-top: 12px; }
@media (max-width: 640px) { .chan-stats { gap: 6px; } .chan-st .v { font-size: 22px; } .chan-head { font-size: 14px; } }

/* ============================================================
   Badges, tags, chips
   ============================================================ */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.tag .d { width: 6px; height: 6px; border-radius: 50%; }
.tag-soft { background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); }
.tag-up { background: var(--up-soft); color: var(--up); }
.tag-down { background: var(--down-soft); color: var(--down); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag-plum { background: #F3E6EE; color: var(--plum); }

.chan { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; color: #fff; }
.chan svg { width: 12px; height: 12px; }
.chan-facebook { background: var(--c-facebook); }
.chan-instagram { background: linear-gradient(135deg,#F58529,#DD2A7B,#8134AF); }
.chan-zalo { background: var(--c-zalo); }
.chan-tiktok { background: var(--c-tiktok); }
.chan-web { background: var(--c-web); }

.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; color: #fff; }
.av-ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }

/* member tier */
.tier { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; letter-spacing: .02em; }
.tier-kc { background: #EFEAE2; color: #8A7B66; }       /* khách mới */
.tier-bac { background: #EDEFF2; color: #6B7585; }      /* bạc */
.tier-vang { background: #FBF1DC; color: #B0851F; }     /* vàng */
.tier-kim { background: #F3E6EE; color: #8E3F69; }      /* kim cương */

/* ============================================================
   Tables
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .nm { font-weight: 600; }
.cell-user .sub { font-size: 11.5px; color: var(--ink-3); }

/* mini progress bar in cells */
.minibar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 64px; }
.minibar > span { display: block; height: 100%; border-radius: 6px; background: var(--accent); }

/* ============================================================
   Charts
   ============================================================ */
.chart-wrap { position: relative; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.legend-item .sw { width: 11px; height: 11px; border-radius: 4px; }
.chart-svg { width: 100%; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis-label { font-size: 11px; fill: var(--ink-3); font-family: var(--font-sans); }
.bar-rect { transition: opacity .2s; }
.bar-rect:hover { opacity: .82; }
.donut-center { text-align: center; }

/* spark */
.spark { width: 100%; height: 40px; overflow: visible; }

/* ============================================================
   Inbox (3-pane) — Pancake signature
   ============================================================ */
.inbox { display: grid; grid-template-columns: 340px 1fr 320px; height: 100%; background: var(--surface); }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.inbox-filters { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.fpill { height: 30px; padding: 0 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; border: 1px solid transparent; }
.fpill:hover { color: var(--ink); }
.fpill.active { background: var(--ink); color: #fff; }
.fpill .cnt { font-size: 11px; opacity: .7; }

.conv-list { flex: 1; overflow-y: auto; }
.conv {
  display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
  position: relative; transition: background .15s;
}
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--accent-soft); }
.conv.active::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--accent); }
.conv-av { position: relative; flex: none; }
.conv-av .chan { position: absolute; right: -3px; bottom: -3px; border: 2px solid var(--surface); width: 19px; height: 19px; }
.conv.active .conv-av .chan { border-color: var(--accent-soft); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; gap: 6px; }
.conv-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.conv-time { font-size: 11px; color: var(--ink-3); flex: none; }
.conv-snippet { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.chat-subbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); }
.page-chip { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 4px; color: #1877F2; flex: none; }
.conv.unread .conv-name { font-weight: 700; }
.conv.unread .conv-snippet { color: var(--ink); font-weight: 500; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

/* chat thread */
.chat { display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.chat-head { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head .nm { font-weight: 600; font-size: 14.5px; }
.chat-head .st { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.chat-head .online { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.chat-actions { margin-left: auto; display: flex; gap: 7px; }

.chat-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; background-image: radial-gradient(rgba(120,90,60,.04) 1px, transparent 1px); background-size: 20px 20px; }
.day-sep { text-align: center; font-size: 11.5px; color: var(--ink-3); margin: 14px 0 8px; position: relative; }
.day-sep span { background: var(--surface-2); padding: 0 12px; position: relative; z-index: 1; }
.day-sep::before { content:""; position:absolute; left:0; right:0; top:50%; height:1px; background: var(--line); }
.msg { max-width: 70%; display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.msg-in { align-self: flex-start; align-items: flex-start; }
.msg-out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--sh-xs); }
.msg-in .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-out .bubble { background: linear-gradient(160deg, var(--accent), var(--accent-ink)); color: #fff; border-bottom-right-radius: 5px; }
.msg-time { font-size: 10.5px; color: var(--ink-3); padding: 0 4px; }
.bubble-img { padding: 5px; }
.msg-img { max-width: 230px; max-height: 300px; border-radius: 11px; display: block; cursor: zoom-in; }

/* dòng lịch hẹn (màn Lịch hẹn) */
.appt-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.appt-row:last-child { border-bottom: 0; }
.appt-time { font-family: var(--font-display); font-weight: 700; font-size: 15px; min-width: 46px; color: var(--accent-ink); flex: none; }
.bot-tag { font-size: 10px; font-weight: 700; color: var(--plum); background: #F3E6EE; padding: 1px 6px; border-radius: 5px; }

.chat-foot { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: 12px 16px; }
.quick-row { display: flex; gap: 7px; margin-bottom: 10px; flex-wrap: wrap; }
.quick-chip { height: 30px; padding: 0 11px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: all .15s; border: 1px solid var(--line); }
.quick-chip:hover { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; transform: translateY(-1px); }
.composer { display: flex; align-items: flex-end; gap: 10px; }
.composer-box { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; display: flex; align-items: center; gap: 10px; transition: border-color .2s, box-shadow .2s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.composer-box input { flex: 1; border: none; outline: none; background: none; font-size: 13.5px; }
.send-btn { width: 42px; height: 42px; border-radius: var(--r-md); background: linear-gradient(160deg, var(--accent), var(--accent-ink)); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px -6px var(--accent-glow); transition: transform .15s; }
.send-btn:hover { transform: translateY(-1px) scale(1.04); }

/* customer panel */
.cust-panel { border-left: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
.cust-hero { padding: 22px 18px 16px; text-align: center; border-bottom: 1px solid var(--line); position: relative; }
.cust-hero::before { content:""; position:absolute; top:0; left:0; right:0; height:70px; background: linear-gradient(180deg, var(--accent-soft), transparent); }
.cust-hero .av { margin: 0 auto 11px; position: relative; }
.cust-hero .nm { font-weight: 700; font-size: 16px; font-family: var(--font-display); }
.cust-hero .ph { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.cust-stats { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); }
.cust-stat { padding: 13px 8px; text-align: center; border-right: 1px solid var(--line); }
.cust-stat:last-child { border-right: none; }
.cust-stat .v { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.cust-stat .l { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
.panel-sec { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-sec h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; margin-bottom: 11px; display: flex; align-items: center; gap: 7px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.kv .k { color: var(--ink-3); }
.kv .v { font-weight: 600; text-align: right; }
.history-item { display: flex; gap: 11px; padding: 9px 0; }
.history-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; position: relative; }
.history-item .dot::after { content:""; position:absolute; top:12px; left:4px; bottom:-13px; width:1px; background: var(--line); }
.history-item:last-child .dot::after { display: none; }
.history-item .ttl { font-weight: 600; font-size: 13px; }
.history-item .meta { font-size: 11.5px; color: var(--ink-3); }

/* ============================================================
   Booking / Calendar board
   ============================================================ */
.board { display: grid; gap: 14px; }
.board-cols { display: grid; gap: 12px; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--surface-3); border-radius: var(--r-lg); border: 1px solid var(--line); min-height: 200px; }
.board-col-head { padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.board-col-head .av { width: 30px; height: 30px; }
.board-col-head .nm { font-weight: 600; font-size: 13.5px; }
.board-col-head .cnt { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.board-col-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.appt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 12px;
  border-left: 3px solid var(--accent); cursor: pointer; transition: all .18s; box-shadow: var(--sh-xs);
}
.appt:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.appt .t { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.appt .svc { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.appt .who { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12px; color: var(--ink-3); }

/* ============================================================
   Chatbot flow builder (Botcake-style)
   ============================================================ */
.flow-canvas {
  position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  min-height: 460px; overflow: hidden;
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}
.flow-node {
  position: absolute; width: 218px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-md); overflow: hidden; z-index: 2;
  transition: transform .2s, box-shadow .2s;
}
.flow-node:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.flow-node-head { padding: 9px 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12.5px; color: #fff; }
.flow-node-body { padding: 11px 12px; font-size: 12.5px; color: var(--ink-2); }
.flow-node .opt { display: flex; align-items: center; gap: 7px; padding: 6px 8px; background: var(--surface-3); border-radius: 8px; margin-top: 6px; font-size: 12px; font-weight: 500; }
.flow-pin { position: absolute; right: -7px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.flow-svg { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

/* automation cards */
.auto-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.auto-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.toggle { width: 42px; height: 24px; border-radius: 20px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.toggle::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition: transform .2s; box-shadow: var(--sh-sm); }
.toggle.on { background: var(--up); }
.toggle.on::after { transform: translateX(18px); }

/* ============================================================
   Segmented control / tabs
   ============================================================ */
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .18s; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 11px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); position: relative; transition: color .18s; }
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--accent-ink); }
.tab.active::after { content:""; position:absolute; left:14px; right:14px; bottom:-1px; height:2.5px; border-radius:3px; background: var(--accent); }

/* ============================================================
   Modal / drawer
   ============================================================ */
.modal-back { position: fixed; inset: 0; background: rgba(30,20,14,.5); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 24px; animation: fadeIn .2s var(--ease); }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-pop); width: 100%; max-width: 560px; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; animation: popIn .26s var(--ease-out); }
.modal-lg { max-width: 760px; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.close-x { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); transition: all .15s; }
.close-x:hover { background: var(--surface-3); color: var(--ink); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: var(--surface); }
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 80px; }

/* ============================================================
   Toast
   ============================================================ */
.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--ink-inv); padding: 13px 16px; border-radius: var(--r-md); box-shadow: var(--sh-pop); display: flex; align-items: center; gap: 11px; min-width: 260px; animation: toastIn .3s var(--ease-out); }
.toast .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.toast.ok .ti { background: rgba(31,157,107,.25); color: #6ee7b0; }
.toast .tt { font-weight: 600; font-size: 13.5px; }
.toast .td { font-size: 12px; color: rgba(251,246,239,.65); }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   Empty / misc
   ============================================================ */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .ei { width: 64px; height: 64px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 14px; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.b { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.pill-stat { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 20px; background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--ink-2); }

.progress-track { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.progress-track > span { display: block; height: 100%; border-radius: 8px; transition: width .8s var(--ease); }

/* breakdown row */
.bd-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.bd-row:last-child { border-bottom: none; }
.bd-row .bd-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.bd-row .bd-name { font-weight: 600; font-size: 13.5px; }
.bd-row .bd-sub { font-size: 11.5px; color: var(--ink-3); }
.bd-row .bd-val { margin-left: auto; text-align: right; }
.bd-row .bd-val .v { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.bd-row .bd-val .p { font-size: 11.5px; color: var(--ink-3); }

/* ============================================================
   Animations & view transitions
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawIn { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

.view-enter > * { animation: rise .5s var(--ease) backwards; }
.stagger > * { animation: rise .55s var(--ease) backwards; }
.stagger > *:nth-child(1){animation-delay:.02s} .stagger > *:nth-child(2){animation-delay:.06s}
.stagger > *:nth-child(3){animation-delay:.10s} .stagger > *:nth-child(4){animation-delay:.14s}
.stagger > *:nth-child(5){animation-delay:.18s} .stagger > *:nth-child(6){animation-delay:.22s}
.stagger > *:nth-child(7){animation-delay:.26s} .stagger > *:nth-child(8){animation-delay:.30s}

.area-path { animation: drawIn 1.1s var(--ease) forwards; }
.bar-grow { transform-box: fill-box; transform-origin: bottom; animation: barGrow .7s var(--ease) backwards; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes goldPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(184,146,74,.13), 0 7px 18px -6px var(--accent-glow-2); } 50% { box-shadow: 0 0 0 7px rgba(184,146,74,.05), 0 9px 22px -6px var(--accent-glow-2); } }
@keyframes sheenSweep { 0% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Hero chào mừng (ảnh chủ + lời chào) — đầu trang Tổng quan
   ============================================================ */
.hero-greet {
  display: flex; align-items: center; gap: 17px;
  background:
    radial-gradient(130% 160% at 0% 0%, rgba(184,146,74,.17), transparent 56%),
    linear-gradient(118deg, var(--accent-soft) 0%, var(--surface) 62%);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  padding: 17px 20px; box-shadow: var(--sh-sm); position: relative;
}
.hero-ava {
  width: 64px; height: 64px; border-radius: 50%; flex: none; overflow: hidden; position: relative; z-index: 1;
  border: 2.5px solid var(--accent); box-shadow: 0 0 0 4px rgba(184,146,74,.13), 0 7px 18px -6px var(--accent-glow-2);
}
.hero-ava > * { width: 64px; height: 64px; display: block; border-radius: 0 !important; }
.hero-ava img { object-fit: cover; }
.hero-txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-hi { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .01em; }
.hero-name { font-family: var(--font-display); font-weight: 800; font-size: 23px; letter-spacing: -.02em; line-height: 1.12; background: linear-gradient(118deg, #9C7A34 0%, #C6A050 50%, #7E5F22 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent-ink); }
.hero-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.date-pick {
  display: flex; align-items: center; gap: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 7px 11px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.date-pick input { border: none; background: transparent; font: inherit; color: var(--ink); outline: none; cursor: pointer; max-width: 130px; }

/* Dropdown chọn ngày có nút nhanh (Tổng quan) */
.rangepick { position: relative; }
.rangepick .date-pick { width: 100%; }
.range-pop { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-pop); padding: 10px; display: flex; gap: 10px; }
.range-pop[hidden] { display: none; }
.range-presets { display: grid; gap: 3px; align-content: start; }
.range-preset { display: block; text-align: left; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: pointer; font: inherit; }
.range-preset:hover { background: var(--surface-3); color: var(--ink); }
.range-preset.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.range-cal { border-left: 1px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.range-cal-lb { font-size: 11.5px; color: var(--ink-3); }
.range-cal input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; font: inherit; color: var(--ink); background: var(--surface); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .inbox { grid-template-columns: 300px 1fr; }
  .cust-panel { display: none; }
  .page-sub { display: none; }
}
@media (max-width: 900px) {
  :root { --sb-w: 0px; }
  .side { position: fixed; left: -280px; width: 256px; height: 100vh; transition: left .25s; z-index: 40; }
  .side.open { left: 0; box-shadow: var(--sh-pop); }
  .side-head { padding-right: 56px; }
  .side-close {
    display: grid; place-items: center; position: absolute; top: 14px; right: 12px; z-index: 3;
    width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,.08); color: var(--side-ink); border: 1px solid var(--side-line);
  }
  .side-close:hover { background: rgba(255,255,255,.16); color: #fff; }
  .side-backdrop {
    display: block; position: fixed; inset: 0; z-index: 30;
    background: rgba(15,12,8,.55); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  .side-backdrop.show { opacity: 1; visibility: visible; }
  .shell { grid-template-columns: 1fr; }
  .search { display: none; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { display: none; }
  /* gom 2 thẻ cạnh nhau thành cột dọc cho điện thoại */
  .dash-cols { flex-direction: column; }
  .dash-cols > .card { flex: 1 1 auto !important; width: 100%; }
  /* khoá lưới theo bề ngang màn — chặn thẻ con tràn ra ngoài (min-width:auto) */
  .grid.stagger { grid-template-columns: minmax(0, 1fr); }
  .grid.stagger > * { min-width: 0; }
}
@media (max-width: 640px) {
  .view-pad { padding: 12px; }
  .grid.stagger { gap: 12px !important; }
  /* ô số xếp 2 cột cho liền mạch, đỡ khoảng trống dọc */
  .mom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mom-stat { padding: 12px 12px 12px 14px; }
  /* ô lẻ cuối (vd card 3 ô) chiếm trọn hàng — không chừa trống nửa bên */
  .mom-grid > .mom-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mom-val { font-size: 21px; margin-top: 7px; }
  .mom-label { font-size: 11.5px; }
  .mom-foot { margin-top: 7px; font-size: 11px; }
  /* dọn gọn thanh trên cùng */
  .topbar { gap: 10px; padding: 0 13px; }
  .topbar > .tb-title { flex: 1; max-width: none; }
  .top-spacer, .date-pill { display: none; }
  .top-actions .pill-stat { display: none; }
  .top-actions [data-act="quick-add"] span { display: none; }
  .top-actions [data-act="quick-add"] { padding: 0; width: 34px; }
  .page-title { font-size: 17px; }
  .top-actions { gap: 6px; }
  /* KPI gọn lại, bớt khoảng trống */
  .kpi-grid { gap: 10px; }
  .kpi { padding: 13px; border-radius: var(--r-md); }
  .kpi::after { width: 80px; height: 80px; right: -24px; top: -24px; }
  .kpi-top { gap: 8px; }
  .kpi-ico { width: 32px; height: 32px; }
  .kpi-ico svg { width: 17px; height: 17px; }
  .kpi-label { font-size: 11.5px; }
  .kpi-val { font-size: 22px; margin-top: 9px; }
  .kpi-foot { margin-top: 8px; font-size: 11.5px; }
  .card-head { padding: 13px 14px; }
  .card-head h3 { font-size: 14.5px; }
  .card-pad { padding: 14px; }
  /* hero gọn cho điện thoại — avatar anh TO & nổi, luôn ở trên cùng */
  .hero-greet { flex-wrap: wrap; gap: 12px 14px; padding: 15px 16px; }
  .hero-ava {
    width: 72px; height: 72px; border-width: 3px;
    box-shadow: 0 0 0 5px rgba(184,146,74,.16), 0 9px 22px -7px var(--accent-glow-2);
  }
  .hero-ava > * { width: 72px; height: 72px; }
  .hero-name { font-size: 21px; }
  .hero-sub { white-space: normal; }
  .hero-actions { width: 100%; flex-wrap: wrap; }
  .hero-actions .rangepick { flex: 1 1 130px; min-width: 0; }
  .hero-actions .rangepick .date-pick { width: 100%; justify-content: center; }
  .hero-actions .btn { flex: 1 1 130px; min-width: 0; }
  .range-pop { right: auto; left: 0; flex-direction: column; min-width: 200px; }
  .range-cal { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 8px; }
  .range-presets { grid-template-columns: 1fr 1fr; }
}

.menu-toggle { display: none; }
@media (max-width: 900px) { .menu-toggle { display: grid; } }
