﻿/* ==========================================================================
   Freight Solutions ERP — Design System
   Light UI · neat elements · abstract panel accents
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, p, figure, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
/* default icon size — every component rule below overrides it */
svg:not([width]) { width: 16px; height: 16px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Tokens ---------- */
:root {
  /* surfaces */
  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --surface-3:     #eef2f9;
  --border:        #e4e9f2;
  --border-strong: #d3dae8;

  /* ink */
  --text:      #0d1b30;
  --text-2:    #3c4a61;
  --muted:     #6b7a93;
  --faint:     #97a3b6;

  /* brand */
  --brand-900: #0a1c38;
  --brand-800: #0f2a52;
  --brand-700: #163a6e;
  --brand-600: #1d4ed8;
  --brand-500: #2f6bea;
  --brand-100: #e7effd;
  --brand-50:  #f2f6fe;

  /* accents */
  --teal:      #0d9488;
  --teal-100:  #d7f2ee;
  --violet:    #6d4aff;
  --violet-100:#ece7ff;
  --amber:     #d97706;
  --amber-100: #fdf0dc;
  --green:     #0f9d58;
  --green-100: #dcf5e8;
  --red:       #d92d20;
  --red-100:   #fde8e6;
  --sky:       #0284c7;
  --sky-100:   #e0f2fe;

  /* geometry */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(13,27,48,.06), 0 1px 1px rgba(13,27,48,.04);
  --sh-2: 0 2px 6px rgba(13,27,48,.06), 0 8px 20px -12px rgba(13,27,48,.18);
  --sh-3: 0 12px 40px -12px rgba(13,27,48,.25), 0 2px 8px rgba(13,27,48,.06);
  --ring: 0 0 0 3px rgba(45,107,234,.18);

  /* layout */
  --sidebar-w: 262px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 62px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

/* ---------- 3. Base ---------- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
small { font-size: 12px; }
::selection { background: var(--brand-100); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5dced; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bfc9df; background-clip: content-box; border: 3px solid transparent; }

/* ==========================================================================
   4. App shell
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
  transition: width .22s ease, flex-basis .22s ease;
}
.sidebar__brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.brandmark {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand-600), var(--brand-800) 60%, var(--teal));
  display: grid; place-items: center;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 4px 12px -4px rgba(29,78,216,.55);
}
.brandmark::after {
  content: ""; position: absolute; inset: -40% -60% auto auto;
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,.22);
}
.brandmark svg { width: 19px; height: 19px; position: relative; }
.brandtext { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.brandtext b { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brandtext span { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }

.sidebar__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 12px 18px; }
.navgroup + .navgroup { margin-top: 18px; }
.navgroup__title {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); padding: 0 10px 7px;
}
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.2px;
  position: relative; white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
.navlink svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--faint); transition: color .14s; }
.navlink:hover { background: var(--surface-3); color: var(--text); }
.navlink:hover svg { color: var(--brand-600); }
.navlink.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.navlink.is-active svg { color: var(--brand-600); }
.navlink.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--brand-600);
}
.navlink__badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: var(--surface-3); color: var(--muted);
  padding: 1px 7px; border-radius: var(--r-pill);
}
.navlink.is-active .navlink__badge { background: #fff; color: var(--brand-700); }
.navlink__badge--hot { background: var(--red-100); color: var(--red); }

.sidebar__foot { padding: 12px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.sidecard {
  position: relative; overflow: hidden;
  border-radius: var(--r-md); padding: 13px 14px;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  color: #fff;
}
.sidecard::before {
  content: ""; position: absolute; right: -22px; bottom: -34px;
  width: 96px; height: 96px; border-radius: 50%;
  border: 14px solid rgba(255,255,255,.10);
}
.sidecard::after {
  content: ""; position: absolute; right: 16px; top: -18px;
  width: 44px; height: 44px; border-radius: 12px; transform: rotate(28deg);
  background: rgba(255,255,255,.10);
}
.sidecard b { font-size: 12.5px; display: block; position: relative; }
.sidecard p { font-size: 11.5px; color: rgba(255,255,255,.75); margin-top: 3px; position: relative; }
.sidecard .bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,.22); margin-top: 10px; position: relative; }
.sidecard .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: #fff; }

/* collapsed state */
.app.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
.app.is-collapsed .brandtext,
.app.is-collapsed .navgroup__title,
.app.is-collapsed .navlink span,
.app.is-collapsed .navlink__badge,
.app.is-collapsed .sidebar__foot { display: none; }
.app.is-collapsed .navlink { justify-content: center; padding: 10px; }
.app.is-collapsed .sidebar__brand { justify-content: center; padding: 0; }

/* --- Topbar --- */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 35;
}
.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: .14s;
}
.iconbtn:hover { background: var(--surface-3); color: var(--text); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn--bordered { border-color: var(--border); background: var(--surface); }

.searchbar {
  flex: 1; max-width: 420px; position: relative;
}
.searchbar input {
  width: 100%; height: 36px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 0 74px 0 36px; font-size: 13px; outline: none; transition: .16s;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar input:focus { background: #fff; border-color: var(--brand-500); box-shadow: var(--ring); }
.searchbar svg { position: absolute; left: 11px; top: 9px; width: 17px; height: 17px; color: var(--faint); }
.searchbar kbd {
  position: absolute; right: 8px; top: 8px;
  font: 600 10.5px/1 var(--font); color: var(--faint);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 4px 6px;
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.dot { position: relative; }
.dot::after {
  content: ""; position: absolute; top: 6px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 2px solid #fff;
}

.userchip {
  display: flex; align-items: center; gap: 9px; padding: 4px 9px 4px 4px;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: .14s;
}
.userchip:hover { border-color: var(--border-strong); box-shadow: var(--sh-1); }
.userchip__meta { line-height: 1.2; text-align: left; }
.userchip__meta b { font-size: 12.5px; font-weight: 600; display: block; }
.userchip__meta span { font-size: 10.5px; color: var(--muted); }
.userchip svg { width: 14px; height: 14px; color: var(--faint); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  display: grid; place-items: center; color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--brand-600), var(--violet));
}
.avatar--lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 22px; border-radius: 18px; }
.avatar--xl { width: 86px; height: 86px; flex-basis: 86px; font-size: 30px; border-radius: 24px; }
.avatar--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }
.avatar--teal { background: linear-gradient(135deg, var(--teal), #0369a1); }
.avatar--amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar--green { background: linear-gradient(135deg, #10b981, #047857); }

/* dropdown */
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 218px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-3); padding: 6px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s;
}
.menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.menu__head { padding: 10px 10px 11px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px;
  color: var(--text-2); background: none; border: 0; cursor: pointer; text-align: left;
}
.menu__item:hover { background: var(--surface-3); color: var(--text); }
.menu__item svg { width: 16px; height: 16px; color: var(--faint); }
.menu__item--danger { color: var(--red); }
.menu__item--danger svg { color: var(--red); }
.menu__sep { height: 1px; background: var(--border); margin: 6px 0; }
.has-menu { position: relative; }

/* --- Main --- */
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { padding: 24px 26px 46px; flex: 1; }
.main--flush { padding: 0; }
.container { max-width: 1400px; margin: 0 auto; }

/* ==========================================================================
   5. Page header
   ========================================================================== */
.pagehead { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead__text { min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumbs svg { width: 12px; height: 12px; opacity: .6; }
.crumbs a:hover { color: var(--brand-600); }
.pagehead p.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pagehead__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* hero band with abstract art */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 22px 24px;
  background: linear-gradient(115deg, var(--brand-900) 0%, var(--brand-700) 46%, #1b4fa8 100%);
  color: #fff; margin-bottom: 20px;
}
.hero > * { position: relative; z-index: 2; }
.hero h1 { color: #fff; font-size: 20px; }
.hero p { color: rgba(255,255,255,.72); font-size: 13px; margin-top: 5px; max-width: 62ch; }
.hero__art { position: absolute; inset: 0; z-index: 1; opacity: .9; pointer-events: none; }
.hero__art .ring {
  position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.14);
}
.hero__art .ring:nth-child(1) { width: 300px; height: 300px; right: -60px; top: -120px; }
.hero__art .ring:nth-child(2) { width: 210px; height: 210px; right: -14px; top: -74px; border-color: rgba(255,255,255,.20); }
.hero__art .ring:nth-child(3) { width: 120px; height: 120px; right: 32px; top: -22px; border-color: rgba(255,255,255,.26); }
.hero__art .blob {
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  filter: blur(60px); opacity: .45;
}
.hero__art .blob--teal { background: #0d9488; right: 120px; bottom: -190px; }
.hero__art .blob--violet { background: #6d4aff; right: -60px; top: -160px; opacity: .38; }
.hero__art .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(100deg, #000 10%, transparent 72%);
  -webkit-mask-image: linear-gradient(100deg, #000 10%, transparent 72%);
}
.hero__row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.hero__stats { margin-left: auto; display: flex; gap: 26px; }
.hero__stat b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.hero__stat span { font-size: 11px; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .07em; }

/* ==========================================================================
   6. Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--primary {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
  box-shadow: 0 1px 2px rgba(29,78,216,.35), 0 6px 16px -8px rgba(29,78,216,.6);
}
.btn--primary:hover { background: #1a45c2; border-color: #1a45c2; color: #fff; }
.btn--dark { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.btn--dark:hover { background: #13294a; color: #fff; }
.btn--teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--teal:hover { background: #0b7d73; color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-3); }
.btn--danger { color: var(--red); border-color: #f3cfcb; background: #fff; }
.btn--danger:hover { background: var(--red-100); border-color: #ecb7b2; color: var(--red); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.2px; border-radius: var(--r-xs); }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: 42px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }

.btngroup { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: var(--r-sm); gap: 2px; }
.btngroup button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 6px;
  font-size: 12.4px; font-weight: 600; color: var(--muted); cursor: pointer; transition: .14s;
}
.btngroup button:hover { color: var(--text); }
.btngroup button.is-active { background: #fff; color: var(--brand-700); box-shadow: var(--sh-1); }

/* ==========================================================================
   7. Cards & panels
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-1);
}
.card--pad { padding: 18px; }
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card__head h2, .card__head h3 { font-size: 14.5px; }
.card__head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card__head-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 18px; }
.card__body--tight { padding: 12px 18px; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-md) var(--r-md); display: flex; align-items: center; gap: 10px; }

/* grids */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* stat tile */
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 17px; box-shadow: var(--sh-1);
  transition: .18s;
}
.stat:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.stat::after {
  content: ""; position: absolute; right: -28px; top: -34px;
  width: 96px; height: 96px; border-radius: 50%;
  border: 16px solid var(--surface-3); opacity: .75;
}
.stat > * { position: relative; z-index: 1; }
.stat__top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.stat__ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-600);
}
.stat__ico svg { width: 16px; height: 16px; }
.stat__ico--teal { background: var(--teal-100); color: var(--teal); }
.stat__ico--violet { background: var(--violet-100); color: var(--violet); }
.stat__ico--amber { background: var(--amber-100); color: var(--amber); }
.stat__ico--green { background: var(--green-100); color: var(--green); }
.stat__ico--red { background: var(--red-100); color: var(--red); }
.stat__ico--sky { background: var(--sky-100); color: var(--sky); }
.stat__label { font-size: 12.2px; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 25px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.stat__value small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat__foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11.8px; color: var(--muted); }

.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 11.6px; padding: 1.5px 6px; border-radius: var(--r-pill); }
.trend svg { width: 12px; height: 12px; }
.trend--up { color: var(--green); background: var(--green-100); }
.trend--down { color: var(--red); background: var(--red-100); }
.trend--flat { color: var(--muted); background: var(--surface-3); }

/* mini bar / spark */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark i { flex: 1; background: var(--brand-100); border-radius: 2px 2px 0 0; min-height: 3px; }
.spark i.hi { background: var(--brand-600); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--brand-600); }
.progress i.teal { background: var(--teal); }
.progress i.amber { background: var(--amber); }
.progress i.green { background: var(--green); }
.progress i.red { background: var(--red); }
.progress--lg { height: 9px; }

/* ==========================================================================
   8. Chips, badges, pills
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge--plain::before { display: none; }
.badge--green { background: var(--green-100); color: #07794a; }
.badge--amber { background: var(--amber-100); color: #a35a05; }
.badge--red   { background: var(--red-100); color: #b02419; }
.badge--blue  { background: var(--brand-100); color: var(--brand-700); }
.badge--teal  { background: var(--teal-100); color: #0b6f66; }
.badge--violet{ background: var(--violet-100); color: #4b31c4; }
.badge--sky   { background: var(--sky-100); color: #0369a1; }
.badge--grey  { background: var(--surface-3); color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: var(--r-xs); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 11.8px; color: var(--text-2); font-weight: 500;
}
.tag svg { width: 13px; height: 13px; color: var(--faint); }

.kbd { font: 600 11px var(--font); background: var(--surface-3); border-radius: 5px; padding: 2px 6px; color: var(--muted); }

/* ==========================================================================
   9. Forms
   ========================================================================== */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.label {
  display: block; font-size: 12.4px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px;
}
.label .req { color: var(--red); }
.label .hint { font-weight: 400; color: var(--faint); float: right; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); font-size: 13.2px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; padding: 10px 12px; min-height: 84px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-500); box-shadow: var(--ring); background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 34px; cursor: pointer;
}
.inputgroup { position: relative; }
.inputgroup .input { padding-left: 36px; }
.inputgroup > svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.inputgroup .suffix { position: absolute; right: 12px; top: 9px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.help { font-size: 11.8px; color: var(--muted); margin-top: 5px; }
.error-text { font-size: 11.8px; color: var(--red); margin-top: 5px; }
.formrow { display: grid; gap: 14px; }
.formrow--2 { grid-template-columns: 1fr 1fr; }
.formrow--3 { grid-template-columns: repeat(3, 1fr); }
.formrow--4 { grid-template-columns: repeat(4, 1fr); }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.check input { width: 16px; height: 16px; margin: 1.5px 0 0; accent-color: var(--brand-600); cursor: pointer; flex: 0 0 16px; }
.check b { font-weight: 600; color: var(--text); display: block; font-size: 13px; }
.check span.d { font-size: 12px; color: var(--muted); }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong);
  position: relative; transition: .18s; display: block; flex: 0 0 38px;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: .18s; box-shadow: var(--sh-1);
}
.switch input:checked + i { background: var(--brand-600); }
.switch input:checked + i::after { transform: translateX(16px); }

