/* ==========================================================================
   MNCloude brand theme.
   Brand colours from the MNCloude logo: navy #30308A, lime green #8DC22C, red #E11619.
   Navy carries structure (bars, panels), green carries action (buttons, active items),
   red is kept for alerts and small accents. Display: Bahnschrift. Body: Segoe UI. Offline.
   ========================================================================== */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --brand-navy: #30308A;
  --brand-green: #8DC22C;
  --brand-red: #E11619;

  --ink: #EEF1FF;
  --ink-2: rgba(226, 231, 255, .74);
  --ink-3: rgba(226, 231, 255, .46);
  --accent: #B4E05C;
  --link: #B4E05C;
  --line: rgba(196, 205, 255, .12);
  --line-2: rgba(196, 205, 255, .22);
  --hover: rgba(196, 205, 255, .07);
  --inset: rgba(6, 8, 30, .55);
  --inset-2: rgba(6, 8, 30, .32);
  --surface: linear-gradient(180deg, rgba(48, 48, 138, .5), rgba(20, 21, 72, .78));
  --surface-solid: #191B5A;
  --side-bg: linear-gradient(180deg, rgba(22, 23, 80, .95), rgba(11, 12, 44, .98));
  --shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 24px 48px -28px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-pop: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .08) inset;
  --page-bg:
    radial-gradient(1100px 520px at 82% 112%, rgba(141, 194, 44, .14), transparent 62%),
    radial-gradient(900px 640px at -10% -10%, rgba(76, 80, 214, .22), transparent 60%),
    radial-gradient(600px 420px at 108% 6%, rgba(225, 22, 25, .06), transparent 60%),
    linear-gradient(180deg, #0A0B2C 0%, #10123F 58%, #121445 100%);
  --star-opacity: .5;

  --gold: #8DC22C;
  --emerald: #3FC79A;
  --sky: #8C95FF;
  --rose: #F08FB5;
  --ember: #F0503A;
  --violet: #B58CF5;
  --ok-ink: #9BE07A; --ok-bg: rgba(141, 194, 44, .16);
  --info-ink: #B3BAFF; --info-bg: rgba(108, 116, 255, .17);
  --warn-ink: #F5CF6B; --warn-bg: rgba(240, 180, 40, .15);
  --bad-ink: #FF8C80; --bad-bg: rgba(225, 22, 25, .18);
  --muted-bg: rgba(196, 205, 255, .09);

  --grad-gold: linear-gradient(120deg, #B9E35F 0%, #8DC22C 52%, #6AA318 100%);
  --grad-aurora: linear-gradient(120deg, #4C51D6 0%, #30308A 55%, #22236E 100%);
  --grad-bar: linear-gradient(100deg, #1B1C63 0%, #30308A 52%, #24267A 100%);
  --grad-text: linear-gradient(95deg, #FFFFFF 0%, #D6F09E 45%, #8DC22C 100%);
  --grad-line: linear-gradient(90deg, #8DC22C 0%, #8DC22C 30%, #4C51D6 72%, #E11619 100%);
  --on-gold: #12143F;

  --hero-bg: linear-gradient(180deg, #0B0C32 0%, #1D1F6B 55%, #26357A 100%);
  --hero-ink: #F2F4FF;
  --hero-ink-2: rgba(232, 236, 255, .78);
  --hero-glass: rgba(14, 16, 58, .45);
  --sc-glow1: #8DC22C; --sc-glow2: #30308A;
  --sc-far1: #23266E; --sc-far2: #181A55;
  --sc-near1: #1B1D5C; --sc-near2: #0D0E34;
  --sc-city1: #121446; --sc-city2: #090A2A;
  --sc-star: #EEF1FF; --sc-moon: #E4F5C2; --sc-win: #B4E05C; --sc-clock: #1A1C5E;

  --chart-grid: rgba(196, 205, 255, .09);
  --chart-text: rgba(226, 231, 255, .52);
  --chart-track: rgba(6, 8, 30, .6);

  --r-xl: 26px; --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --side: 264px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --ink: #15174A;
  --ink-2: #4A4E85;
  --ink-3: #8A8DB2;
  --accent: #30308A;
  --link: #2E31A8;
  --line: rgba(48, 48, 138, .11);
  --line-2: rgba(48, 48, 138, .2);
  --hover: rgba(141, 194, 44, .1);
  --inset: rgba(255, 255, 255, .9);
  --inset-2: rgba(48, 48, 138, .04);
  --surface: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(255, 255, 255, .88));
  --surface-solid: #FFFFFF;
  --side-bg: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(243, 246, 252, .97));
  --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 22px 44px -30px rgba(30, 32, 110, .4), 0 2px 6px rgba(30, 32, 110, .07);
  --shadow-pop: 0 40px 90px -30px rgba(30, 32, 110, .45), 0 1px 0 #fff inset;
  --page-bg:
    radial-gradient(1000px 520px at 88% 110%, rgba(141, 194, 44, .16), transparent 62%),
    radial-gradient(900px 600px at -10% -10%, rgba(48, 48, 138, .11), transparent 60%),
    linear-gradient(180deg, #F3F5FC 0%, #F7F8FC 55%, #F5F9EE 100%);
  --star-opacity: 0;

  --gold: #7AAE1F;
  --emerald: #13906F;
  --sky: #3B42C4;
  --rose: #C9487E;
  --ember: #D3221E;
  --violet: #7A4DC9;
  --ok-ink: #3F7410; --ok-bg: rgba(141, 194, 44, .17);
  --info-ink: #2E31A8; --info-bg: rgba(48, 48, 138, .1);
  --warn-ink: #8A5508; --warn-bg: rgba(230, 160, 30, .16);
  --bad-ink: #B3120F; --bad-bg: rgba(225, 22, 25, .1);
  --muted-bg: rgba(48, 48, 138, .06);

  --grad-text: linear-gradient(95deg, #1E1F6B 0%, #30308A 50%, #5E9A14 100%);

  --hero-bg: linear-gradient(180deg, #4A50C8 0%, #8C93E3 40%, #D9E1F6 78%, #EEF4E1 100%);
  --hero-ink: #12143F;
  --hero-ink-2: rgba(18, 20, 63, .78);
  --hero-glass: rgba(255, 255, 255, .6);
  --sc-glow1: #D7F09F; --sc-glow2: #8C93E3;
  --sc-far1: #BFD99A; --sc-far2: #A5C77A;
  --sc-near1: #8DB65A; --sc-near2: #6A9A35;
  --sc-city1: #30308A; --sc-city2: #20226B;
  --sc-star: #FFFFFF; --sc-moon: #FFFFFF; --sc-win: #D7F09F; --sc-clock: #30308A;

  --chart-grid: rgba(48, 48, 138, .09);
  --chart-text: rgba(21, 23, 74, .52);
  --chart-track: rgba(48, 48, 138, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.55 var(--text); background: var(--page-bg); background-attachment: fixed; transition: color .3s; }
.sky {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--star-opacity); transition: opacity .4s;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 33% 8%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 58% 22%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 76% 12%, #fff5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 90% 30%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 22% 42%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 48%, #fff4 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { to { filter: brightness(1.6); } }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .005em; margin: 0; line-height: 1.2; }
p { margin: 0 0 .6em; }
code { font-size: .9em; background: var(--inset-2); padding: 1px 6px; border-radius: 5px; }
small { font-size: .82em; }
kbd { font: 600 11px var(--text); padding: 2px 6px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .7); }
.muted { color: var(--ink-2); }
.fine { color: var(--ink-3); font-size: 12.5px; margin: .5rem 0 0; }
.block { display: block; }
.strong { font-weight: 600; }
.upper { text-transform: uppercase; }
.pos { color: var(--emerald); }
.neg { color: var(--ember); }
.gold { color: var(--accent); }
.warn { color: var(--warn-ink); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ic { width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------- app layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; background: var(--side-bg); border-right: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 20px; height: 72px; color: var(--ink); text-decoration: none !important; background: var(--grad-bar); }
.brand-mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 6px 14px rgba(141, 194, 44, .45)); transition: transform .6s var(--spring); }
.brand:hover .brand-mark { transform: rotate(-18deg) scale(1.08); }
.brand-text { color: #F2F4FF; }
.brand-text strong { display: block; font-family: var(--display); font-size: 15px; line-height: 1.2; }
.brand-text small { color: rgba(242, 244, 255, .62); }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; }
.nav-group { margin: 16px 10px 6px; font-size: 12px; color: var(--ink-3); }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--ink-2); text-decoration: none !important; position: relative; transition: background .2s, color .2s, transform .25s var(--ease); }
.nav-link:hover { background: var(--hover); color: var(--ink); transform: translateX(3px); }
.nav-link .ic { transition: transform .35s var(--spring); }
.nav-link:hover .ic { transform: scale(1.15); }
.nav-link.is-active { color: var(--on-gold); font-weight: 600; background: var(--grad-gold); background-size: 160% 100%; box-shadow: 0 10px 22px -10px rgba(141, 194, 44, .6), 0 1px 0 rgba(255, 255, 255, .5) inset; animation: pill-in .5s var(--ease) both; }
@keyframes pill-in { from { transform: scaleX(.6); opacity: 0; } }
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; text-align: center; background: var(--grad-aurora); color: #fff; animation: badge-pulse 2.4s ease-in-out infinite; }
@keyframes badge-pulse { 50% { box-shadow: 0 0 0 5px rgba(225, 22, 25, 0), 0 0 14px rgba(225, 22, 25, .6); } }
.nav-link.is-active .nav-badge { background: var(--on-gold); color: #B9E35F; animation: none; }
.side-card { margin: 10px 12px 14px; padding: 12px 14px; border-radius: 14px; background: var(--inset-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.side-card a { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.side-card .ic { width: 15px; height: 15px; }
.main { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ------------------------------------------------------------- app bar */
.appbar { position: sticky; top: 0; z-index: 25; height: 72px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--grad-bar); background-size: 200% 100%; animation: bar-flow 18s ease-in-out infinite alternate; box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .7); color: #F2F4FF; }
@keyframes bar-flow { to { background-position: 100% 0; } }
.appbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad-line); opacity: .8; }
.search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 13px; color: rgba(242, 244, 255, .62); pointer-events: none; }
.search input { height: 42px; padding: 0 52px 0 40px; border-radius: 12px; color: #F2F4FF; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); transition: background .2s, border-color .2s, box-shadow .2s; }
.search input::placeholder { color: rgba(242, 244, 255, .58); }
.search input:focus { background: rgba(255, 255, 255, .14); border-color: rgba(141, 194, 44, .7); box-shadow: 0 0 0 4px rgba(141, 194, 44, .18); }
.search kbd { position: absolute; right: 12px; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bar-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); color: #F2F4FF; cursor: pointer; transition: background .2s, transform .3s var(--spring); }
.bar-btn:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.theme-toggle .ic { transition: transform .6s var(--spring), opacity .3s; }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .t-sun, .theme-toggle .t-moon { position: absolute; }
[data-theme="dark"] .theme-toggle .t-sun { transform: translateY(26px) rotate(90deg); opacity: 0; }
[data-theme="light"] .theme-toggle .t-moon { transform: translateY(-26px) rotate(-90deg); opacity: 0; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 46px; padding: 4px 12px 4px 5px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08); color: #F2F4FF; cursor: pointer; font: inherit; transition: background .2s; }
.user-chip:hover { background: rgba(255, 255, 255, .15); }
.user-chip .ic { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.user-chip[aria-expanded="true"] .ic { transform: rotate(180deg); }
.user-chip-text { text-align: left; line-height: 1.15; font-size: 13.5px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { display: block; font-weight: 400; color: rgba(242, 244, 255, .64); }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #fff; background: var(--grad-aurora); box-shadow: 0 6px 14px -6px rgba(48, 48, 138, .8); flex: none; }
.btn-logout { height: 44px; color: #fff !important; background: var(--grad-aurora); background-size: 180% 100%; border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 12px 24px -12px rgba(48, 48, 138, .9); }
.btn-logout:hover { background-position: 100% 0; }

/* dropdowns and menus (animated) */
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; padding: 8px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); z-index: 40; color: var(--ink);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.96); transform-origin: top right; transition: opacity .2s, transform .35s var(--spring), visibility 0s .35s; }
.dropdown.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .35s var(--spring); }
.dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-head strong { display: block; }
.dropdown-head small { color: var(--ink-3); }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--ink); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; text-decoration: none; transition: background .15s, padding-left .2s var(--ease); }
.dropdown a:hover, .dropdown button:hover { background: var(--hover); padding-left: 16px; }
.dropdown .ic { color: var(--ink-2); }
.dropdown .danger-link { color: var(--bad-ink); }
.dropdown .danger-link .ic { color: var(--bad-ink); }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* page header (title + actions) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 32px 6px; position: relative; z-index: 2; }
.crumb { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.page-title { font-size: clamp(24px, 2.4vw, 32px); }
.sub { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions form { margin: 0; }
.menu-btn { display: none !important; }
.content { padding: 18px 32px 40px; flex: 1; }
.foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 16px 32px; color: var(--ink-3); font-size: 12.5px; border-top: 1px solid var(--line); }
.scrim { display: none; }

/* --------------------------------------------------- entry animations */
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.anim { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.page-head { animation: rise .5s var(--ease) both; }
body.leaving .content, body.leaving .page-head { opacity: 0; transform: translateY(-8px); transition: opacity .18s, transform .18s; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; background: var(--grad-line); box-shadow: 0 0 12px rgba(141, 194, 44, .65); transition: width .4s var(--ease), opacity .3s; }
.progress.run { width: 70%; transition: width 4s cubic-bezier(.1, .7, .2, 1); }
.progress.done { width: 100%; opacity: 0; }

/* ------------------------------------------------------------- surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; backdrop-filter: blur(10px); position: relative; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.pad { padding: 16px 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel.flush > .panel-head { margin: 0; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16.5px; }
.panel-head a { font-size: 13px; }
.panel-tools { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-tools input { max-width: 320px; }
.note { color: var(--ink-2); font-size: 13.5px; border-left: 3px solid var(--gold); padding: 6px 12px; background: var(--warn-bg); border-radius: 0 8px 8px 0; margin: 0 0 16px; }
.empty { color: var(--ink-2); text-align: center; padding: 26px 12px; margin: 0; }

/* -------------------------------------------------------------- buttons */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; font: 600 14px/1.2 var(--text); text-decoration: none !important; white-space: nowrap; transition: transform .3s var(--spring), box-shadow .25s, background-position .5s, background-color .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn .ic { width: 16px; height: 16px; transition: transform .4s var(--spring); }
.btn:hover .ic { transform: rotate(-8deg) scale(1.12); }
.btn-gold { color: var(--on-gold); background: var(--grad-gold); background-size: 180% 100%; box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 -2px 0 rgba(0, 0, 0, .14) inset, 0 12px 24px -12px rgba(141, 194, 44, .7); }
.btn-gold:hover { background-position: 100% 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 -2px 0 rgba(0, 0, 0, .14) inset, 0 18px 30px -12px rgba(141, 194, 44, .85); }
.btn-gold::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); }
.btn-gold:hover::after { animation: shine .8s var(--ease); }
@keyframes shine { to { left: 130%; } }
.btn-glass { color: var(--ink); background: var(--hover); border-color: var(--line-2); }
.btn-glass:hover { background: var(--muted-bg); border-color: var(--gold); }
.btn-ghost { color: var(--ink-2); background: transparent; border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn-danger { color: #fff; background: linear-gradient(120deg, #F24A3E, #E11619 55%, #A80F12); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, .45); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--hover); color: var(--ink); cursor: pointer; flex: none; transition: background .2s, color .2s, transform .3s var(--spring); }
.icon-btn:hover { background: var(--muted-bg); transform: scale(1.08); }
.icon-btn.danger:hover { color: var(--ember); border-color: var(--ember); transform: rotate(90deg); }
.icon-btn.ok { color: var(--emerald); }
.icon-btn.ok:hover { background: var(--ok-bg); }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--muted-bg); color: var(--ink-2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip-approved, .chip-issued, .chip-confirmed, .chip-active { color: var(--ok-ink); background: var(--ok-bg); }
.chip-unapproved, .chip-pending, .chip-on-leave { color: var(--warn-ink); background: var(--warn-bg); }
.chip-pending::before, .chip-unapproved::before { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.chip-applied, .chip-completed { color: var(--info-ink); background: var(--info-bg); }
.chip-rejected, .chip-cancelled, .chip-left { color: var(--bad-ink); background: var(--bad-bg); }

/* ------------------------------------------------------- toasts, alerts */
.toasts { position: fixed; top: 86px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { position: relative; overflow: hidden; display: flex; gap: 12px; align-items: flex-start; padding: 13px 40px 13px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); font-size: 14px; color: var(--ink); animation: toast-in .55s var(--spring) both; }
.toast.out { animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(60px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(60px); } }
.toast-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; background: var(--grad-aurora); }
.toast-ok .toast-ic { background: var(--grad-gold); color: #12143F; }
.toast-error .toast-ic { background: linear-gradient(120deg, #FF6A5C, #E11619); }
.toast-ic .ic { width: 16px; height: 16px; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--grad-line); transform-origin: left; animation: toast-timer var(--life, 5s) linear forwards; }
@keyframes toast-timer { to { transform: scaleX(0); } }
.toast-x { position: absolute; right: 8px; top: 9px; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 4px; display: grid; }
.alert { position: relative; margin: 0 0 16px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--hover); font-size: 14px; }
.alert-ok { border-color: rgba(51, 179, 142, .5); background: var(--ok-bg); }
.alert-error { border-color: rgba(226, 108, 80, .55); background: var(--bad-bg); }
.alert-warn { border-color: rgba(240, 180, 40, .55); background: var(--warn-bg); }

/* --------------------------------------------------------------- modals */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; visibility: hidden; pointer-events: none; }
.modal.open { visibility: visible; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 9, 26, .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.modal.open .modal-backdrop { opacity: 1; }
.modal-card { position: relative; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 26px; border-radius: 24px; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(30px) scale(.92) rotateX(8deg); transform-origin: 50% 100%; transition: opacity .25s, transform .5s var(--spring); }
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad-line); }
.modal-card.sm { width: min(430px, 100%); }
.modal-card h2 { font-size: 22px; margin-bottom: 4px; }
.modal-x { position: absolute; right: 14px; top: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.quick { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--inset-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: transform .35s var(--spring), border-color .2s, box-shadow .3s; opacity: 0; transform: translateY(14px) scale(.95); }
.modal.open .quick { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 40ms + 80ms); }
.modal.open .quick:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 18px 30px -18px rgba(141, 194, 44, .65); transition-delay: 0s; }
.quick-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--grad-aurora); }
.quick:nth-child(3n+1) .quick-ic { background: var(--grad-gold); color: var(--on-gold); }
.quick:nth-child(3n+2) .quick-ic { background: linear-gradient(120deg, #1EA59A, #30308A); }
.quick b { font-family: var(--display); font-size: 15px; }
.quick span { font-size: 12.5px; color: var(--ink-2); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; transition: color .2s; }
.field:focus-within > span { color: var(--accent); }
.field small { color: var(--ink-3); font-size: 12px; }
.req { font-style: normal; font-weight: 400; color: var(--accent); font-size: 11px; margin-left: 4px; }
input, select, textarea { width: 100%; font: 14px/1.4 var(--text); color: var(--ink); background: var(--inset); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; transition: border-color .2s, box-shadow .25s, background .2s; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(141, 194, 44, .25); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--gold); padding: 0; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select option, select optgroup { background: var(--surface-solid); color: var(--ink); }
textarea { resize: vertical; }
.big-input { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 18px; }
.filters .field { flex: 0 1 170px; }
.filters .field.grow { flex: 1 1 260px; }
.filter-btns { display: flex; gap: 8px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.visa-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.visa-form select { width: 128px; padding: 6px 8px; }
.visa-form input { width: 110px; padding: 6px 8px; }
.visa-form input[type="date"], .visa-form input[type="month"] { width: 140px; }
.w-xs { width: 90px !important; }
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.bulk-bar select { width: auto; }
.new-customer { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 12px; animation: rise .4s var(--ease); }
.prows, [data-rows] { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.prow, .jrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; border-radius: 14px; background: var(--inset-2); border: 1px solid var(--line); position: relative; animation: row-in .45s var(--spring) both; }
.prow::before, .jrow::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--grad-line); }
.prow.removing, .jrow.removing { animation: row-out .3s var(--ease) forwards; }
@keyframes row-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes row-out { to { opacity: 0; transform: translateX(30px) scale(.96); height: 0; padding: 0; margin: 0; } }
.prow .w-name { flex: 2 1 240px; } .prow .w-sm { flex: 0 1 110px; }
.prow .w-md, .jrow .w-md { flex: 1 1 140px; }
.jrow .w-acc { flex: 2 1 280px; } .jrow .w-memo { flex: 2 1 200px; }
.counts { margin: 0; font-size: 13px; color: var(--ink-2); }
.counts b { color: var(--accent); font-family: var(--display); }
.counts .bad { color: var(--ember); }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 11px 14px; background: var(--inset-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; transition: background .15s; }
.table tbody tr { animation: fade .5s var(--ease) both; }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.table tfoot td { font-weight: 700; font-family: var(--display); background: var(--warn-bg); border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table td input, .table td select { padding: 6px 8px; }
.table.compact td { padding: 8px 4px; }
.table.compact tr:last-child td { border-bottom: 0; }
.table td > a { white-space: nowrap; }
.row-muted td { color: var(--ink-2); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions a + a { margin-left: 12px; }
.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; padding: 4px; border-radius: 13px; background: var(--inset-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.tab { padding: 7px 14px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none !important; transition: color .2s, background .2s; }
.tab:hover { color: var(--ink); background: var(--hover); }
.tab.is-active { background: var(--grad-gold); color: var(--on-gold); box-shadow: 0 8px 18px -10px rgba(141, 194, 44, .65); }
.sum-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 0 4px 14px; color: var(--ink-2); font-size: 14px; }
.sum-row b { color: var(--ink); font-family: var(--display); font-size: 16px; margin-left: 4px; }

/* --------------------------------------------------- hero (3D scene) */
.hero { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 290px; margin-bottom: 20px; border: 1px solid var(--line-2); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .1) inset; background: var(--hero-bg); transform-style: preserve-3d; transition: transform .6s var(--ease), background .5s; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 240px at var(--mx, 70%) var(--my, 30%), rgba(255, 255, 255, .1), transparent 70%); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .layer { transition: transform .6s var(--ease); will-change: transform; }
.scene .twinkle circle { animation: star 3s ease-in-out infinite alternate; }
.scene .twinkle circle:nth-child(3n) { animation-delay: -1s; }
.scene .twinkle circle:nth-child(4n) { animation-delay: -2s; animation-duration: 4s; }
@keyframes star { to { opacity: .1; } }
.scene .moon { animation: moon-float 7s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
@keyframes moon-float { to { transform: translateY(-6px); } }
.scene .windows rect { animation: window 4s ease-in-out infinite alternate; }
.scene .windows rect:nth-child(odd) { animation-delay: -2s; }
@keyframes window { to { opacity: .2; } }
.hero-copy { position: relative; z-index: 2; padding: 34px 38px; max-width: 640px; color: var(--hero-ink); }
.hero-date { color: var(--hero-ink-2); font-size: 13.5px; margin-bottom: 8px; font-weight: 600; }
.hero h2 { font-size: clamp(28px, 3.6vw, 46px); font-weight: 600; letter-spacing: -.01em; }
[data-theme="dark"] .hero h2 { filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .5)); }
.hero-line { color: var(--hero-ink-2); margin: 10px 0 20px; max-width: 52ch; font-size: 15.5px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-glass { color: var(--hero-ink); backdrop-filter: blur(8px); background: var(--hero-glass); border-color: rgba(255, 255, 255, .25); }
.hero-copy > * { animation: rise .8s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .16s; } .hero-copy > :nth-child(4) { animation-delay: .24s; }

.money-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); position: relative; }
.money-strip::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad-line); }
.money { padding: 18px 18px 16px; border-right: 1px solid var(--line); transition: background .25s; position: relative; }
.money:hover { background: var(--hover); }
.money:last-child { border-right: 0; }
.money span { display: block; font-size: 12.5px; color: var(--ink-2); }
.money strong { display: block; margin-top: 4px; font-family: var(--display); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.dash-grid > .panel { margin: 0; transition: transform .4s var(--ease), box-shadow .4s; }
.dash-grid > .panel:hover { transform: translateY(-3px); }
.span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
.dash-grid .span-4 { grid-column: span 4; }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--surface-solid); border: 1px solid var(--line-2); font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -115%); box-shadow: var(--shadow-pop); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend i, .legend-list i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { position: relative; width: 190px; height: 190px; margin: 4px auto 10px; }
.donut { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-family: var(--display); font-size: 32px; line-height: 1; }
.donut-center span { font-size: 12px; color: var(--ink-2); }
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13.5px; color: var(--ink-2); }
.legend-list b { float: right; color: var(--ink); font-family: var(--display); }
.split { display: flex; flex-direction: column; gap: 12px; }
.split-row { display: grid; grid-template-columns: 74px 1fr 46px; gap: 12px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.split-row b { text-align: right; font-family: var(--display); color: var(--ink); font-size: 16px; }
.bar { height: 10px; border-radius: 99px; background: var(--chart-track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow 1.1s var(--ease) both .3s; background-image: linear-gradient(90deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .35)); }
@keyframes grow { from { transform: scaleX(0); } }
.status-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.status-tile { padding: 14px 12px; border-radius: 14px; background: var(--inset-2); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none !important; border-top: 3px solid var(--ink-3); transition: transform .35s var(--spring), background .2s; }
.status-tile b { display: block; font-family: var(--display); font-size: 26px; color: var(--ink); }
.status-tile:hover { background: var(--hover); transform: translateY(-4px) scale(1.02); }
.tile-pending { border-top-color: var(--gold); } .tile-confirmed { border-top-color: var(--emerald); }
.tile-completed { border-top-color: var(--sky); } .tile-cancelled { border-top-color: var(--ember); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li a { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; border-radius: 8px; transition: background .2s, padding-left .3s var(--ease); }
.timeline li a:hover { background: var(--hover); padding-left: 12px; }
.timeline li:last-child a { border-bottom: 0; }
.timeline time { font-family: var(--display); color: var(--accent); font-size: 13.5px; }
.tl-main small { display: block; color: var(--ink-3); }

.count-band { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin-bottom: 18px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); position: relative; }
.count-band::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad-line); }
.cb { padding: 15px 12px 13px; border-right: 1px solid var(--line); color: var(--ink-2); text-decoration: none !important; font-size: 12.5px; transition: background .2s; }
.cb:last-child { border-right: 0; }
.cb b { display: block; font-family: var(--display); font-size: 24px; color: var(--ink); transition: transform .35s var(--spring); }
.cb:hover { background: var(--hover); }
.cb:hover b { transform: scale(1.12); transform-origin: left; }
.cb-ok b { color: var(--ok-ink); } .cb-info b { color: var(--info-ink); } .cb-bad b { color: var(--bad-ink); }

