/* ── Google Font imports ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════════════════════════════════
   SEIPH / OpsKnit — Design System
   Theme: Deep Navy sidebar · Royal Blue primary · Amber governance
   Dual‑font: Inter (body) + Plus Jakarta Sans (UI labels)
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Fonts ────────────────────────────────────────────────────── */
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif:   Georgia, 'Times New Roman', serif;

  /* ── Sidebar / brand palette ───────────────────────────────────── */
  --forest:    #0B1A2B;
  --canopy:    #13263D;
  --grove:     #1B3553;
  --leaf:      #2D6CDF;
  --moss:      #7A8FA6;

  /* ── Governance (approvals, flags, risk) — amber stays ─────────── */
  --amber:     #D88A1D;
  --amber-hi:  #BF7A1A;
  --amber-lt:  #FDF3E6;
  --amber-md:  #E8B86D;

  /* ── Primary action — royal blue ───────────────────────────────── */
  --primary:    #2D6CDF;
  --primary-hi: #2560C8;
  --primary-lt: #E8F0FE;
  --primary-md: #93B8F7;

  /* ── Surface / neutral ──────────────────────────────────────────── */
  --cream:      #F6F8FA;
  --parchment:  #E9ECF0;
  --white:      #FFFFFF;

  /* ── Text ───────────────────────────────────────────────────────── */
  --ink:        #222222;
  --charcoal:   #3D4A5A;
  --mist:       #6B7A8A;
  --fog:        #8A9AAA;

  /* ── Borders ────────────────────────────────────────────────────── */
  --rule:       #E3E7EB;
  --rule-lt:    #EEF1F5;

  /* ── Semantic status ────────────────────────────────────────────── */
  --flag:       #D64545;
  --flag-lt:    #FCEAEA;
  --ok:         #0E9F8A;
  --ok-lt:      #E6F6F4;
  --warn:       #E6A700;
  --warn-lt:    #FDF6E3;
  --err:        #D64545;
  --err-lt:     #FCEAEA;
  --info:       #2D6CDF;
  --info-lt:    #E8F0FE;

  /* ── Layout ──────────────────────────────────────────────────────── */
  --sidebar-w:  256px;
  --header-h:   60px;
}

/* ── Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Headings ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
}
/* Page titles (h1) use serif */
.page-hdr-left h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -.02em;
}

/* ── Shell layout ─────────────────────────────────────────────────── */
.shell   { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); background: var(--forest); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; overflow-x: hidden; }
.main    { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar  { height: var(--header-h); background: var(--white); border-bottom: 1px solid var(--rule); display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0; }
.content { flex: 1; overflow-y: auto; padding: 28px 28px 40px; }

/* ── Sidebar brand ────────────────────────────────────────────────── */
.sb-brand    { padding: 20px 18px 16px; border-bottom: 1px solid var(--grove); }
.sb-logo     { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sb-logo-mark{ width: 34px; height: 34px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.sb-logo-text{
  font-family: var(--font-serif);
  font-weight: 700; font-size: 18px; color: var(--white); letter-spacing: .04em;
}
.sb-logo-text span { color: var(--amber); }
.sb-org      { background: var(--canopy); border-radius: 8px; padding: 10px 12px; }
.sb-org-name { font-size: 12px; font-weight: 600; color: var(--white); line-height: 1.2; }
.sb-org-sub  { font-size: 10px; color: var(--moss); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.sb-org-dot  { width: 5px; height: 5px; background: var(--ok); border-radius: 50%; display: inline-block; }

/* ── Sidebar nav ──────────────────────────────────────────────────── */
.sb-nav           { flex: 1; padding: 12px 0; }
.sb-section       { margin-bottom: 4px; }
.sb-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--moss); padding: 10px 18px 4px;
  font-family: var(--font-display);
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; cursor: pointer; transition: background .15s;
  position: relative; border: none; background: none;
  width: 100%; text-align: left;
  color: var(--fog); font-size: 13px;
  font-family: var(--font-body); text-decoration: none;
}
.sb-item:hover { background: var(--canopy); color: var(--white); text-decoration: none; }
.sb-item.active  { background: var(--grove); color: var(--white); text-decoration: none; }
.sb-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--primary); border-radius: 0 2px 2px 0;
}
.sb-item i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── Sidebar footer ───────────────────────────────────────────────── */
.sb-footer    { padding: 14px 16px; border-top: 1px solid var(--grove); }
.sb-user      { display: flex; align-items: center; gap: 10px; }
.sb-avatar    { width: 32px; height: 32px; border-radius: 50%; background: var(--leaf); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--white); flex-shrink: 0; font-family: var(--font-display); }
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 12px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
.sb-user-role { font-size: 10px; color: var(--moss); font-family: var(--font-body); }

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar-breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px;
  font-family: var(--font-display);
}
.bc-sep     { color: var(--fog); }
.bc-current { font-weight: 600; color: var(--ink); }
.bc-parent  { color: var(--mist); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.tb-icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--mist); position: relative;
  transition: all .15s; text-decoration: none;
  font-family: var(--font-body);
}
.tb-icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.tb-notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--flag); border-radius: 50%; border: 1.5px solid var(--white); }
.tb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-lt); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--primary);
  border: 2px solid var(--primary-md); cursor: pointer; text-decoration: none;
  font-family: var(--font-display);
}

