/* ============================================================
   CAVARI LINK · Internal Operating System
   Brand-aligned with cavari.com.au
   Fonts: Manrope · DM Sans · JetBrains Mono
   Palette: navy #212C43 / #001F3C, red #F14F44, blue #396AB7
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---- Tokens (matched to cavari.com.au) ---------------------- */
:root {
  /* Brand palette — exactly cavari.com.au */
  --red: #F14F44;
  --red-dark: #D43D33;
  --red-darker: #C03028;
  --blue: #396AB7;
  --blue-dark: #2C5494;
  --navy: #001F3C;
  --navy-card: #212C43;

  /* Greys */
  --grey-text: #4A5568;
  --grey-mid: #8A92A0;
  --grey-light: #C8CDD5;
  --grey-border: #E2E8F0;
  --grey-bg: #F7FAFC;
  --grey-bg-2: #EDF2F7;

  --white: #FFFFFF;

  /* Surface aliases */
  --bg: #FFFFFF;
  --bg-2: #F7FAFC;
  --bg-3: #EDF2F7;
  --surface: #FFFFFF;
  --surface-2: #F7FAFC;

  /* Ink aliases */
  --ink: #212C43;
  --ink-strong: #001F3C;
  --ink-2: #2A3656;
  --text: #212C43;
  --text-2: #4A5568;
  --text-3: #8A92A0;
  --text-4: #A8B0BC;
  --text-5: #C8CDD5;

  /* Lines */
  --rule: #E2E8F0;
  --rule-2: #CBD5E0;
  --rule-3: #A0AEC0;

  /* Brand tokens */
  --brand: var(--red);
  --accent: var(--red);
  --accent-2: var(--blue);

  /* Semantic */
  --positive: #2E7D5B;
  --positive-bg: #E6F4EE;
  --warn: #C77D17;
  --warn-bg: #FDF4E5;
  --danger: var(--red);
  --danger-bg: #FDECEB;
  --info: var(--blue);
  --info-bg: #E8EFF8;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(33,44,67,0.04), 0 1px 3px rgba(33,44,67,0.06);
  --shadow-2: 0 4px 12px -2px rgba(33,44,67,0.08), 0 2px 6px -1px rgba(33,44,67,0.04);
  --shadow-3: 0 24px 48px -12px rgba(33,44,67,0.18);

  /* Type */
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --sans-alt: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Layout */
  --topbar-h: 60px;
  --sidebar-w: 252px;
  --content-max: 1480px;
  --radius: 6px;
  --radius-2: 10px;
  --radius-3: 16px;
}

/* ---- Reset --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; outline: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--red); color: #fff; }

/* ---- Base ---------------------------------------------------- */
html, body {
  height: 100%;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   SIGN-IN
   ============================================================ */
.signin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.signin__brand {
  position: relative;
  background: var(--navy);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.signin__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(57,106,183,0.20), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(241,79,68,0.15), transparent 60%);
  pointer-events: none;
}
.signin__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(700px 600px at 30% 50%, #000 30%, transparent 80%);
  pointer-events: none;
}
.signin__logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}
.signin__logo img { height: 36px; }
.signin__logo .divider {
  width: 1px; height: 22px;
  background: rgba(255,255,255,0.30);
}
.signin__logo .system {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.70);
  font-weight: 500;
}
.signin__hero {
  position: relative;
  z-index: 2;
  max-width: 540px;
}
.signin__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 28px;
}
.signin__eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--red);
}
.signin__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0 0 22px;
}
.signin__title em { font-style: normal; font-weight: 500; color: var(--red); }
.signin__sub {
  font-size: 16px;
  color: rgba(255,255,255,0.72);
  line-height: 1.6;
  font-weight: 400;
  max-width: 480px;
}
.signin__pillars {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 28px;
}
.signin__pillar { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); font-weight: 600; }
.signin__pillar strong {
  display: block;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  text-transform: none;
}
.signin__pillar strong em { font-style: normal; color: var(--red); font-weight: 500; }

.signin__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  position: relative;
  background: var(--bg);
}
.signin__form { width: 100%; max-width: 400px; }
.signin__form-eyebrow {
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 600;
  margin-bottom: 18px;
}
.signin__form h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.025em;
  color: var(--navy);
  margin: 0 0 12px;
  line-height: 1.1;
}
.signin__form p { color: var(--grey-text); margin: 0 0 32px; font-size: 14px; line-height: 1.6; }

