/* SmartStock — warehouse command center UI */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --navy-900: #071226; --navy-850: #0a1a33; --navy-800: #0f2447; --navy-700: #183461; --navy-500: #2f5698;
  --bg: #eef3fa; --bg-2: #f6f9fd; --card: #ffffff; --line: #e1e8f2; --line-2: #ecf1f7;
  --ink: #0e1a2e; --ink-2: #3b4b64; --muted: #66768f; --faint: #94a3b8;
  --primary: #2563eb; --primary-ink: #1d4ed8; --primary-soft: #e8f0fe;

  /* status (reserved, always paired with an icon + text) */
  --green: #129a52; --green-soft: #e6f6ed; --green-ink: #0b7a3f;
  --amber: #d68a00; --amber-soft: #fff4dc; --amber-ink: #925c00;
  --orange: #e5600f; --orange-soft: #ffece0;
  --red: #dc2c2c; --red-soft: #fdeaea; --red-ink: #b51f1f;
  --blue: #2a78d6; --blue-soft: #e7f0fc; --blue-ink: #1b5fb3;
  --violet: #6d4fd8; --violet-soft: #efebfd; --teal: #0e9f8e; --teal-soft: #e2f6f3; --indigo: #4552d6; --indigo-soft: #eceefd;
  --slate-soft: #eef2f7;
  /* categorical viz (validated reference palette, light) */
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a;

  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(15, 36, 71, .05), 0 1px 1px rgba(15, 36, 71, .03);
  --sh-2: 0 6px 24px -8px rgba(15, 36, 71, .18), 0 2px 6px -2px rgba(15, 36, 71, .08);
  --sh-3: 0 24px 60px -16px rgba(7, 18, 38, .35);
  --side-w: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); font-feature-settings: 'tnum' 1, 'cv11' 1; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(900px 400px at 85% -10%, rgba(42, 120, 214, .08), transparent 60%), radial-gradient(700px 300px at 20% 0%, rgba(18, 154, 82, .05), transparent 60%); z-index: 0; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.xs { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.center { text-align: center; }
.mb { margin-bottom: 12px; }
.grow { flex: 1; }
.req { color: var(--red); font-weight: 700; }
em { font-style: normal; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------- boot & login */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); position: relative; z-index: 1; }
.boot .logo { width: 48px; height: 48px; animation: pulse 1.4s ease-in-out infinite; }
.boot.error { color: var(--ink); text-align: center; padding: 24px; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.94); } }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; position: relative; z-index: 1; }
.login-art { background: linear-gradient(155deg, var(--navy-850), var(--navy-700) 60%, #1f4a8a); color: #dbe7fb; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .04); }
.login-art h2 { color: #fff; font-size: 34px; line-height: 1.15; max-width: 420px; }
.login-art p { max-width: 440px; color: #b9c9e6; font-size: 15px; }
.login-art ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-card { padding: 56px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.login-card h1 { font-size: 28px; }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.demo-box { margin-top: 24px; padding: 14px; border: 1px dashed #b7c7de; border-radius: var(--r); background: var(--bg-2); }
.demo-box > b { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.demo-accts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.demo-accts button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 12.5px; }
.demo-accts button:hover { border-color: var(--primary); }
.demo-accts span { display: block; color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: #fff; letter-spacing: -.02em; }
.brand .logo { width: 30px; height: 30px; }
.brand.lg { font-size: 22px; } .brand.lg .logo { width: 40px; height: 40px; }

/* ------------------------------------------------------------- sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: linear-gradient(180deg, var(--navy-850), var(--navy-900)); color: #b8c6de; display: flex; flex-direction: column; z-index: 40; border-right: 1px solid rgba(255, 255, 255, .04); }
.sidebar .brand { padding: 20px 20px 16px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #b8c6de; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(90deg, #2563eb, #2f6fe8); color: #fff; box-shadow: 0 6px 18px -6px rgba(37, 99, 235, .7); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; min-width: 20px; text-align: center; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); display: grid; gap: 10px; }
.side-mode { font-size: 12px; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 8px; }
.side-mode.demo { background: rgba(214, 138, 0, .14); color: #f6c766; }
.side-mode.live { background: rgba(18, 154, 82, .16); color: #6ee7a8; }
.side-user { display: flex; gap: 10px; align-items: center; padding: 6px; }
.side-user b { color: #fff; display: block; font-size: 13px; } .side-user span { font-size: 12px; }
.nav-scrim { display: none; }

/* ------------------------------------------------------------- main column & topbar */
.main-col { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(246, 249, 253, .86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.gsearch { position: relative; flex: 1; max-width: 520px; min-width: 0; }
.gsearch label { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); height: 40px; }
.gsearch label:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.gsearch input { border: 0 !important; box-shadow: none !important; outline: 0; flex: 1; background: transparent; min-width: 0; padding: 0; height: 38px; }
.gs-results { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); padding: 6px; max-height: 70vh; overflow: auto; }
.gs-results [data-hit] { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.gs-results [data-hit]:hover, .gs-results [data-hit].active { background: var(--bg-2); }
.gs-name { flex: 1; min-width: 0; } .gs-name small { display: block; color: var(--muted); font-size: 12px; }
.gs-qty { font-weight: 700; font-size: 13px; white-space: nowrap; }
.gs-all { display: flex; justify-content: center; gap: 4px; padding: 8px; font-weight: 600; border-top: 1px solid var(--line-2); margin-top: 4px; }
.gs-empty { padding: 14px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sync-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); line-height: 1.2; }
.sync-chip:hover { text-decoration: none; border-color: #c9d6e8; }
.sync-chip b { display: block; font-size: 12.5px; } .sync-chip small { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.sync-chip.ok { color: var(--green-ink); } .sync-chip.ok .pulse { background: var(--green); }
.sync-chip.demo { color: var(--amber-ink); } .sync-chip.demo .pulse { background: var(--amber); }
.sync-chip.bad { color: var(--red-ink); border-color: #f3c3c3; } .sync-chip.bad .pulse { background: var(--red); }
.pulse { width: 7px; height: 7px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 0 currentColor; animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(18, 154, 82, .4); } 70% { box-shadow: 0 0 0 6px rgba(18, 154, 82, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 154, 82, 0); } }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-size: 12px; color: var(--muted); }
.clock b { color: var(--ink); font-size: 14px; }
.pop-wrap { position: relative; }
.bell { position: relative; }
.dot-count { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg-2); }
.profile { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 10px; text-align: left; line-height: 1.2; }
.profile:hover { background: #fff; }
.profile b { display: block; font-size: 13px; } .profile small { color: var(--muted); font-size: 12px; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); z-index: 50; overflow: hidden; }
.popover.menu { width: 240px; padding: 6px; }
.popover.menu a, .popover.menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; color: var(--ink); cursor: pointer; text-align: left; }
.popover.menu a:hover, .popover.menu button:hover { background: var(--bg-2); text-decoration: none; }
.pm-head { padding: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: grid; gap: 4px; justify-items: start; }
.pm-head span:not(.badge) { color: var(--muted); font-size: 12px; }
.pop-head { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.pop-body { padding: 14px; display: flex; gap: 8px; align-items: center; }
.pop-list { list-style: none; margin: 0; padding: 6px; max-height: 380px; overflow: auto; }
.pop-list button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; align-items: center; }
.pop-list button:hover { background: var(--bg-2); }
.pop-list small { display: block; color: var(--muted); font-size: 12px; }

.content { padding: 24px 28px 32px; display: grid; gap: 20px; align-content: start; flex: 1; min-width: 0; }
.content:focus { outline: none; }
.foot { padding: 14px 28px; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; position: relative; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { height: 46px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .6); }
.btn-primary:hover:not(:disabled) { background: var(--primary-ink); }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 6px 14px -6px rgba(18, 154, 82, .6); }
.btn-success:hover:not(:disabled) { background: var(--green-ink); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 6px 14px -6px rgba(220, 44, 44, .55); }
.btn-danger:hover:not(:disabled) { background: var(--red-ink); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: #c5d3e6; background: var(--bg-2); }
.btn-success-soft { background: var(--green-soft); color: var(--green-ink); }
.btn-success-soft:hover { background: #d4efe0; }
.danger-text { color: var(--red-ink) !important; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost.loading::after { border-color: #c7d2e2; border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: #fff; border-color: var(--line); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.in:hover:not(:disabled) { color: var(--green-ink); background: var(--green-soft); }
.icon-btn.out:hover:not(:disabled) { color: var(--red-ink); background: var(--red-soft); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.link { font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.link-btn { border: 0; background: none; padding: 0; font-weight: 650; color: var(--ink); cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--primary-ink); text-decoration: underline; }
.info-dot { border: 0; background: none; padding: 0; color: var(--faint); cursor: help; display: inline-flex; vertical-align: -2px; }
.info-dot:hover { color: var(--primary); }

/* ------------------------------------------------------------- cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-1); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); text-transform: uppercase; letter-spacing: .04em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-head p { margin: 6px 0 0; max-width: 820px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-title { font-size: 14px; margin: 20px 0 10px; }
.span-all { grid-column: 1 / -1; }

.welcome-row { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
.welcome { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.welcome h1 { font-size: 26px; font-weight: 800; }
.welcome p { margin: 6px 0 0; font-size: 14.5px; max-width: 760px; }
.wl-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.banner { position: relative; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(120deg, var(--navy-800), #1d4f96 70%, #2563eb); color: #fff; min-height: 128px; display: flex; align-items: flex-end; box-shadow: var(--sh-2); }
.banner-art { position: absolute; right: -10px; top: 0; height: 100%; width: 70%; opacity: .55; }
.banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 26, 51, .92) 25%, rgba(10, 26, 51, .1)); z-index: 1; }
.banner-text { position: relative; z-index: 2; padding: 16px 18px; display: grid; gap: 2px; }
.banner-text b { font-size: 22px; font-weight: 800; }
.banner-text span { color: #c5d6f2; font-size: 12.5px; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; text-transform: uppercase; letter-spacing: .08em; font-size: 11px !important; font-weight: 700; color: #9fc0f5 !important; }

/* KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.kpi-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.kpi { --tc: var(--blue); --ts: var(--blue-soft); display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; color: var(--ink); box-shadow: var(--sh-1); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tc); opacity: .85; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--tc) 35%, var(--line)); text-decoration: none; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--ts); color: var(--tc); }
.kpi-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--slate-soft); padding: 2px 7px; border-radius: 6px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kpi-value small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-foot { margin-top: auto; padding-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--tc); display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--line); margin-top: 10px; gap: 6px; }
.kpi-go { opacity: .6; }
.kpi-compact .kpi-value { font-size: 24px; }
.kpi-compact { padding: 14px 16px; }
.kpi.static::after { opacity: .5; }
.kpi.tone-green { --tc: var(--green); --ts: var(--green-soft); }
.kpi.tone-amber { --tc: var(--amber); --ts: var(--amber-soft); }
.kpi.tone-red { --tc: var(--red); --ts: var(--red-soft); }
.kpi.tone-indigo { --tc: var(--indigo); --ts: var(--indigo-soft); }
.kpi.tone-teal { --tc: var(--teal); --ts: var(--teal-soft); }
.kpi.tone-violet { --tc: var(--violet); --ts: var(--violet-soft); }
.kpi.tone-slate { --tc: #475569; --ts: var(--slate-soft); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.delta.good { color: var(--green-ink); } .delta.bad { color: var(--red-ink); } .delta.neutral { color: var(--muted); font-weight: 600; }
.skeleton-card { min-height: 150px; }

/* quick actions */
.quick { display: flex; flex-direction: column; }
.quick .card-head { margin-bottom: 10px; }
.quick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.qbtn { border: 0; border-radius: 14px; padding: 14px; color: #fff; cursor: pointer; display: grid; justify-items: start; gap: 2px; text-align: left; transition: transform .1s, box-shadow .15s; min-height: 96px; }
.qbtn b { font-size: 16px; } .qbtn span { font-size: 12px; opacity: .9; }
.qbtn.in { background: linear-gradient(140deg, #16a35b, #0e8a4a); box-shadow: 0 10px 20px -10px rgba(18, 154, 82, .8); }
.qbtn.out { background: linear-gradient(140deg, #e53e3e, #c62828); box-shadow: 0 10px 20px -10px rgba(220, 44, 44, .8); }
.qbtn:hover:not(:disabled) { transform: translateY(-2px); }
.qbtn:disabled { opacity: .45; cursor: not-allowed; }
.quick-links { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.quick-links a, .quick-links button { flex: 1; display: inline-flex; gap: 5px; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; padding: 7px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.quick-links a:hover, .quick-links button:hover { background: var(--primary-soft); color: var(--primary-ink); text-decoration: none; }

/* analytics grid */
.analytics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.analytics .span-2 { grid-column: span 1; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.two-col.wide-left { grid-template-columns: minmax(0, 1fr) 360px; }
.chart-box { width: 100%; min-height: 200px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.legend-inline { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend-inline span { display: inline-flex; gap: 6px; align-items: center; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.trend-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.trend-meta div { background: var(--bg-2); border-radius: 10px; padding: 8px 10px; }
.trend-meta span { display: block; font-size: 11.5px; } .trend-meta b { font-size: 16px; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .cross { stroke: #9aaecb; stroke-dasharray: 3 3; }
.chart .ref-line { stroke-dasharray: 4 3; stroke-width: 1.25; } .ref-line.amber { stroke: var(--amber); } .ref-line.blue { stroke: var(--blue); }
.chart .ref-txt { font-size: 10.5px; }
.donut-wrap { display: grid; gap: 14px; justify-items: center; }
.donut { width: 168px; height: 168px; }
.donut-seg { cursor: pointer; transition: opacity .15s; }
.donut-wrap:has(.donut-seg:hover) .donut-seg:not(:hover) { opacity: .45; }
.donut-seg:focus-visible { outline: none; stroke-width: 24; }
.donut-total { font-size: 30px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.donut-sub { font-size: 12px; fill: var(--muted); font-family: var(--font); }
.legend-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 2px; }
.legend-row { display: grid; grid-template-columns: 12px 1fr auto 42px; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; text-align: left; }
.legend-row:hover { background: var(--bg-2); }
.lg-val { font-weight: 700; } .lg-pct { color: var(--muted); text-align: right; font-size: 12px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hbar { display: grid; gap: 5px; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.hbar:hover { background: var(--bg-2); }
.hb-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hb-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hb-val { font-weight: 700; white-space: nowrap; }
.hb-track { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 999px; }
.hb-note { font-size: 11.5px; color: var(--muted); }

/* tooltip */
.tooltip { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; background: #0d1b33; color: #e8eefa; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; max-width: 280px; box-shadow: var(--sh-3); opacity: 0; transition: opacity .12s; }
.tooltip.show { opacity: 1; }
.tooltip b { color: #fff; }
.tt-row { display: flex; align-items: center; gap: 6px; } .tt-row b { margin-left: auto; padding-left: 12px; }
.tt-mute { color: #9fb2d3; font-size: 11.5px; margin-top: 2px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.3; }
.badge.tone-green { background: var(--green-soft); color: var(--green-ink); }
.badge.tone-amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge.tone-red { background: var(--red-soft); color: var(--red-ink); }
.badge.tone-blue { background: var(--blue-soft); color: var(--blue-ink); }
.badge.tone-violet { background: var(--violet-soft); color: var(--violet); }
.badge.tone-slate { background: var(--slate-soft); color: #475569; }
.badge.st-critical { background: var(--orange-soft); color: #b2440a; }
.badge.outline { background: #fff; border: 1px solid currentColor; }
.tone-text-green { color: var(--green-ink); } .tone-text-red { color: var(--red-ink); } .tone-text-amber { color: var(--amber-ink); } .tone-text-blue { color: var(--blue-ink); } .tone-text-slate { color: #475569; } .tone-text-ink { color: var(--ink); }
.tone-bg-green { background: var(--green-soft); } .tone-bg-red { background: var(--red-soft); } .tone-bg-amber { background: var(--amber-soft); } .tone-bg-blue { background: var(--blue-soft); }
.status-legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: hsl(var(--h) 55% 92%); color: hsl(var(--h) 45% 32%); font-weight: 700; flex: none; }
.sidebar .avatar { background: hsl(var(--h) 45% 30%); color: #fff; }
.who { display: inline-flex; gap: 8px; align-items: center; }
.cat-ic { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.cat-ic.sm { width: 28px; height: 28px; border-radius: 8px; } .cat-ic.lg { width: 52px; height: 52px; border-radius: 14px; }

/* alerts center */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tabs button { border: 0; background: none; padding: 8px 10px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--primary); }
.tabs .count { background: var(--slate-soft); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.tabs button.on .count { background: var(--primary-soft); color: var(--primary-ink); }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; border-left: 4px solid var(--sc); align-items: start; }
.sev-red { --sc: var(--red); --ss: var(--red-soft); } .sev-amber { --sc: var(--amber); --ss: var(--amber-soft); } .sev-blue { --sc: var(--blue); --ss: var(--blue-soft); }
.al-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--ss); color: var(--sc); flex: none; }
.al-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.al-main p { margin: 4px 0; color: var(--ink-2); font-size: 13px; }
.al-meta { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.al-actions { display: flex; flex-direction: column; gap: 6px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-height: 560px; overflow: auto; }
.tl { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 8px 0; position: relative; }
.tl:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 38px; bottom: -8px; width: 2px; background: var(--line-2); }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.tl-IN .tl-dot { background: var(--green-soft); color: var(--green-ink); } .tl-OUT .tl-dot { background: var(--red-soft); color: var(--red-ink); } .tl-ADJ .tl-dot { background: var(--violet-soft); color: var(--violet); }
.tl-top { display: flex; justify-content: space-between; gap: 8px; }
.tl-qty { white-space: nowrap; }
.tl-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.tl-meta > span { display: inline-flex; gap: 4px; align-items: center; }
.tl-sub { font-size: 12px; margin-top: 2px; }

/* toolbar & inputs */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar-card { padding: 12px 14px; } .toolbar-card .toolbar { margin: 0; }
select, input[type=text], input[type=search], input[type=number], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input:not([type]), textarea {
  height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; min-width: 0; outline: 0; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 9px 12px; resize: vertical; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366768f' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select:focus, input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled, select:disabled { background: var(--bg-2); color: var(--muted); }
.search-in { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; height: 38px; color: var(--muted); min-width: 240px; flex: 1 1 240px; max-width: 360px; }
.search-in:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-in input { border: 0; height: 36px; padding: 0; flex: 1; box-shadow: none !important; }
.range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--slate-soft); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--primary-ink); box-shadow: var(--sh-1); }
.date-in { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.date-in input { height: 34px; padding: 0 8px; font-size: 13px; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.active-filters:empty { display: none; }
.active-filters { margin: -4px 0 10px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #c7d7f2; background: var(--primary-soft); color: var(--primary-ink); padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { font-size: 12px; color: var(--muted); }
.field-error { color: var(--red-ink); font-size: 12px; font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { background: var(--red-soft); color: var(--red-ink); padding: 10px 12px; border-radius: 10px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.form-error[hidden] { display: none; }
.readout { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--line); font-size: 13.5px; }
.input-suffix { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.input-suffix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-suffix input { border: 0 !important; box-shadow: none !important; border-radius: 0; flex: 1; }
.input-suffix span { display: grid; place-items: center; padding: 0 12px; background: var(--bg-2); color: var(--muted); font-weight: 600; font-size: 12.5px; border-left: 1px solid var(--line); min-width: 60px; }
.field.has-error .input-suffix { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-form .span2 { grid-column: span 2; }
.txn-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.txn-grid.compact { gap: 16px; }
.txn-grid.compact .card { box-shadow: none; }
.form-card { display: grid; gap: 14px; }
.summary-card { position: sticky; top: 84px; }
.sum-item { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--bg-2); border-radius: 12px; margin-bottom: 12px; }
.sum-rows { margin: 0 0 12px; display: grid; }
.sum-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.sum-rows dt { color: var(--muted); } .sum-rows dd { margin: 0; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.sum-total { border-radius: 10px; padding: 12px !important; border: 0 !important; margin: 6px 0; }
.sum-total dd b { font-size: 20px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-top: 8px; }
.note .ic { margin-top: 1px; }
.note-red { background: var(--red-soft); color: var(--red-ink); } .note-amber { background: var(--amber-soft); color: var(--amber-ink); } .note-blue { background: var(--blue-soft); color: var(--blue-ink); }
.note-green { background: var(--green-soft); color: var(--green-ink); } .note-slate { background: var(--slate-soft); color: #475569; }
.done-note { margin: 0 0 12px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--bg-2); padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.tbl-compact td { padding: 8px 10px; white-space: nowrap; } .tbl-compact th { padding: 8px 10px; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr[data-row] { cursor: pointer; }
.tbl tbody tr:hover { background: #f7faff; }
.tbl tbody tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl td.msg { max-width: 340px; color: var(--ink-2); font-size: 12.5px; }
.tbl tr.is-muted td { opacity: .65; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.th-sort.on { color: var(--primary-ink); }
th.num .th-sort { flex-direction: row-reverse; }
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions.wrap { flex-wrap: wrap; gap: 6px; min-width: 250px; }
.item-cell { display: flex; gap: 10px; align-items: center; }
.meter { display: block; height: 4px; width: 64px; background: var(--line-2); border-radius: 4px; margin: 4px 0 0 auto; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; }
.m-ok { background: var(--green); } .m-low { background: var(--amber); } .m-critical { background: var(--orange); } .m-out { background: var(--red); } .m-over { background: var(--blue); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; }
.pager-btns { display: flex; gap: 4px; align-items: center; }
.pg { min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; display: grid; place-items: center; }
.pg.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.pg-gap { padding: 0 4px; color: var(--muted); }
.is-loading { opacity: .55; pointer-events: none; transition: opacity .2s; }
.txn-totals { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin-bottom: 10px; }

/* states */
.skeleton-wrap { display: grid; gap: 10px; padding: 4px 0; }
.skeleton { border-radius: 6px; background: linear-gradient(90deg, #edf1f7 25%, #f6f8fc 50%, #edf1f7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--muted); }
.empty .ic { color: var(--faint); }
.empty-title { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.empty p { margin: 0 0 6px; max-width: 380px; font-size: 13px; }
.error-state .ic { color: var(--red); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; width: min(400px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 12px; padding: 12px; box-shadow: var(--sh-2); animation: tin .25s ease-out; font-size: 13px; }
.toast > .ic { color: var(--tc); }
.toast strong { display: block; }
.toast-success { --tc: var(--green); } .toast-error { --tc: var(--red); } .toast-warning { --tc: var(--amber); } .toast-info { --tc: var(--blue); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(7, 18, 38, .45); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; }
.overlay.open .overlay-backdrop { opacity: 1; }
.modal { position: relative; background: #fff; border-radius: 18px; box-shadow: var(--sh-3); width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; transform: translateY(12px) scale(.98); opacity: 0; transition: .2s; }
.overlay.open .modal { transform: none; opacity: 1; }
.modal-sm { max-width: 440px; } .modal-md { max-width: 620px; } .modal-lg { max-width: 1020px; }
.overlay-drawer { place-items: stretch end; padding: 0; }
.drawer { position: relative; background: var(--bg-2); width: min(680px, 100vw); height: 100vh; display: flex; flex-direction: column; box-shadow: var(--sh-3); transform: translateX(30px); opacity: 0; transition: .22s; }
.overlay.open .drawer { transform: none; opacity: 1; }
.ov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 18px 18px 0 0; }
.drawer .ov-head { border-radius: 0; }
.ov-head h2 { font-size: 18px; } .ov-head p { margin: 2px 0 0; font-size: 13px; }
.ov-body { padding: 20px; overflow-y: auto; flex: 1; }
.ov-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 18px 18px; flex-wrap: wrap; }
.drawer-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.dh-badges { display: flex; gap: 6px; margin-top: 4px; }
.balance-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-radius: 14px; padding: 14px; }
.balance-hero span { display: block; font-size: 12px; } .balance-hero b { font-size: 20px; }
.explain { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.kv.one { grid-template-columns: 1fr; border: 0; padding: 0; margin-bottom: 16px; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.kv dt { font-size: 12px; color: var(--muted); } .kv dd { margin: 2px 0 0; font-weight: 600; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.drawer .chart-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 150px; }
.drawer .table-wrap { background: #fff; }
.mini-alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12.5px; }
.mini-alerts li { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); padding: 8px 10px; border-radius: 10px; }

/* sync */
.sync-status { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; }
.sync-status b { display: block; } .sync-status span { font-size: 12.5px; color: var(--ink-2); }
.sync-ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; }
.tone-bg-green .sync-ic { color: var(--green); } .tone-bg-amber .sync-ic { color: var(--amber); } .tone-bg-red .sync-ic { color: var(--red); }
.sync-kv { margin: 10px 0 14px; display: grid; }
.sync-kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.sync-kv dt { color: var(--muted); } .sync-kv dd { margin: 0; font-weight: 600; text-align: right; }
.sync-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.how ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-2); }
.page-sync > div > .card { margin-bottom: 16px; }

/* employees & settings */
.roles-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.role-card b { color: var(--ink); display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid form .btn { margin-top: 16px; }
.settings-grid .badge { margin: 2px; }
.print-title { display: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1440px) {
  .analytics { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .analytics > .card:last-child { grid-column: 1 / -1; }
  .analytics > .card:last-child .hbars { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 16px; }
}
@media (max-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-row-2 { grid-template-columns: 1fr; }
  .quick-btns { grid-template-columns: 1fr 1fr; }
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .welcome-row { grid-template-columns: 1fr; }
  .banner { min-height: 110px; }
  .clock { display: none; }
  .sync-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: var(--sh-3); }
  .sidebar.open { transform: none; }
  .nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(7, 18, 38, .45); z-index: 35; }
  .main-col { margin-left: 0; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 28px; }
  .only-wide { display: none; }
  .analytics { grid-template-columns: 1fr; }
  .txn-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .roles-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { padding: 32px 20px; }
}
@media (min-width: 1024px) { .only-mobile { display: none !important; } }
@media (max-width: 720px) {
  .kpi-row, .kpi-row.three, .kpi-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 22px; } .kpi-compact .kpi-value { font-size: 20px; }
  .kpi { padding: 12px; } .kpi-ic { width: 32px; height: 32px; }
  .kpi-sub { font-size: 12px; }
  .sync-chip span { display: none; } .sync-chip { padding: 8px; }
  .topbar { gap: 8px; padding: 10px 12px; } .top-right { gap: 4px; } .profile > .ic { display: none; } .profile { padding: 2px; }
  .gs-results { position: fixed; left: 12px; right: 12px; top: 60px; }
  .popover { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; }
  .gsearch label { height: 38px; }
  .trend-meta { grid-template-columns: repeat(2, 1fr); }
  .alert-row { grid-template-columns: 32px minmax(0, 1fr); }
  .al-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .grid-form, .field-row { grid-template-columns: 1fr; } .grid-form .span2 { grid-column: auto; }
  .page-head h1 { font-size: 20px; } .welcome h1 { font-size: 21px; }
  .search-in { min-width: 0; max-width: none; flex-basis: 100%; }
  .toolbar > select { flex: 1 1 140px; }
  .balance-hero { grid-template-columns: 1fr 1fr; }
  .demo-accts { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .pager { justify-content: center; }
}
@media (max-width: 359px) {
  .kpi-row, .kpi-row.three, .kpi-row.four { grid-template-columns: 1fr; }
  .roles-grid { grid-template-columns: 1fr; }
  .top-right { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------- print (reports → PDF) */
@media print {
  .sidebar, .topbar, .foot, .toolbar-card, .head-actions, .toasts, .nav-scrim { display: none !important; }
  .main-col { margin: 0; } body { background: #fff; } body::before { display: none; }
  .content { padding: 0; }
  .print-title { display: block; } .print-title h2 { font-size: 18px; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .analytics, .two-col { grid-template-columns: 1fr 1fr; }
  .kpi-row.four { grid-template-columns: repeat(4, 1fr); }
}
