/* ═══════════════════════════════════════════════════════════════════════
   RI-FOCUS DESIGN SYSTEM  v2.0
   Reset, layout, components, utilities.
   Copied from /Users/op2ma/Projects/Op2ma/design-system/06-assets/css/main.css
   Tokens are imported separately via design-tokens.css.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 2. RESET & BASE ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-base), color var(--transition-base);
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 3. LAYOUT ──────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main   { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page-content { padding: 18px; flex: 1; }

/* ── 4. SIDEBAR ─────────────────────────────────────────────────────── */
/* Base sidebar — theme-aware via tokens. Dark mode tokens give a dark
   sidebar; light mode tokens give a light sidebar, which the [data-theme="light"]
   block below overrides to match the premium enterprise chrome treatment. */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: background var(--transition-base), border var(--transition-base);
}

.sidebar-logo {
  height: var(--topbar-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo img {
  width: 196px;
  height: auto;
  object-fit: contain;
}
.sidebar-logo .logo-text { display: flex; flex-direction: column; line-height: 1; }
.sidebar-logo .logo-name {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  letter-spacing: 0.3px;
}
.sidebar-logo .logo-sub {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px; margin-top: 3px;
}

.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }

.nav-section-label {
  padding: 10px 20px 3px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 20px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast); position: relative;
}
.nav-item svg,
.nav-item .nav-icon {
  color: var(--text-secondary);
}
.nav-item:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-item.active {
  background: var(--orange-light);
  color: var(--orange);
}
.nav-item.active svg,
.nav-item.active .nav-icon {
  color: var(--orange);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; background: var(--orange); border-radius: 0 2px 2px 0;
}
/* Dark mode — slightly more saturated orange tint against navy, navy section label nudge */
[data-theme="dark"] .nav-item.active {
  background: rgba(245, 129, 31, 0.15);
}
[data-theme="dark"] .nav-section-label {
  color: rgba(255, 255, 255, 0.35);
}
.nav-arr {
  width: 0; height: 0; flex-shrink: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent currentColor;
  opacity: 0.3; transition: opacity var(--transition-fast);
}
.nav-item.active .nav-arr { opacity: 1; }
.nav-item:hover  .nav-arr { opacity: 0.6; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sidebar-footer .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.sidebar-footer .user-role { font-size: 11px; color: var(--text-muted); }

/* ── 4b. LIGHT MODE SIDEBAR OVERRIDES ───────────────────────────────── */
/* Per spec: sidebar is dark navy in light mode too — separates navigation
   from content and reads as premium enterprise chrome. All text/icons inside
   flip to white-on-dark. Dark mode is untouched. */
[data-theme="light"] .sidebar {
  background-color: #1E293B;
  border-right: none;
}
[data-theme="light"] .sidebar .nav-section-label {
  color: rgba(255, 255, 255, 0.38);
}
[data-theme="light"] .sidebar .nav-item {
  color: rgba(255, 255, 255, 0.68);
}
[data-theme="light"] .sidebar .nav-item svg,
[data-theme="light"] .sidebar .nav-item .nav-icon {
  color: rgba(255, 255, 255, 0.50);
}
[data-theme="light"] .sidebar .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.90);
}
[data-theme="light"] .sidebar .nav-item.active {
  background-color: rgba(245, 129, 31, 0.18);
  color: #F5811F;
}
[data-theme="light"] .sidebar .nav-item.active svg,
[data-theme="light"] .sidebar .nav-item.active .nav-icon {
  color: #F5811F;
}
[data-theme="light"] .sidebar .sidebar-logo {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .sidebar .sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .sidebar .user-name {
  color: rgba(255, 255, 255, 0.90);
}
[data-theme="light"] .sidebar .user-role,
[data-theme="light"] .sidebar .user-title {
  color: rgba(255, 255, 255, 0.50);
}

/* ── 5. TOPBAR ──────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  transition: background var(--transition-base), border var(--transition-base);
  flex-shrink: 0;
}
/* Light mode topbar — two-layer shadow lifts it off the white content */
[data-theme="light"] .topbar {
  background-color: #FFFFFF;
  border-bottom: none;
  box-shadow: 0 1px 0 #E2DDD7, 0 2px 8px rgba(0, 0, 0, 0.05);
}
.topbar-title    { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--text-primary); }
.topbar-title .bc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.brand-slot {
  display: flex; align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}
