/* ================================================================
   Femto Artemis Design System — portal.css
   Source: storage/zlocal-files/femto_artemis_portal_mockup/assets/styles.css
   Supplements: portal-specific functional classes
   ================================================================ */

:root {
  --red: #E31837;
  --red-deep: #B7122B;
  --red-soft: #FFF0F3;
  --ink: #101216;
  --ink-2: #1B1E24;
  --text: #262A31;
  --muted: #69707B;
  --muted-2: #8D939D;
  --line: #E4E7EB;
  --line-strong: #D7DBE0;
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --green: #168A5B;
  --green-soft: #EAF8F2;
  --amber: #C77607;
  --amber-soft: #FFF6E8;
  --blue: #2F67C7;
  --blue-soft: #EDF4FF;
  --purple: #7652B8;
  --purple-soft: #F3EFFB;
  --shadow-sm: 0 6px 18px rgba(16,18,22,.055);
  --shadow: 0 18px 48px rgba(16,18,22,.09);
  --radius: 14px;
  --sidebar: 252px;
  --topbar: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button { cursor: pointer; }
svg { display: block; }

/* ── App shell ─────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
  font-family: Inter, Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
.app-shell a { color: inherit; text-decoration: none; }
.content a:not(.portal-btn):not(.portal-tab) { color: var(--red); }
.app-shell button, .app-shell input, .app-shell select { font: inherit; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar.admin { color: rgba(255,255,255,.9); background: #111317; border-right-color: rgba(255,255,255,.06); }
.brand-area {
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar.admin .brand-area { border-bottom-color: rgba(255,255,255,.07); }
.artemis-brand { width: 160px; height: auto; }
.workspace-tag {
  margin: 18px 20px 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sidebar.admin .workspace-tag { color: rgba(255,255,255,.34); }
.nav-list { padding: 0 12px; }
.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  margin: 2px 0;
  border: 0;
  border-radius: 10px;
  color: #5A626D;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.nav-item:hover { color: var(--ink); background: #F2F4F6; text-decoration: none; }
.nav-item.active { color: var(--red); background: var(--red-soft); }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }
.nav-item .nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--red);
  background: #FFF;
  border: 1px solid rgba(227,24,55,.15);
  font-size: 10px;
  font-weight: 800;
}
.nav-sub-list { padding: 0 0 4px 28px; }
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 13px;
  margin: 1px 0;
  border: 0;
  border-radius: 8px;
  color: #7A828C;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-sub-item:hover { color: var(--ink); background: #F2F4F6; text-decoration: none; }
.nav-sub-item.active { color: var(--red); background: var(--red-soft); }
.sidebar.admin .nav-item { color: rgba(255,255,255,.57); }
.sidebar.admin .nav-item:hover { color: #FFF; background: rgba(255,255,255,.055); }
.sidebar.admin .nav-item.active { color: #FFF; background: rgba(227,24,55,.94); box-shadow: 0 8px 18px rgba(227,24,55,.18); }
.sidebar.admin .nav-count { color: #FFF; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.08); }
.sidebar.admin .nav-sub-item { color: rgba(255,255,255,.45); }
.sidebar.admin .nav-sub-item:hover { color: #FFF; background: rgba(255,255,255,.055); }
.sidebar.admin .nav-sub-item.active { color: #FFF; }
.sidebar-spacer { flex: 1; }
.sidebar-help {
  margin: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FAFBFC;
  flex-shrink: 0;
}
.sidebar-help strong { display: block; color: var(--ink); font-size: 12px; }
.sidebar-help p { margin: 4px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.sidebar-help a { color: var(--red); font-size: 10px; font-weight: 800; }
.sidebar-help-link { background: none; border: none; padding: 0; cursor: pointer; color: var(--red); font-size: 10px; font-weight: 800; }
.sidebar.admin .sidebar-help { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.035); }
.sidebar.admin .sidebar-help strong { color: #FFF; }
.sidebar.admin .sidebar-help p { color: rgba(255,255,255,.45); }
.sidebar.admin .sidebar-help a { color: rgba(255,120,120,1); }
.sidebar.admin .sidebar-help-link { color: rgba(255,120,120,1); }
.sidebar-user {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar.admin .sidebar-user { border-top-color: rgba(255,255,255,.07); }
.avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #FFF;
  background: linear-gradient(145deg, var(--red), #86172A);
  font-size: 11px;
  font-weight: 850;
}
.user-copy { min-width: 0; }
.user-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy span { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar.admin .user-copy strong { color: #FFF; }
.sidebar.admin .user-copy span { color: rgba(255,255,255,.42); }

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto var(--sidebar);
  z-index: 25;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(14px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.mobile-menu {
  display: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: #F2F4F6;
  place-items: center;
}
.mobile-menu svg { width: 18px; height: 18px; }
.org-switcher {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFF;
  cursor: pointer;
}
.org-symbol {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--red);
  background: var(--red-soft);
}
.org-symbol svg { width: 14px; height: 14px; }
.org-copy strong { display: block; font-size: 11px; line-height: 1.15; color: var(--ink); }
.org-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.15; }
.chevron { color: var(--muted); }
.chevron svg { width: 14px; height: 14px; }
.topbar .env-tag {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #AFCBEF;
  border-radius: 10px;
  background: #E7F0FC;
  color: #1B4B8F;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: default;
  flex-shrink: 0;
}
.global-search {
  width: min(330px, 28vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-2);
  background: #F8F9FA;
  text-decoration: none;
}
.global-search svg { width: 16px; height: 16px; }
.global-search span { font-size: 11px; }
.global-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 11px;
  color: var(--muted-2);
  min-width: 0;
}
.global-search input::placeholder { color: var(--muted-2); }
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #555D67;
  background: #FFF;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 2px solid #FFF;
  border-radius: 50%;
  background: var(--red);
}

/* ── Main content area ─────────────────────────────────── */
.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding-top: var(--topbar);
}
.content {
  width: min(1480px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 54px;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 26px;
}
.eyebrow {
  margin-bottom: 7px;
  color: var(--red);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.13;
  letter-spacing: -.035em;
  font-family: Inter, Aptos, "Segoe UI", Helvetica, Arial, sans-serif;
}
.page-heading p {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────── */
.btn,
.app-shell .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary,
.app-shell .btn-primary { color: #FFF; background: var(--red); box-shadow: 0 8px 18px rgba(227,24,55,.18); border-color: transparent; }
.btn-primary:hover,
.app-shell .btn-primary:hover { background: var(--red-deep); color: #FFF; }
.btn-secondary,
.app-shell .btn-secondary { color: var(--ink); border-color: var(--line-strong); background: #FFF; }
.btn-secondary:hover,
.app-shell .btn-secondary:hover { color: var(--ink); }
.btn-quiet { color: var(--muted); background: #F2F4F6; }
.btn-dark { color: #FFF; background: var(--ink); }

/* ── Role note banner ──────────────────────────────────── */
.role-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: -10px 0 22px;
  padding: 11px 14px;
  border: 1px solid #DCE6F5;
  border-radius: 10px;
  color: #36557F;
  background: #F5F8FD;
  font-size: 10px;
}
.role-note strong { color: #243F67; }

/* ── KPI Grid ──────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 15px; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.kpi-card { position: relative; min-height: 146px; overflow: hidden; padding: 18px; }
.kpi-card::after { content: ""; position: absolute; right: -22px; bottom: -28px; width: 88px; height: 88px; border-radius: 50%; background: rgba(227,24,55,.04); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-icon.red { color: var(--red); background: var(--red-soft); }
.kpi-icon.green { color: var(--green); background: var(--green-soft); }
.kpi-icon.amber { color: var(--amber); background: var(--amber-soft); }
.kpi-icon.blue { color: var(--blue); background: var(--blue-soft); }
.kpi-label { color: var(--muted); font-size: 10px; font-weight: 700; }
.kpi-value { margin-top: 14px; color: var(--ink); font-size: 28px; font-weight: 760; line-height: 1; letter-spacing: -.045em; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; }
.trend.up { color: var(--green); }
.trend.warn { color: var(--amber); }
.trend.danger { color: var(--red); }
.sparkline { position: absolute; right: 16px; bottom: 14px; width: 70px; height: 30px; opacity: .8; }

/* ── Layout grids ──────────────────────────────────────── */
.layout-main { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.75fr); gap: 15px; margin-bottom: 15px; }
.layout-even { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; margin-bottom: 15px; }

/* ── Card internals ────────────────────────────────────── */
.card-head {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; color: var(--ink); font-size: 13px; letter-spacing: -.015em; font-family: Inter, Aptos, "Segoe UI", Helvetica, Arial, sans-serif; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.card-link { border: 0; color: var(--red); background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.card-body { padding: 18px; }
.card-body.no-pad { padding: 0; }

/* ── Compliance grid ───────────────────────────────────── */
.compliance-grid { display: grid; grid-template-columns: 184px minmax(0,1fr); min-height: 274px; }
.score-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; border-right: 1px solid var(--line); }
.score-ring {
  --score: 97.8%;
  position: relative;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0 var(--score), #ECEFF2 var(--score) 100%);
}
.score-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #FFF; }
.score-number { position: relative; z-index: 1; text-align: center; }
.score-number strong { display: block; color: var(--ink); font-size: 25px; letter-spacing: -.04em; }
.score-number span { display: block; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.score-panel p { margin: 13px 0 0; color: var(--green); font-size: 9px; font-weight: 750; }
.facility-bars { padding: 18px; }
.facility-row { margin-bottom: 17px; }
.facility-row:last-child { margin-bottom: 0; }
.facility-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 9.5px; }
.facility-label strong { color: var(--ink); }
.facility-label span { color: var(--muted); }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #EEF0F3; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #F04C65); }
.progress.green span { background: linear-gradient(90deg, #168A5B, #45B384); }
.progress.amber span { background: linear-gradient(90deg, #C77607, #EAA43B); }

/* ── Attention list ────────────────────────────────────── */
.attention-list { padding: 8px 18px 12px; }
.attention-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.attention-item:last-child { border-bottom: 0; }
.attention-symbol { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; }
.attention-symbol svg { width: 15px; height: 15px; }
.attention-symbol.red { color: var(--red); background: var(--red-soft); }
.attention-symbol.amber { color: var(--amber); background: var(--amber-soft); }
.attention-symbol.blue { color: var(--blue); background: var(--blue-soft); }
.attention-symbol.green { color: var(--green); background: var(--green-soft); }
.attention-copy strong { display: block; color: var(--ink); font-size: 10px; }
.attention-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.item-arrow { color: #A0A6AF; }
.item-arrow svg { width: 14px; height: 14px; }

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.app-shell table { width: 100%; border-collapse: collapse; }
.app-shell th {
  height: 38px;
  padding: 0 14px;
  color: var(--muted-2);
  background: #FAFBFC;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.app-shell td {
  height: 53px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: #4E5560;
  font-size: 9.5px;
  white-space: nowrap;
}
.app-shell td strong { display: block; color: var(--ink); font-size: 10px; }
.app-shell td small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }

/* ── Status pills ──────────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.green { color: var(--green); background: var(--green-soft); }
.status.red { color: var(--red); background: var(--red-soft); }
.status.amber { color: var(--amber); background: var(--amber-soft); }
.status.blue { color: var(--blue); background: var(--blue-soft); }
.status.gray { color: #6E7580; background: #EEF0F3; }

/* ── Chart area ────────────────────────────────────────── */
.chart-area { min-height: 220px; padding: 14px 18px 18px; }
.chart-legend { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; color: var(--muted); font-size: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 2px; background: var(--red); }
.chart-legend .gray i { background: #AEB4BD; }
.line-chart { width: 100%; height: 154px; }
.chart-axis { stroke: #E9EBEE; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--red); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-secondary { fill: none; stroke: #AEB4BD; stroke-width: 1.7; stroke-dasharray: 4 5; }
.chart-fill { fill: url(#redGradient); }
.chart-labels { display: flex; justify-content: space-between; padding: 0 2px; color: var(--muted-2); font-size: 7.5px; }

/* ── Quick actions ─────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.quick-action {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #FFF;
  cursor: pointer;
  text-align: left;
}
.quick-action:hover { border-color: rgba(227,24,55,.35); box-shadow: var(--shadow-sm); }
.quick-action-icon { width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 8px; color: var(--red); background: var(--red-soft); }
.quick-action-icon svg { width: 15px; height: 15px; }
.quick-action strong { display: block; color: var(--ink); font-size: 9.5px; }
.quick-action span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }

/* ── Admin dashboard ───────────────────────────────────── */
.admin-kpis .kpi-card { min-height: 132px; }
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; padding: 16px; }
.pipeline-stage { position: relative; min-height: 96px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #FAFBFC; }
.pipeline-stage + .pipeline-stage::before { content: ""; position: absolute; top: 47px; left: -9px; width: 9px; height: 1px; background: #D8DCE1; }
.pipeline-stage .step { color: var(--muted-2); font-size: 7px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.pipeline-stage strong { display: block; margin-top: 9px; color: var(--ink); font-size: 22px; line-height: 1; }
.pipeline-stage span { display: block; margin-top: 6px; color: var(--muted); font-size: 8px; }
.pipeline-stage.alert { border-color: rgba(227,24,55,.2); background: var(--red-soft); }
.pipeline-stage.alert strong, .pipeline-stage.alert .step { color: var(--red); }
.ops-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(300px,.7fr); gap: 15px; margin-bottom: 15px; }

/* ── Timeline ──────────────────────────────────────────── */
.timeline { padding: 4px 18px 14px; }
.timeline-head { display: grid; grid-template-columns: 138px repeat(8, 1fr); align-items: end; min-height: 38px; color: var(--muted-2); font-size: 7.5px; }
.timeline-row { display: grid; grid-template-columns: 138px minmax(0,1fr); min-height: 50px; align-items: center; border-top: 1px solid var(--line); }
.tech { display: flex; align-items: center; gap: 9px; }
.tech .mini-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #FFF; background: #343942; font-size: 8px; font-weight: 800; }
.tech strong { display: block; color: var(--ink); font-size: 9px; }
.tech span { display: block; margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.timeline-track { position: relative; height: 30px; border-radius: 8px; background-image: linear-gradient(to right, transparent calc(12.5% - 1px), #EDF0F2 calc(12.5% - 1px), #EDF0F2 12.5%, transparent 12.5%); background-size: 12.5% 100%; }
.job-block { position: absolute; top: 4px; height: 22px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; border-radius: 6px; color: #FFF; background: #343942; font-size: 7.5px; font-weight: 750; white-space: nowrap; }
.job-block.red { background: var(--red); }
.job-block.blue { background: var(--blue); }
.job-block.green { background: var(--green); }
.job-block.amber { background: var(--amber); }
.now-line { position: absolute; top: 0; bottom: 0; left: 53%; width: 1px; background: var(--red); }
.now-line::before { content: ""; position: absolute; top: -2px; left: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }

/* ── Priority queue ────────────────────────────────────── */
.queue-list { padding: 7px 16px 14px; }
.queue-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 57px; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: 0; }
.queue-rank { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--red); background: var(--red-soft); font-size: 8px; font-weight: 850; }
.queue-copy strong { display: block; color: var(--ink); font-size: 9.5px; }
.queue-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.queue-time { color: var(--red); font-size: 8px; font-weight: 800; }

/* ── Bar chart ─────────────────────────────────────────── */
.bar-chart { display: flex; align-items: end; gap: 12px; height: 142px; padding: 10px 2px 0; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 7px; }
.bar { position: relative; width: 100%; max-width: 26px; min-height: 8px; border-radius: 5px 5px 2px 2px; background: #DDE1E5; }
.bar.red { background: linear-gradient(180deg, #F04B63, var(--red)); }
.bar span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 7.5px; font-weight: 750; }
.bar-col label { color: var(--muted-2); font-size: 7px; }

/* ── Region list ───────────────────────────────────────── */
.region-list { padding: 3px 18px 14px; }
.region-row { display: grid; grid-template-columns: 88px minmax(0,1fr) 42px; gap: 10px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--line); }
.region-row:last-child { border-bottom: 0; }
.region-row strong { color: var(--ink); font-size: 9px; }
.region-row .progress { height: 6px; }
.region-row span { color: var(--muted); font-size: 8px; text-align: right; }

/* ── Toolbar & filters ─────────────────────────────────── */
.toolbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-control {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #FFF;
  font-size: 9px;
  cursor: pointer;
  white-space: nowrap;
}
.filter-control svg { width: 14px; height: 14px; }
.search-field { width: 230px; }
.table-card { overflow: hidden; }
.table-card td { height: 57px; }
.asset-cell { display: flex; align-items: center; gap: 10px; }
.asset-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--red); background: #FAFBFC; }
.asset-icon svg { width: 14px; height: 14px; }

/* ── Pagination ────────────────────────────────────────── */
.pagination-bar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
}
.page-controls { display: flex; gap: 5px; }
.page-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #FFF;
  font-size: 8px;
  cursor: pointer;
}
.page-controls button.active { color: #FFF; border-color: var(--red); background: var(--red); }
.empty-view { min-height: 520px; display: grid; place-items: center; text-align: center; }
.empty-view .empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 16px; color: var(--red); background: var(--red-soft); }
.empty-view h2 { margin: 0; color: var(--ink); font-size: 18px; }
.empty-view p { max-width: 430px; margin: 8px auto 18px; color: var(--muted); font-size: 11px; }

/* ── Scheduling board ──────────────────────────────────── */
.schedule-board { display: grid; grid-template-columns: 178px repeat(5, minmax(125px,1fr)); min-width: 850px; }
.schedule-cell { min-height: 78px; padding: 9px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
.schedule-board > :nth-child(-n+6) { border-top: 0; min-height: 46px; background: #FAFBFC; }
.schedule-board > :nth-child(6n) { border-right: 0; }
.schedule-day { color: var(--muted); font-size: 8px; font-weight: 800; text-align: center; }
.schedule-day strong { display: block; color: var(--ink); font-size: 10px; }
.schedule-tech { display: flex; align-items: center; gap: 8px; }
.schedule-tech .mini-avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #FFF; background: #343942; font-size: 7px; font-weight: 800; }
.schedule-tech strong { color: var(--ink); font-size: 9px; }
.schedule-tech span { display: block; color: var(--muted); font-size: 7px; }
.schedule-job { padding: 7px; border-left: 3px solid var(--red); border-radius: 6px; background: var(--red-soft); }
.schedule-job.blue { border-left-color: var(--blue); background: var(--blue-soft); }
.schedule-job.green { border-left-color: var(--green); background: var(--green-soft); }
.schedule-job strong { display: block; color: var(--ink); font-size: 8px; }
.schedule-job span { display: block; margin-top: 2px; color: var(--muted); font-size: 7px; }

/* ── Toast ─────────────────────────────────────────────── */
.toast-notify {
  position: fixed;
  right: 24px;
  top: 88px;
  z-index: 80;
  min-width: 290px;
  max-width: 420px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.toast-notify.show { transform: none; opacity: 1; }
.toast-notify strong { display: block; font-size: 11px; font-weight: 700; }
.toast-notify span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }


/* ===== PORTAL SUPPLEMENTARY — functional classes ===== */

/* ── Fleet summary strip (assets page) ─────────────────── */
.fleet-strip {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 15px;
  overflow: hidden;
}
.fleet-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-right: 1px solid var(--line);
  flex: 1;
  min-width: 130px;
}
.fleet-card:last-child { border-right: none; }
.fleet-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.fleet-card__count { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.fleet-card__label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.fleet-card--overdue .fleet-card__icon { background: var(--red-soft); color: var(--red); }
.fleet-card--overdue .fleet-card__count { color: var(--red); }
.fleet-card--soon .fleet-card__icon { background: var(--amber-soft); color: var(--amber); }
.fleet-card--soon .fleet-card__count { color: var(--amber); }
.fleet-card--current .fleet-card__icon { background: var(--green-soft); color: var(--green); }
.fleet-card--current .fleet-card__count { color: var(--green); }
.fleet-card--unknown .fleet-card__icon { background: #F5F5F5; color: #aaa; }
.fleet-card--unknown .fleet-card__count { color: #aaa; }

/* ── Portal tab bar ────────────────────────────────────── */
.portal-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  padding: 0 4px 0 18px;
  margin-bottom: 0;
}
.portal-tabs { display: flex; }
.portal-tab {
  display: flex;
  align-items: center;
  padding: 16px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.portal-tab:hover { color: var(--ink); text-decoration: none; }
.portal-tab.active { color: var(--red); border-bottom-color: var(--red); }
.portal-tab-actions { display: flex; gap: 8px; align-items: center; padding: 10px 0; }

/* ── Info bar ──────────────────────────────────────────── */
.asset-info-bar {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
}
.asset-info-bar__count { font-size: 12px; color: var(--muted); }
.asset-info-bar__count strong { color: var(--ink); font-weight: 700; }
.asset-info-bar__hint { font-size: 11px; color: var(--muted-2); }

/* ── Calibration urgency chips — WCAG 1.4.1 (shape + color + weight) */
.cal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border: 1px solid;
}
.cal-chip--overdue { background: var(--red-soft); color: #b71c1c; border-color: #f4aaa9; }
.cal-chip--soon    { background: var(--amber-soft); color: #7a4f00; border-color: #fdd47b; }
.cal-chip--current { background: var(--green-soft); color: #15803d; border-color: #86efac; }
.cal-chip--unknown { background: #f5f5f5; color: #999; border-color: #ddd; }

/* ── Due date display ──────────────────────────────────── */
.due-iso { display: block; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); margin-top: 3px; }
.due-iso.is-overdue { color: #b71c1c; font-weight: 600; }
.due-iso.is-soon { color: #7a4f00; }

/* ── FS ID — ISO 17025 §7.8.2(c) unambiguous identification ── */
.fs-id {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
  font-feature-settings: 'tnum' on, 'ss03' on;
}
a.fs-id, a > .fs-id { font-family: inherit; }

/* ── Status chip aliases (backward compat) ──────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: none;
}
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-chip--success { color: var(--green); background: var(--green-soft); }
.status-chip--info    { color: var(--blue);  background: var(--blue-soft); }
.status-chip--warning { color: var(--amber); background: var(--amber-soft); }
.status-chip--neutral { color: #6E7580;      background: #EEF0F3; }
.status-chip--danger  { color: var(--red);   background: var(--red-soft); }

/* ── Workflow progress stepper ───────────────────────────── */
.workflow-stepper {
  display: flex;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  gap: 0;
  margin-bottom: 15px;
  padding: 20px 24px 18px;
}
.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
  position: relative;
}
.workflow-step + .workflow-step::before {
  content: '';
  position: absolute;
  top: 9px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line-strong);
  z-index: 0;
}
.workflow-step--done + .workflow-step::before  { background: var(--ink-2); }
.workflow-step--active + .workflow-step::before { background: var(--ink-2); }
.workflow-step__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.workflow-step--done   .workflow-step__dot { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.workflow-step--active .workflow-step__dot { background: #fff; border-color: var(--red); color: var(--red); }
.workflow-step__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  line-height: 1.3;
}
.workflow-step--done   .workflow-step__label { color: var(--text); }
.workflow-step--active .workflow-step__label { color: var(--red); }
.workflow-step__sub { font-size: 9px; color: var(--muted-2); text-align: center; margin-top: 2px; font-style: italic; line-height: 1.3; }
.workflow-step--active .workflow-step__sub { color: var(--red); opacity: .8; }

/* ── Portal section cards (form layouts) ────────────────── */
.portal-content-area { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.portal-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.portal-section__header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #FAFBFC;
  border-radius: var(--radius) var(--radius) 0 0;
}
.portal-section__title {
  font-size: 11px;
  font-weight: 750;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.portal-section__body { padding: 20px 18px; }
.portal-section__header a { color: var(--red); font-size: 11px; font-weight: 700; }
.portal-form-actions { display: flex; gap: 8px; }

/* ── Field layout system ────────────────────────────────── */
.portal-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.portal-field-grid--single { grid-template-columns: 1fr; }
.portal-field-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.portal-field { display: flex; flex-direction: column; gap: 4px; }
.portal-field label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.portal-field input.form-control,
.portal-field .form-control,
.portal-field textarea.form-control {
  font-size: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  color: var(--ink);
  background: #FFF;
}
.portal-field input.form-control:focus,
.portal-field .form-control:focus,
.portal-field textarea.form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227,24,55,.08);
  outline: none;
}
.portal-field input.form-control:disabled,
.portal-field .form-control:disabled {
  background: #FAFBFC;
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
}
.portal-field .control-error { font-size: 11px; color: #b71c1c; margin-top: 2px; }
.portal-field__value { font-size: 13px; color: var(--ink); padding: 7px 0; }

/* ── Button aliases ─────────────────────────────────────── */
.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--red);
  color: #fff !important;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 18px rgba(227,24,55,.18);
  transition: transform .16s ease, background .16s ease;
}
.portal-btn:hover { background: var(--red-deep); color: #fff !important; text-decoration: none; transform: translateY(-1px); opacity: 1; }
.portal-btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.portal-btn--outline {
  background: #FFF;
  color: var(--red) !important;
  border-color: var(--line-strong);
  box-shadow: none;
}
.portal-btn--outline:hover { background: var(--red-soft); border-color: var(--red); color: var(--red) !important; }
.portal-btn--sm { font-size: 11px; padding: 4px 10px; min-height: unset; }
.portal-btn svg,
.portal-btn i { width: 15px; height: 15px; font-size: 15px; }

/* ── Document request table ────────────────────────────────── */
.portal-doc-request-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.portal-doc-request-table thead tr { border-bottom: 2px solid var(--line); }
.portal-doc-request-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #4d9ca6;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.portal-doc-request-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.portal-doc-request-table tbody tr:last-child td { border-bottom: none; }

/* ── Portal tables (updated from dark to light headers) ──── */
.asset-table-area,
.portal-table-area { overflow-x: auto; flex: 1; }
.asset-table,
.portal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.asset-table thead tr,
.portal-table thead tr { background: #FAFBFC; }
.asset-table thead th,
.portal-table thead th {
  padding: 0 14px;
  height: 38px;
  font-size: 8px;
  font-weight: 850;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.asset-table thead th.col-check,
.portal-table thead th.col-check { width: 44px; text-align: center; }
.asset-table thead th.col-num,
.portal-table thead th.col-num { width: 36px; }
.asset-table tbody tr,
.portal-table tbody tr { border-bottom: 1px solid var(--line); transition: background .1s; }
.asset-table tbody tr:hover,
.portal-table tbody tr:hover { background: #FAFBFC; }
.asset-table tbody td,
.portal-table tbody td { padding: 10px 14px; color: var(--text); vertical-align: middle; font-size: 12px; }
.asset-table tbody td.col-check,
.portal-table tbody td.col-check { text-align: center; }
.asset-table tbody td.col-num,
.portal-table tbody td.col-num { color: var(--muted); font-size: 11px; }
.batch-assets-row .portal-table thead tr { background: #FAFBFC; }
.batch-assets-row .portal-table thead th { color: var(--muted-2); }
.batch-assets-row .portal-table tbody tr:hover { background: transparent; }

/* ── Portal select ──────────────────────────────────────── */
.portal-select {
  font-size: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  background: #FFF;
  font-family: inherit;
}
.portal-select:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px rgba(227,24,55,.08); }

/* ── Portal pagination (backward compat alias) ───────────── */
.portal-pagination { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.portal-pagination .pagination { gap: 3px; margin: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; padding: 0; }
.portal-pagination .theme-btn { background: var(--red); color: #fff !important; border: none; padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.portal-pagination .theme-btn-secondary { background: #fff; color: var(--text) !important; border: 1px solid var(--line); padding: 5px 11px; font-size: 12px; border-radius: 7px; }

/* ── Empty states ───────────────────────────────────────── */
.asset-empty,
.portal-empty { text-align: center; padding: 56px 0; color: var(--muted-2); }
.asset-empty i,
.portal-empty i { font-size: 36px; display: block; margin-bottom: 12px; opacity: 0.4; }
.asset-empty p,
.portal-empty p { font-size: 14px; margin: 0; }

/* ── CRM global sidebar search ──────────────────────────── */
.crm-sidebar-search { display: block; }
.crm-sidebar-search__wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  transition: border-color .15s, background .15s;
}
.crm-sidebar-search__wrap:focus-within {
  border-color: rgba(200,16,46,.7);
  background: rgba(255,255,255,.11);
}
.crm-sidebar-search__icon { font-size: 11px; color: rgba(255,255,255,.35); padding: 0 0 0 9px; flex-shrink: 0; pointer-events: none; }
.crm-sidebar-search__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  padding: 7px 9px 7px 6px;
  min-width: 0;
}
.crm-sidebar-search__input::placeholder { color: rgba(255,255,255,.3); }
.crm-sidebar-search__input:focus { box-shadow: none; }
.crm-search-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200,16,46,.15);
  color: var(--red);
  border: 1px solid rgba(200,16,46,.25);
  font-size: 10px;
  font-weight: 700;
  border-radius: 5px;
  padding: 0 5px;
  min-width: 18px;
  height: 16px;
  margin-left: 8px;
  letter-spacing: 0.3px;
  vertical-align: middle;
}

/* ── Portal context form-control focus override ──────────── */
.portal-field .form-control:focus,
.app-shell .form-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,24,55,.08); }

/* ── Cart image ─────────────────────────────────────────── */
.portal-cart-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

/* ── Checkout tabs ──────────────────────────────────────── */
.checkout-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.checkout-tab:hover { color: var(--ink); }
.checkout-tab--active { color: var(--red); border-bottom-color: var(--red); }

/* ── Mobile sidebar toggle ──────────────────────────────── */
@media (max-width: 1180px) {
  :root { --sidebar: 226px; }
  .content { width: calc(100% - 38px); }
  .global-search { display: none; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .pipeline { grid-template-columns: repeat(3,1fr); }
  .pipeline-stage + .pipeline-stage::before { display: none; }
  .quick-actions { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar: 252px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .app-shell.menu-open .sidebar { transform: none; }
  .portal-wrap.menu-open .sidebar { transform: none; }
  .topbar { left: 0; padding: 0 18px; }
  .mobile-menu { display: grid; }
  .main { margin-left: 0; }
  .content { width: calc(100% - 30px); padding-top: 24px; }
  .layout-main, .layout-even, .ops-grid { grid-template-columns: 1fr; }
  .compliance-grid { grid-template-columns: 160px 1fr; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .org-switcher { max-width: 160px; }
  .org-copy strong, .org-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-heading { flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { min-height: 132px; padding: 14px; }
  .kpi-value { font-size: 23px; }
  .compliance-grid { grid-template-columns: 1fr; }
  .score-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
}

/* ── Print styles (invoice-detail) ─────────────────────── */
@media print {
  .sidebar,
  .topbar,
  .portal-tab-bar,
  .portal-pagination,
  .heading-actions,
  .fleet-strip { display: none !important; }
  .main { margin-left: 0 !important; padding-top: 0 !important; }
  .content { width: 100% !important; padding: 0 !important; }
  .app-shell { background: #fff !important; }
  body { background: #fff !important; }
}

/* ── Notification dropdown (navbar bell) ──────────────────── */
.sidebar-notif-badge {
    margin-left:auto; background:#C8102E; color:#fff;
    font-size:9px; font-weight:700; border-radius:10px;
    padding:1px 5px; min-width:16px; text-align:center;
    line-height:1.6; flex-shrink:0;
}
.notif-btn {
    position:relative; width:40px; height:40px;
    border:1.5px solid #d0d0d0; border-radius:50%;
    background:#f7f7f7; color:#444; font-size:15px;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
}
.notif-btn:hover { border-color:#C8102E; color:#2D2D2D; }
.notif-count-badge {
    position:absolute; top:-3px; right:-3px;
    background:#C8102E; color:#fff;
    font-size:9px; font-weight:700;
    border-radius:10px; padding:1px 4px;
    min-width:14px; text-align:center; line-height:1.6;
}
.notif-dropdown-wrapper { position:relative; }
.notif-dropdown {
    display:none; position:absolute; right:0; top:calc(100% + 10px);
    width:340px; background:#fff;
    border:1px solid #e0e0e0; border-radius:4px;
    box-shadow:0 4px 20px rgba(0,0,0,0.12); z-index:9999;
}
.notif-dropdown__header {
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 16px 10px; border-bottom:1px solid #f0f0f0;
}
.notif-dropdown__header-title {
    font-size:11px; font-weight:700; color:#2D2D2D;
    text-transform:uppercase; letter-spacing:0.4px;
}
.notif-dropdown__mark-all {
    font-size:11px; color:#C8102E;
    background:none; border:none; cursor:pointer; font-weight:600;
}
.notif-list { max-height:320px; overflow-y:auto; }
.notif-item {
    display:block; padding:10px 16px;
    border-bottom:1px solid #f5f5f5;
    text-decoration:none; color:#555; position:relative;
}
.notif-item:hover { background:#fafafa; }
.notif-item--unread { background:#fefaf8; }
.notif-item--unread::before {
    content:''; position:absolute; left:0; top:0; bottom:0;
    width:3px; background:#C8102E;
}
.notif-item__title { font-size:12px; font-weight:700; color:#2D2D2D; margin-bottom:2px; }
.notif-item__body { font-size:11px; color:#888; }
.notif-item__time { font-size:10px; color:#bbb; margin-top:3px; }
.notif-dropdown__footer {
    padding:9px 16px; border-top:1px solid #f0f0f0; text-align:center;
}
.notif-dropdown__footer a {
    font-size:11px; color:#C8102E; font-weight:700;
    text-transform:uppercase; letter-spacing:0.3px; text-decoration:none;
}
.notif-empty { padding:24px 16px; text-align:center; color:#aaa; font-size:12px; }

/* ── Portal shop category cards ── */
.portal-shop-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.portal-shop-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: var(--red);
    text-decoration: none;
}
.portal-shop-card__img {
    height: 140px;
    overflow: hidden;
    background: #F5F6F7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portal-shop-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.portal-shop-card__body {
    padding: 13px 15px;
}
.portal-shop-card__name {
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.3;
}
.portal-shop-card__cta {
    font-size: 11px;
    font-weight: 700;
    color: var(--red);
    margin-top: 5px;
}