.segment { display: flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.segment label { flex: 1; }
.segment input { position: absolute; opacity: 0; }
.segment span {
  display: block; text-align: center; padding: 8px 10px; font-size: 12.6px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: .14s; border-right: 1px solid var(--border);
}
.segment label:last-child span { border-right: 0; }
.segment input:checked + span { background: var(--brand-50); color: var(--brand-700); }

/* filter bar */
.filters {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.filters .input, .filters .select { height: 34px; font-size: 12.6px; }
.filters .searchmini { position: relative; min-width: 230px; }
.filters .searchmini svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--faint); }
.filters .searchmini input { padding-left: 33px; }
.filters .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ==========================================================================
   10. Tables
   ========================================================================== */
.tablewrap { overflow-x: auto; }
.table { font-size: 13px; }
.table thead th {
  text-align: left; font-size: 11.2px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
  padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .strong { font-weight: 600; color: var(--text); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--mono); font-size: 12.2px; letter-spacing: -.02em; }
.table a.link { color: var(--brand-600); font-weight: 600; }
.table a.link:hover { text-decoration: underline; }
.table td .sub { font-size: 11.6px; color: var(--faint); display: block; margin-top: 1px; }
.table--compact tbody td { padding: 8.5px 14px; }
.cellflex { display: flex; align-items: center; gap: 9px; }