.brand-slot-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.brand-slot-name  { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.5px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition-fast); position: relative;
}
.icon-btn:hover { background: var(--bg-primary); color: var(--text-primary); }

.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 15px; height: 15px;
  border-radius: 8px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  background: var(--orange); color: white;
}

.theme-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all var(--transition-fast); font-family: 'Inter', sans-serif;
}
.theme-toggle:hover { background: var(--bg-primary); color: var(--text-primary); }

/* ── 6. PAGE HEADER ─────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 16px;
}
.page-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.page-title    { font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--text-primary); }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 6px; list-style: none;
}
.breadcrumb li + li::before { content: '/'; margin-right: 6px; opacity: 0.5; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.breadcrumb li.active { color: var(--text-primary); font-weight: 500; }

/* ── 7. GRID UTILITIES ──────────────────────────────────────────────── */
.grid   { display: grid; gap: 12px; }
.col-1  { grid-template-columns: 1fr; }
.col-2  { grid-template-columns: 1fr 1fr; }
.col-3  { grid-template-columns: repeat(3, 1fr); }
.col-4  { grid-template-columns: repeat(4, 1fr); }
.col-5  { grid-template-columns: repeat(5, 1fr); }
.col-6  { grid-template-columns: repeat(6, 1fr); }
.col-7-5 { grid-template-columns: 7fr 5fr; }
.col-3-2 { grid-template-columns: 3fr 2fr; }
.col-2-1 { grid-template-columns: 2fr 1fr; }

/* ── 8. CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 1px 8px rgba(0, 0, 0, 0.04);
  transition: background var(--transition-base), border var(--transition-base), box-shadow var(--transition-fast);
}
/* Interactive cards (clickable rows that navigate) — subtle hover lift */
.card.card-interactive:hover {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
/* Accent bar — 3px gradient orange fade at the top of primary stat cards */
.card.card-stat-primary {
  position: relative;
  overflow: hidden;
}
.card.card-stat-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--orange),
    rgba(245, 129, 31, 0.4)
  );
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
[data-theme="dark"] .card.card-stat-primary::before {
  background: linear-gradient(
    to right,
    var(--orange),
    rgba(245, 129, 31, 0.2)
  );
}

/* ── Gradient progress bars (Enhancement 4) ───────────────────── */
.progress-bar.gradient-positive {
  background: linear-gradient(to right, var(--orange), var(--green));
}
.progress-bar.gradient-negative {
  background: var(--red);
}
.progress-bar.gradient-warning {
  background: var(--orange);
}
/* Dark mode: shadows don't read on dark bg — use a slightly brightened border instead */
[data-theme="dark"] .card {
  box-shadow: none;
}
[data-theme="dark"] .card.card-interactive:hover {
  border-color: rgba(255, 255, 255, 0.14);
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-header-right { display: flex; align-items: center; gap: 8px; }
.card-title    { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text-primary); }
.card-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.card-body   { padding: 14px 16px; }
.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ── 9. BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--transition-fast); text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--orange); color: white; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }

.btn-secondary { background: transparent; color: var(--orange); border-color: var(--orange); }
.btn-secondary:hover { background: var(--orange-light); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-primary); color: var(--text-primary); }

.btn-blue { background: var(--blue); color: white; border-color: var(--blue); }
.btn-blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-danger { background: var(--red); color: white; border-color: var(--red); }
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 22px; font-size: 14px; }

.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition-fast);
}
.btn-icon:hover { background: var(--bg-primary); color: var(--text-primary); }