.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 8px;
  font-weight: 600;
}
.field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 500;
  transition: border-color 120ms;
}
.field__input:focus { border-color: var(--navy); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  border: 1px solid transparent;
  transition: all 120ms;
  white-space: nowrap;
  font-family: var(--sans);
}
.btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--navy {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn--navy:hover { background: var(--navy-card); border-color: var(--navy-card); }
.btn--ghost {
  background: var(--surface);
  color: var(--navy);
  border-color: var(--grey-border);
}
.btn--ghost:hover { background: var(--bg-2); border-color: var(--grey-mid); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 13px; font-size: 12px; }
.btn--lg { padding: 14px 22px; font-size: 14px; }
.btn--icon { padding: 8px; aspect-ratio: 1; }

.signin__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--grey-mid);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 600;
}
.signin__divider::before, .signin__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--grey-border);
}
.signin__legal {
  margin-top: 24px;
  font-size: 12px;
  color: var(--grey-mid);
  line-height: 1.6;
}
.signin__legal a { color: var(--navy); font-weight: 600; }
.signin__footer {
  position: absolute;
  bottom: 24px;
  left: 56px;
  right: 56px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--grey-mid);
  letter-spacing: 0.04em;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: none; min-height: 100vh; flex-direction: column; }
.app.active { display: flex; }

/* ---- Topbar -------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--grey-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 50;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 24px;
  width: calc(var(--sidebar-w) - 24px);
}
.topbar__brand img { height: 22px; }
.topbar__brand .divider {
  width: 1px; height: 18px;
  background: var(--grey-border);
}
.topbar__brand .system {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 600;
}
.entity-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--grey-border);
  background: var(--surface);
  cursor: pointer;
  transition: all 120ms;
  margin-right: 14px;
  font-family: var(--sans);
}
.entity-switch:hover { border-color: var(--grey-mid); background: var(--bg-2); }
.entity-switch__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px rgba(46, 125, 91, 0.18);
}
.entity-switch__name {
  font-size: 12px; font-weight: 600;
  color: var(--navy);
}
.entity-switch__caret { color: var(--grey-mid); }

.topbar__search {
  flex: 1;
  max-width: 540px;
  position: relative;
}
.topbar__search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius);
  border: 1px solid var(--grey-border);
  background: var(--surface);
  color: var(--navy);
  font-size: 13px;
  font-weight: 500;
}
.topbar__search input::placeholder { color: var(--grey-mid); font-weight: 400; }
.topbar__search input:focus { border-color: var(--navy); }
.topbar__search .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--grey-mid);
}
.topbar__search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px;
  color: var(--grey-mid);
  background: var(--bg-2);
  padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--grey-border);
  font-weight: 500;
}
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--grey-text);
  transition: all 120ms;
  position: relative;
}
.icon-btn:hover { background: var(--bg-2); color: var(--navy); }
.icon-btn .badge {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--surface);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  flex-shrink: 0;
  font-feature-settings: 'tnum';
}
.avatar--lg { width: 56px; height: 56px; font-size: 16px; }
.avatar--xl { width: 96px; height: 96px; font-size: 26px; font-weight: 600; }
.avatar--sm { width: 22px; height: 22px; font-size: 9px; }

.avatar[data-hue="1"] { background: var(--navy); }
.avatar[data-hue="2"] { background: var(--blue); }
.avatar[data-hue="3"] { background: #2D5C4D; }
.avatar[data-hue="4"] { background: #5A4374; }
.avatar[data-hue="5"] { background: #8B5A30; }
.avatar[data-hue="6"] { background: var(--navy-card); }
.avatar[data-hue="7"] { background: #6B4226; }
.avatar[data-hue="8"] { background: #2A4A3D; }

/* ---- Layout -------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1;
  min-height: 0;
}

/* ---- Sidebar ------------------------------------------------- */
.sidebar {
  border-right: 1px solid var(--grey-border);
  padding: 20px 14px 90px;
  overflow-y: auto;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  background: var(--bg);
}
.sidebar__group { margin-bottom: 22px; }
.sidebar__group-title {
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
  padding: 0 12px;
  margin-bottom: 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--grey-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 100ms;
  position: relative;
  margin-bottom: 1px;
}
.nav-link svg { color: var(--grey-mid); transition: color 100ms; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-2); color: var(--navy); }
.nav-link:hover svg { color: var(--navy-card); }
.nav-link.active {
  background: var(--navy);
  color: #fff;
}
.nav-link.active svg { color: #fff; }
.nav-link__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--grey-mid);
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.nav-link.active .nav-link__count { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.10); }

.sidebar__footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--grey-border);
  background: var(--bg);
  font-size: 11px;
  color: var(--grey-mid);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__footer .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px rgba(46, 125, 91, 0.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- Main content ------------------------------------------- */
.main {
  min-width: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--bg);
}
.view { display: none; }
.view.active { display: block; }
.view__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 44px 96px;
}

