/* ============================================================
   INTEGRATED MEDICAL ACCREDITATION QMS — STYLESHEET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg: #f0f4f8;
  --c-surface: #ffffff;
  --c-surface2: #f8fafc;
  --c-border: #e2e8f0;
  --c-border2: #cbd5e1;
  --c-text: #0f172a;
  --c-text2: #475569;
  --c-text3: #94a3b8;
  --c-accent: #1e40af;
  --c-accent-l: #dbeafe;
  --c-accent-t: #1e40af18;
  --c-green: #059669;
  --c-green-l: #d1fae5;
  --c-red: #dc2626;
  --c-red-l: #fee2e2;
  --c-amber: #d97706;
  --c-amber-l: #fef3c7;
  --c-purple: #7c3aed;
  --c-purple-l: #ede9fe;
  --c-teal: #0891b2;
  --c-teal-l: #cffafe;
  --c-navy: #0f172a;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --font: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* Topbar */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--c-navy);
  display: flex; align-items: center; padding: 0 16px 0 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#topbar .tb-brand {
  width: var(--sidebar-w); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; flex-shrink: 0;
}
#topbar .tb-brand .logo-icon {
  width: 30px; height: 30px; background: var(--c-accent);
  border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
#topbar .tb-brand .logo-text { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; }
#topbar .tb-brand .logo-text span { color: #93c5fd; font-size: 11px; font-weight: 400; display: block; }

.tb-company-switcher {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: rgba(255,255,255,.08); border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.12); margin-right: 12px;
  transition: background .15s;
}
.tb-company-switcher:hover { background: rgba(255,255,255,.14); }
.tb-company-switcher .co-emoji { font-size: 16px; }
.tb-company-switcher .co-name { color: #fff; font-size: 12px; font-weight: 500; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-company-switcher .co-arrow { color: #94a3b8; font-size: 10px; }

.tb-spacer { flex: 1; }

.tb-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; padding: 0 12px; height: 32px; margin-right: 8px;
}
.tb-search input { background: none; border: none; outline: none; color: #fff; font-size: 13px; width: 200px; font-family: var(--font); }
.tb-search input::placeholder { color: #64748b; }
.tb-search .search-icon { color: #64748b; font-size: 14px; }

.tb-actions { display: flex; align-items: center; gap: 6px; }
.tb-btn {
  width: 32px; height: 32px; border-radius: 6px; background: none; border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #94a3b8;
  transition: all .15s; position: relative;
}
.tb-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.tb-btn .badge {
  position: absolute; top: -4px; right: -4px; background: var(--c-red);
  width: 16px; height: 16px; border-radius: 50%; font-size: 9px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; border: 2px solid var(--c-navy);
}

.tb-user {
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px;
  background: rgba(255,255,255,.06); border-radius: 6px; cursor: pointer; margin-left: 6px;
}
.tb-user .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600;
}
.tb-user .user-name { color: #e2e8f0; font-size: 12px; font-weight: 500; }
.tb-user .user-role { color: #64748b; font-size: 11px; }

/* Sidebar */
#sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 90;
  width: var(--sidebar-w); background: var(--c-surface);
  border-right: 1px solid var(--c-border); overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--c-border2); border-radius: 4px; }

.nav-section { padding: 16px 12px 4px; }
.nav-section-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--c-text3); padding: 0 8px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; color: var(--c-text2); font-size: 13px; font-weight: 400;
  transition: all .12s; white-space: nowrap; text-decoration: none; position: relative;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--c-bg); color: var(--c-text); }
.nav-item.active { background: var(--c-accent-l); color: var(--c-accent); font-weight: 500; }
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--c-accent); border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--c-red); color: #fff; font-size: 10px;
  font-weight: 600; padding: 1px 5px; border-radius: 10px; min-width: 18px; text-align: center;
}
.nav-item .nav-badge.amber { background: var(--c-amber); }
.nav-item .nav-badge.green { background: var(--c-green); }

/* Main content */
#main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  flex: 1; padding: 24px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page-header-left { flex: 1; }
.page-title { font-size: 20px; font-weight: 600; color: var(--c-text); }
.page-subtitle { font-size: 13px; color: var(--c-text2); margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--c-border);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--c-text); }
.card-body { padding: 20px; }