/* ── 10. TABS ───────────────────────────────────────────────────────── */
.tab-group {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px; gap: 2px;
}
.tab-btn {
  padding: 5px 13px; border-radius: var(--radius-xs); border: none;
  background: transparent; color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast); font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.tab-btn.active { background: var(--orange); color: white; }
.tab-btn:not(.active):hover { background: var(--bg-primary); color: var(--text-primary); }

.tab-nav { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-nav-inline { margin-bottom: 0; border-bottom: 1px solid transparent; }
.tab-nav-item {
  padding: 10px 18px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all var(--transition-fast);
  text-decoration: none; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
  font-family: 'Inter', sans-serif;
}
.tab-nav-item:hover { color: var(--text-primary); text-decoration: none; }
.tab-nav-item.active { color: var(--orange); border-bottom-color: var(--orange); }

.seg-tabs {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bg-primary); border-radius: var(--radius-sm);
}
.seg-tab {
  flex: 1; padding: 5px 8px; border: none; background: transparent;
  color: var(--text-secondary); font-size: 11.5px; font-weight: 500;
  cursor: pointer; border-radius: var(--radius-xs);
  transition: all var(--transition-fast); font-family: 'Inter', sans-serif; text-align: center;
}
.seg-tab.active { background: var(--bg-secondary); color: var(--orange); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg-tab:not(.active):hover { color: var(--text-primary); }

/* ── 11. BADGES ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-blue   { background: var(--blue-light);   color: var(--blue); }
.badge-green  { background: var(--green-light);  color: var(--green); }
.badge-red    { background: var(--red-light);    color: var(--red); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-grey   { background: var(--bg-primary);   color: var(--text-secondary); }

.badge-dot::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* ── 12. STAT CARDS ─────────────────────────────────────────────────── */
.stat-card { padding: 14px 16px; }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; color: white; background: var(--orange);
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--blue); }
.stat-icon.green  { background: var(--green); }
.stat-icon.red    { background: var(--red); }
.stat-icon.yellow { background: var(--yellow); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1; margin-bottom: 3px; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  margin-top: 5px; padding: 2px 7px; border-radius: var(--radius-xs);
}
.stat-change.up   { color: var(--green); background: var(--green-light); }
.stat-change.down { color: var(--red);   background: var(--red-light); }
.stat-change.neutral { color: var(--text-secondary); background: var(--bg-primary); }

/* ── 13. PROGRESS BARS ──────────────────────────────────────────────── */
.progress {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.progress.sm { height: 3px; }
.progress.lg { height: 10px; }
.progress-bar          { height: 100%; border-radius: 3px; background: var(--orange); transition: width 0.3s ease; }
.progress-bar.blue     { background: var(--blue); }
.progress-bar.green    { background: var(--green); }
.progress-bar.red      { background: var(--red); }

/* ── 14. TABLES ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left; padding: 7px 12px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary); vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-primary); }
.table tbody tr.selected td { background: var(--orange-light); }
.table .cell-primary  { font-weight: 500; color: var(--text-primary); }
.table .cell-muted    { color: var(--text-muted); font-size: 12px; }
.table .cell-number   { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-actions  { text-align: right; white-space: nowrap; }

/* ── 15. FORM ELEMENTS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-label .required { color: var(--orange); margin-left: 2px; }

.form-control {
  width: 100%; padding: 8px 12px;
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 13px;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,129,31,0.12); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 4px; }
.form-control.has-error { border-color: var(--red); }
.form-control.has-error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }

.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.search-wrap .form-control { padding-left: 34px; }

/* ── 16. ALERTS ─────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  border-left: 3px solid transparent;
}
.alert-icon  { flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-body  { font-size: 12px; opacity: 0.85; }

.alert-info    { background: var(--blue-light);   color: var(--blue);   border-color: var(--blue); }
.alert-success { background: var(--green-light);  color: var(--green);  border-color: var(--green); }
.alert-warning { background: var(--yellow-light); color: var(--yellow); border-color: var(--yellow); }
.alert-danger  { background: var(--red-light);    color: var(--red);    border-color: var(--red); }

/* Dark-mode tints: explicit low-opacity backgrounds + full-brightness titles */
[data-theme="dark"] .alert-info    { background: rgba(26,110,189,0.14);  border-color: rgba(26,110,189,0.40); }
[data-theme="dark"] .alert-success { background: rgba(5,150,105,0.14);   border-color: rgba(5,150,105,0.40); }
[data-theme="dark"] .alert-warning { background: rgba(217,119,6,0.14);   border-color: rgba(217,119,6,0.40); }
[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,0.14);   border-color: rgba(220,38,38,0.40); }
[data-theme="dark"] .alert .alert-title { opacity: 1; font-weight: 700; }
[data-theme="dark"] .alert .alert-body  { opacity: 1; color: var(--text-primary); }