/* ---- Page Header -------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--grey-border);
  gap: 24px;
}
.page-header__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.030em;
  color: var(--navy);
  margin: 0 0 6px;
  line-height: 1.1;
}
.page-header__title em { font-style: normal; font-weight: 500; color: var(--red); }
.page-header__sub {
  font-size: 14px;
  color: var(--grey-text);
  max-width: 720px;
  font-weight: 400;
  line-height: 1.55;
}
.page-header__breadcrumb {
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header__breadcrumb::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--red);
}
.page-header__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---- Tabs --------------------------------------------------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--grey-border);
  margin-bottom: 28px;
}
.tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-mid);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 100ms;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-color: var(--red); }
.tab__count {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: 6px;
  color: var(--grey-mid);
}

/* ---- Cards ------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  position: relative;
  transition: border-color 150ms, box-shadow 150ms;
}
.card:hover { border-color: var(--grey-mid); }
.card--pad { padding: 24px 26px; }
.card--pad-sm { padding: 16px 18px; }
.card--lift { box-shadow: var(--shadow-1); }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grey-border);
}
.card__title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 0;
}
.card__subtitle {
  font-size: 11px;
  color: var(--grey-mid);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}
.card__body { padding: 22px 24px; }
.card__foot {
  padding: 14px 24px;
  border-top: 1px solid var(--grey-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--grey-text);
}

/* ---- Stat ---------------------------------------------------- */
.stat-row {
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  overflow: hidden;
}
.stat {
  background: var(--surface);
  padding: 22px 26px;
  position: relative;
  border-right: 1px solid var(--grey-border);
}
.stat:last-child { border-right: none; }
.stat__label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
  margin-bottom: 12px;
}
.stat__value {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.030em;
  line-height: 1;
  font-feature-settings: 'lnum', 'tnum';
}
.stat__value--mono {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 24px;
}
.stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 10px;
  padding: 2px 7px;
  border-radius: 3px;
}
.stat__delta--up { color: var(--positive); background: var(--positive-bg); }
.stat__delta--down { color: var(--red); background: var(--danger-bg); }
.stat__delta--flat { color: var(--grey-text); background: var(--bg-2); }
.stat__spark { position: absolute; right: 16px; top: 16px; opacity: 0.85; }