/* ── Page header ──────────────────────────────────────────────────── */
.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-hdr-left h1 { font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.page-hdr-left p  { font-size: 13px; color: var(--mist); margin-top: 4px; font-family: var(--font-display); }
.page-hdr-right   { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 36px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  font-family: var(--font-display); transition: all .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary     { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hi); }
.btn-ghost       { background: transparent; border: 1px solid var(--rule); color: var(--charcoal); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost-muted { background: transparent; border: 1px solid var(--rule); color: var(--mist); }
.btn-ghost-muted:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--err-lt);  color: var(--err);  border: 1px solid #e8b4b4; }
.btn-ok     { background: var(--ok-lt);   color: var(--ok);   border: 1px solid #a8d4b4; }
.btn-warn   { background: var(--warn-lt); color: var(--warn); border: 1px solid #ddb96a; }
.btn-link   { background: none; border: none; color: var(--primary); padding: 0; font-weight: 600; cursor: pointer; font-size: 13px; font-family: var(--font-display); }
.btn-sm     { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.btn-xs     { height: 24px; padding: 0 8px;  font-size: 11px; border-radius: 5px; }
.btn-full   { width: 100%; text-align: center; }
.btn-block-center { width: 100%; text-align: center; }
.align-self-start { align-self: flex-start; }

/* ── Stat grid ────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.stat-grid-5 { grid-template-columns: repeat(5,1fr); }
.stat-grid-6 { grid-template-columns: repeat(6,1fr); }
.stat-grid-7 { grid-template-columns: repeat(7,1fr); }
.stat-card { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 12px 12px 0 0; }
.stat-card.c-amber::after { background: var(--amber); }
.stat-card.c-ok::after    { background: var(--ok); }
.stat-card.c-flag::after  { background: var(--flag); }
.stat-card.c-info::after  { background: var(--info); }
.stat-card.ok   { background: var(--ok-lt);   border-color: var(--ok); }
.stat-card.err  { background: var(--err-lt);  border-color: var(--err); }
.stat-card.warn { background: var(--warn-lt); border-color: var(--warn); }
.stat-card.info { background: var(--info-lt); border-color: var(--info); }
.stat-card.ok   .stat-label, .stat-card.ok   .stat-num { color: var(--ok); }
.stat-card.err  .stat-label, .stat-card.err  .stat-num { color: var(--err); }
.stat-card.warn .stat-label, .stat-card.warn .stat-num { color: var(--warn); }
.stat-card.info .stat-label, .stat-card.info .stat-num { color: var(--info); }
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--mist); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display);
}
.stat-num   { font-size: 32px; font-weight: 500; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.stat-value { font-size: 32px; font-weight: 500; color: var(--ink); line-height: 1; font-family: var(--font-body); }
.stat-delta { font-size: 11px; color: var(--mist); margin-top: 6px; font-family: var(--font-body); }
.stat-delta.down { color: var(--err); }
.stat-icon  { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-card.c-amber .stat-icon { background: var(--amber-lt); color: var(--amber); }
.stat-card.c-ok    .stat-icon { background: var(--ok-lt);    color: var(--ok); }
.stat-card.c-flag  .stat-icon { background: var(--flag-lt);  color: var(--flag); }
.stat-card.c-info  .stat-icon { background: var(--info-lt);  color: var(--info); }

/* ── Layout helpers ───────────────────────────────────────────────── */
.two-col       { display: grid; grid-template-columns: 1fr 380px;   gap: 16px; margin-bottom: 16px; }
.two-col-wide  { display: grid; grid-template-columns: 2fr 1fr;     gap: 16px; }
.two-col-equal { display: grid; grid-template-columns: 1fr 1fr;     gap: 14px; }
.three-col     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Card ─────────────────────────────────────────────────────────── */
.card     { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; }
.card-hdr {
  padding: 14px 20px; border-bottom: 1px solid var(--rule-lt);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 13px; color: var(--ink);
  font-family: var(--font-display);
}
.card-body { padding: 16px 20px; font-family: var(--font-body); }
.card-body-divider { border-bottom: 1px solid var(--rule-lt); }
.card-count {
  font-size: 11px; background: var(--parchment); padding: 2px 8px;
  border-radius: 10px; color: var(--mist); font-weight: 500;
  font-family: var(--font-display);
}
.card-max-sm { max-width: 680px; }
.card-max-md { max-width: 700px; }
.card-title  {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
}

/* ── Activity items ───────────────────────────────────────────────── */
.act-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule-lt); }
.act-item:last-child { border-bottom: none; }
.act-dot  { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; font-family: var(--font-display); }
.act-dot.ok    { background: var(--ok-lt);    color: var(--ok); }
.act-dot.warn  { background: var(--warn-lt);  color: var(--warn); }
.act-dot.flag  { background: var(--flag-lt);  color: var(--flag); }
.act-dot.info  { background: var(--info-lt);  color: var(--info); }
.act-dot.amber { background: var(--amber-lt); color: var(--amber); }
.act-body { flex: 1; }
.act-text { font-size: 13px; color: var(--charcoal); line-height: 1.4; font-family: var(--font-body); }
.act-meta { font-size: 11px; color: var(--fog); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-body); }

/* ── Approval items ───────────────────────────────────────────────── */
.appr-item       { padding: 14px 20px; border-bottom: 1px solid var(--rule-lt); }
.appr-item:last-child { border-bottom: none; }
.appr-type       { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); margin-bottom: 4px; font-family: var(--font-display); }
.appr-title      { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 3px; font-family: var(--font-display); }
.appr-meta       { font-size: 11px; color: var(--mist); margin-bottom: 10px; font-family: var(--font-body); }
.appr-actions    { display: flex; gap: 6px; }

/* ── Flag items ───────────────────────────────────────────────────── */
.flag-item       { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule-lt); }
.flag-item:last-child { border-bottom: none; }
.flag-ic         { width: 28px; height: 28px; background: var(--flag-lt); color: var(--flag); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; margin-top: 1px; font-family: var(--font-display); }
.flag-body       { flex: 1; }
.flag-action     { font-size: 13px; color: var(--ink); font-weight: 500; font-family: var(--font-display); }
.flag-reason     { font-size: 11px; color: var(--mist); margin-top: 3px; line-height: 1.4; font-family: var(--font-body); }
.flag-meta       { display: flex; gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; font-family: var(--font-body); }
.flag-status     { font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 600; font-family: var(--font-display); }
.fs-open         { background: var(--flag-lt);  color: var(--flag);  }
.fs-acknowledged { background: var(--warn-lt);  color: var(--warn);  }
.fs-resolved     { background: var(--ok-lt);    color: var(--ok);    }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge {
  font-size: 10px; padding: 2px 8px; border-radius: 8px;
  font-weight: 600; display: inline-block;
  font-family: var(--font-display);
}
.b-ok       { background: var(--ok-lt);      color: var(--ok);   }
.b-warn     { background: var(--warn-lt);    color: var(--warn); }
.b-err      { background: var(--err-lt);     color: var(--err);  }
.b-info     { background: var(--info-lt);    color: var(--info); }
.b-flag     { background: var(--flag-lt);    color: var(--flag); }
.b-muted    { background: var(--parchment);  color: var(--mist); }
.b-amber    { background: var(--amber-lt);   color: var(--amber);}
.b-purp     { background: #e9d8fd;           color: #5521b5; }
.b-critical { background: var(--err-lt);     color: var(--err);  }
.b-high     { background: var(--flag-lt);    color: var(--flag); }
.b-medium   { background: var(--info-lt);    color: var(--info); }
.b-low      { background: var(--parchment);  color: var(--mist); }

/* ── Priority pips ────────────────────────────────────────────────── */
.prio {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-display);
}
.prio::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.prio-critical { color: var(--err);  } .prio-critical::before { background: var(--err);  }
.prio-high     { color: var(--flag); } .prio-high::before     { background: var(--flag); }
.prio-medium   { color: var(--warn); } .prio-medium::before   { background: var(--warn); }
.prio-low      { color: var(--ok);   } .prio-low::before      { background: var(--ok);   }