.rowactions { display: flex; gap: 2px; justify-content: flex-end; opacity: .35; transition: .14s; }
tr:hover .rowactions { opacity: 1; }
.rowactions .iconbtn { width: 28px; height: 28px; }
.rowactions .iconbtn svg { width: 15px; height: 15px; }

.tablefoot {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--border); font-size: 12.4px; color: var(--muted);
  background: var(--surface-2); border-radius: 0 0 var(--r-md) var(--r-md);
}
.pager { margin-left: auto; display: flex; gap: 4px; }
.pager button {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-xs);
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  font-size: 12.4px; font-weight: 600; cursor: pointer;
}
.pager button:hover { background: var(--surface-3); }
.pager button.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 38px; height: 38px; margin: 0 auto 12px; color: var(--border-strong); }

/* ==========================================================================
   11. Tabs
   ========================================================================== */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  padding: 0 4px; overflow-x: auto;
}
.tabs button {
  border: 0; background: none; cursor: pointer; position: relative;
  padding: 11px 13px; font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; transition: .14s;
}
.tabs button:hover { color: var(--text); }
.tabs button.is-active { color: var(--brand-700); }
.tabs button.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--brand-600); border-radius: 2px 2px 0 0;
}
.tabs .count { font-size: 10.8px; background: var(--surface-3); border-radius: 99px; padding: 1px 6px; margin-left: 5px; }
.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   12. Timeline / milestones
   ========================================================================== */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-strong);
}
.tl-item.done::before { background: var(--green); border-color: var(--green); }
.tl-item.active::before { background: var(--brand-600); border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }
.tl-item.warn::before { background: var(--amber); border-color: var(--amber); }
.tl-item b { font-size: 13px; font-weight: 600; display: block; }
.tl-item .when { font-size: 11.8px; color: var(--faint); }
.tl-item p { font-size: 12.4px; color: var(--muted); margin-top: 3px; }