/* ---- Grid Helpers -------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--12 { grid-template-columns: repeat(12, 1fr); }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }
.gap-sm { gap: 12px; }
.gap-lg { gap: 28px; }

/* ---- Pills / Chips ------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid var(--grey-border);
  color: var(--grey-text);
  background: var(--surface);
  white-space: nowrap;
}
.pill--navy { color: #fff; background: var(--navy); border-color: var(--navy); }
.pill--red { color: #fff; background: var(--red); border-color: var(--red); }
.pill--positive { color: var(--positive); border-color: rgba(46, 125, 91, 0.30); background: var(--positive-bg); }
.pill--warn { color: var(--warn); border-color: rgba(199, 125, 23, 0.30); background: var(--warn-bg); }
.pill--danger { color: var(--red); border-color: rgba(241, 79, 68, 0.30); background: var(--danger-bg); }
.pill--info { color: var(--blue); border-color: rgba(57, 106, 183, 0.30); background: var(--info-bg); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-2);
  border-radius: 4px;
  color: var(--navy);
  letter-spacing: 0.01em;
}

/* ---- Tables ------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-border);
  white-space: nowrap;
  background: var(--bg-2);
}
.table td {
  padding: 16px;
  border-bottom: 1px solid var(--grey-border);
  font-size: 13px;
  color: var(--ink);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-2); }
.table--compact td { padding: 11px 16px; }
.table__num { font-family: var(--mono); font-size: 12px; color: var(--navy); font-weight: 600; }
.table__pri { font-weight: 600; color: var(--navy); }
.table__sub { font-size: 11px; color: var(--grey-mid); margin-top: 2px; font-weight: 500; }

/* ---- Progress ------------------------------------------------- */
.progress {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress__bar {
  height: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: width 300ms;
}
.progress--positive .progress__bar { background: var(--positive); }
.progress--warn .progress__bar { background: var(--warn); }
.progress--danger .progress__bar { background: var(--red); }
.progress--red .progress__bar { background: var(--red); }
.progress--lg { height: 6px; }
.progress--xs { height: 2px; }

/* ---- Skill chip ---------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--grey-border);
  color: var(--navy);
  font-size: 12px;
  font-weight: 500;
}

/* ---- Avatars stack ------------------------------------------- */
.stack { display: inline-flex; }
.stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.stack .avatar:first-child { margin-left: 0; }

/* ---- Entity cards ------------------------------------------- */
.entity-card {
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  padding: 24px 26px;
  position: relative;
  cursor: pointer;
  transition: all 200ms;
  overflow: hidden;
}
.entity-card:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.entity-card__num {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--grey-mid);
  font-weight: 600;
}
.entity-card__head { margin-bottom: 18px; }
.entity-card__name {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.entity-card__name em {
  font-style: normal;
  font-weight: 500;
  color: var(--red);
}
.entity-card__tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-top: 6px;
  font-weight: 600;
}
.entity-card__metric { display: flex; gap: 28px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--grey-border); }
.entity-card__metric-item { flex: 1; }
.entity-card__metric-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 6px;
  font-weight: 700;
}
.entity-card__metric-value {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.020em;
}
.entity-card__bottom {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-border);
  font-size: 12px;
  color: var(--grey-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

/* ---- Profile ------------------------------------------------- */
.profile-hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: var(--red);
}
.profile-hero__main { flex: 1; position: relative; }
.profile-hero__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 36px;
  color: var(--navy);
  letter-spacing: -0.030em;
  margin: 0 0 6px;
  line-height: 1.05;
}
.profile-hero__role {
  color: var(--grey-text);
  font-size: 15px;
  margin-bottom: 22px;
  font-weight: 500;
}
.profile-hero__role b { color: var(--navy); font-weight: 600; }
.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  font-size: 13px;
  color: var(--grey-text);
}
.profile-hero__meta span b {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--grey-mid);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---- Org Chart ---------------------------------------------- */
.org-canvas {
  background:
    radial-gradient(rgba(33,44,67,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  padding: 48px 28px;
  overflow: auto;
  min-height: 600px;
}
.org-tree { display: flex; flex-direction: column; align-items: center; gap: 36px; min-width: max-content; }
.org-row { display: flex; gap: 24px; justify-content: center; }
.org-node {
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 220px;
  position: relative;
  cursor: pointer;
  transition: all 150ms;
  box-shadow: var(--shadow-1);
}
.org-node:hover { border-color: var(--navy); box-shadow: var(--shadow-2); }
.org-node--lead {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.org-node--lead .org-node__role,
.org-node--lead .org-node__meta { color: rgba(255,255,255,0.65); }
.org-node--lead .org-node__name { color: #fff; }
.org-node__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.org-node__role { font-size: 11px; color: var(--grey-text); font-weight: 500; }
.org-node__meta {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 6px;
  font-weight: 700;
}
.org-line { width: 1px; height: 28px; background: var(--grey-mid); margin: 0 auto; }

/* ---- Calendar ----------------------------------------------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--grey-border);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal__day {
  background: var(--surface);
  padding: 10px 12px;
  min-height: 96px;
  font-size: 11px;
  cursor: pointer;
}
.cal__day--head {
  min-height: 0;
  padding: 8px 12px;
  background: var(--bg-2);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
}
.cal__day--out { background: var(--bg-2); opacity: 0.5; }
.cal__day--active { background: rgba(241, 79, 68, 0.05); border-left: 2px solid var(--red); padding-left: 10px; }
.cal__day--active .cal__day-num { color: var(--red); font-weight: 700; }
.cal__day-num { font-family: var(--mono); color: var(--grey-text); margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.cal__event {
  font-size: 10px;
  padding: 3px 6px;
  background: var(--navy);
  color: #fff;
  border-radius: 3px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.cal__event--positive { background: var(--positive); }
.cal__event--info { background: var(--blue); }
.cal__event--red { background: var(--red); }

/* ---- Booking ----------------------------------------------- */
.slot {
  padding: 11px 12px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 100ms;
  text-align: center;
  font-family: var(--mono);
  background: var(--surface);
  color: var(--navy);
  font-weight: 600;
}
.slot:hover { border-color: var(--navy); }
.slot--selected { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; }

/* ---- Tracker ------------------------------------------------ */
.tracker { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }
.tracker__step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 14px 18px;
  border: 1px solid var(--grey-border);
  border-right: none;
  background: var(--surface);
}
.tracker__step:last-child { border-right: 1px solid var(--grey-border); border-radius: 0 var(--radius) var(--radius) 0; }
.tracker__step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.tracker__step--done { background: var(--positive-bg); border-color: rgba(46, 125, 91, 0.20); }
.tracker__step--active { background: var(--red); border-color: var(--red); color: #fff; }
.tracker__num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--bg-3);
  color: var(--grey-text);
  flex-shrink: 0;
}
.tracker__step--done .tracker__num { background: var(--positive); color: #fff; }
.tracker__step--active .tracker__num { background: #fff; color: var(--red); }
.tracker__label { font-size: 12px; font-weight: 600; color: inherit; }
.tracker__sub { font-size: 10px; color: var(--grey-mid); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 1px; font-weight: 600; }
.tracker__step--active .tracker__sub { color: rgba(255,255,255,0.75); }
.tracker__step--done .tracker__sub { color: var(--positive); }

/* ---- Timeline ---------------------------------------------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute;
  left: 6px; top: 4px; bottom: 4px;
  width: 1px; background: var(--grey-border);
}
.timeline__item { position: relative; padding-bottom: 20px; }
.timeline__dot {
  position: absolute; left: -24px; top: 4px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--navy);
}
.timeline__time { font-size: 11px; color: var(--grey-mid); letter-spacing: 0.04em; font-weight: 600; }
.timeline__text { font-size: 13px; color: var(--ink); margin-top: 4px; line-height: 1.5; }
.timeline__text b { color: var(--navy); font-weight: 600; }

/* ---- KPI rows ----------------------------------------------- */
.kpi-row { padding: 16px 0; border-bottom: 1px solid var(--grey-border); }
.kpi-row:last-child { border-bottom: none; padding-bottom: 0; }
.kpi-row:first-child { padding-top: 0; }
.kpi-row__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 16px; }
.kpi-row__name { font-size: 13px; font-weight: 600; color: var(--navy); }
.kpi-row__sub { font-size: 11px; color: var(--grey-text); margin-top: 3px; font-weight: 500; }
.kpi-row__num { font-family: var(--mono); font-size: 13px; color: var(--navy); font-weight: 700; }

/* ---- AI Assistant ------------------------------------------ */
.ai-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--grey-border);
  z-index: 40;
  display: none;
  flex-direction: column;
  box-shadow: -24px 0 64px -24px rgba(33,44,67,0.10);
}
.ai-panel.active { display: flex; }
.ai-panel__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-panel__title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--navy);
  font-weight: 600;
}
.ai-panel__title svg { color: var(--red); }
.ai-panel__body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.ai-panel__msg { margin-bottom: 22px; }
.ai-panel__msg-from {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--grey-mid); margin-bottom: 8px; font-weight: 700;
}
.ai-panel__msg-content { font-size: 13px; line-height: 1.7; color: var(--ink); }
.ai-panel__msg--user .ai-panel__msg-content {
  background: var(--bg-2);
  padding: 12px 14px;
  border-radius: var(--radius);
}
.ai-panel__suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ai-panel__suggestion {
  padding: 6px 11px;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: 100px;
  color: var(--navy);
  cursor: pointer;
  transition: all 120ms;
  font-weight: 600;
}
.ai-panel__suggestion:hover { background: var(--red); color: #fff; border-color: var(--red); }
.ai-panel__input {
  border-top: 1px solid var(--grey-border);
  padding: 14px 18px;
  display: flex; gap: 10px;
}
.ai-panel__input input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy); font-size: 13px;
  font-family: var(--sans);
}
.ai-panel__input input:focus { border-color: var(--navy); }