/* ── Table (legacy global) ────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
th {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--mist);
  padding: 10px 16px; text-align: left;
  background: var(--parchment); border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  font-family: var(--font-display);
}
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--rule-lt); color: var(--charcoal); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F6F8FA; }
.td-mono { font-size: 12px; color: var(--mist); font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.td-bold { font-weight: 600; color: var(--ink); }
.td-bold a        { color: var(--ink); }
.td-bold a:hover  { color: var(--primary); }
.td-right  { text-align: right; }
.td-center { text-align: center; }

/* ── Class-based table ────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-family: var(--font-body); }
.tbl thead tr { background: var(--parchment); border-bottom: 2px solid var(--rule); }
.tbl th {
  padding: 10px 16px; text-align: left; font-size: 10px; font-weight: 700;
  text-transform: uppercase; color: var(--mist); letter-spacing: .08em;
  white-space: nowrap; font-family: var(--font-display);
}
.tbl tbody tr { border-bottom: 1px solid var(--rule-lt); transition: background .1s; }
.tbl tbody tr:hover { background: #F6F8FA; }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl td { padding: 12px 16px; font-size: 13px; color: var(--charcoal); vertical-align: middle; }
.tbl td.td-bold   { font-weight: 600; color: var(--ink); }
.tbl td.td-mono   { font-size: 12px; color: var(--mist); font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.tbl td.td-right  { text-align: right; }
.tbl td.td-center { text-align: center; }
.tbl-link         { color: var(--primary); font-weight: 600; text-decoration: none; }
.tbl-link:hover   { text-decoration: underline; }
.tbl tbody tr.overdue       { background: var(--err-lt); }
.tbl tbody tr.overdue:hover { background: #fce0e0; }

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 2px; background: var(--parchment);
  padding: 4px; border-radius: 10px; width: fit-content;
  margin-bottom: 20px;
  font-family: var(--font-display);
}
.tab  {
  padding: 6px 14px; border-radius: 7px; font-size: 12px;
  font-weight: 600; cursor: pointer; color: var(--mist);
  border: none; background: none; font-family: inherit;
  transition: all .15s; text-decoration: none;
}
.tab.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tab:hover  { color: var(--ink); text-decoration: none; }

.tabs-underline { display: flex; gap: 2px; border-bottom: 2px solid var(--rule); margin-bottom: 1rem; }
.tabs-flush     { margin-top: -1rem; }
.tab-ul {
  padding: 8px 16px; font-size: 13px; font-weight: 400;
  color: var(--mist); text-decoration: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  cursor: pointer; transition: color .12s, border-color .12s;
  white-space: nowrap; font-family: var(--font-display);
}
.tab-ul:hover  { color: var(--ink); text-decoration: none; }
.tab-ul.active { font-weight: 600; color: var(--primary); border-bottom-color: var(--primary); }

.tab-pills {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem;
  font-family: var(--font-display);
}
.tab-pill  {
  padding: 5px 12px; font-size: 12px; font-weight: 400;
  color: var(--mist); background: var(--white);
  border: 1px solid var(--rule); border-radius: 20px;
  text-decoration: none; cursor: pointer; transition: all .12s;
  white-space: nowrap; font-family: inherit;
}
.tab-pill:hover  { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.tab-pill.active { background: var(--primary); color: var(--white); border-color: var(--primary); font-weight: 600; }

/* ── Search bar ───────────────────────────────────────────────────── */
.search-bar   { display: flex; gap: 10px; margin-bottom: 18px; align-items: center; flex-wrap: wrap; }
.search-wrap  { position: relative; flex: 1; max-width: 320px; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fog); font-size: 15px; pointer-events: none; }
.search-input  {
  width: 100%; height: 36px; border: 1px solid var(--rule);
  border-radius: 8px; padding: 0 12px 0 36px; font-size: 13px;
  font-family: var(--font-body); background: var(--white);
  color: var(--ink); outline: none;
}
.search-input:focus { border-color: var(--primary); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group    { display: flex; flex-direction: column; }
.form-row      { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-label    {
  font-size: 12px; font-weight: 600; color: var(--charcoal);
  margin-bottom: 6px; font-family: var(--font-display);
}
.form-input, .form-select {
  width: 100%; height: 38px; border: 1px solid var(--rule);
  border-radius: 8px; padding: 0 12px; font-size: 13px;
  font-family: var(--font-body); color: var(--ink);
  background: var(--white); outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }
.form-textarea {
  width: 100%; border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; font-family: var(--font-body);
  color: var(--ink); background: var(--white); resize: vertical;
  outline: none; box-sizing: border-box;
}
.form-textarea:focus { border-color: var(--primary); }
textarea.form-input { height: 80px; padding: 10px 12px; resize: vertical; }
.form-hint  { font-size: 11px; color: var(--fog); margin-top: 3px; font-family: var(--font-body); }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; font-family: var(--font-body); }
.form-flow  { display: flex; flex-direction: column; gap: 14px; }
.form-footer{ display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--rule-lt); }
.form-inline { margin: 0; }

