/* ============================================================
   CandiRef Design System — Enterprise / Modern SaaS / Bright Theme
   Brand: navy #071E6B · red #E30620 · white · light gray
   Inspired by SAP Fiori, Oracle Fusion, Dynamics 365, Salesforce,
   Workday, HubSpot. Built on Material 3 + Apple HIG + WCAG 2.2.
   ============================================================ */
:root {
  /* Brand — navy + red (accent only) */
  --navy: #0B2A6B;
  --navy-50: #EEF3FB;
  --navy-100: #DCE6F5;
  --navy-200: #C3D2EC;
  --navy-600: #15489E;
  --navy-700: #0F3A85;
  --red: #E5394D;
  --red-50: #FCEBED;
  --red-600: #D12A3E;

  /* Neutrals — soft, bright */
  --white: #ffffff;
  --bg: #F6F8FC;
  --bg-2: #EEF2F9;
  --border: #EAEFF6;
  --border-strong: #DCE3EE;
  --text: #16233B;
  --text-2: #41506B;
  --muted: #7A879E;
  --muted-2: #9AA6BB;

  /* Semantic (soft) */
  --green: #1FA971;
  --green-50: #E6F6EE;
  --amber: #E08A1E;
  --amber-50: #FBF1DD;
  --gray-50: #F0F3F8;
  --info: #2E7FD1;
  --info-50: #E9F1FC;

  /* Type scale */
  --fs-display: 30px;
  --fs-h1: 23px;
  --fs-h2: 18px;
  --fs-h3: 14.5px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-2xs: 11px;

  /* Geometry — softer, rounder */
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 76px;
  --header-h: 62px;
  --radius: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  /* Elevation — soft, no hard shadows */
  --shadow-xs: 0 1px 2px rgba(20,40,80,.04);
  --shadow-sm: 0 2px 8px rgba(20,40,80,.05), 0 1px 3px rgba(20,40,80,.04);
  --shadow-md: 0 10px 30px rgba(20,40,80,.08);
  --shadow-lg: 0 24px 60px rgba(20,40,80,.14);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --ease: cubic-bezier(.4,0,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
.ui-icon { display:block; overflow:visible; color:inherit; fill:none; stroke:currentColor; shape-rendering:geometricPrecision; vector-effect:non-scaling-stroke; }
svg.ui-icon use { pointer-events:none; }
svg.ui-icon use[href="#i-more"] { fill:currentColor; stroke:none; }
h1,h2,h3,h4 { color: var(--navy); font-weight: 700; margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 1em; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
.skip-link { position:fixed; left:18px; top:-80px; z-index:1000; padding:10px 14px; border-radius:10px; background:var(--navy); color:#fff; box-shadow:var(--shadow-md); transition:top .18s var(--ease); }
.skip-link:focus { top:14px; color:#fff; }

/* ---------- App Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: rgba(255,255,255,.98);
  color: var(--text-2);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  transition: width .26s var(--ease);
  z-index: 100; overflow-x: hidden;
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 28px rgba(20,40,80,.035);
}
.app-shell.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar .brand {
  height: 78px; display: flex; align-items: center; gap: 11px;
  padding: 10px 22px; color: var(--navy); font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  border-bottom: 1px solid var(--border); white-space: nowrap; overflow:hidden;
}
.sidebar .brand .logo-img { display:block; width:190px; height:52px; object-fit:contain; object-position:left center; max-width:none; filter:none; transition:width .24s var(--ease),height .24s var(--ease); }
.sidebar .brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: var(--red);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; flex: 0 0 32px;
}
.app-shell.collapsed .sidebar .brand { justify-content: flex-start; padding:10px 15px; }
.app-shell.collapsed .sidebar .brand .logo-img { width:46px; height:46px; object-fit:cover; object-position:left center; }
.app-shell.collapsed .brand .brand-text { opacity: 0; pointer-events: none; }
.sidebar .nav { padding: 12px 12px 20px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color:var(--border-strong) transparent; }
.sidebar .nav .section {
  font-size: 10px; text-transform: uppercase; letter-spacing: .11em; color: var(--muted-2);
  padding: 18px 12px 8px; white-space: nowrap; font-weight: 700;
}
.app-shell.collapsed .nav .section { opacity: 0; height: 10px; padding: 0; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 13px;
  color: var(--text-2); border-radius: 12px; margin-bottom: 3px;
  white-space: nowrap; font-weight: 500; font-size: var(--fs-sm);
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
  position: relative;
}
.sidebar .nav a:hover { background: var(--bg); color: var(--navy); text-decoration: none; transform: translateX(2px); }
.sidebar .nav a.active { background: var(--navy-50); color: var(--navy); font-weight: 700; }
.sidebar .nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; background: var(--red); border-radius: 0 4px 4px 0; box-shadow:none;
}
.sidebar .nav a .ico { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; color: inherit; }
.sidebar .nav a .ico svg { width: 20px; height: 20px; }
.sidebar .nav a .label { transition: opacity .18s var(--ease); }
.app-shell.collapsed .sidebar .nav a { justify-content: center; }
.app-shell.collapsed .sidebar .nav a .label { opacity: 0; width: 0; pointer-events: none; }
.sidebar .nav a .badge { margin-left: auto; }
.app-shell.collapsed .sidebar .nav a .badge { position: absolute; right: 8px; top: 6px; margin: 0; }
.app-shell.collapsed .sidebar .nav a[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: #0B1430; color: #fff; padding: 7px 11px; border-radius: 9px; font-size: 12px; white-space: nowrap;
  box-shadow: var(--shadow-md); z-index: 200; pointer-events: none;
}

.main { flex: 1; margin-left: var(--sidebar-w); transition: margin-left .26s var(--ease); min-width: 0; }
.app-shell.collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* ---------- Top Header ---------- */
.topbar {
  height: var(--header-h); background: rgba(255,255,255,.85); backdrop-filter: saturate(1.5) blur(10px);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 90;
}
.topbar .toggle { background: none; border: none; cursor: pointer; color: var(--navy); padding: 7px; border-radius: 10px; display: grid; place-items: center; transition: background .14s var(--ease); }
.topbar .toggle:hover { background: var(--bg-2); }
.topbar .toggle svg { width: 21px; height: 21px; }
.topbar .page-title { font-weight: 700; color: var(--navy); font-size: var(--fs-sm); letter-spacing: -.01em; }
.topbar .global-search { position: relative; width: 320px; max-width: 38vw; }
.topbar .global-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.topbar .global-search input { width: 100%; padding: 9px 12px 9px 38px; border: 1px solid transparent; background: var(--bg-2); border-radius: 11px; font-size: var(--fs-sm); font-family: inherit; color: var(--text); transition: background .14s, border-color .14s; }
.topbar .global-search input:focus { outline: none; background: #fff; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(11,42,107,.10); }
.search-shortcut { position:absolute; right:10px; top:50%; transform:translateY(-50%); min-width:22px; height:22px; display:grid; place-items:center; border:1px solid var(--border-strong); border-bottom-width:2px; border-radius:6px; background:#fff; color:var(--muted); font:600 11px/1 var(--font); }
.topbar .global-search input { padding-right:42px; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--text-2); display: grid; place-items: center;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.topbar .icon-btn:hover { background: var(--bg-2); color: var(--navy); }
.topbar .icon-btn svg { width: 20px; height: 20px; }
.topbar .icon-btn .dot {
  position: absolute; top: 7px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); border-radius: 9px; border: 2px solid #fff; color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.topbar .user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 8px 5px 10px; border-radius: 12px; border: 1px solid transparent; transition: background .14s, border-color .14s; }
.topbar .user-chip:hover { background: var(--bg-2); border-color: var(--border); }
.topbar .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-600)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 36px; box-shadow: var(--shadow-xs); }
.topbar .user-chip .meta { line-height: 1.15; }
.topbar .user-chip .meta .nm { font-weight: 700; color: var(--text); font-size: 13px; }
.topbar .user-chip .meta .rl { font-size: 11px; color: var(--muted); }
.topbar .user-menu { position: absolute; right: 22px; top: calc(var(--header-h) - 4px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); min-width: 214px; z-index: 95; padding: 7px; display: none; }
.topbar .user-menu.open { display: block; animation: fadeIn .14s var(--ease); }
.topbar .user-menu a, .topbar .user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 10px; color: var(--text); background: none; border: none; font-size: 13px; cursor: pointer; }
.topbar .user-menu a:hover, .topbar .user-menu button:hover { background: var(--bg-2); text-decoration: none; }
.topbar .user-menu .mi { width: 17px; height: 17px; color: var(--muted); }
.topbar .user-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; gap: 8px; align-items: center; padding: 18px 24px 0; font-size: var(--fs-xs); color: var(--muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb .sep { color: var(--muted-2); }
.breadcrumb .cur { color: var(--navy); font-weight: 600; }

/* ---------- Content ---------- */
.content { padding: 18px 26px 40px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-h1); margin: 0; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: var(--fs-sm); }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease); }
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: var(--fs-h3); margin: 0; letter-spacing: -.01em; }
.card-head .actions { margin-left: auto; display: flex; gap: 7px; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }

/* ---------- Summary / KPI Cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; gap: 16px; align-items: center;
  position: relative; overflow: hidden; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.kpi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(11,42,107,.04), rgba(11,42,107,0) 40%); opacity: 0; transition: opacity .18s var(--ease); pointer-events: none; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kpi:hover::after { opacity: 1; }
a.kpi { text-decoration: none; color: inherit; }
.kpi .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--navy-50); color: var(--navy); flex: 0 0 50px; box-shadow: inset 0 0 0 1px rgba(11,42,107,.06); }
.kpi.red .ic { background: var(--red-50); color: var(--red); }
.kpi.green .ic { background: var(--green-50); color: var(--green); }
.kpi.amber .ic { background: var(--amber-50); color: var(--amber); }
.kpi .ic svg { width: 24px; height: 24px; }
.kpi .body { min-width: 0; }
.kpi .v { font-size: 25px; font-weight: 800; color: var(--navy); line-height: 1.05; letter-spacing: -.02em; }
.kpi .l { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; font-weight: 500; }
.kpi .delta { font-size: var(--fs-2xs); font-weight: 700; margin-top: 6px; display: inline-flex; align-items: center; gap: 3px; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .spark { margin-top: 8px; width: 100%; height: 30px; display: block; }

/* ---------- Executive command strip ---------- */
.executive-strip { display:grid; grid-template-columns:minmax(260px,.78fr) minmax(420px,1.7fr); gap:18px; margin:0 0 22px; }
.executive-focus,.executive-performance { position:relative; overflow:hidden; border-radius:var(--radius); background:#fff; box-shadow:var(--shadow-sm); border:1px solid var(--border); }
.executive-focus { padding:20px; }
.executive-eyebrow { color:var(--muted); font-size:10.5px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.executive-date { display:flex; align-items:center; gap:12px; margin:8px 0 14px; }
.date-number { font-size:34px; line-height:1; font-weight:800; color:var(--navy); letter-spacing:-.04em; }
.executive-date strong,.executive-date small { display:block; }
.executive-date small,.focus-list small { color:var(--muted); font-size:11px; font-weight:500; }
.focus-list { display:grid; gap:4px; }
.focus-list a { display:grid; grid-template-columns:8px 1fr 16px; align-items:center; gap:10px; padding:9px 10px; margin:0 -10px; border-radius:11px; color:var(--text); transition:background .16s var(--ease),transform .16s var(--ease); }
.focus-list a:hover { background:var(--bg); text-decoration:none; transform:translateX(2px); }
.focus-list strong,.focus-list small { display:block; line-height:1.35; }
.focus-arrow { color:var(--muted-2); font-size:15px; }
.focus-dot { width:8px; height:8px; border-radius:50%; box-shadow:0 0 0 4px var(--amber-50); background:var(--amber); }
.focus-dot.red { background:var(--red); box-shadow:0 0 0 4px var(--red-50); }
.executive-performance { display:grid; grid-template-columns:1.1fr 1fr; align-items:center; gap:30px; padding:24px 26px; background:linear-gradient(120deg,#fff 0%,#fff 55%,var(--navy-50) 100%); }
.executive-performance::after { content:""; position:absolute; width:180px; height:180px; right:-75px; top:-105px; border:35px solid rgba(21,72,158,.05); border-radius:50%; }
.performance-copy h2 { margin:6px 0; font-size:20px; color:var(--text); }
.performance-copy p { margin:0; color:var(--muted); font-size:12px; max-width:390px; }
.performance-meter { position:relative; z-index:1; }
.meter-label,.meter-foot { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.meter-label { margin-bottom:9px; font-size:12px; color:var(--muted); }
.meter-label strong { color:var(--navy); font-size:16px; }
.meter-track { height:10px; padding:2px; border-radius:20px; background:#dce6f5; overflow:hidden; }
.meter-track span { display:block; width:var(--progress); height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--navy-600),var(--info)); animation:progressGrow .8s var(--ease) both; }
.meter-foot { margin-top:8px; color:var(--muted); font-size:10.5px; }
@keyframes progressGrow { from { width:0; } }
@media (max-width:1100px) { .executive-strip { grid-template-columns:1fr 1.5fr; } .executive-performance { grid-template-columns:1fr; gap:18px; } }
@media (max-width:768px) { .executive-strip { grid-template-columns:1fr; } .executive-performance { padding:20px; } .search-shortcut { display:none; } .topbar .global-search input { padding-right:12px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-weight: 600; font-size: var(--fs-sm);
  white-space: nowrap; transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .08s var(--ease), color .16s;
  font-family: inherit; line-height: 1.2; position: relative; overflow: hidden;
}
.btn svg { width: 18px; height: 18px; flex:0 0 18px; }
.btn .rip { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.55); animation: rip .6s var(--ease); pointer-events: none; }
.btn:hover { background: var(--bg-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 13px; font-size: var(--fs-xs); }
.btn-lg { padding: 12px 22px; font-size: var(--fs-body); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 4px 14px rgba(11,42,107,.22); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-primary .rip { background: rgba(255,255,255,.35); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 4px 14px rgba(229,57,77,.22); }
.btn-danger:hover { background: var(--red-600); border-color: var(--red-600); }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 4px 14px rgba(31,169,113,.22); }
.btn-success:hover { filter: brightness(.97); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--navy-600); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-outline { background: #fff; border-color: var(--navy-600); color: var(--navy); }
.btn-outline:hover { background: var(--navy-50); }
.btn-soft { background: var(--navy-50); border-color: transparent; color: var(--navy); }
.btn-soft:hover { background: var(--navy-100); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-icon { padding: 8px 10px; }
.btn-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 80; width: 54px; height: 54px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(11,42,107,.32); transition: transform .16s var(--ease), box-shadow .16s;
}
.btn-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 38px rgba(11,42,107,.4); }
.btn-fab svg { width: 22px; height: 22px; }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; }
.crud-actions { display:flex; align-items:center; justify-content:flex-end; gap:6px; white-space:nowrap; }
.crud-form { display:inline-flex; margin:0; }
.crud-icon { width:36px; height:36px; padding:0; display:inline-grid; place-items:center; border:1px solid transparent; border-radius:11px; background:var(--gray-50); color:var(--text-2); cursor:pointer; transition:transform .15s var(--ease),background .15s var(--ease),color .15s var(--ease),box-shadow .15s var(--ease); }
.crud-icon svg { width:19px; height:19px; fill:none; }
.crud-icon:hover { transform:translateY(-1px); text-decoration:none; box-shadow:var(--shadow-sm); }
.crud-icon.view:hover { color:var(--navy); background:var(--navy-50); }
.crud-icon.edit:hover { color:var(--info); background:var(--info-50); }
.crud-icon.approve:hover { color:var(--green); background:var(--green-50); }
.crud-icon.delete:hover { color:var(--red); background:var(--red-50); }
.crud-actions > .dropdown { display:inline-flex; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.section-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 18px; }
.section-card > h4 { font-size: var(--fs-h3); margin: 0 0 16px; display: flex; align-items: center; gap: 9px; }
.section-card > h4 .si { width: 30px; height: 30px; border-radius: 9px; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; flex: 0 0 30px; }
.section-card > h4 .si svg { width: 16px; height: 16px; }
.field { position: relative; margin-bottom: 2px; }
.field > label { display: block; font-weight: 600; margin-bottom: 7px; font-size: var(--fs-sm); color: var(--text-2); }
.field .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .16s var(--ease), box-shadow .2s var(--ease), background .16s; line-height: 1.45;
}
.field textarea { resize: vertical; min-height: 92px; }
.field select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A879E' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(11,42,107,.12); background: #fff;
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); background: var(--red-50); border-width: 1.5px; box-shadow: 0 0 0 3px rgba(229,57,77,.10); }
.field.has-error { animation: shake .28s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-4px)} 40%{transform:translateX(4px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(2px)} }
.field .err { color: var(--red); font-size: var(--fs-xs); margin-top: 6px; display: none; font-weight: 600; }
.field.has-error .err { display:flex; align-items:center; gap:5px; }
.field.has-error .err::before { content:"!"; width:14px; height:14px; border-radius:50%; background:var(--red); color:#fff; font-size:10px; font-weight:800; display:grid; place-items:center; flex:0 0 14px; }
.field .hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 6px; line-height: 1.5; }
.form-actions { display: flex; gap: 12px; margin-top: 22px; }
/* floating label variant */
.field.float { margin-top: 14px; }
.field.float input, .field.float select, .field.float textarea { padding-top: 18px; padding-bottom: 18px; }
.field.float > label { position: absolute; left: 14px; top: 13px; margin: 0; color: var(--muted); pointer-events: none; transition: .16s var(--ease); font-weight: 500; }
.field.float input:focus + label, .field.float input:not(:placeholder-shown) + label,
.field.float textarea:focus + label, .field.float textarea:not(:placeholder-shown) + label {
  top: 4px; font-size: 10.5px; color: var(--navy); font-weight: 600; }

/* ---------- Badges / Status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px; font-size: var(--fs-2xs); font-weight: 700; line-height: 1.5; white-space: nowrap; letter-spacing: .01em; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-navy { background: var(--navy-50); color: var(--navy-700); }
.b-red { background: var(--red-50); color: var(--red-600); }
.b-green { background: var(--green-50); color: #15803D; }
.b-amber { background: var(--amber-50); color: #B45309; }
.b-gray { background: var(--gray-50); color: var(--muted); }
.b-outline { background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); }
/* status helpers (9 fee statuses) */
.st-calculated { background: var(--navy-50); color: var(--navy-700); }
.st-pending { background: var(--amber-50); color: #B45309; }
.st-approved { background: var(--green-50); color: #15803D; }
.st-rejected { background: var(--red-50); color: var(--red-600); }
.st-ready { background: var(--info-50); color: #0E7490; }
.st-processing { background: var(--navy-50); color: var(--navy-700); }
.st-paid { background: var(--green-50); color: #15803D; }
.st-cancelled { background: var(--gray-50); color: var(--muted); }
.st-reversed { background: var(--red-50); color: var(--red-600); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
table.data thead th {
  text-align: left; padding: 13px 18px; background: var(--bg-2); color: var(--navy-700);
  font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2; font-size: var(--fs-xs); letter-spacing: .02em; text-transform: uppercase;
}
table.data tbody td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
table.data tbody tr { transition: background .14s var(--ease); }
table.data tbody tr:hover { background: var(--bg); }
table.data tbody tr:nth-child(even) { background: #FCFEFF; }
table.data.zebra tbody tr:nth-child(even):hover { background: var(--bg); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .col-actions { white-space: nowrap; text-align: right; }
table.data .cell-strong { font-weight: 700; color: var(--text); }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--navy); }
.th-sort .arrow { opacity: .4; font-size: 10px; margin-left: 4px; transition: transform .14s var(--ease); }
.th-sort.asc .arrow, .th-sort.desc .arrow { opacity: 1; color: var(--red); }

/* ---------- Toolbar (search/filter/export) ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .search { position: relative; flex: 1; min-width: 240px; }
.toolbar .search input { padding: 10px 12px 10px 40px; width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding-top: 10px; padding-bottom: 10px; padding-right: 12px; font-size: var(--fs-sm); font-family: inherit; background: #fff; color: var(--text); transition: border-color .16s, box-shadow .16s; }
.toolbar .search input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,42,107,.12); }
.toolbar .search .si { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; place-items: center; }
.toolbar .search .si svg { width: 17px; height: 17px; }
.toolbar select, .toolbar input.filter { padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--fs-sm); background: #fff; font-family: inherit; color: var(--text); transition: border-color .16s, box-shadow .16s; }
.toolbar select:focus, .toolbar input.filter:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,42,107,.12); }
.toolbar .spacer { flex: 1; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); min-width: 200px; z-index: 50; padding: 7px; display: none; }
.dropdown.open .dropdown-menu { display: block; animation: fadeIn .14s var(--ease); }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--text); background: none; border: none; font-size: var(--fs-sm); cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-2); text-decoration: none; }
.dropdown-menu .mi { width: 18px; height: 18px; color: var(--text-2); flex: 0 0 18px; }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 7px; align-items: center; margin-top: 0; padding:14px 18px; border-top:1px solid var(--border); background:rgba(250,251,253,.8); flex-wrap: wrap; }
.pagination .info { color: var(--muted); font-size: var(--fs-xs); margin-right: auto; }
.pagination a, .pagination .pg, .pagination .pg-arrow { min-width:40px; min-height:36px; padding:8px 12px; display:inline-flex; align-items:center; justify-content:center; gap:4px; border:1px solid var(--border); border-radius:10px; color:var(--navy); font:600 var(--fs-xs)/1 var(--font); background:#fff; text-align:center; cursor:pointer; text-decoration:none; transition:background .14s var(--ease),border-color .14s,color .14s,transform .14s; }
.pagination a:hover, .pagination .pg-arrow:hover:not(.disabled) { background:var(--navy-50); text-decoration:none; border-color:var(--navy-200); transform:translateY(-1px); }
.pagination .active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; box-shadow: 0 4px 12px rgba(11,42,107,.2); }
.pg-arrow { width:auto; aspect-ratio:1; border-radius:10px; }
.pg-arrow.disabled { color:var(--muted-2); background:var(--gray-50); border-color:var(--border); cursor:not-allowed; opacity:.7; pointer-events:none; }
.pagination:empty { display:none; }

/* ---------- Empty State ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ill { width: 92px; height: 92px; margin: 0 auto 18px; color: var(--navy-100); }
.empty .ill svg { width: 100%; height: 100%; }
.empty .t { font-weight: 700; color: var(--text); font-size: var(--fs-h3); margin-bottom: 7px; }
.empty .d { font-size: var(--fs-sm); max-width: 380px; margin: 0 auto 18px; line-height: 1.55; }

/* ---------- Loading ---------- */
.loading-bar { height: 3px; background: var(--navy); position: relative; overflow: hidden; display: none; }
.loading-bar.active { display: block; }
.loading-bar::after { content: ""; position: absolute; left: -30%; width: 30%; height: 100%; background: var(--red); animation: slide 1s infinite; }
@keyframes slide { to { left: 100%; } }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--navy); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EEF2F9 25%, #E2E8F2 37%, #EEF2F9 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton-row td { padding: 15px 18px; }
.skeleton-row .sk { height: 13px; border-radius: 6px; }
.table-skeleton { padding: 18px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,42,107,.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; z-index: 200; padding: 56px 16px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-md); width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); overflow: hidden; }
.modal.wide { max-width: 900px; }
.modal.sm { max-width: 440px; }
@keyframes pop { from { transform: translateY(12px) scale(.985); opacity: .4; } }
.modal-head { display: flex; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: var(--fs-h3); letter-spacing: -.01em; }
.modal-head .x { margin-left: auto; background: none; border: none; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; font-size: 18px; transition: background .14s; }
.modal-head .x:hover { background: var(--bg-2); color: var(--text); }
.modal-body { padding: 22px; max-height: 72vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 11px; justify-content: flex-end; padding: 15px 22px; border-top: 1px solid var(--border); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 11px; max-width: 384px; }
.toast { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--navy); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 13px 15px; display: flex; gap: 12px; align-items: flex-start; animation: slideUp .22s var(--ease); }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }
.toast .ti { font-size: 18px; display: grid; place-items: center; flex: 0 0 auto; }
.toast .tx { font-size: var(--fs-sm); }
.toast .tx .tt { font-weight: 700; color: var(--text); }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } }

/* ---------- Charts ---------- */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: var(--fs-xs); color: var(--muted); }
.chart-legend .it { display: flex; align-items: center; gap: 7px; }
.chart-legend .sw { width: 11px; height: 11px; border-radius: 3px; }

/* ---------- Misc: progress / ring / timeline / kv ---------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { min-width: 0; }
.col-8 { flex: 2 1 0; }
.col-4 { flex: 1 1 0; }
.prog-bar { height: 8px; border-radius: 20px; background: var(--bg-2); overflow: hidden; }
.prog-bar > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--navy), var(--navy-600)); transition: width .5s var(--ease); }
.prog-ring { transform: rotate(-90deg); }
.prog-ring .track { stroke: var(--bg-2); }
.prog-ring .val { stroke: var(--navy); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 9px 18px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; color: var(--text); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.timeline { border-left: 2px solid var(--border); padding-left: 20px; margin: 0; }
.timeline .ev { position: relative; padding-bottom: 18px; }
.timeline .ev::before { content: ""; position: absolute; left: -27px; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border); }
.timeline .ev .when { font-size: var(--fs-xs); color: var(--muted); }
.timeline .ev.amber::before { background: var(--amber); }
.timeline .ev.green::before { background: var(--green); }
.timeline .ev.red::before { background: var(--red); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: linear-gradient(150deg, var(--navy) 0%, #0a2c93 60%, #123a9e 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.login-hero h1 { color: #fff; font-size: 30px; }
.login-hero .p { color: #c3d0ee; max-width: 420px; }
.login-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.login-card { width: 100%; max-width: 388px; }
.role-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
.role-grid .rb { position:relative; overflow:hidden; display:flex; align-items:center; gap:10px; padding:11px 13px; border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; transition:border-color .14s, background .14s; }
.role-grid .rb .rip { position:absolute; border-radius:50%; transform:scale(0); background:rgba(21,72,158,.12); animation:rip .6s var(--ease); pointer-events:none; }
.role-grid .rb.active { border-color: var(--navy); background: var(--navy-50); }
.role-grid .rb .rnm { font-weight: 700; }
.role-grid .rb .rd { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .col-8, .col-4 { flex: 1 1 100%; } }
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg); }
  .app-shell.mobile-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .form-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .content { padding: 12px 12px 28px; }
  .breadcrumb, .page-head { padding-left: 12px; padding-right: 12px; }
  .kv { grid-template-columns: 110px 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .ic { width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px; }
  .kpi .v { font-size: 17px !important; }
  .page-head h1 { font-size: var(--fs-h2); }
  /* table card-mode: header label + value rows */
  .table-wrap { border: none; border-radius: 0; background: transparent; overflow: visible; }
  .table-wrap table,
  .table-wrap thead,
  .table-wrap .th-sort,
  .table-wrap th.col-actions,
  .table-wrap td.col-actions { display: none; }
  .table-wrap tbody { display: block; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
  .table-wrap tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table-wrap tr:last-child { border-bottom: none; }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border: none; background: transparent; }
  .table-wrap td::before { content: attr(data-label); font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-right: 10px; }
  .table-wrap td[data-label=""]::before { content: none; }
  /* pagination compact */
  .pagination { justify-content: center; }
}
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }
/* ---------- Animations ---------- */
@keyframes rip { to { transform: scale(2.4); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
.card, .kpi, .empty, .toast { animation: cardIn .26s var(--ease) both; }
.page-enter { animation: pageIn .18s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ============ AUTH / LOGIN (full-page wallpaper) ============ */
body.auth-body { margin: 0; background: var(--navy); }
.auth-page {
  position: fixed; inset: 0;
  background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 40px;
}
.auth-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(11,42,107,.80) 0%, rgba(11,42,107,.52) 45%, rgba(11,42,107,.30) 100%),
    linear-gradient(180deg, rgba(11,42,107,.32) 0%, rgba(11,42,107,0) 28%);
}
.auth-card {
  position: relative; z-index: 2;
  width: 400px; max-width: 100%;
  background: rgba(11,42,107,.30);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(2,10,40,.5);
  padding: 34px 34px 30px;
  color: #fff;
  animation: cardIn .34s var(--ease) both;
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-logo { height: 48px; width: auto; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); }
.auth-title { font-size: 22px; font-weight: 800; text-align: center; color: #fff; margin: 0; letter-spacing: -.01em; }
.auth-sub { text-align: center; color: rgba(255,255,255,.82); font-size: 13px; margin: 5px 0 22px; }

/* form inside transparent card */
.auth-card .field label { color: rgba(255,255,255,.92); }
.auth-card .text-muted { color: rgba(255,255,255,.78); }
.auth-card .field input {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.32);
  color: #fff;
}
.auth-card .field input::placeholder { color: rgba(255,255,255,.55); }
.auth-card .field input:focus { background: rgba(255,255,255,.20); border-color: #fff; }
.auth-card .err { color: #FFD2D8; }
.auth-card .req { color: #FFB3BC; }
.auth-card .role-grid .rb {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
}
.auth-card .role-grid .rb .rnm { color: #fff; }
.auth-card .role-grid .rb .rd { color: rgba(255,255,255,.70); }
.auth-card .role-grid .rb.active {
  background: rgba(255,255,255,.24);
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35) inset;
}
.auth-card a.text-muted { color: rgba(255,255,255,.82); }
.auth-card a.text-muted:hover { color: #fff; }

@media (max-width: 768px) {
  .auth-page { justify-content: center; padding: 18px; }
  .auth-scrim {
    background:
      linear-gradient(180deg, rgba(11,42,107,.55), rgba(11,42,107,.84)),
      linear-gradient(90deg, rgba(11,42,107,.42), rgba(11,42,107,.42));
  }
}

/* ---------- Enterprise authentication experience ---------- */
html:has(body.auth-body),body.auth-body { width:100%; height:100%; overflow:hidden; }
body.auth-body { min-height:100vh; min-height:100dvh; background:#eef3f9; }
.auth-page { position:relative; width:100%; height:100vh; height:100dvh; min-height:0; inset:auto; display:grid; grid-template-columns:minmax(360px,1fr) minmax(440px,520px); align-items:stretch; gap:0; padding:0; overflow:hidden; background-size:100% 100%; background-position:center; background-repeat:no-repeat; }
.auth-scrim { background:linear-gradient(90deg,rgba(5,24,65,.92) 0%,rgba(8,36,88,.78) 52%,rgba(238,243,249,.78) 100%); }
.auth-showcase { position:relative; z-index:2; display:flex; flex-direction:column; min-height:0; height:100%; padding:clamp(28px,5vh,46px) clamp(42px,7vw,104px); color:#fff; }
.auth-showcase-brand { display:flex; align-items:center; gap:12px; font-size:15px; font-weight:800; letter-spacing:.01em; }
.showcase-mark { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:var(--red); color:#fff; font-size:18px; box-shadow:0 8px 24px rgba(227,6,32,.28); }
.auth-showcase-copy { margin:auto 0; max-width:620px; }
.auth-kicker { display:inline-flex; align-items:center; gap:7px; color:var(--navy-600); font-size:10.5px; line-height:1; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.auth-showcase .auth-kicker { color:#b9d4ff; }
.auth-showcase-copy h2 { max-width:580px; margin:14px 0 16px; color:#fff; font-size:clamp(34px,4vw,58px); font-weight:750; line-height:1.08; letter-spacing:-.045em; }
.auth-showcase-copy p { max-width:540px; margin:0; color:rgba(255,255,255,.76); font-size:15px; line-height:1.75; }
.auth-trust { display:flex; align-items:center; gap:22px; color:rgba(255,255,255,.76); font-size:12px; font-weight:600; }
.auth-trust span { display:flex; align-items:center; gap:7px; }
.auth-trust svg { width:16px; height:16px; color:#7ee0b8; }
.auth-card { position:relative; z-index:3; align-self:center; justify-self:center; width:calc(100% - 64px); max-width:456px; max-height:calc(100dvh - 32px); margin:16px 32px; padding:clamp(20px,3.2vh,28px) 34px clamp(18px,2.8vh,24px); overflow:hidden; color:var(--text); background:rgba(255,255,255,.97); border:1px solid rgba(255,255,255,.9); border-radius:24px; box-shadow:0 30px 80px rgba(10,31,72,.18),0 2px 8px rgba(10,31,72,.06); backdrop-filter:blur(18px); }
.auth-brand { display:flex; align-items:center; justify-content:center; min-height:86px; margin:0 0 12px; padding:12px 20px; overflow:hidden; border:1px solid var(--border); border-radius:16px; background:#fff; box-shadow:var(--shadow-xs); }
.auth-logo { display:block; width:100%; max-width:330px; height:68px; object-fit:contain; filter:none; }
.auth-heading { margin-bottom:20px; text-align:left; }
.auth-title { margin:8px 0 4px; color:var(--navy); font-size:24px; text-align:left; letter-spacing:-.025em; }
.auth-sub { margin:0; color:var(--muted); font-size:12.5px; text-align:left; }
.demo-label { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; color:var(--text-2); font-size:11.5px; font-weight:700; }
.demo-label small { color:var(--muted); font-size:10.5px; font-weight:500; }
.auth-card .role-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0 0 18px; }
.auth-card .role-grid .rb { position:relative; min-width:0; padding:9px 10px; gap:9px; color:var(--text); background:var(--bg); border:1px solid transparent; border-radius:12px; }
.auth-card .role-grid .rb:hover { background:var(--navy-50); border-color:var(--navy-100); }
.auth-card .role-grid .rb.active { color:var(--text); background:var(--navy-50); border-color:var(--navy-200); box-shadow:0 0 0 1px var(--navy-100); }
.auth-card .role-grid .rb .rnm { overflow:hidden; color:var(--text); font-size:11.5px; white-space:nowrap; text-overflow:ellipsis; }
.auth-card .role-grid .rb .rd { color:var(--muted); font-size:9.5px; }
.role-avatar { width:29px; height:29px; display:grid; place-items:center; flex:0 0 29px; border-radius:9px; color:var(--navy); background:#fff; font-size:9px; font-weight:800; box-shadow:inset 0 0 0 1px var(--border); }
.role-check { position:absolute; top:7px; right:8px; color:var(--navy); font-size:10px; opacity:0; }
.rb.active .role-check { opacity:1; }
.auth-card .login-field { margin-bottom:12px; }
.password-input-wrap { position:relative; }
.password-input-wrap input { width:100%; padding-right:48px !important; }
.password-toggle { position:absolute; top:50%; right:7px; width:34px; height:34px; padding:0; display:grid; place-items:center; transform:translateY(-50%); color:var(--muted); background:transparent; border:0; border-radius:9px; cursor:pointer; }
.password-toggle:hover,.password-toggle:focus-visible { color:var(--navy); background:var(--navy-50); outline:none; }
.password-toggle svg { width:19px; height:19px; }
.password-toggle.is-visible::after { content:''; position:absolute; width:21px; height:2px; background:currentColor; transform:rotate(-45deg); border-radius:2px; }
.auth-card .field label { margin-bottom:6px; color:var(--text-2); font-size:11.5px; }
.auth-card .field input { min-height:44px; color:var(--text); background:#fff; border-color:var(--border-strong); }
.auth-card .field input::placeholder { color:var(--muted-2); }
.auth-card .field input:focus { background:#fff; border-color:var(--navy-600); box-shadow:0 0 0 4px rgba(21,72,158,.1); }
.auth-card .req,.auth-card .err { color:var(--red); }
.auth-submit { width:100%; min-height:46px; justify-content:center; margin-top:3px; box-shadow:0 8px 20px rgba(11,42,107,.2); }
.auth-submit span { margin-left:auto; font-size:18px; }
.auth-register { margin-top:15px; color:var(--muted); font-size:11.5px; text-align:center; }
.auth-register a,.auth-card a.text-muted { color:var(--navy-600); font-weight:700; }
.auth-footer { display:flex; justify-content:space-between; gap:12px; margin:20px -4px 0; padding-top:14px; border-top:1px solid var(--border); color:var(--muted-2); font-size:9.5px; }
@media (max-width:900px) { .auth-page { grid-template-columns:1fr; place-items:center; padding:14px; } .auth-showcase { display:none; } .auth-scrim { background:linear-gradient(180deg,rgba(7,30,74,.78),rgba(238,243,249,.82)); } .auth-card { width:min(100%,456px); max-height:calc(100dvh - 28px); margin:0; } }
@media (max-width:520px) { .auth-page { padding:10px; } .auth-card { max-height:calc(100dvh - 20px); margin:0; padding:16px 20px 14px; border-radius:20px; } .auth-brand { min-height:62px; margin-bottom:8px; padding:8px 16px; } .auth-logo { height:48px; } .auth-heading { margin-bottom:12px; } .auth-title { margin-top:5px; font-size:21px; } .auth-card .role-grid { grid-template-columns:1fr 1fr; margin-bottom:12px; } .auth-card .role-grid .rb { padding:7px 8px; } .auth-card .login-field { margin-bottom:8px; } .auth-card .field input { min-height:40px; padding-top:8px; padding-bottom:8px; } .auth-submit { min-height:42px; } .auth-register { margin-top:9px; } .auth-footer { flex-direction:row; align-items:center; gap:6px; margin-top:10px; padding-top:9px; } }
@media (max-height:680px) { .auth-card { padding-top:14px; padding-bottom:12px; } .auth-brand { min-height:58px; margin-bottom:7px; padding:6px 14px; } .auth-logo { height:45px; } .auth-heading { margin-bottom:10px; } .auth-title { margin-top:4px; font-size:20px; } .auth-sub { font-size:11px; } .demo-label { margin-bottom:5px; } .auth-card .role-grid { margin-bottom:9px; gap:5px; } .auth-card .role-grid .rb { padding:6px 8px; } .role-avatar { width:25px; height:25px; flex-basis:25px; } .auth-card .login-field { margin-bottom:6px; } .auth-card .field label { margin-bottom:3px; } .auth-card .field input { min-height:38px; padding-top:7px; padding-bottom:7px; } .auth-submit { min-height:40px; } .auth-register { margin-top:7px; } .auth-footer { margin-top:8px; padding-top:7px; } }

/* ---------- RBAC tabs & switches ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn { border: 1px solid var(--border); background: #fff; color: var(--text-2); padding: 8px 15px; border-radius: 11px; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; display: inline-flex; align-items: center; transition: background .14s, color .14s, border-color .14s; }
.tab-btn:hover { background: var(--bg-2); }
.tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 4px 12px rgba(11,42,107,.22); }
.tab-btn.active .badge { background: rgba(255,255,255,.2); color: #fff; }
.switch { position: relative; display: inline-block; width: 40px; height: 23px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cfd6e4; border-radius: 20px; transition: .18s var(--ease); }
.switch .slider::before { content: ""; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.22); }
.switch input:checked + .slider { background: var(--green); }
.switch input:disabled + .slider { opacity: .55; cursor: not-allowed; }
.switch input:checked + .slider::before { transform: translateX(17px); }
.perm-mod { background: var(--bg-2); font-weight: 700; color: var(--navy); padding: 9px 16px !important; font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Notification list ---------- */
.notif-item { display: flex; gap: 13px; padding: 15px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; transition: background .14s; }
.notif-item:hover { background: var(--bg); }
.notif-item .ni-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 38px; }
.notif-item .ni-ic svg { width: 18px; height: 18px; }
.notif-item.unread { background: var(--navy-50); }
.notif-item .ni-body { flex: 1; min-width: 0; }
.notif-item .ni-body .ni-title { font-weight: 600; color: var(--text); font-size: var(--fs-sm); }
.notif-item .ni-body .ni-msg { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.notif-item .ni-when { font-size: var(--fs-2xs); color: var(--muted); white-space: nowrap; }

/* ---------- Print / PDF export ---------- */
@media print {
  .sidebar, .topbar, .breadcrumb, .page-head .actions, .toolbar, .pagination, .toast-wrap, .loading-bar, .modal-overlay { display: none !important; }
  .app-shell { display: block; }
  .main { margin-left: 0 !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  table.data thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-color-adjust: exact; }
  .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  h1,h2,h3 { color: #000 !important; }
}

/* ============================================================
   Dark Mode
   ============================================================ */
body.dark {
  --navy: #E8EDF5;
  --navy-50: #121B2E;
  --navy-100: #1A2440;
  --navy-200: #243055;
  --navy-600: #6B8CFF;
  --navy-700: #5A7AEE;
  --red: #FF6B7A;
  --red-50: #2A1218;
  --red-600: #FF4D5E;
  --white: #0D1320;
  --bg: #0D1320;
  --bg-2: #121B2E;
  --border: #1F2A40;
  --border-strong: #2A3650;
  --text: #E6ECF7;
  --text-2: #B8C3D8;
  --muted: #8A96AE;
  --muted-2: #6B7790;
  --green: #3DDC97;
  --green-50: #0D1F18;
  --amber: #FFB74D;
  --amber-50: #1F1810;
  --gray-50: #141C2E;
  --info: #64B5F6;
  --info-50: #0F1A2A;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
}
body.dark { background: var(--bg); color: var(--text); }
body.dark .sidebar { background: var(--navy-50); border-right-color: var(--border); }
body.dark .topbar { background: rgba(13,19,32,.85); border-bottom-color: var(--border); }
body.dark .topbar .global-search input { background: var(--bg-2); color: var(--text); border-color: var(--border); }
body.dark .page-title { color: var(--text); }
body.dark .card { background: var(--bg-2); border-color: var(--border); }
body.dark .kpi { background: var(--bg-2); border-color: var(--border); }
body.dark .kpi .v { color: var(--text); }
body.dark .kpi .l { color: var(--text-2); }
body.dark .form-grid { background: var(--bg-2); }
body.dark .field input, body.dark .field select, body.dark .field textarea { background: var(--bg); border-color: var(--border); color: var(--text); }
body.dark .field input:focus, body.dark .field select:focus, body.dark .field textarea:focus { background: var(--white); border-color: var(--navy-600); }
body.dark .field.has-error input, body.dark .field.has-error select, body.dark .field.has-error textarea { background: var(--red-50); }
body.dark table.data th { background: var(--bg-2); color: var(--text-2); border-bottom-color: var(--border); }
body.dark table.data td { border-bottom-color: var(--border); }
body.dark table.data tr:hover td { background: var(--navy-50); }
body.dark .btn-soft { background: var(--bg-2); color: var(--text); border-color: var(--border); }
body.dark .btn-ghost { background: transparent; color: var(--text); }
body.dark .breadcrumb a { color: var(--muted); }
body.dark .breadcrumb .cur { color: var(--navy-600); }
body.dark .dropdown-menu { background: var(--bg-2); border-color: var(--border); }
body.dark .dropdown-menu a:hover { background: var(--navy-50); }
body.dark .modal { background: var(--bg-2); }
body.dark .toast { background: var(--bg-2); color: var(--text); border-color: var(--border); }
body.dark .auth-card { background: rgba(13,19,32,.72); border-color: rgba(255,255,255,.08); }

/* ============================================================
   Command Palette (⌘K / Ctrl+K)
   ============================================================ */
.cmd-backdrop { position: fixed; inset: 0; background: rgba(7,18,46,.45); backdrop-filter: blur(4px); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding-top: 18vh; animation: fadeIn .14s var(--ease); }
.cmd-backdrop.open { display: flex; }
.cmd-box { width: min(720px, 96vw); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .18s var(--ease); }
.cmd-input { width: 100%; padding: 16px 18px; border: none; border-bottom: 1px solid var(--border); background: transparent; font: 400 15px var(--font); color: var(--text); outline: none; }
.cmd-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmd-item { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius: var(--radius-sm); cursor:pointer; color: var(--text); }
.cmd-item:hover, .cmd-item.active { background: var(--bg-2); }
.cmd-item .cmd-ic { width:36px; height:36px; border-radius:10px; background:var(--navy-50); color:var(--navy); display:grid; place-items:center; }
.cmd-item .cmd-ic svg { width:18px; height:18px; }
.cmd-item b { color: var(--navy); }
.cmd-foot { display:flex; gap:14px; padding:8px 14px; border-top:1px solid var(--border); color:var(--muted); font-size:11.5px; }
.cmd-foot span { display:inline-flex; align-items:center; gap:5px; }
body.dark .cmd-box { background: var(--bg-2); }

/* ============================================================
   Onboarding Tour
   ============================================================ */
.tour-backdrop { position: fixed; inset: 0; background: rgba(7,18,46,.55); z-index: 190; display: none; align-items: center; justify-content: center; animation: fadeIn .2s var(--ease); }
.tour-backdrop.open { display: flex; }
.tour-card { width: min(460px, 94vw); background: #fff; border-radius: var(--radius-md); padding: 26px; box-shadow: var(--shadow-lg); }
.tour-card h3 { font-size: var(--fs-h2); margin: 0 0 6px; }
.tour-card p { color: var(--text-2); font-size: var(--fs-sm); margin: 0 0 18px; line-height: 1.55; }
.tour-dots { display:flex; gap:7px; margin-bottom:18px; }
.tour-dot { width:8px; height:8px; border-radius:50%; background: var(--border-strong); transition: background .2s; }
.tour-dot.active { background: var(--navy); width: 20px; border-radius: 4px; }
.tour-actions { display:flex; gap:10px; justify-content:flex-end; }
body.dark .tour-card { background: var(--bg-2); color: var(--text); }
body.dark .tour-dot { background: var(--border); }