/* ---- Alert ------------------------------------------------- */
.alert-item {
  display: flex;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--grey-border);
  transition: background 100ms;
  cursor: pointer;
  align-items: flex-start;
}
.alert-item:hover { background: var(--bg-2); }
.alert-item:last-child { border-bottom: none; }
.alert-item__icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.alert-item__icon--gold { background: var(--bg-2); color: var(--navy); border: 1px solid var(--grey-border); }
.alert-item__icon--warn { background: var(--warn-bg); color: var(--warn); }
.alert-item__icon--danger { background: var(--danger-bg); color: var(--red); }
.alert-item__icon--positive { background: var(--positive-bg); color: var(--positive); }
.alert-item__icon--info { background: var(--info-bg); color: var(--blue); }
.alert-item__title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 3px; }
.alert-item__desc { font-size: 12px; color: var(--grey-text); line-height: 1.5; font-weight: 500; }
.alert-item__time { font-size: 11px; color: var(--grey-mid); white-space: nowrap; align-self: center; font-weight: 600; }

/* ---- Charts (CSS-only) -------------------------------------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 8px 0;
}
.bar-chart__bar {
  flex: 1;
  background: var(--navy);
  border-radius: 3px 3px 0 0;
  position: relative;
  min-height: 4px;
  transition: opacity 120ms;
}
.bar-chart__bar:hover { opacity: 0.85; }
.bar-chart__bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--grey-mid);
  white-space: nowrap;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.bar-chart__bar--alt { background: var(--blue); }
.bar-chart__bar--red { background: var(--red); }
.bar-chart__bar--muted { background: var(--grey-light); }

/* Donut */
.donut { width: 140px; height: 140px; position: relative; }
.donut__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.donut__value {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.025em;
}
.donut__label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-top: 2px;
  font-weight: 700;
}

.heatmap { display: grid; gap: 3px; }
.heatmap__row {
  display: grid;
  grid-template-columns: 120px repeat(20, 1fr);
  gap: 3px;
  align-items: center;
  font-size: 11px;
}
.heatmap__label { color: var(--grey-text); font-size: 11px; font-weight: 600; }
.heatmap__cell {
  height: 22px;
  border-radius: 3px;
  background: var(--bg-3);
}
.heatmap__cell--l1 { background: #DBE3F0; }
.heatmap__cell--l2 { background: #B5C5E0; }
.heatmap__cell--l3 { background: #6E89BD; }
.heatmap__cell--l4 { background: #3D5A92; }
.heatmap__cell--l5 { background: var(--navy); }
.heatmap__cell--over { background: var(--red); }

/* Sparkline */
.sparkline { width: 100%; height: 32px; }
.sparkline path { fill: none; stroke: var(--red); stroke-width: 1.5; }
.sparkline__area { fill: rgba(241,79,68,0.10); stroke: none; }

/* ---- Filter bar -------------------------------------------- */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-bar__search { flex: 1; max-width: 320px; position: relative; }
.filter-bar__search input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  font-size: 13px;
  font-family: var(--sans);
}
.filter-bar__search input::placeholder { color: var(--grey-mid); }
.filter-bar__search input:focus { border-color: var(--navy); }
.filter-bar__search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--grey-mid); }
.filter-pill {
  padding: 7px 13px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--grey-text);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600;
  transition: all 100ms;
}
.filter-pill:hover { border-color: var(--navy); color: var(--navy); }
.filter-pill--active { border-color: var(--navy); color: #fff; background: var(--navy); }
.filter-pill--active .mono { color: rgba(255,255,255,0.55); }

/* ---- Person card -------------------------------------------- */
.person-card {
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  padding: 22px;
  cursor: pointer;
  transition: all 150ms;
}
.person-card:hover { border-color: var(--navy); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.person-card__head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.person-card__name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.person-card__role { font-size: 12px; color: var(--grey-text); margin-top: 3px; font-weight: 500; }
.person-card__meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--grey-text);
  padding-top: 14px;
  border-top: 1px solid var(--grey-border);
  font-weight: 500;
}
.person-card__meta b { color: var(--navy); font-weight: 600; }