/* horizontal stepper */
.stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 4px 0; }
.step { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 120px; }
.step__dot {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--surface-3); color: var(--muted); border: 2px solid transparent;
}
.step__dot svg { width: 14px; height: 14px; }
.step.done .step__dot { background: var(--green-100); color: var(--green); }
.step.active .step__dot { background: var(--brand-600); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.step__label { font-size: 12.2px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step.done .step__label, .step.active .step__label { color: var(--text); }
.step__line { flex: 1; height: 2px; background: var(--border); margin: 0 10px; border-radius: 2px; min-width: 14px; }
.step.done .step__line { background: var(--green); }

/* ==========================================================================
   13. Modal, toast, drawer
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; background: rgba(10,20,38,.45); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px; z-index: 90;
  opacity: 0; visibility: hidden; transition: .18s;
}
.overlay.is-open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 540px; background: #fff; border-radius: var(--r-lg);
  box-shadow: var(--sh-3); transform: translateY(10px) scale(.99); transition: .2s;
  max-height: 88vh; display: flex; flex-direction: column;
}
.overlay.is-open .modal { transform: none; }
.modal--wide { max-width: 780px; }
.modal__head { padding: 18px 20px 15px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.modal__head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 120; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 11px; min-width: 280px;
  background: var(--brand-900); color: #fff; padding: 12px 15px;
  border-radius: var(--r-md); box-shadow: var(--sh-3); font-size: 13px;
  animation: slideIn .22s cubic-bezier(.2,.9,.3,1.2);
}
.toast svg { width: 17px; height: 17px; flex: 0 0 17px; }
.toast--ok svg { color: #4ade80; }
.toast--warn svg { color: #fbbf24; }
.toast--err svg { color: #fb7185; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* command palette */
.cmdk { align-items: flex-start; padding-top: 12vh; }
.cmdk .modal { max-width: 560px; }
.cmdk__input { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.cmdk__input svg { width: 18px; height: 18px; color: var(--faint); }
.cmdk__input input { flex: 1; border: 0; outline: none; font-size: 14.5px; }
.cmdk__list { max-height: 320px; overflow-y: auto; padding: 8px; }
.cmdk__item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.2px; color: var(--text-2); }
.cmdk__item svg { width: 16px; height: 16px; color: var(--faint); }
.cmdk__item:hover, .cmdk__item.is-sel { background: var(--brand-50); color: var(--brand-700); }
.cmdk__item .grp { margin-left: auto; font-size: 11px; color: var(--faint); }

/* ==========================================================================
   14. Auth pages
   ========================================================================== */
.auth { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth__art {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #071731 0%, var(--brand-800) 45%, #16408a 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 42px 46px;
}
.auth__art > * { position: relative; z-index: 3; }
.auth__bg { position: absolute; inset: 0; z-index: 1; }
.auth__bg .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 30%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000, transparent 78%);
}
.auth__bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); }
.auth__bg .b1 { width: 380px; height: 380px; background: #1d4ed8; opacity: .5; left: -90px; top: -80px; }
.auth__bg .b2 { width: 320px; height: 320px; background: #0d9488; opacity: .38; right: -60px; bottom: 60px; }
.auth__bg .b3 { width: 240px; height: 240px; background: #6d4aff; opacity: .30; right: 120px; top: -60px; }
.auth__bg .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.auth__bg .r1 { width: 460px; height: 460px; right: -140px; bottom: -170px; }
.auth__bg .r2 { width: 320px; height: 320px; right: -70px; bottom: -100px; border-color: rgba(255,255,255,.16); }
.auth__bg .r3 { width: 190px; height: 190px; right: -6px; bottom: -36px; border-color: rgba(255,255,255,.2); }

.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__brand .brandtext b { color: #fff; font-size: 15px; }
.auth__brand .brandtext span { color: rgba(255,255,255,.6); }
.auth__pitch h2 { color: #fff; font-size: 30px; line-height: 1.22; letter-spacing: -.035em; max-width: 15ch; }
.auth__pitch p { color: rgba(255,255,255,.66); font-size: 14px; margin-top: 14px; max-width: 46ch; line-height: 1.65; }
.auth__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.auth__chips span {
  font-size: 12px; padding: 5px 11px; border-radius: 99px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.86);
}
.auth__flow {
  margin-top: 30px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 15px 16px; border-radius: var(--r-md);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.auth__flow i {
  font-style: normal; font-size: 11.4px; padding: 4px 9px; border-radius: 6px;
  background: rgba(255,255,255,.1); color: #fff; white-space: nowrap;
}
.auth__flow svg { width: 13px; height: 13px; color: rgba(255,255,255,.4); }
.auth__foot { display: flex; gap: 20px; font-size: 12px; color: rgba(255,255,255,.5); }

.auth__form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth__box { width: 100%; max-width: 380px; }
.auth__box h1 { font-size: 25px; letter-spacing: -.03em; }
.auth__box .lead { color: var(--muted); font-size: 13.5px; margin-top: 7px; margin-bottom: 26px; }
.auth__alt { text-align: center; font-size: 12.8px; color: var(--muted); margin-top: 22px; }
.auth__alt a { color: var(--brand-600); font-weight: 600; }
.auth__sep { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--faint); font-size: 11.5px; }
.auth__sep::before, .auth__sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth__legal { margin-top: 34px; font-size: 11.4px; color: var(--faint); text-align: center; line-height: 1.6; }
.auth__mobilebrand { display: none; }

/* ==========================================================================
   15. Flow diagram page
   ========================================================================== */
.flowcanvas {
  position: relative; padding: 26px; border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 1px 1px, #dbe2f0 1px, transparent 0) 0 0/22px 22px,
    var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.flowlane { display: flex; align-items: stretch; gap: 12px; min-width: max-content; padding: 4px 0; }
.flowlane + .flowlane { margin-top: 18px; }
.lanelabel {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: grid; place-items: center; padding: 10px 6px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--surface-3); color: var(--muted); flex: 0 0 30px;
}
.lanelabel--brand { background: var(--brand-100); color: var(--brand-700); }
.lanelabel--teal { background: var(--teal-100); color: #0b6f66; }
.lanelabel--violet { background: var(--violet-100); color: #4b31c4; }
.lanelabel--amber { background: var(--amber-100); color: #a35a05; }

.node {
  position: relative; min-width: 158px; max-width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 13px; box-shadow: var(--sh-1); transition: .18s;
}
.node:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--brand-500); }
.node__ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-600); margin-bottom: 9px; }
.node__ico svg { width: 14px; height: 14px; }
.node b { font-size: 12.6px; display: block; line-height: 1.35; }
.node p { font-size: 11.4px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.node--ai { border-color: #ddd6ff; background: linear-gradient(180deg, #fbfaff, #fff); }
.node--ai .node__ico { background: var(--violet-100); color: var(--violet); }
.node--human { border-color: #fbe3c4; background: linear-gradient(180deg, #fffcf7, #fff); }
.node--human .node__ico { background: var(--amber-100); color: var(--amber); }
.node--done .node__ico { background: var(--green-100); color: var(--green); }
.node__tag { position: absolute; top: 10px; right: 10px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

.arrow { display: grid; place-items: center; flex: 0 0 26px; color: var(--border-strong); }
.arrow svg { width: 18px; height: 18px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* module map */
.modmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 12px; }
.modcard {
  border: 1px solid var(--border); border-radius: var(--r-md); background: #fff;
  padding: 14px; transition: .18s; position: relative; overflow: hidden;
}
.modcard:hover { border-color: var(--brand-500); box-shadow: var(--sh-2); transform: translateY(-2px); }
.modcard::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2); }
.modcard > * { position: relative; }
.modcard .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-600); margin-bottom: 10px; }
.modcard .ico svg { width: 17px; height: 17px; }
.modcard .ico.stat__ico--teal   { background: var(--teal-100);   color: var(--teal); }
.modcard .ico.stat__ico--violet { background: var(--violet-100); color: var(--violet); }
.modcard .ico.stat__ico--amber  { background: var(--amber-100);  color: var(--amber); }
.modcard .ico.stat__ico--green  { background: var(--green-100);  color: var(--green); }
.modcard .ico.stat__ico--red    { background: var(--red-100);    color: var(--red); }
.modcard .ico.stat__ico--sky    { background: var(--sky-100);    color: var(--sky); }
.modcard b { font-size: 13px; display: block; }
.modcard p { font-size: 11.8px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.modcard .meta { margin-top: 10px; display: flex; gap: 6px; align-items: center; }

/* ==========================================================================
   16. Misc components
   ========================================================================== */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12.4px; }
.kv dd { color: var(--text); font-weight: 500; }

.list-plain > li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-plain > li:last-child { border-bottom: 0; }
.list-plain b { font-size: 13px; font-weight: 600; }
.list-plain .sub { font-size: 11.8px; color: var(--muted); display: block; margin-top: 1px; }
.list-plain .right { margin-left: auto; text-align: right; }

.alert {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--r-md);
  font-size: 12.8px; border: 1px solid; line-height: 1.55;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.alert b { display: block; margin-bottom: 2px; }
.alert--info { background: var(--brand-50); border-color: #d5e2fb; color: var(--brand-700); }
.alert--warn { background: #fffaf0; border-color: #f7e3c2; color: #92590a; }
.alert--ok { background: #f3fbf6; border-color: #cdecda; color: #0a6b41; }
.alert--err { background: #fef5f4; border-color: #f6d6d2; color: #a52318; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }
.dot-sep { color: var(--border-strong); margin: 0 6px; }

.aiwidget {
  position: relative; overflow: hidden;
  border-radius: var(--r-md); border: 1px solid #e2dcff;
  background: linear-gradient(135deg, #fbfaff 0%, #f4f1ff 100%);
  padding: 16px;
}
.aiwidget::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px;
  border-radius: 50%; background: radial-gradient(circle, rgba(109,74,255,.16), transparent 70%);
}
.aiwidget > * { position: relative; }
.aiwidget__head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.aiwidget__head .ico { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--violet), #9333ea); display: grid; place-items: center; color: #fff; }
.aiwidget__head .ico svg { width: 15px; height: 15px; }
.aiwidget__head b { font-size: 13.5px; }
.aiwidget__head .sub { font-size: 11.4px; color: var(--muted); }

.aimsg { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed #e2dcff; font-size: 12.6px; color: var(--text-2); line-height: 1.55; }
.aimsg:first-of-type { border-top: 0; }
.aimsg .who { font-weight: 600; color: var(--violet); }

.employee {
  border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; padding: 15px;
  transition: .18s; position: relative; overflow: hidden;
}
.employee:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.employee__top { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.employee__av { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 38px; }
.employee__av svg { width: 19px; height: 19px; }
.employee b { font-size: 13.2px; display: block; }
.employee .role { font-size: 11.4px; color: var(--muted); }
.employee p { font-size: 12.2px; color: var(--muted); line-height: 1.55; min-height: 56px; }
.employee__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.matrix td .badge { min-width: 74px; justify-content: center; }

.donut { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.donut svg { transform: rotate(-90deg); }
.donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut__center b { font-size: 21px; font-weight: 700; letter-spacing: -.03em; display: block; }
.donut__center span { font-size: 10.8px; color: var(--muted); }

.barchart {
  display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 10px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(to top, transparent 0 24%, var(--surface-3) 24% calc(24% + 1px));
}
.barchart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.barchart .bars { width: 100%; display: flex; gap: 4px; align-items: flex-end; height: 100%; justify-content: center; }
.barchart .bars i { width: 20px; max-width: 22%; border-radius: 4px 4px 0 0; background: var(--brand-600); transition: .2s; }
.barchart .bars i.b2 { background: var(--teal); }
.barchart .col span { font-size: 11px; color: var(--muted); }
.barchart .col:hover .bars i { filter: brightness(1.12); }

.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.heat i.l1 { background: #dbe7fd; } .heat i.l2 { background: #b6cffb; }
.heat i.l3 { background: #7ba6f5; } .heat i.l4 { background: var(--brand-600); }

/* ==========================================================================
   17. Utilities
   ========================================================================== */
.mt-0{margin-top:0}.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}
.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mt-24{margin-top:24px}
.mb-4{margin-bottom:4px}.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}
.mb-16{margin-bottom:16px}.mb-20{margin-bottom:20px}.mb-24{margin-bottom:24px}
.flex{display:flex}.between{justify-content:space-between}.center{align-items:center}
.wrap{flex-wrap:wrap}.col{flex-direction:column}.g4{gap:4px}.g6{gap:6px}.g8{gap:8px}
.g10{gap:10px}.g12{gap:12px}.g16{gap:16px}.g20{gap:20px}
.ml-auto{margin-left:auto}.w-100{width:100%}.tr{text-align:right}.tc{text-align:center}
.muted{color:var(--muted)}.faint{color:var(--faint)}.strong{font-weight:600;color:var(--text)}
.fs11{font-size:11px}.fs12{font-size:12px}.fs13{font-size:13px}.fs15{font-size:15px}
.fs18{font-size:18px}.fs22{font-size:22px}.fw6{font-weight:600}.fw7{font-weight:700}
.mono{font-family:var(--mono)}.nowrap{white-space:nowrap}
.c-green{color:var(--green)}.c-red{color:var(--red)}.c-amber{color:var(--amber)}
.c-brand{color:var(--brand-600)}.c-teal{color:var(--teal)}.c-violet{color:var(--violet)}
.hide{display:none}

/* ==========================================================================
   18. Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .g-5, .g-6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-2-1, .g-1-2, .g-3-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .auth__mobilebrand { display: flex; justify-content: center; margin-bottom: 26px; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    box-shadow: var(--sh-3); transition: transform .22s ease;
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(10,20,38,.4); z-index: 39;
  }
  .searchbar { max-width: none; }
  .userchip__meta { display: none; }
  .main { padding: 18px 16px 40px; }
}
@media (max-width: 720px) {
  .g-2, .g-3, .g-4, .g-5, .g-6, .g-auto { grid-template-columns: 1fr; }
  .formrow--2, .formrow--3, .formrow--4 { grid-template-columns: 1fr; }
  .hero__stats { margin-left: 0; }
  .pagehead__actions { margin-left: 0; width: 100%; }
}

@media print {
  .sidebar, .topbar, .pagehead__actions, .rowactions { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