/* --------------------------------------------------------------- detail */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 18px; }
.detail-grid > .panel { margin: 0; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; }
.money-dl dd { text-align: right; font-family: var(--display); font-size: 16px; font-variant-numeric: tabular-nums; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.mini-stats b { color: var(--ink); font-family: var(--display); font-size: 16px; margin-right: 3px; }
.voucher-sheet { position: relative; }
.vs-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.vs-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13.5px; color: var(--ink-2); }
.vs-meta strong { font-family: var(--display); font-size: 18px; color: var(--accent); }
.vs-party { font-size: 15px; }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; font-size: 13px; color: var(--ink-2); }
.signs span { border-top: 1px solid var(--line-2); padding-top: 8px; }
.stamp { position: absolute; top: 90px; right: 40px; transform: rotate(-12deg); font-family: var(--display); font-size: 28px; color: var(--ember); border: 3px solid var(--ember); padding: 2px 16px; border-radius: 8px; opacity: .65; pointer-events: none; animation: stamp .7s var(--spring) both .3s; }
@keyframes stamp { from { transform: rotate(-12deg) scale(2.2); opacity: 0; } }

.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.pkg { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .45s var(--ease), box-shadow .45s, border-color .2s; transform-style: preserve-3d; }
.pkg::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad-line); }
.pkg:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -30px rgba(141, 194, 44, .5), var(--shadow); }
.pkg.is-off { opacity: .55; }
.pkg header { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.pkg-cat { color: var(--accent); font-weight: 600; }
.pkg-online { display: inline-flex; gap: 5px; align-items: center; color: var(--ok-ink); }
.pkg-online .ic { width: 14px; height: 14px; }
.pkg h3 { font-size: 19px; }
.pkg-price b { font-family: var(--display); font-size: 24px; color: var(--ink); }
.pkg-price { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.pkg-hotels, .pkg-desc { font-size: 13px; color: var(--ink-2); }
.pkg footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 13px; }
.pkg-pick { cursor: pointer; }
.pkg-pick input { position: absolute; opacity: 0; pointer-events: none; }
.pkg-pick:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(141, 194, 44, .3), var(--shadow); transform: translateY(-4px); }
.pkg-select { margin-top: 10px; font-weight: 600; color: var(--accent); font-size: 13.5px; }
.pkg-pick:has(input:checked) .pkg-select::after { content: " (selected)"; }