/* ---- Deal card ---------------------------------------------- */
.deal-card {
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  padding: 22px 24px;
  position: relative;
  cursor: pointer;
  transition: all 150ms;
  overflow: hidden;
}
.deal-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px; background: var(--red);
  opacity: 0; transition: opacity 150ms;
}
.deal-card:hover { border-color: var(--navy); box-shadow: var(--shadow-2); }
.deal-card:hover::before { opacity: 1; }
.deal-card__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.deal-card__code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--red);
  text-transform: uppercase;
  font-weight: 700;
}
.deal-card__name {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin: 5px 0 4px;
  letter-spacing: -0.020em;
}
.deal-card__client { font-size: 12px; color: var(--grey-text); font-weight: 500; }
.deal-card__num {
  font-family: var(--sans);
  font-size: 18px;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.020em;
}
.deal-card__bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-border);
}

/* ---- Module / training card --------------------------------- */
.module-card {
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  padding: 22px;
  position: relative;
  cursor: pointer;
  transition: all 150ms;
  overflow: hidden;
}
.module-card:hover { border-color: var(--navy); box-shadow: var(--shadow-2); }
.module-card__type {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 10px;
}
.module-card__title {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--navy);
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.3;
  letter-spacing: -0.020em;
}
.module-card__desc { font-size: 12px; color: var(--grey-text); line-height: 1.6; margin-bottom: 16px; font-weight: 500; }
.module-card__meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--grey-mid); font-weight: 600; }

/* ---- Misc helpers ------------------------------------------- */
.muted { color: var(--grey-mid); }
.faint { color: var(--grey-text); }
.mono { font-family: var(--mono); }
.text-0, .text-ink, .text-navy { color: var(--navy); }
.text-red { color: var(--red); }
.uppercase-label {
  font-size: 10px; letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
}
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-12 { font-size: 12px; } .text-13 { font-size: 13px; } .text-14 { font-size: 14px; }
.weight-500 { font-weight: 500; } .weight-600 { font-weight: 600; } .weight-700 { font-weight: 700; }

/* Section title */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.section-head__title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.02em;
}
.section-head__sub {
  font-size: 11px;
  color: var(--grey-mid);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}
.section-head__action { font-size: 12px; color: var(--red); cursor: pointer; font-weight: 600; }
.section-head__action:hover { color: var(--red-dark); }

hr.divider { border: none; height: 1px; background: var(--grey-border); margin: 32px 0; }

/* ---- Notice ------------------------------------------------ */
.notice {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--grey-border);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 16px;
}
.notice b { color: var(--navy); font-weight: 600; }

/* ---- Pull quote -------------------------------------------- */
.pull {
  font-style: normal;
  font-size: 18px;
  color: var(--navy);
  line-height: 1.5;
  border-left: 3px solid var(--red);
  padding: 4px 22px;
  margin: 14px 0;
  font-weight: 500;
}
.pull cite {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--grey-mid);
  letter-spacing: 0.04em;
  margin-top: 12px;
  font-weight: 600;
}

/* Communication feed item */
.feed-item {
  padding: 22px 24px;
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  gap: 16px;
}
.feed-item:last-child { border-bottom: none; }
.feed-item__body { flex: 1; }
.feed-item__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.feed-item__name { font-size: 13px; font-weight: 600; color: var(--navy); }
.feed-item__role { font-size: 11px; color: var(--grey-mid); font-weight: 500; }
.feed-item__time { font-size: 11px; color: var(--grey-mid); margin-left: auto; font-family: var(--mono); font-weight: 500; }
.feed-item__title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin: 8px 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.feed-item__content { font-size: 14px; color: var(--grey-text); line-height: 1.65; font-weight: 500; }

/* ---- Email signature ----------------------------------------- */
.signature-preview {
  background: #FFFFFF;
  color: var(--navy);
  padding: 28px 32px;
  border-radius: var(--radius);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--grey-border);
}
.signature-preview .sig-name {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.signature-preview .sig-role { color: var(--red); font-size: 12px; margin-bottom: 16px; font-weight: 600; }
.signature-preview .sig-firm { font-size: 13px; color: var(--navy); margin-bottom: 8px; font-weight: 700; letter-spacing: 0.01em; }
.signature-preview .sig-meta { font-size: 11px; color: var(--grey-text); font-weight: 500; }
.signature-preview .sig-meta a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--grey-light); text-underline-offset: 3px; }
.signature-preview .sig-rule { border-top: 1px solid var(--grey-border); margin: 16px 0; }