/* ── Progress bars ────────────────────────────────────────────────── */
.prog-track    { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.prog-fill     { height: 100%; border-radius: 2px; background: var(--primary); }
.progress-wrap { height: 8px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 4px; background: var(--primary); transition: width .3s ease; }
.progress-bar.ok   { background: var(--ok);   }
.progress-bar.warn { background: var(--warn); }
.progress-bar.err  { background: var(--err);  }
.progress-mini    { width: 90px; }
.progress-mini-sm { width: 60px; }

/* ── Ticket items ─────────────────────────────────────────────────── */
.ticket-item    { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--rule-lt); align-items: flex-start; }
.ticket-item:last-child { border-bottom: none; }
.ticket-type-ic {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  font-family: var(--font-display);
}
.tt-it          { background: var(--info-lt); color: var(--info); }
.tt-facilities  { background: var(--warn-lt); color: var(--warn); }
.tt-general, .tt-hr, .tt-finance { background: var(--parchment); color: var(--mist); }
.ticket-id      { font-size: 10px; color: var(--fog); margin-bottom: 2px; font-family: var(--font-body); }
.ticket-title   {
  font-size: 13px; font-weight: 600; color: var(--ink);
  margin-bottom: 4px; font-family: var(--font-display);
}
.ticket-title a { color: var(--ink); }
.ticket-title a:hover { color: var(--primary); }
.ticket-meta    { font-size: 11px; color: var(--mist); display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-body); }
.sla-ok         { color: var(--ok);   }
.sla-warn       { color: var(--warn); }
.sla-over       { color: var(--err);  font-weight: 600; }
.cond-pip { display: flex; gap: 2px; align-items: center; }
.pip      { width: 6px; height: 14px; border-radius: 2px; background: var(--rule); }
.pip.on   { background: var(--ok);   }
.pip.warn { background: var(--warn); }
.pip.err  { background: var(--err);  }

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination      { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 14px 20px; border-top: 1px solid var(--rule-lt); }
.pagination-info { font-size: 12px; color: var(--mist); font-family: var(--font-body); }
.pagination-btns { display: flex; gap: 6px; }
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--rule); font-size: 12px;
  color: var(--mist); text-decoration: none;
  transition: all .15s; font-family: var(--font-display);
}
.pg-btn.active, .pg-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); text-decoration: none; }
.pg-prev, .pg-next {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; height: 30px; border-radius: 6px;
  border: 1px solid var(--rule); font-size: 12px;
  color: var(--mist); text-decoration: none;
  transition: all .15s; font-family: var(--font-display);
}
.pg-prev:hover { background: var(--primary); color: var(--white); border-color: var(--primary); text-decoration: none; }
.pg-next { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ── Empty states ─────────────────────────────────────────────────── */
.empty       { text-align: center; padding: 48px 20px; color: var(--mist); }
.empty i     { font-size: 36px; margin-bottom: 10px; display: block; }
.empty p     { font-size: 13px; font-family: var(--font-body); }
.empty-state { padding: 48px 24px; text-align: center; color: var(--mist); }
.empty-state i  { font-size: 3rem; display: block; margin-bottom: 12px; opacity: .3; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; color: var(--charcoal); font-family: var(--font-display); }
.empty-state p  { margin: 0; font-size: 13px; font-family: var(--font-body); }
.empty-inline   { padding: 24px; }

/* ── Flash messages ───────────────────────────────────────────────── */
.flash         { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; font-family: var(--font-body); }
.flash-success { background: var(--ok-lt);   color: var(--ok);   border: 1px solid #a8d4b4; }
.flash-error   { background: var(--err-lt);  color: var(--err);  border: 1px solid #e8b4b4; }
.flash-warning { background: var(--warn-lt); color: var(--warn); border: 1px solid #ddb96a; }
.flash-info    { background: var(--info-lt); color: var(--info); border: 1px solid #93B8F7; }
.overdue       { color: var(--err); font-weight: 600; }

/* ── Auth layout ──────────────────────────────────────────────────── */
.auth-body { background: var(--cream); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 420px; padding: 24px; }
.auth-box  { background: var(--white); border: 1px solid var(--rule); border-radius: 16px; padding: 32px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 28px; }
.auth-logo h1 { font-family: var(--font-serif); }

/* ── Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar            { width: 5px; height: 5px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: var(--rule); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--grove); }

/* ══════════════════════════════════════════════════════════════════
   MOBILE SIDEBAR
   ══════════════════════════════════════════════════════════════════ */
.sb-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--rule);
  background: var(--white); cursor: pointer; color: var(--charcoal);
  font-size: 18px; flex-shrink: 0; margin-right: 8px;
}
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 900; opacity: 0; transition: opacity .2s ease; }
.sb-backdrop.open { display: block; opacity: 1; }

@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); overflow-y: auto; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.22); }
  .sb-toggle { display: flex; }
  .shell { flex-direction: column; }
  .main { width: 100%; min-width: 0; }
  .topbar { padding: 0 14px; gap: 8px; }
  .content { padding: 16px 14px 32px; }
  .stat-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px; }
  .two-col       { grid-template-columns: 1fr !important; }
  .two-col-wide  { grid-template-columns: 1fr; }
  .two-col-equal { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr !important; }
  .form-row  { grid-template-columns: 1fr !important; }
  .detail-grid   { grid-template-columns: 1fr; }
  .decision-panel { grid-template-columns: 1fr; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table     { min-width: 560px; }
  .search-bar  { flex-wrap: wrap; }
  .search-wrap { flex: 1 1 100%; max-width: 100%; }
  .page-hdr    { flex-direction: column; gap: 12px; }
  .page-hdr-right { align-self: flex-start; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; width: 100%; padding-bottom: 4px; }
  .card > form { padding: 16px !important; }
}
@media (max-width: 600px) {
  .form-row-3 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-num  { font-size: 24px; }
  .page-hdr-left h1 { font-size: 20px; }
  .btn { padding: 0 12px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════════════════
   DS COMPONENT EXTENSIONS
   ══════════════════════════════════════════════════════════════════ */

/* DS token aliases */
:root {
  --ds-bg:        var(--cream);
  --ds-surface:   var(--white);
  --ds-primary:   var(--primary);
  --ds-primary-d: var(--primary-hi);
  --ds-success:   var(--ok);
  --ds-warning:   var(--warn);
  --ds-danger:    var(--err);
  --ds-purple:    #9b59b6;
  --ds-text:      var(--ink);
  --ds-muted:     var(--charcoal);
  --ds-label:     var(--mist);
  --ds-fog:       var(--fog);
  --ds-border:    var(--rule);
  --ds-border-a:  #b2b9bf;
  --ds-radius:    8px;
  --ds-radius-sm: 6px;
  --ds-shadow:    0 1px 3px rgba(0,0,0,0.06);
  --ds-shadow-md: 0 4px 8px rgba(0,0,0,0.10);
  --ds-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --ds-ok-bg:   var(--ok-lt);    --ds-ok-cl:   var(--ok);
  --ds-err-bg:  var(--err-lt);   --ds-err-cl:  var(--err);
  --ds-warn-bg: var(--warn-lt);  --ds-warn-cl: var(--warn);
  --ds-info-bg: var(--info-lt);  --ds-info-cl: var(--info);
  --ds-mute-bg: var(--parchment); --ds-mute-cl: var(--mist);
  --ds-purp-bg: #e9d8fd;          --ds-purp-cl: #5521b5;
  --ds-flag-bg: var(--flag-lt);  --ds-flag-cl: var(--flag);
}

/* ── Section labels & dividers ────────────────────────────────────── */
.section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .10em; color: var(--mist);
  padding: 10px 0 6px; border-bottom: 1px solid var(--rule-lt);
  margin-bottom: 12px; font-family: var(--font-display);
}
.section-divider    { padding-top: 12px; border-top: 1px solid var(--rule-lt); margin-top: 1rem; }
.section-divider-sm { padding-top: 8px;  border-top: 1px solid var(--rule-lt); }

/* ── Detail grid ──────────────────────────────────────────────────── */
.detail-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.detail-grid .full  { grid-column: 1 / -1; }
.dl { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mist); margin-bottom: 3px; font-family: var(--font-display); }
.dv { font-size: 13px; color: var(--charcoal); font-family: var(--font-body); }
.dv.mono { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--mist); }