/* ── 17. DIVIDER ────────────────────────────────────────────────────── */
.divider   { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.divider-v { width: 1px; background: var(--border); align-self: stretch; }

/* ── 18. CALENDAR ───────────────────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-dh {
  text-align: center; font-size: 10px; font-weight: 600;
  color: var(--text-muted); padding: 5px 0; text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12px; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition-fast); position: relative; min-height: 34px;
  background: transparent; border: none;
}
.cal-day:hover { background: var(--bg-primary); }
.cal-day.today { background: var(--orange); color: white; font-weight: 600; }
.cal-day.has-event::after {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--blue); position: absolute; bottom: 3px;
}
.cal-day.today.has-event::after { background: rgba(255,255,255,0.7); }
.cal-day.other-month { color: var(--text-muted); opacity: 0.35; }

/* ── 19. UTILITY HELPERS ────────────────────────────────────────────── */
.text-orange  { color: var(--orange); }
.text-blue    { color: var(--blue); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.text-lg      { font-size: 16px; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.uppercase    { text-transform: uppercase; letter-spacing: 0.5px; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.see-all {
  color: var(--orange); font-size: 11.5px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.see-all:hover { text-decoration: underline; }

/* ── 20. SCROLLBARS ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 21. APP SHELL HELPERS ──────────────────────────────────────────── */
/* These extend the existing Vue components to play nicely with the DS. */
.app-shell { display: flex; min-height: 100vh; }
.app-shell .main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Avatar circle reused for table rows */
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-cell .avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange-light); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.member-cell .avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.member-cell .member-name { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.member-cell .member-title { font-size: 11px; color: var(--text-muted); }

/* Toggle switch */
.toggle {
  position: relative; width: 36px; height: 20px; flex-shrink: 0;
  background: var(--border); border-radius: 10px; cursor: pointer;
  transition: background var(--transition-fast); border: none; padding: 0;
}
.toggle.on { background: var(--orange); }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: white; border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.toggle.on::after { transform: translateX(16px); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
}
.modal {
  background: var(--bg-secondary); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.modal-body   { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal-close {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg-primary); color: var(--text-primary); }

/* Kebab menu */
.kebab {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-secondary);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.kebab:hover { background: var(--bg-primary); color: var(--text-primary); }

/* Severity dot for alerts */
.severity-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.severity-dot.red    { background: var(--red-light);    color: var(--red); }
.severity-dot.orange { background: var(--orange-light); color: var(--orange); }
.severity-dot.blue   { background: var(--blue-light);   color: var(--blue); }
.severity-dot.green  { background: var(--green-light);  color: var(--green); }

/* Unread row indicator */
.unread-row { border-left: 3px solid var(--orange); }

/* Section divider labels */
.section-divider {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

/* Goal row */
.goal-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0;
}
.goal-row + .goal-row { border-top: 1px solid var(--border); }
.goal-meta { font-size: 11px; color: var(--text-muted); }

/* Inline detail panel for expanded rows */
.detail-panel {
  background: var(--bg-primary);
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-secondary);
  margin: 4px 0 12px;
}

/* Mini timeline */
.timeline { position: relative; padding-left: 16px; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; padding: 4px 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -14px; top: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border);
}
.timeline-item.active::before { background: var(--orange); }