/* ---- Scroll ------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--grey-light);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--grey-mid); background-clip: padding-box; border: 2px solid transparent; }

/* ============================================================
   INTERACTIVE LAYER — modals, palette, toasts, drawer, banner
   ============================================================ */

/* ---- Toast ------------------------------------------------ */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  animation: toastIn 200ms cubic-bezier(.2,.8,.2,1);
  pointer-events: auto;
}
.toast--success { background: var(--positive); }
.toast--error { background: var(--red); }
.toast--info { background: var(--blue); }
.toast__icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast__body { flex: 1; }
.toast__title { font-size: 13px; font-weight: 600; }
.toast__sub { font-size: 12px; opacity: 0.85; margin-top: 2px; font-weight: 500; }
.toast__close { color: rgba(255,255,255,0.7); cursor: pointer; background: none; border: none; padding: 0; }
.toast__close:hover { color: #fff; }
@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Modal ------------------------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: flex-start; justify-content: center;
  background: rgba(0, 31, 60, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 60px 20px 20px;
  overflow-y: auto;
}
.modal.active { display: flex; }
.modal__panel {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  animation: modalIn 220ms cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal__panel--lg { max-width: 960px; }
.modal__panel--xl { max-width: 1140px; }
.modal__head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.015em;
}
.modal__sub { font-size: 12px; color: var(--grey-mid); margin-top: 4px; font-weight: 500; }
.modal__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--grey-text);
  cursor: pointer;
  background: none;
  border: none;
}
.modal__close:hover { background: var(--bg-2); color: var(--navy); }
.modal__body { padding: 26px; overflow-y: auto; flex: 1; }
.modal__foot {
  padding: 16px 26px;
  border-top: 1px solid var(--grey-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-2);
}

/* ---- Command palette (Cmd+K) ------------------------------ */
.palette-modal {
  align-items: flex-start;
  padding-top: 100px;
}
.palette {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: modalIn 200ms cubic-bezier(.2,.8,.2,1);
}
.palette__input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--grey-border);
}
.palette__input-row svg { color: var(--grey-mid); flex-shrink: 0; }
.palette__input {
  flex: 1;
  font-size: 16px;
  color: var(--navy);
  font-family: var(--sans);
  font-weight: 500;
}
.palette__input::placeholder { color: var(--grey-mid); font-weight: 400; }
.palette__results {
  max-height: 480px;
  overflow-y: auto;
  padding: 8px;
}
.palette__group-title {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
  padding: 12px 14px 6px;
}
.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.palette__item--active, .palette__item:hover {
  background: var(--navy);
  color: #fff;
}
.palette__item--active .palette__sub, .palette__item:hover .palette__sub { color: rgba(255,255,255,0.65); }
.palette__item--active svg, .palette__item:hover svg { color: #fff; }
.palette__item-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--grey-text);
  flex-shrink: 0;
}
.palette__item--active .palette__item-icon, .palette__item:hover .palette__item-icon {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.palette__main { flex: 1; min-width: 0; }
.palette__sub { font-size: 11px; color: var(--grey-mid); margin-top: 1px; font-weight: 500; }
.palette__kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--grey-mid);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--grey-border);
  font-weight: 600;
}
.palette__item--active .palette__kbd, .palette__item:hover .palette__kbd {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
}
.palette__empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--grey-mid);
  font-size: 13px;
}
.palette__hint {
  border-top: 1px solid var(--grey-border);
  padding: 10px 18px;
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--grey-mid);
  font-weight: 500;
}
.palette__hint kbd {
  font-family: var(--mono);
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--grey-border);
  font-size: 10px;
}

/* ---- Drawer (right slide-over for detail) ----------------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  z-index: 90;
  box-shadow: -32px 0 64px -16px rgba(0,31,60,0.18);
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(.2,.8,.2,1);
}
.drawer.active { display: flex; transform: translateX(0); }
.drawer__overlay {
  position: fixed; inset: 0;
  background: rgba(0, 31, 60, 0.40);
  backdrop-filter: blur(2px);
  z-index: 89;
  display: none;
  animation: fadeIn 180ms;
}
.drawer__overlay.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer__head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.drawer__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.020em;
  line-height: 1.2;
}
.drawer__eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.drawer__body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer__foot {
  padding: 14px 28px;
  border-top: 1px solid var(--grey-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-2);
}

/* ---- Form fields (modal forms) ---------------------------- */
.form-grid { display: grid; gap: 16px; }
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-mid);
  font-weight: 700;
}
.form-row input, .form-row select, .form-row textarea {
  padding: 10px 12px;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  width: 100%;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--navy);
}
.form-row textarea { resize: vertical; min-height: 80px; font-family: var(--sans); }
.form-row__hint { font-size: 11px; color: var(--grey-mid); font-weight: 500; }