/* ── Alert banners ────────────────────────────────────────────────── */
.alert     { border-radius: 8px; padding: 12px 16px; margin-bottom: 1rem; font-size: 13px; display: flex; align-items: flex-start; gap: 10px; font-family: var(--font-body); }
.alert i   { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.alert-ok   { background: var(--ok-lt);   color: var(--ok);   border: 1px solid #a8d4b4; border-left: 4px solid var(--ok);   }
.alert-err  { background: var(--err-lt);  color: var(--err);  border: 1px solid #e8b4b4; border-left: 4px solid var(--err);  }
.alert-warn { background: var(--warn-lt); color: var(--warn); border: 1px solid #ddb96a; border-left: 4px solid var(--warn); }
.alert-info { background: var(--info-lt); color: var(--info); border: 1px solid #93B8F7; border-left: 4px solid var(--info); }
.alert-flag { background: var(--flag-lt); color: var(--flag); border: 1px solid #e8a87c; border-left: 4px solid var(--flag); }

/* ── Filter bar ───────────────────────────────────────────────────── */
.filter-bar { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 18px; margin-bottom: 1rem; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }

/* ── Timeline ─────────────────────────────────────────────────────── */
.timeline  { display: flex; flex-direction: column; }
.tl-item   { display: flex; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--rule-lt); }
.tl-item:last-child { border-bottom: none; }
.tl-dot    { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; font-size: .8rem; font-family: var(--font-display); }
.tl-dot.ok   { background: var(--ok-lt);    color: var(--ok);   }
.tl-dot.err  { background: var(--err-lt);   color: var(--err);  }
.tl-dot.warn { background: var(--warn-lt);  color: var(--warn); }
.tl-dot.info { background: var(--info-lt);  color: var(--info); }
.tl-dot.mute { background: var(--parchment); color: var(--mist); }
.tl-dot.flag { background: var(--flag-lt);  color: var(--flag); }
.tl-dot.amber{ background: var(--amber-lt); color: var(--amber);}
.tl-body   { flex: 1; min-width: 0; }
.tl-title  { font-size: 13px; color: var(--charcoal); line-height: 1.5; font-family: var(--font-display); }
.tl-sub    { font-size: 11px; color: var(--mist); margin-top: 2px; font-family: var(--font-body); }
.tl-meta   { font-size: 11px; color: var(--fog);  margin-top: 3px; font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.tl-scroll-320 { max-height: 320px; overflow-y: auto; }
.tl-scroll-360 { max-height: 360px; overflow-y: auto; }
.tl-scroll-400 { max-height: 400px; overflow-y: auto; }
.tl-scroll-480 { max-height: 480px; overflow-y: auto; }
.tl-scroll-500 { max-height: 500px; overflow-y: auto; }
.tl-scroll-560 { max-height: 560px; overflow-y: auto; }
.tl-scroll-680 { max-height: 680px; overflow-y: auto; }
.tl-scroll-sm  { max-height: 320px; overflow-y: auto; }
.tl-scroll-md  { max-height: 480px; overflow-y: auto; }
.tl-scroll-lg  { max-height: 560px; overflow-y: auto; }
.tl-scroll-xl  { max-height: 680px; overflow-y: auto; }

/* ── Info box ─────────────────────────────────────────────────────── */
.info-box    { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 20px; font-size: 12px; color: var(--mist); line-height: 1.7; font-family: var(--font-body); }
.info-box h4 { margin: 0 0 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fog); font-family: var(--font-display); }
.info-box p  { margin: 0 0 8px; }
.info-box p:last-child { margin: 0; }

/* ── Status banner ────────────────────────────────────────────────── */
.status-banner { border-radius: 8px; padding: 10px 16px; margin-bottom: 1rem; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--font-body); }
.status-banner a { font-size: 12px; font-weight: 600; text-decoration: none; flex-shrink: 0; font-family: var(--font-display); }
.status-banner.info { background: var(--info-lt); color: var(--info); border: 1px solid #93B8F7; }
.status-banner.warn { background: var(--warn-lt); color: var(--warn); border: 1px solid #ddb96a; }
.status-banner.ok   { background: var(--ok-lt);   color: var(--ok);   border: 1px solid #a8d4b4; }
.status-banner.err  { background: var(--err-lt);  color: var(--err);  border: 1px solid #e8b4b4; }
.status-banner.flag { background: var(--flag-lt); color: var(--flag); border: 1px solid #e8a87c; }
.status-banner.purp { background: var(--ds-purp-bg); color: var(--ds-purp-cl); border: 1px solid #b39ddb; }

/* ── Risk score ───────────────────────────────────────────────────── */
.risk-score {
  padding: 3px 12px; border-radius: 10px; font-size: 12px;
  font-weight: 700; display: inline-block;
  font-family: var(--font-display);
}
.risk-score.low      { background: var(--parchment); color: var(--mist); }
.risk-score.medium   { background: var(--info-lt);   color: var(--info); }
.risk-score.high     { background: var(--warn-lt);   color: var(--warn); }
.risk-score.critical { background: var(--err-lt);    color: var(--err);  }

/* ── Decision panel ───────────────────────────────────────────────── */
.decision-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── CAPA actions ─────────────────────────────────────────────────── */
.capa-action { display: flex; gap: 10px; padding: 8px 20px; border-bottom: 1px solid var(--rule-lt); align-items: flex-start; font-family: var(--font-body); }
.capa-action-check { width: 18px; height: 18px; border-radius: 50%; background: var(--rule); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.capa-action-check.done { background: var(--ok); }
.capa-action-check.done i { color: var(--white); font-size: .65rem; }
.capa-action-text { font-size: 13px; color: var(--charcoal); }
.capa-action-text.done { text-decoration: line-through; color: var(--fog); }

/* ── Flag status dots ─────────────────────────────────────────────── */
.flag-status-dot          { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.flag-status-dot.open         { background: var(--flag); }
.flag-status-dot.acknowledged { background: var(--warn); }
.flag-status-dot.resolved     { background: var(--ok);   }

/* ── Resolution box ───────────────────────────────────────────────── */
.resolution-box    { background: var(--ok-lt); border: 1px solid #a8d4b4; border-radius: 8px; padding: 12px 16px; font-family: var(--font-body); }
.resolution-box .rl { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--ok); margin-bottom: 4px; letter-spacing: .06em; font-family: var(--font-display); }
.resolution-box .rv { font-size: 13px; color: var(--ok); line-height: 1.7; }
.resolution-box .rm { font-size: 11px; color: var(--ok); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ── New DS sidebar (app.php new layout) ──────────────────────────── */
.ds-sidebar { width: 240px; background: var(--forest); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transition: width .2s ease; overflow: hidden; }
.ds-sidebar.collapsed { width: 56px; }
.ds-sidebar.collapsed .ds-brand-text,
.ds-sidebar.collapsed .ds-item-text,
.ds-sidebar.collapsed .ds-item-badge,
.ds-sidebar.collapsed .ds-group-label,
.ds-sidebar.collapsed .ds-group-chevron,
.ds-sidebar.collapsed .ds-footer-info,
.ds-sidebar.collapsed .ds-branch-wrap { display: none !important; }
.ds-nav-children { display: none; flex-direction: column; gap: 1px; margin-top: 2px; }
.ds-nav-group.open .ds-nav-children { display: flex; }
.ds-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  color: var(--moss); text-decoration: none;
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
  font-family: var(--font-body);
}
.ds-item:hover  { background: var(--canopy); color: var(--white); text-decoration: none; }
.ds-item.active { background: var(--grove);  color: var(--white); text-decoration: none; }
.ds-item .ds-item-icon  { width: 20px; text-align: center; flex-shrink: 0; font-size: 16px; }
.ds-item .ds-item-text  { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ds-item .ds-item-badge { background: var(--flag); color: var(--white); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; flex-shrink: 0; font-family: var(--font-display); }
.ds-item .ds-item-badge.warn { background: var(--warn); }
.ds-group-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; cursor: pointer; user-select: none;
  border-radius: 6px; color: var(--moss);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; transition: color .12s, background .12s;
  font-family: var(--font-display);
}
.ds-group-trigger:hover { color: rgba(255,255,255,.7); background: var(--canopy); }
.ds-group-chevron { font-size: 12px; transition: transform .2s; flex-shrink: 0; }
.ds-nav-group.open .ds-group-chevron { transform: rotate(90deg); }

/* ── Utility ──────────────────────────────────────────────────────── */
.mono         { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--mist); font-family: var(--font-body); }
.prose        { line-height: 1.7; font-family: var(--font-body); }
.text-muted   { color: var(--mist); }
.text-label   { color: var(--fog); }
.text-fog     { color: var(--fog); }
.text-primary { color: var(--primary); }
.text-ok      { color: var(--ok);   }
.text-err     { color: var(--err);  }
.text-warn    { color: var(--warn); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1   { margin-top: .5rem;  }
.mt-2   { margin-top: 1rem;   }
.mb-1   { margin-bottom: .5rem; }
.mb-2   { margin-bottom: 1rem;  }
.hidden { display: none; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-1       { flex: 1; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.align-self-start { align-self: flex-start; }
.btn-full { width: 100%; text-align: center; }

/* ── PO line item grid ────────────────────────────────────────────── */
.po-item-grid  { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr 1fr auto; gap: 6px; align-items: flex-end; margin-bottom: 4px; }
.po-label-pad  { padding-top: 20px; }

/* ── Misc layout helpers ──────────────────────────────────────────── */
.tabs-flush       { margin-top: -1rem; }
.settings-nav-link { text-decoration: none; }
.btn-block-center { width: 100%; text-align: center; }
.card-body-divider { border-bottom: 1px solid var(--rule-lt); }
.section-divider  { padding-top: 12px; border-top: 1px solid var(--rule-lt); margin-top: 1rem; }
.section-divider-sm { padding-top: 8px; border-top: 1px solid var(--rule-lt); }

/* ══════════════════════════════════════════════════════════════════
   BELL NOTIFICATION DROPDOWN
   ══════════════════════════════════════════════════════════════════ */
.ds-bell-wrap { position: relative; }
.ds-bell-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; background: var(--white);
  border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14); z-index: 2000; overflow: hidden;
}
.ds-bell-hdr { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule-lt); }
.ds-bell-hdr-title { font-size: 13px; font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.ds-bell-hdr a { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600; font-family: var(--font-display); }
.ds-bell-hdr a:hover { text-decoration: underline; }
.ds-bell-list { max-height: 380px; overflow-y: auto; }
.ds-bell-footer { padding: 10px 16px; border-top: 1px solid var(--rule-lt); display: flex; justify-content: space-between; align-items: center; }
.ds-bell-footer a { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600; font-family: var(--font-display); }
.ds-bell-footer a:hover { text-decoration: underline; }
.ds-bell-footer button { font-size: 11px; color: var(--mist); background: none; border: none; cursor: pointer; font-family: var(--font-body); padding: 0; }
.ds-bell-footer button:hover { color: var(--ink); }

.bell-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--rule-lt); cursor: pointer; transition: background .1s; font-family: var(--font-body); }
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--cream); }
.bell-item--unread { background: var(--primary-lt); }
.bell-item--unread:hover { background: #d5e5fd; }
.bell-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--parchment); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; color: var(--primary); font-family: var(--font-display); }
.bell-item--unread .bell-icon { background: var(--primary-lt); color: var(--primary); }
.bell-body { flex: 1; min-width: 0; }
.bell-title { font-size: 13px; color: var(--ink); font-weight: 400; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
.bell-item--unread .bell-title { font-weight: 600; }
.bell-sub   { font-size: 11px; color: var(--mist); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-body); }
.bell-time  { font-size: 10px; color: var(--fog); margin-top: 3px; font-family: var(--font-body); }
.bell-dot   { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.ds-bell-count { position: absolute; top: 4px; right: 4px; background: var(--err); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 8px; line-height: 1.4; min-width: 16px; text-align: center; pointer-events: none; font-family: var(--font-display); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════
   PERFORMANCE TABLE (perf-row)
   ══════════════════════════════════════════════════════════════════ */
.perf-row       { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--rule-lt); }
.perf-row:last-child { border-bottom: none; }
.perf-dept      { font-size: 13px; font-weight: 500; color: var(--ink); width: 160px; flex-shrink: 0; font-family: var(--font-display); }
.perf-bar-wrap  { flex: 1; }
.perf-num       { font-size: 12px; color: var(--mist); width: 40px; text-align: right; flex-shrink: 0; font-family: var(--font-body); }

/* ══════════════════════════════════════════════════════════════════
   APP LAYOUT SPECIFIC CLASSES
   ══════════════════════════════════════════════════════════════════ */

/* ── Impersonation bar ────────────────────────────────────────────── */
.impersonation-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: #7C3AED; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 20px; font-size: 12px; font-weight: 600;
}
.impersonation-bar + * { margin-top: 34px; }
.impersonation-bar-btn {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4);
  color: #fff; padding: 3px 14px; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}

/* ── Branch bar ───────────────────────────────────────────────────── */
.branch-bar {
  position: sticky; top: 0; z-index: 800;
  background: var(--amber); color: var(--forest);
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 20px; font-size: 12px; font-weight: 600;
}
.branch-bar-btn {
  background: rgba(0,0,0,.15); border: none; color: var(--forest);
  padding: 3px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
}

/* ── Sidebar badge (notification counts) ─────────────────────────── */
.sb-badge {
  margin-left: auto;
  background: var(--primary); color: #fff;
  border-radius: 10px; padding: 0 6px;
  font-size: 9px; font-weight: 700; min-width: 18px; text-align: center;
}
.sb-badge-err  { background: var(--err); }
.sb-badge-warn { background: var(--warn); color: var(--forest); }

/* ── Branch switcher in sidebar ───────────────────────────────────── */
.sb-branch-wrap {
  padding: 8px 14px;
  border-bottom: 1px solid var(--grove);
}
.sb-branch-label {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--moss); margin-bottom: 6px;
}
.sb-branch-select {
  width: 100%; height: 30px; font-size: 11px;
  background: var(--canopy); border: 1px solid var(--grove);
  color: var(--white); border-radius: 6px; padding: 0 8px;
}

/* ── God Mode sidebar item ────────────────────────────────────────── */
.sb-item-god { color: var(--amber) !important; }
.sb-item-god:hover { color: var(--amber) !important; }

/* ── Sidebar footer links ─────────────────────────────────────────── */
.sb-footer-link {
  color: var(--moss); font-size: 16px; text-decoration: none;
  display: flex; align-items: center; padding: 4px;
  border-radius: 6px; transition: color .12s;
}
.sb-footer-link:hover { color: var(--white); text-decoration: none; }

/* ── Header search ────────────────────────────────────────────────── */
.header-search-wrap {
  position: relative; flex: 1; max-width: 360px; margin: 0 16px;
}
.header-search-box {
  display: flex; align-items: center;
  background: var(--cream); border-radius: 8px;
  border: 1px solid var(--rule); padding: 6px 12px; gap: 8px;
}
.header-search-icon { color: var(--mist); font-size: .95rem; flex-shrink: 0; }
.header-search-input {
  border: none; background: transparent; outline: none;
  font-size: .875rem; flex: 1; color: var(--ink); min-width: 0;
  font-family: var(--font-body);
}
.header-search-input::placeholder { color: var(--fog); }
.header-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  min-width: 360px; background: var(--white);
  border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 9999; overflow: hidden;
}
.header-search-results { max-height: 400px; overflow-y: auto; }
.header-search-footer {
  padding: 8px 12px; border-top: 1px solid var(--rule);
  font-size: .8rem; color: var(--mist);
  display: flex; justify-content: space-between;
}
.header-search-footer a { color: var(--primary); }
.header-search-msg { padding: 16px; text-align: center; color: var(--mist); font-size: .85rem; }
.header-search-group-label {
  padding: 4px 12px; font-size: .72rem; font-weight: 600;
  color: var(--mist); text-transform: uppercase; letter-spacing: .05em;
  background: var(--cream);
}
.header-search-result {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--rule-lt); transition: background .1s;
}
.header-search-result:hover,
.header-search-result.selected { background: var(--cream); text-decoration: none; }
.header-search-title { font-size: .875rem; font-weight: 500; color: var(--ink); }
.header-search-ref   { font-size: .75rem; color: var(--mist); font-family: monospace; }

/* ── Mobile sidebar overrides ─────────────────────────────────────── */
@media (max-width: 900px) {
  .header-search-wrap { max-width: none; margin: 0 8px; flex: 1; }
  .header-search-dropdown { min-width: auto; right: 0; left: 0; }
  .tb-avatar { display: none; } /* hide avatar on very small topbar */
}
@media (max-width: 600px) {
  .topbar-breadcrumb .bc-parent,
  .topbar-breadcrumb .bc-sep { display: none; }
  .header-search-wrap { display: none; } /* hide search on smallest screens */
}
/* ── Checklist run item forms ─────────────────────────────────────── */
.checklist-photo-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border: 2px dashed var(--rule); border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--mist);
  background: var(--cream); transition: border-color .15s;
}
.checklist-photo-label:hover { border-color: var(--primary); color: var(--primary); }
.checklist-photo-label input[type="file"] { display: none; }
.checklist-photo-preview {
  max-width: 100%; border-radius: 8px; margin-top: 8px;
  border: 1px solid var(--rule);
}

/*Add css for sections navigation*/

/* ── Collapsible Sidebar Section Headers ────────────────────────── */
.sb-section-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;          /* Increased from small caption size */
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.625rem 0.75rem;
  margin-top: 0.5rem;
  border-radius: 6px;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Subtle hover interaction */
.sb-section-label:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

/* Caret Icon Transition */
.sb-section-label::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);     /* Pointing down when expanded */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 0.5rem;
  opacity: 0.7;
}