/* Metric cards */
.metric-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden;
}
.metric-card .metric-label { font-size: 12px; color: var(--c-text2); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.metric-card .metric-value { font-size: 28px; font-weight: 700; color: var(--c-text); line-height: 1; }
.metric-card .metric-sub { font-size: 12px; color: var(--c-text3); margin-top: 6px; }
.metric-card .metric-icon {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.metric-card.accent { border-left: 3px solid var(--c-accent); }
.metric-card.green { border-left: 3px solid var(--c-green); }
.metric-card.red { border-left: 3px solid var(--c-red); }
.metric-card.amber { border-left: 3px solid var(--c-amber); }
.metric-card.purple { border-left: 3px solid var(--c-purple); }
.metric-card.teal { border-left: 3px solid var(--c-teal); }

/* Grid layouts */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; height: 34px;
  border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  font-family: var(--font); transition: all .12s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: #1d3a8a; }
.btn-secondary { background: var(--c-surface); color: var(--c-text2); border: 1px solid var(--c-border2); }
.btn-secondary:hover { background: var(--c-bg); color: var(--c-text); }
.btn-danger { background: var(--c-red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--c-green); color: #fff; }
.btn-ghost { background: none; color: var(--c-text2); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--c-bg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { padding: 0; width: 34px; }

/* ── BADGES / STATUS ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--c-green-l); color: #065f46; }
.badge-red { background: var(--c-red-l); color: #991b1b; }
.badge-amber { background: var(--c-amber-l); color: #92400e; }
.badge-blue { background: var(--c-accent-l); color: #1e3a8a; }
.badge-purple { background: var(--c-purple-l); color: #4c1d95; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-teal { background: var(--c-teal-l); color: #155e75; }
.badge dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th {
  padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--c-text2);
  border-bottom: 1px solid var(--c-border); background: var(--c-surface2); white-space: nowrap;
}
table td { padding: 12px 14px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--c-bg); }
.table-code { font-family: var(--font-mono); font-size: 12px; color: var(--c-accent); font-weight: 500; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--c-text2); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 0 12px; height: 36px; border: 1px solid var(--c-border2);
  border-radius: 6px; font-size: 13px; font-family: var(--font); color: var(--c-text);
  background: var(--c-surface); outline: none; transition: border .12s;
}
.form-control:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-t); }
select.form-control { cursor: pointer; }
textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; }

/* ── PROGRESS ────────────────────────────────────────────── */
.progress-wrap { background: #e2e8f0; border-radius: 20px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; transition: width .3s; }
.progress-bar.green { background: var(--c-green); }
.progress-bar.blue { background: var(--c-accent); }
.progress-bar.amber { background: var(--c-amber); }
.progress-bar.red { background: var(--c-red); }

/* ── ACCREDITATION TREE ─────────────────────────────────── */
.acc-tree { list-style: none; }
.acc-tree-item { border-bottom: 1px solid var(--c-border); }
.acc-tree-item:last-child { border-bottom: none; }
.acc-tree-parent {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer;
  font-weight: 600; font-size: 13px; transition: background .12s;
}
.acc-tree-parent:hover { background: var(--c-bg); }
.acc-tree-parent.open { background: var(--c-bg); }
.acc-tree-parent .acc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.acc-tree-children { display: none; }
.acc-tree-children.open { display: block; }
.acc-tree-chapter {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 36px;
  cursor: pointer; font-size: 12px; color: var(--c-text2); transition: background .12s;
}
.acc-tree-chapter:hover { background: var(--c-bg); color: var(--c-text); }
.acc-tree-chapter.open { color: var(--c-accent); font-weight: 500; }
.acc-tree-rules { display: none; }
.acc-tree-rules.open { display: block; }
.acc-tree-rule {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 52px;
  cursor: pointer; font-size: 12px; color: var(--c-text3); transition: background .12s;
}
.acc-tree-rule:hover { background: var(--c-bg); color: var(--c-text2); }
.acc-tree-rule.active { background: var(--c-accent-l); color: var(--c-accent); font-weight: 500; }
.acc-tree-rule .rule-code { font-family: var(--font-mono); font-size: 11px; }

/* ── SCORE RING ──────────────────────────────────────────── */
.score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-text { position: absolute; text-align: center; }
.score-ring .score-num { font-size: 22px; font-weight: 700; }
.score-ring .score-lbl { font-size: 10px; color: var(--c-text2); }

/* ── GAPS MATRIX ─────────────────────────────────────────── */
.gap-row { display: grid; grid-template-columns: 80px 1fr 90px 100px 80px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--c-border); }
.gap-row:hover { background: var(--c-bg); }
.gap-status { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-align: center; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--c-surface); border-radius: var(--radius-lg);
  max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--c-border); position: sticky; top: 0;
  background: var(--c-surface); z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── WORKFLOW STEPPER ────────────────────────────────────── */
.workflow-steps { display: flex; align-items: center; gap: 0; margin-bottom: 24px; }
.workflow-step { display: flex; align-items: center; flex: 1; }
.workflow-step-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--c-border2);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  color: var(--c-text3); background: var(--c-surface); flex-shrink: 0; z-index: 1;
}
.workflow-step-dot.done { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.workflow-step-dot.active { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.workflow-step-line { flex: 1; height: 2px; background: var(--c-border); margin: 0 -1px; }
.workflow-step-line.done { background: var(--c-green); }
.workflow-step-label { font-size: 10px; color: var(--c-text2); text-align: center; margin-top: 6px; white-space: nowrap; }

/* ── AUDIT TIMELINE ──────────────────────────────────────── */
.audit-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.audit-item:last-child { border-bottom: none; }
.audit-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); flex-shrink: 0; margin-top: 5px; }
.audit-dot.green { background: var(--c-green); }
.audit-dot.red { background: var(--c-red); }
.audit-dot.amber { background: var(--c-amber); }
.audit-content { flex: 1; }
.audit-action { font-size: 13px; font-weight: 500; }
.audit-meta { font-size: 11px; color: var(--c-text3); margin-top: 2px; }

/* ── PAGES ───────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* Dashboard specific */
.readiness-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.readiness-bar .acc-name { font-size: 12px; font-weight: 500; width: 80px; flex-shrink: 0; }
.readiness-bar .bar-wrap { flex: 1; background: var(--c-bg); height: 8px; border-radius: 4px; overflow: hidden; }
.readiness-bar .bar-fill { height: 100%; border-radius: 4px; }
.readiness-bar .pct { font-size: 12px; font-weight: 600; width: 38px; text-align: right; flex-shrink: 0; }

/* Policy crosswalk */
.crosswalk-cell {
  padding: 6px 8px; text-align: center; font-size: 11px; font-weight: 600;
  border-radius: 4px; min-width: 60px;
}
.crosswalk-cell.linked { background: var(--c-green-l); color: #065f46; }
.crosswalk-cell.empty { background: var(--c-bg); color: var(--c-text3); }

/* Evidence card */
.evidence-card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: 16px; display: flex; gap: 14px; align-items: flex-start; transition: box-shadow .15s;
}
.evidence-card:hover { box-shadow: var(--c-shadow-md); }
.evidence-icon {
  width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.evidence-info { flex: 1; min-width: 0; }
.evidence-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evidence-meta { font-size: 12px; color: var(--c-text2); margin-top: 3px; }

/* Notification dot */
.notif-list { padding: 8px 0; }
.notif-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--c-border); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-icon.warning { background: var(--c-amber); }
.notif-icon.info { background: var(--c-accent); }
.notif-icon.danger { background: var(--c-red); }
.notif-icon.success { background: var(--c-green); }
.notif-text { flex: 1; font-size: 13px; }
.notif-time { font-size: 11px; color: var(--c-text3); white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--c-border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 16px; font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  background: none; color: var(--c-text2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .12s; font-family: var(--font);
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Stats row */
.stats-row { display: flex; gap: 24px; padding: 16px 20px; background: var(--c-surface2); }
.stat-item { text-align: center; }
.stat-val { font-size: 20px; font-weight: 700; color: var(--c-text); }
.stat-lbl { font-size: 11px; color: var(--c-text2); margin-top: 2px; }

/* Company switcher dropdown */
.co-dropdown {
  position: fixed; top: calc(var(--topbar-h) + 4px); left: 250px; z-index: 300;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); min-width: 280px; display: none;
}
.co-dropdown.open { display: block; }
.co-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  transition: background .12s; border-radius: 4px;
}
.co-dropdown-item:hover { background: var(--c-bg); }
.co-dropdown-item.active { background: var(--c-accent-l); }
.co-dropdown-item .co-emoji2 { font-size: 20px; }
.co-dropdown-item .co-info { flex: 1; }
.co-dropdown-item .co-info .co-nm { font-size: 13px; font-weight: 500; }
.co-dropdown-item .co-info .co-pl { font-size: 11px; color: var(--c-text3); }
.co-check { color: var(--c-accent); font-size: 16px; }

/* Super Admin highlight */
.superadmin-banner {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: #93c5fd; padding: 8px 20px; font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

/* Notifications panel */
.notif-panel {
  position: fixed; top: calc(var(--topbar-h) + 4px); right: 8px; z-index: 300;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: 340px; display: none;
}
.notif-panel.open { display: block; }
.notif-panel-header { padding: 14px 16px; border-bottom: 1px solid var(--c-border); font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }

/* Inline charts */
.sparkline-wrap { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.sparkline-bar { flex: 1; border-radius: 2px 2px 0 0; background: var(--c-accent-l); transition: height .3s; }
.sparkline-bar:hover { background: var(--c-accent); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--c-text3); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── RESPONSIVE helpers ──────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar { display: none; }
  #main { padding: 16px; }
  .grid-4, .grid-3, .grid-2, .grid-5 { grid-template-columns: 1fr; }
}

/* Divider */
.divider { height: 1px; background: var(--c-border); margin: 16px 0; }

/* Search/filter bar */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .filter-group { display: flex; align-items: center; gap: 6px; }

/* Tooltip */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: var(--c-navy); color: #fff; font-size: 11px;
  padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s; z-index: 10;
}
[data-tooltip]:hover::after { opacity: 1; }