.report-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list a { display: block; padding: 12px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; transition: background .2s, transform .3s var(--ease); }
.report-list a:hover { background: var(--hover); transform: translateX(6px); }
.report-list b { display: block; font-family: var(--display); font-weight: 600; font-size: 15.5px; color: var(--accent); }
.report-list span { font-size: 13.5px; color: var(--ink-2); }
.search-group { margin-bottom: 18px; }
.search-group h3 { font-size: 15px; margin: 0 0 10px; color: var(--ink-2); }
mark { background: var(--warn-bg); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------------------------------------------------------------- login */
.login-page, .public { position: relative; min-height: 100vh; }
.login-page .scene { position: fixed; inset: auto 0 0 0; height: 58vh; width: 100%; }
.login-page::before { content: ""; position: fixed; inset: 0; background: var(--hero-bg); opacity: .9; }
.login-wrap { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { position: relative; overflow: hidden; width: min(410px, 100%); padding: 34px 32px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); backdrop-filter: blur(16px); display: flex; flex-direction: column; gap: 14px; animation: card-in .9s var(--spring) both; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad-line); }
@keyframes card-in { from { opacity: 0; transform: translateY(40px) scale(.9) rotateX(12deg); } }
.login-moon { width: 44px; height: 44px; filter: drop-shadow(0 0 18px rgba(141, 194, 44, .5)); animation: moon-float 5s ease-in-out infinite alternate; }
.login-card h1 { font-size: 26px; }
.login-alt { text-align: center; font-size: 13.5px; }
.corner-toggle { position: fixed; top: 18px; right: 18px; z-index: 5; background: var(--grad-bar); }