/* Rotated Caret when collapsed */
.sb-section.collapsed .sb-section-label::after {
  transform: rotate(-45deg);    /* Pointing right when collapsed */
}

/* Smooth Accordion Body Collapse */
.sb-section-body {
  overflow: hidden;
  max-height: 1000px;            /* Generous height cap for animation */
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), opacity 0.2s ease;
  opacity: 1;
}

.sb-section.collapsed .sb-section-body {
  max-height: 0;
  opacity: 0;
}

/* ── Settings edit rows ───────────────────────────────────────────── */
.edit-row-cell { background: var(--parchment); padding: 0; }
.edit-row-form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── PATCH: Missing classes from original CSS ────────────────────── */

/* ── Sidebar section accordion (collapsible) ────────────────────── */
.sb-section-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.625rem 0.75rem;
  margin-top: 0.5rem;
  border-radius: 6px;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.sb-section-label:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
.sb-section-label::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 0.5rem;
  opacity: 0.7;
}
.sb-section.collapsed .sb-section-label::after {
  transform: rotate(-45deg);
}
.sb-section-body {
  overflow: hidden;
  max-height: 1000px;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), opacity 0.2s ease;
  opacity: 1;
}
.sb-section.collapsed .sb-section-body {
  max-height: 0;
  opacity: 0;
}