/* ---- Notification dropdown ------------------------------- */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-2);
  display: none;
  z-index: 60;
  max-height: 480px;
  overflow-y: auto;
}
.notif-dropdown.active { display: block; }
.notif-dropdown__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-dropdown__title { font-size: 14px; font-weight: 600; color: var(--navy); }
.notif-dropdown__action { font-size: 11px; color: var(--red); cursor: pointer; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---- Profile dropdown ------------------------------------ */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-2);
  display: none;
  z-index: 60;
}
.profile-dropdown.active { display: block; }
.profile-dropdown__head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-dropdown__items {
  padding: 8px;
}
.profile-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
}
.profile-dropdown__item:hover { background: var(--bg-2); color: var(--navy); }
.profile-dropdown__item--danger { color: var(--red); }
.profile-dropdown__item--danger:hover { background: var(--danger-bg); }

/* ---- Empty state ----------------------------------------- */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--grey-mid);
}
.empty-state__icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-mid);
}
.empty-state__title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.empty-state__desc { font-size: 12px; max-width: 320px; margin: 0 auto 16px; line-height: 1.5; font-weight: 500; }

/* ---- Tab content ----------------------------------------- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Topbar dropdown wrapper ----------------------------- */
.topbar__action-wrap { position: relative; }

/* ---- Loading dots ---------------------------------------- */
.dots { display: inline-flex; gap: 4px; }
.dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--grey-mid);
  animation: dot 1.2s infinite ease-in-out;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* ---- Calendar day detail --------------------------------- */
.cal__day:hover { background: var(--bg-2); }

/* ---- Heatmap tooltip ------------------------------------- */
.heatmap__cell { transition: outline 100ms; cursor: pointer; }
.heatmap__cell:hover { outline: 2px solid var(--navy); outline-offset: 1px; }

/* ---- Sortable table headers ------------------------------ */
.table th.sortable {
  cursor: pointer;
  user-select: none;
}
.table th.sortable:hover { color: var(--navy); }
.table th.sortable::after {
  content: " ↕";
  opacity: 0.3;
  font-size: 10px;
}
.table th.sorted-asc::after { content: " ↑"; opacity: 1; color: var(--red); }
.table th.sorted-desc::after { content: " ↓"; opacity: 1; color: var(--red); }

/* ---- Status banner --------------------------------------- */
.status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 20px;
  font-weight: 500;
}
.status-banner--info { background: var(--info-bg); border-color: rgba(57,106,183,0.25); color: var(--blue); }
.status-banner--positive { background: var(--positive-bg); border-color: rgba(46,125,91,0.25); color: var(--positive); }
.status-banner--warn { background: var(--warn-bg); border-color: rgba(199,125,23,0.30); color: var(--warn); }
.status-banner__close { margin-left: auto; cursor: pointer; opacity: 0.6; }
.status-banner__close:hover { opacity: 1; }

/* ---- Star button (favorites) ----------------------------- */
.star-btn { color: var(--grey-mid); }
.star-btn.active { color: var(--red); fill: var(--red); }
.star-btn:hover { color: var(--red); }

/* ============================================================
   APP FOOTER (matches cavari.com.au)
   ============================================================ */
.app-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  padding: 56px 0 24px;
  margin-top: 64px;
}
.app-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 44px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr 1fr;
  gap: 48px;
}
.app-footer__col h4 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  margin: 0 0 16px;
}
.app-footer__col a {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  margin-bottom: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: color 100ms;
}
.app-footer__col a:hover { color: #fff; }
.app-footer__col p {
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  margin: 0 0 8px;
  font-weight: 500;
}
.app-footer__col--brand .app-footer__logo {
  height: 28px;
  filter: brightness(0) invert(1);
  margin-bottom: 18px;
}
.app-footer__tag {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px !important;
  color: #fff !important;
  letter-spacing: -0.01em;
  margin-bottom: 12px !important;
  line-height: 1.35;
}
.app-footer__sub {
  font-size: 13px !important;
  color: rgba(255,255,255,0.65) !important;
  line-height: 1.6;
  max-width: 320px;
  font-weight: 400 !important;
}
.app-footer__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px !important;
}
.app-footer__pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6BA88F;
  box-shadow: 0 0 0 3px rgba(107, 168, 143, 0.25);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.app-footer__version {
  font-family: var(--mono);
  font-size: 11px !important;
  color: rgba(255,255,255,0.45) !important;
  margin-top: 4px !important;
}
.app-footer__bottom {
  max-width: var(--content-max);
  margin: 40px auto 0;
  padding: 24px 44px 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.app-footer__bottom a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
}
.app-footer__bottom a:hover { color: #fff; }

@media (max-width: 1100px) {
  .app-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .app-footer__col--brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .app-footer__inner { grid-template-columns: 1fr; padding: 0 24px; }
  .app-footer__bottom { padding: 24px 24px 0; flex-direction: column; gap: 8px; }
}

/* ---- Responsive --------------------------------------------- */
@media (max-width: 1200px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .col-3 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .col-8 { grid-column: span 12; }
  .col-9 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .signin { grid-template-columns: 1fr; }
  .signin__brand { display: none; }
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .view__inner { padding: 24px; }
  .ai-panel { width: 100%; }
}