/* --------------------------------------------------------------- public */
.pub-hero { position: relative; min-height: 380px; overflow: hidden; background: var(--hero-bg); border-bottom: 1px solid var(--line-2); }
.pub-hero-copy { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 32px 24px 110px; color: var(--hero-ink); }
.pub-hero-copy > * { animation: rise .8s var(--ease) both; }
.pub-hero-copy > :nth-child(2) { animation-delay: .1s; } .pub-hero-copy > :nth-child(3) { animation-delay: .2s; } .pub-hero-copy > :nth-child(4) { animation-delay: .3s; }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 36px; }
.pub-brand { font-family: var(--display); font-size: 18px; font-weight: 700; }
.pub-hero h1 { font-size: clamp(30px, 5vw, 56px); max-width: 16ch; letter-spacing: -.015em; }
.pub-hero-copy p { color: var(--hero-ink-2); max-width: 52ch; font-size: 16px; margin-top: 12px; }
.pub-nav { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.pub-nav a { padding: 8px 15px; border-radius: 11px; color: var(--hero-ink); background: var(--hero-glass); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(8px); font-size: 13.5px; font-weight: 600; transition: transform .3s var(--spring); }
.pub-nav a:hover { transform: translateY(-2px); text-decoration: none; }
.pub-main { position: relative; z-index: 1; max-width: 1100px; margin: -60px auto 0; padding: 0 24px 40px; }
.pub-section { margin-bottom: 28px; }
.pub-section > h2 { font-size: 22px; margin: 0 0 14px; }
.estimate { font-family: var(--display); font-size: 20px; margin: 10px 0 0; }
.pub-foot { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 22px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }
.done-card { text-align: center; }
.done-no { font-family: var(--display); font-size: 40px; letter-spacing: .02em; margin: 4px 0 12px; animation: stamp-pop .8s var(--spring) both .2s; }
@keyframes stamp-pop { from { transform: scale(.3); opacity: 0; } }
.public .bar-btn { background: var(--hero-glass); color: var(--hero-ink); border-color: rgba(255, 255, 255, .25); }

.print-head, .print-only { display: none; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .money-strip { grid-template-columns: repeat(3, 1fr); }
  .money:nth-child(3) { border-right: 0; }
  .money:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .count-band { grid-template-columns: repeat(5, 1fr); }
  .cb { border-bottom: 1px solid var(--line); }
  .span-8 { grid-column: 1 / -1; }
  .dash-grid .span-4 { grid-column: span 6; }
  .trend-summary { grid-template-columns: 1fr 1fr 1fr; }
  .user-chip-text { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--side); transform: translateX(-100%); transition: transform .4s var(--ease); box-shadow: var(--shadow-pop); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 15; animation: fade .3s; }
  .menu-btn { display: inline-grid !important; }
  .appbar { padding: 0 14px; gap: 8px; }
  .search kbd, .btn-logout span { display: none; }
  .btn-logout { padding: 0 12px; }
  .page-head, .content, .foot { padding-left: 16px; padding-right: 16px; }
  .span-6, .dash-grid .span-4 { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .span-3, .span-4, .form-grid .span-2 { grid-column: 1 / -1; }
  .hero-copy { padding: 26px 22px; }
}
@media (max-width: 600px) {
  .search { display: none; }
  .money-strip { grid-template-columns: 1fr 1fr; }
  .money { border-bottom: 1px solid var(--line); }
  .money:nth-child(odd) { border-right: 1px solid var(--line); }
  .money:nth-child(even) { border-right: 0; }
  .count-band { grid-template-columns: repeat(3, 1fr); }
  .status-tiles { grid-template-columns: 1fr 1fr; }
  .form-grid, .new-customer { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .timeline li a { grid-template-columns: 1fr auto; }
  .timeline time { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}


/* ===================================================== dashboard v3 */
.money { font: inherit; color: inherit; text-align: left; background: transparent; border: 0; border-right: 1px solid var(--line); cursor: pointer; width: 100%; display: flex; flex-direction: column; gap: 2px; }
.money .money-top { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.money .m-ic { display: grid; }
.money strong { margin-top: 4px; transition: transform .35s var(--spring); transform-origin: left; }
.money:hover strong { transform: scale(1.06); }
.money-more { font-size: 12px; font-weight: 600; color: var(--accent); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .3s var(--ease); }
.money:hover .money-more, .money:focus-visible .money-more { opacity: 1; transform: none; }
.money:hover .m-ic { transform: rotate(-8deg) scale(1.1); }
.m-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; color: #fff; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .35) inset; transition: transform .4s var(--spring); }
.m-ic .ic { width: 16px; height: 16px; }
.m-ic.lg { width: 52px; height: 52px; border-radius: 15px; }
.m-ic.lg .ic { width: 26px; height: 26px; }
.t-gold { background: linear-gradient(135deg, #C3E874, #8DC22C 55%, #5E9A14); color: #12143F; }
.t-emerald { background: linear-gradient(135deg, #6E74F2, #30308A 60%, #1E1F66); }
.t-violet { background: linear-gradient(135deg, #F7C75A, #E9A21C 55%, #C77A0A); color: #241500; }
.t-sky { background: linear-gradient(135deg, #5FD3C9, #1EA59A 55%, #12757A); }
.t-rose { background: linear-gradient(135deg, #9FA6FF, #5A61E0 55%, #3B3FB0); }
.t-ember { background: linear-gradient(135deg, #FF7A6E, #E11619 55%, #A80F12); }

.status-tile { font: inherit; text-align: left; cursor: pointer; position: relative; }
.st-ic { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--hover); color: var(--ink-2); transition: transform .4s var(--spring); }
.st-ic .ic { width: 15px; height: 15px; }
.tile-pending .st-ic { color: var(--warn-ink); background: var(--warn-bg); }
.tile-confirmed .st-ic { color: var(--ok-ink); background: var(--ok-bg); }
.tile-completed .st-ic { color: var(--info-ink); background: var(--info-bg); }
.tile-cancelled .st-ic { color: var(--bad-ink); background: var(--bad-bg); }
.status-tile:hover .st-ic { transform: rotate(-12deg) scale(1.15); }

/* trend chart */
.trend-head { align-items: flex-start; }
.trend-range { margin: 2px 0 0; font-size: 13px; }
.chart-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--inset-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 600 13px var(--text); cursor: pointer; transition: color .2s, background .25s, transform .3s var(--spring); }
.seg button .ic { width: 15px; height: 15px; }
.seg button:hover { color: var(--ink); background: var(--hover); }
.seg button.is-on { background: var(--grad-gold); color: var(--on-gold); box-shadow: 0 8px 18px -10px rgba(141, 194, 44, .7); transform: scale(1.03); }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: var(--inset); border: 1px solid var(--line-2); position: relative; transition: background .3s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink-3); transition: transform .4s var(--spring), background .3s; }
.switch input:checked + .track { background: var(--grad-aurora); border-color: transparent; }
.switch input:checked + .track .thumb { transform: translateX(17px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.custom-range { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px; margin-bottom: 14px; border-radius: 14px; background: var(--inset-2); border: 1px dashed var(--line-2); animation: rise .45s var(--ease); }
.custom-range .field { width: 170px; }
.trend-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.ts-card { padding: 12px 14px; border-radius: 14px; background: var(--inset-2); border: 1px solid var(--line); position: relative; overflow: hidden; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.ts-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.ts-card span { display: block; font-size: 12.5px; color: var(--ink-2); }
.ts-card b { display: block; font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ts-card small { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.delta { font-weight: 700; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; }
.delta.up { color: var(--ok-ink); background: var(--ok-bg); }
.delta.down { color: var(--bad-ink); background: var(--bad-bg); }
.delta.flat { color: var(--ink-2); background: var(--muted-bg); }
.chart-box.tall { height: 340px; transition: opacity .3s; }
.trend.loading .chart-box, .trend.loading .trend-summary { opacity: .45; }
.chart-tip { min-width: 200px; padding: 10px 12px; border-radius: 12px; line-height: 1.5; transform: translate(14px, -50%); }
.chart-tip.left { transform: translate(calc(-100% - 14px), -50%); }
.chart-tip .tt-h { font-weight: 700; font-family: var(--display); margin-bottom: 4px; }
.chart-tip .tt-r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tip .tt-r i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.chart-tip .tt-r b { font-variant-numeric: tabular-nums; }
.chart-tip .tt-sub { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.legend-toggles { justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.legend-toggles button { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--inset-2); color: var(--ink); font: 600 12.5px var(--text); cursor: pointer; transition: opacity .2s, transform .3s var(--spring); }
.legend-toggles button:hover { transform: translateY(-2px); }
.legend-toggles button:not(.on) { opacity: .4; text-decoration: line-through; }
.legend-toggles i { width: 16px !important; height: 6px !important; border-radius: 3px; }
.legend-toggles i.dashed { background: none; border-top: 2px dashed var(--ink-2); height: 0 !important; }

/* drill-down popup */
.modal-card.wide { width: min(1000px, 100%); }
.dp-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-right: 40px; }
.dp-head h2 { font-size: 24px; margin: 0; }
.dp-head p { margin: 2px 0 0; }
.dp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dp-stat { padding: 12px 14px; border-radius: 14px; background: var(--inset-2); border: 1px solid var(--line); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
.dp-stat span { display: block; font-size: 12px; color: var(--ink-2); }
.dp-stat b { display: block; font-family: var(--display); font-size: 18px; margin-top: 2px; overflow-wrap: anywhere; }
.dp-sec { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dp-sec h3 { font-size: 15px; padding: 12px 14px; margin: 0; border-bottom: 1px solid var(--line); background: var(--inset-2); }
.dp-sec .table-wrap { max-height: 360px; overflow: auto; }
.skeleton { display: grid; gap: 12px; }
.skeleton i { display: block; height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--inset-2) 0%, var(--hover) 40%, var(--inset-2) 80%); background-size: 300% 100%; animation: shimmer 1.1s linear infinite; }
.skeleton i:first-child { height: 52px; width: 50%; }
@keyframes shimmer { to { background-position: -150% 0; } }
@media (max-width: 600px) { .trend-summary { grid-template-columns: 1fr; } .ts-card b { font-size: 20px; } .chart-box.tall { height: 280px; } }


/* ===================================================== MNCloude platform */
.brand-logo { width: 40px; height: 40px; border-radius: 11px; object-fit: contain; background: #fff; padding: 3px; flex: none; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .6); }
.brand.is-platform { height: auto; padding: 16px 18px; justify-content: center; }
.mnc-badge { display: block; width: 100%; max-width: 210px; border-radius: 14px; background: #fff; padding: 8px 12px; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .7); }
.mnc-badge img { display: block; width: 100%; height: auto; }
.powered { margin: 0 16px 14px; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.powered img { height: 22px; width: auto; border-radius: 5px; background: #fff; padding: 2px 4px; }
.branch-switch, .branch-pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #F2F4FF; margin: 0; }
.branch-pill { padding-right: 14px; font-size: 13.5px; font-weight: 600; }
.branch-switch .ic, .branch-pill .ic { width: 16px; height: 16px; color: #B9E35F; }
.branch-switch select { width: auto; max-width: 180px; height: 32px; padding: 0 8px; background: rgba(6, 8, 30, .35); border-color: rgba(255, 255, 255, .14); color: #F2F4FF; font-weight: 600; }
.branch-grid { margin-bottom: 18px; }
.branch-grid .pkg footer { align-items: center; gap: 8px; }
.branch-grid .pkg footer form { margin: 0; }
.branch-dl { grid-template-columns: 1fr auto; margin-top: 8px; font-size: 13.5px; }
.branch-dl dd { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; }
.form-grid.two { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-preview { width: 64px; height: 64px; border-radius: 14px; object-fit: contain; background: #fff; padding: 4px; border: 1px solid var(--line-2); }
.pub-brand { display: inline-flex; align-items: center; gap: 12px; }
.pub-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: contain; background: #fff; padding: 3px; }
.modal-card .field + .field { margin-top: 12px; }
.table td input[name="name"] { min-width: 230px; }
.modal-card > .check { margin-top: 14px; }

/* login: brand pitch + sign-in card */
.login-page::before { opacity: .96; }
.login-split { position: relative; z-index: 2; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px); gap: clamp(28px, 5vw, 80px); align-items: center; max-width: 1180px; margin: 0 auto; padding: 48px 28px; }
.login-pitch { color: var(--hero-ink); animation: rise .9s var(--ease) both; }
.pitch-logo { display: inline-block; background: #fff; border-radius: 18px; padding: 10px 18px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .7); margin-bottom: 26px; }
.pitch-logo img { display: block; height: 72px; width: auto; }
.login-pitch h1 { font-size: clamp(32px, 4.2vw, 54px); line-height: 1.08; letter-spacing: -.02em; max-width: 14ch; }
.pitch-line { color: var(--hero-ink-2); font-size: 16.5px; max-width: 46ch; margin: 16px 0 24px; }
.pitch-panel { max-width: 520px; padding: 16px 18px; border-radius: 18px; background: var(--hero-glass); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.pitch-panel-title { display: flex; justify-content: space-between; margin: 0 0 10px; font-weight: 700; font-size: 14px; }
.pitch-panel-title span { font-weight: 600; font-size: 12px; color: var(--hero-ink-2); }
.pitch-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px; }
.pitch-row i { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); position: relative; overflow: hidden; }
.pitch-row i::after { content: ""; position: absolute; inset: 0; width: var(--w); border-radius: 99px; background: var(--grad-line); transform-origin: left; animation: grow 1.4s var(--ease) both .4s; }
.pitch-row .chip { font-size: 11.5px; }
.pitch-feats { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 560px; }
.pitch-feats li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--hero-glass); border: 1px solid rgba(255, 255, 255, .16); color: var(--hero-ink); }
.pitch-feats .ic { width: 15px; height: 15px; color: var(--gold); }
.login-card h2 { font-size: 26px; }
.login-card .card-logo { align-self: center; background: #fff; border-radius: 14px; padding: 6px 14px; margin-bottom: 4px; }
.login-card .card-logo img { display: block; height: 52px; width: auto; }
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; padding: 28px 18px; }
  .login-pitch { text-align: left; }
  .pitch-panel, .pitch-feats { display: none; }
  .pitch-logo img { height: 54px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .branch-switch select { max-width: 110px; }
}

/* theme switch: circular reveal (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------------------------------------------------------------- print */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #111; font-size: 12px; }
  .sky, .sidebar, .appbar, .powered, .foot, .alert, .toasts, .modal, .filters, .bulk-bar, .tabs, .btn, .no-print, .hero, .form-actions, .icon-btn, .panel-tools, .scene, .page-actions, .progress { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .page-head { padding: 0 0 10px; }
  .anim, .page-head, .table tbody tr { animation: none !important; }
  .panel { background: none; border: 1px solid #ccc; box-shadow: none; backdrop-filter: none; break-inside: avoid; color: #111; }
  .panel::before { display: none; }
  .print-head { display: block; text-align: center; margin-bottom: 14px; }
  .print-head h2 { font-size: 20px; } .print-head h3 { font-size: 15px; margin-top: 6px; }
  .print-only { display: block; text-align: center; margin-top: 18px; }
  .table th { background: #f0f0f0; color: #111; position: static; }
  .table td, .table th { border-color: #ccc; color: #111; }
  .table tfoot td { background: #f7f7f7; }
  a { color: #111; }
  .chip { background: none; color: #111; padding: 0; } .chip::before { display: none; }
  .muted, .dl dt, .vs-meta, .signs, .crumb, .sub { color: #444; }
  .vs-meta strong, .gold, .pos, .neg, .page-title { color: #111; }
  .stamp { color: #c00; border-color: #c00; animation: none; }
}