/* ── DS Sidebar brand text (if not already defined) ────────────── */
.ds-brand-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  letter-spacing: .04em;
}
.ds-brand-text span {
  color: var(--amber);
}
.ds-footer-info {
  flex: 1;
  min-width: 0;
}
.ds-branch-wrap {
  padding: 8px 14px;
  border-bottom: 1px solid var(--grove);
}

/* ── Checklist photo upload ──────────────────────────────────────── */
.checklist-photo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed var(--rule);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--mist);
  background: var(--cream);
  transition: border-color .15s;
}
.checklist-photo-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.checklist-photo-label input[type="file"] {
  display: none;
}
.checklist-photo-preview {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--rule);
}

/* ── Optional colour consistency improvements ───────────────────── */
/* Replace hardcoded shadow with variable */
.header-search-dropdown {
  box-shadow: var(--shadow-md);
}

/* Ensure bell unread hover uses primary-lt variable */
.bell-item--unread:hover {
  background: var(--primary-lt);
}

 
/* ── Checklist photo upload ───────────────────────────────────────── */
.checklist-photo-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border: 2px dashed var(--rule); border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--mist);
  background: var(--cream); transition: border-color .15s;
}
.checklist-photo-label:hover { border-color: var(--primary); color: var(--primary); }
.checklist-photo-label input[type="file"] { display: none; }
.checklist-photo-preview { max-width: 100%; border-radius: 8px; margin-top: 8px; border: 1px solid var(--rule); }
 
/* ── QR Audit Scanner ─────────────────────────────────────────── */
.qr-viewfinder {
  position: relative; width: 100%; max-width: 400px;
  margin: 0 auto; border-radius: 12px; overflow: hidden;
  background: #000; aspect-ratio: 4/3;
}
.qr-viewfinder video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.qr-overlay {
  position: absolute; inset: 0; pointer-events: none;
}
.qr-corner {
  position: absolute; width: 32px; height: 32px;
  border-color: var(--primary); border-style: solid;
  border-width: 0;
}
.qr-corner.tl { top: 16px;    left: 16px;  border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.qr-corner.tr { top: 16px;    right: 16px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.qr-corner.bl { bottom: 16px; left: 16px;  border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.qr-corner.br { bottom: 16px; right: 16px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }
 
/* Depreciation schedule table */
.depr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.depr-table th { padding: 6px 10px; background: var(--parchment); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--mist); text-align: right; }
.depr-table th:first-child { text-align: left; }
.depr-table td { padding: 6px 10px; border-bottom: 1px solid var(--rule-lt); text-align: right; font-variant-numeric: tabular-nums; color: var(--charcoal); }
.depr-table td:first-child { text-align: left; font-weight: 600; }
.depr-table tr.current-year td { background: var(--primary-lt); }
.depr-table tr:last-child td { border-bottom: none; }
 
@media (max-width: 600px) {
  .qr-viewfinder { max-width: 100%; }
}
 
/* ── Timeline dot size variant ───────────────────────────────────── */
.tl-dot-lg { width: 32px; height: 32px; }
 
/* ── Bulk Import Dropzone ────────────────────────────────────────── */
.import-dropzone {
  border: 2px dashed var(--rule); border-radius: 12px;
  padding: 40px 24px; text-align: center;
  cursor: pointer; transition: all .2s; background: var(--cream);
  position: relative;
}
.import-dropzone:hover,
.import-dropzone.drag-over { border-color: var(--primary); background: var(--primary-lt); }
.import-dropzone.file-selected { border-color: var(--ok); background: var(--ok-lt); }
.import-drop-icon { font-size: 3rem; color: var(--mist); display: block; margin-bottom: 12px; }
.import-dropzone.file-selected .import-drop-icon { color: var(--ok); }
.import-drop-label { font-size: 15px; font-weight: 600; color: var(--charcoal); margin-bottom: 6px; font-family: var(--font-display); }
.import-drop-hint  { font-size: 12px; color: var(--fog); font-family: var(--font-body); }
.import-drop-chosen { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ok); font-family: var(--font-body); }
 
/* ── Report type picker cards ────────────────────────────────────── */
.report-type-card {
  display: block; padding: 14px 16px; border: 2px solid var(--rule);
  border-radius: 10px; cursor: pointer; transition: all .15s;
  background: var(--white); position: relative;
}
.report-type-card input[type="radio"] { display: none; }
.report-type-card:hover { border-color: var(--primary); background: var(--primary-lt); }
.report-type-card.selected { border-color: var(--primary); background: var(--primary-lt); }
.report-type-card.selected::after {
  content: '✓'; position: absolute; top: 8px; right: 10px;
  color: var(--primary); font-weight: 700; font-size: 14px;
}
.report-type-icon { font-size: 18px; color: var(--primary); }
 
/* ── Sign-off step connector ─────────────────────────────────────── */
.tl-line {
  flex: 1; height: 2px; background: var(--rule); min-width: 24px;
  align-self: center; max-width: 60px;
}

/* ── Delegation scope type cards ─────────────────────────────────── */
.scope-type-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border: 2px solid var(--rule);
  border-radius: 10px; cursor: pointer; transition: all .15s;
  background: var(--white); flex: 1; min-width: 160px;
}
.scope-type-card input[type="radio"] { display: none; }
.scope-type-card:hover    { border-color: var(--primary); background: var(--primary-lt); }
.scope-type-card.selected { border-color: var(--primary); background: var(--primary-lt); }
.scope-type-card .ti      { font-size: 1.3rem; color: var(--primary); margin-top: 2px; flex-shrink: 0; }

/* ── Permission check grid (delegation create + role permissions) ── */
.perm-check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; max-height: 360px; overflow-y: auto;
  border: 1px solid var(--rule); border-radius: 8px; padding: 12px;
}
.perm-module-block { display: flex; flex-direction: column; gap: 4px; }
.perm-module-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
                     letter-spacing: .06em; color: var(--fog); padding: 4px 0 2px;
                     border-bottom: 1px solid var(--rule-lt); margin-bottom: 2px; }
.perm-check-row    { display: flex; align-items: center; gap: 6px;
                     font-size: 12px; color: var(--charcoal); padding: 2px 0; cursor: pointer; }
.perm-check-row input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; }

/* ── PR / Leave type picker cards ───────────────────────────────── */
.type-picker-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 2px solid var(--rule);
  border-radius: 10px; cursor: pointer; transition: all .15s;
  background: var(--white); flex: 1;
}
.type-picker-card input[type="radio"] { display: none; }
.type-picker-card:hover    { border-color: var(--primary); background: var(--primary-lt); }
.type-picker-card.selected { border-color: var(--primary); background: var(--primary-lt); }
.type-picker-card .ti      { font-size: 1.2rem; color: var(--primary); flex-shrink: 0; }

/* ── State machine / consequence UI helpers ──────────────────────── */
.section-divider-inline {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; border-top: 1px solid var(--rule-lt);
}
.code-block {
  background: var(--parchment); padding: 10px; border-radius: 6px;
  font-size: 11px; overflow-x: auto; margin: 8px 0;
  font-family: var(--font-mono, monospace);
}
.btn-xs { font-size: 9px; margin-left: 2px; }
.form-input-sm { height: 26px; font-size: 11px; }

/* ── Payment voucher status badges ───────────────────────────────── */
/* Uses existing b-ok/b-info/b-amber/b-err/b-muted already in CSS */

/* ── State transition timeline ───────────────────────────────────── */
.state-chain {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
}
.state-node {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; font-size: 12px;
  font-weight: 600; font-family: var(--font-display);
  border: 2px solid var(--rule); background: var(--white); color: var(--charcoal);
  white-space: nowrap;
}
.state-node.active  { border-color: var(--primary); background: var(--primary-lt); color: var(--primary); }
.state-node.done    { border-color: var(--ok);      background: var(--ok-lt);      color: var(--ok); }
.state-node.failed  { border-color: var(--err);     background: var(--err-lt);     color: var(--err); }
.state-arrow {
  font-size: 14px; color: var(--fog); padding: 0 4px; flex-shrink: 0;
}
/* ── New sidebar navigation (groups & children) ──────────────────── */

/* Quick links row – reuses existing .sb-item styles */
.sb-quick {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--grove);
  margin-bottom: 0.5rem;
}
.sb-quick .sb-item {
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0.4rem 0.25rem;
}

/* Group container */
.sb-group {
  margin: 0.15rem 0;
}

/* Group toggle button */
.sb-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: var(--font-body);
}
.sb-group-btn:hover {
  background: var(--canopy);
}
.sb-group-btn .sb-item-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Chevron icon */
.sb-chevron {
  transition: transform 0.25s ease;
  font-size: 0.9rem;
  opacity: 0.6;
}
.sb-group.open .sb-chevron {
  transform: rotate(90deg);
}

/* Collapsible body */
.sb-group-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
  margin-left: 0.5rem;
}
.sb-group.open .sb-group-body {
  max-height: 900px;
  opacity: 1;
}

/* Child links */
.sb-child {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 2.2rem;
  font-size: 0.8rem;
  border-radius: 4px;
  color: var(--fog);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-body);
}
.sb-child:hover {
  background: var(--canopy);
  color: var(--white);
}
.sb-child.active {
  background: var(--grove);
  color: var(--white);
  font-weight: 500;
}
.sb-child i {
  font-size: 0.9rem;
  opacity: 0.7;
}
.sb-child.active i {
  opacity: 1;
}

/* Branch switcher – using existing colours */
.sb-branch-wrap {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--grove);
}
.sb-branch-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--moss);
  margin-bottom: 0.2rem;
}
.sb-branch-select {
  width: 100%;
  background: var(--canopy);
  border: 1px solid var(--grove);
  color: var(--white);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
}
.sb-branch-select option {
  background: var(--forest);
  color: var(--white);
}

/* User footer links (profile, logout) – already have .sb-footer-link, but ensure consistency */
.sb-user-link {
  color: var(--moss);
  text-decoration: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.sb-user-link:hover {
  background: var(--canopy);
  color: var(--white);
}
.sb-user-link i {
  font-size: 1.1rem;
}

/* ── Additional adjustments ──────────────────────────────────────── */

/* Ensure .sb-item (already defined) works well in quick links */
.sb-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

<style>
  /* ── Sidebar group & child styles ──────────────────────────────── */
  .sb-group { margin: 0.15rem 0; }
  .sb-group-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--fog);
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-body);
  }
  .sb-group-btn:hover {
    background: var(--canopy);
    color: var(--white);
  }
  .sb-group-btn .sb-item-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  .sb-chevron {
    transition: transform 0.25s ease;
    font-size: 0.9rem;
    opacity: 0.6;
  }
  .sb-group.open .sb-chevron {
    transform: rotate(90deg);
  }
  .sb-group-body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
    margin-left: 0.5rem;
  }
  .sb-group.open .sb-group-body {
    max-height: 900px;
    opacity: 1;
  }
  .sb-child {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 2.2rem;
    font-size: 0.8rem;
    border-radius: 4px;
    color: var(--fog);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
  }
  .sb-child:hover {
    background: var(--canopy);
    color: var(--white);
  }
  .sb-child.active {
    background: var(--grove);
    color: var(--white);
    font-weight: 500;
  }
  .sb-child i {
    font-size: 0.9rem;
    opacity: 0.7;
  }
  .sb-child.active i {
    opacity: 1;
  }

  /* ── Section headers (e.g. "Operations") ───────────────────────── */
  .sb-section {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--moss);
    padding: 10px 18px 4px;
    font-family: var(--font-display);
    margin-top: 8px;
  }

  /* ── Quick links row ────────────────────────────────────────────── */
  .sb-quick {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--grove);
    margin-bottom: 0.5rem;
  }
  .sb-quick .sb-item {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.4rem 0.25rem;
  }

  /* ── Branch switcher ────────────────────────────────────────────── */
  .sb-branch-wrap {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--grove);
  }
  .sb-branch-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--moss);
    margin-bottom: 0.2rem;
  }
  .sb-branch-select {
    width: 100%;
    background: var(--canopy);
    border: 1px solid var(--grove);
    color: var(--white);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
  }
  .sb-branch-select option {
    background: var(--forest);
    color: var(--white);
  }

  /* ── User footer links ──────────────────────────────────────────── */
  .sb-user-link {
    color: var(--moss);
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
  }
  .sb-user-link:hover {
    background: var(--canopy);
    color: var(--white);
  }
  .sb-user-link i {
    font-size: 1.1rem;
  }

  /* ── Top‑level items (non‑group) ────────────────────────────────── */
  .sb-item .sb-item-label {
    color: var(--fog);
  }
  .sb-item.active .sb-item-label {
    color: var(--white);
  }
</style>

/* Badge styles (if not already present – they are at the end of your file) */
/* Your file already has .sb-badge, .sb-badge-err, .sb-badge-warn – keep them */
