/* ============================================================
   GROWTH OPS TRACKER v4 — Minimal Ops Control Panel
   Font: Geist (body) + Geist Mono (data)
   Palette: Neutral slate + functional color accents
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #f8f9fb;
  --bg2: #ffffff;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line2: #d1d5db;
  --text: #111827;
  --text2: #374151;
  --muted: #6b7280;
  --muted2: #9ca3af;

  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --primary-lt: #eff6ff;
  --primary-ring: rgba(37,99,235,.15);

  --teal: #0d9488;
  --teal-lt: #f0fdfa;

  --s-plan: #6b7280;
  --s-prog: #2563eb;
  --s-wait: #d97706;
  --s-block: #dc2626;
  --s-done: #16a34a;

  --p-crit: #dc2626;
  --p-high: #ea580c;
  --p-med: #d97706;
  --p-low: #6b7280;

  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --sidebar-w: 240px;
  --topbar-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg);
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-h); }
code, .mono { font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace; font-size: 0.92em; }

/* ── APP SHELL ─────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ── SIDEBAR ───────────────────────────────────── */
.sidebar {
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 10px; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 200;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 14px;
  margin-bottom: 4px;
}
.brand-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.brand-icon svg { width: 16px; height: 16px; color: #fff; }
.brand-title { font-weight: 800; font-size: 13px; color: var(--text); line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.brand-version { font-size: 10px; color: var(--muted2); margin-top: 1px; }

.nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted2); padding: 14px 10px 4px;
}
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 13px; color: var(--muted); transition: all .12s ease;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .5; }
.nav-link:hover { color: var(--text); background: #f3f4f6; }
.nav-link:hover svg { opacity: .8; }
.nav-link.active { color: var(--primary); background: var(--primary-lt); font-weight: 600; }
.nav-link.active svg { opacity: 1; color: var(--primary); }

.sidebar-footer { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.user-card { padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fafbfc; }
.user-name { font-weight: 700; font-size: 12px; }
.user-email { font-size: 11px; color: var(--muted); margin-top: 1px; word-break: break-all; }
.user-role {
  margin-top: 5px; display: inline-flex; padding: 2px 7px; border-radius: 999px;
  background: var(--primary-lt); color: var(--primary); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}

/* ── MAIN ──────────────────────────────────────── */
.main { min-width: 0; padding: 20px 24px 40px; overflow-x: hidden; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.topbar-left { flex: 1 1 auto; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.page-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── TOPBAR SEARCH ─────────────────────────────── */
.topbar-search { position: relative; display: flex; align-items: center; }
.topbar-search-input {
  width: 220px; padding: 7px 34px 7px 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #f9fafb;
  font-size: 13px; font-family: inherit; color: var(--text);
  transition: all .15s ease; outline: none;
}
.topbar-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); width: 280px; background: #fff; }
.topbar-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted2); pointer-events: none; width: 14px; height: 14px; }
.search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--muted2); background: #f3f4f6;
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; pointer-events: none;
}

/* ── HAMBURGER ─────────────────────────────────── */
.hamburger-btn {
  display: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 7px; cursor: pointer; color: var(--text);
}
.hamburger-btn svg { width: 18px; height: 18px; display: block; }

/* ── ALERTS ────────────────────────────────────── */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 500;
  font-size: 13px; border: 1px solid; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.alert.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px;
  border-radius: var(--radius-sm); font: 600 13px/1 inherit;
  border: 1px solid transparent; cursor: pointer; transition: all .12s ease;
  white-space: nowrap; text-decoration: none; background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-h); color: #fff; box-shadow: var(--shadow); }
.btn svg { width: 14px; height: 14px; }
.btn-ghost { background: #fff; color: var(--text2); border-color: var(--line); }
.btn-ghost:hover { background: #f9fafb; border-color: var(--line2); color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; justify-content: center; }
.btn.disabled, .btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--primary); }
.btn-success { background: var(--s-done); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--s-wait); color: #fff; }
.btn-warning:hover { background: #b45309; }

/* ── CARDS ──────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; font-weight: 700; }
.card-head a { font-size: 12px; font-weight: 600; color: var(--primary); }
.card > h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }

/* ── GRIDS ─────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }

/* ── STAT CARDS ────────────────────────────────── */
.stat-card { position: relative; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); margin-top: 6px; letter-spacing: -.02em; }
.stat-sub { font-size: 11px; color: var(--muted2); margin-top: 2px; }

/* ── KPI ROW ───────────────────────────────────── */
.kpi-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; }
.kpi-box {
  flex: 1 1 140px; min-width: 120px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  box-shadow: var(--shadow);
}
.kpi-title { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 4px; }

/* ── KPI LIST ──────────────────────────────────── */
.kpi-list { display: grid; gap: 6px; margin-bottom: 14px; }
.kpi-list > div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #f9fafb; border: 1px solid var(--line); border-radius: var(--radius-xs);
  padding: 8px 11px; font-size: 13px;
}
.kpi-list span { color: var(--muted); }
.kpi-list strong { color: var(--text); font-weight: 700; }

/* ── MINI TABLE ────────────────────────────────── */
.mini-table { display: grid; gap: 6px; }
.mini-row {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 8px 12px;
  background: #fff; font-size: 13px;
}
.mini-row strong {
  min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px;
  background: var(--primary-lt); color: var(--primary); font-size: 12px; font-weight: 700;
}

/* ── STACK LIST ─────────────────────────────────── */
.stack-list { display: grid; gap: 6px; }
.list-item {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  background: #fff; transition: all .12s ease;
}
.list-item:hover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-ring); }
.item-title { font-weight: 600; font-size: 13px; color: var(--text); }
.item-meta { margin-top: 2px; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.small-date { font-size: 11px; color: var(--muted2); white-space: nowrap; }

.type-chip {
  display: inline-flex; padding: 2px 6px; border-radius: 999px;
  font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .03em;
}
.type-chip.task { background: var(--primary-lt); color: var(--primary); }
.type-chip.meeting { background: var(--teal-lt); color: var(--teal); }

/* ── INLINE ────────────────────────────────────── */
.inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }

/* ── BADGES ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-planned { background: #f3f4f6; color: var(--s-plan); }
.badge-planned .badge-dot { background: var(--s-plan); }
.badge-progress { background: var(--primary-lt); color: var(--s-prog); }
.badge-progress .badge-dot { background: var(--s-prog); }
.badge-waiting { background: #fffbeb; color: var(--s-wait); }
.badge-waiting .badge-dot { background: var(--s-wait); }
.badge-blocked { background: #fef2f2; color: var(--s-block); }
.badge-blocked .badge-dot { background: var(--s-block); }
.badge-done { background: #f0fdf4; color: var(--s-done); }
.badge-done .badge-dot { background: var(--s-done); }

.badge-critical { background: #fef2f2; color: var(--p-crit); }
.badge-high { background: #fff7ed; color: var(--p-high); }
.badge-medium { background: #fffbeb; color: var(--p-med); }
.badge-low { background: #f3f4f6; color: var(--p-low); }

.status-done { background: #f0fdf4; color: var(--s-done); }
.status-waiting { background: #fffbeb; color: var(--s-wait); }

.tag-admin { background: var(--primary-lt); color: var(--primary); }
.tag-member { background: #f3f4f6; color: var(--muted); }

/* ── MINI FLAGS ────────────────────────────────── */
.mini-flag {
  font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: #fef3c7; color: #92400e; font-weight: 700;
}
.mini-flag.teal { background: var(--teal-lt); color: var(--teal); }
.mini-flag.gray { background: #f3f4f6; color: var(--muted); }

/* ── PAGE TOOLBAR ──────────────────────────────── */
.page-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.toolbar-left { display: flex; flex-direction: column; gap: 4px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.month-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.month-label {
  background: var(--primary-lt); color: var(--primary);
  padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px;
}
.db-pill {
  font-weight: 600; font-size: 10px; padding: 4px 8px; border-radius: 999px;
  background: #f3f4f6; border: 1px solid var(--line); color: var(--muted);
}

/* ── FILTER STRIP ──────────────────────────────── */
.filter-strip {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius); margin-bottom: 14px;
}
.fs-input, .fs-select {
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff;
  color: var(--text); padding: 7px 10px; font: inherit; font-size: 13px; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.fs-input:focus, .fs-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.fs-input { flex: 1 1 220px; min-width: 160px; max-width: 320px; }
.fs-select { flex: 0 0 140px; min-width: 120px; }
.fs-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fafbfc;
  cursor: pointer; flex: 0 0 auto;
}
.fs-check:hover { border-color: var(--primary); }
.fs-check input { width: auto; margin: 0; cursor: pointer; accent-color: var(--primary); }
.fs-check span { font-weight: 600; font-size: 12px; color: var(--text); white-space: nowrap; }
.fs-spacer { flex: 1 1 auto; }

/* ── TABLE ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: #f9fafb; padding: 10px 12px; text-align: left;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .1s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }
tbody tr.row-overdue { background: #fff5f5; }
tbody tr.row-overdue:hover { background: #fef2f2; }
tbody tr.row-hidden { display: none; }
td { padding: 10px 12px; vertical-align: middle; }
td.right { text-align: right; }
td.center { text-align: center; }
.row-title { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 13px; }
.muted { color: var(--muted); }
.muted.small, .small { font-size: 12px; }

/* ── CLICKABLE TITLE ───────────────────────────── */
.title-clickable {
  cursor: pointer; border-bottom: 1px dashed rgba(37,99,235,.3);
  transition: color .1s, border-color .1s; display: inline;
}
.title-clickable:hover { color: var(--primary); border-color: var(--primary); }

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 580px; max-height: 90vh;
  overflow-y: auto; transform: scale(.97) translateY(8px);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal-card { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 700; line-height: 1.35; flex: 1 1 auto; min-width: 0; }
.modal-close-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-xs);
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; line-height: 1; transition: all .12s;
}
.modal-close-btn:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.modal-badges {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 14px 20px; display: grid; gap: 8px; }
.modal-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 13px; align-items: start; }
.modal-row-label { color: var(--muted); font-weight: 600; font-size: 11px; padding-top: 2px; }
.modal-row-val { color: var(--text); line-height: 1.5; word-break: break-word; }
.modal-notes {
  background: #f9fafb; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}

/* Modal Actions Section */
.modal-actions-section {
  padding: 12px 20px; border-top: 1px solid var(--line);
  display: grid; gap: 8px;
}
.modal-actions-section h4 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.modal-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-quick-actions .btn { font-size: 12px; padding: 5px 10px; }

/* Modal Comments Section */
.modal-comments-section {
  padding: 12px 20px; border-top: 1px solid var(--line);
}
.modal-comments-section h4 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.comment-list { display: grid; gap: 8px; max-height: 200px; overflow-y: auto; }
.comment-item { padding: 8px 10px; background: #f9fafb; border-radius: var(--radius-xs); border: 1px solid var(--line); }
.comment-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 4px; }
.comment-meta strong { color: var(--text); font-weight: 600; }
.comment-body { font-size: 13px; line-height: 1.5; }
.comment-form { display: flex; gap: 6px; margin-top: 8px; }
.comment-form textarea { flex: 1; min-height: 36px; max-height: 80px; resize: vertical; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-xs); font: inherit; font-size: 12px; outline: none; }
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-ring); }

.modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap;
}

/* ── FORMS ─────────────────────────────────────── */
.form-layout { align-items: start; }
.stack-gap { display: grid; gap: 10px; }
label { display: grid; gap: 4px; }
label > span { font-size: 12px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=number], select, textarea {
  width: 100%; background: #fff; color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; font: inherit; font-size: 13px;
  outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input:disabled, select:disabled, textarea:disabled { background: #f9fafb; color: var(--muted2); cursor: not-allowed; }
select option { color: var(--text); background: #fff; }
.checkbox-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfc; cursor: pointer;
}
.checkbox-row input[type=checkbox] { width: auto; margin: 0; accent-color: var(--primary); }
.checkbox-row span { font-size: 13px; font-weight: 500; }

/* ── LOGIN ─────────────────────────────────────── */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 32px;
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; font-weight: 800; }
.login-card p { color: var(--muted); margin-bottom: 20px; font-size: 13px; }
.login-help {
  margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: #f9fafb; border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.5;
}

/* ── ARCHIVE ───────────────────────────────────── */
.archive-grid { display: grid; gap: 14px; }
.archive-year { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 16px; }
.archive-year-title { font-weight: 800; margin-bottom: 12px; font-size: 15px; }
.archive-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.month-pill {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fafbfc;
  color: var(--text); font-weight: 600; font-size: 13px; transition: all .12s;
}
.month-pill strong {
  font-weight: 700; color: var(--primary); background: var(--primary-lt);
  padding: 2px 7px; border-radius: 999px; font-size: 11px;
}
.month-pill:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.month-pill.disabled { opacity: .4; pointer-events: none; }

/* ── PROCESSES ─────────────────────────────────── */
.seg-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #f9fafb; }
.seg-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: var(--radius-xs); font-weight: 600; font-size: 12px; color: var(--muted); transition: all .12s; }
.seg-btn:hover { background: #fff; color: var(--text); }
.seg-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.process-toolbar { position: sticky; top: 10px; z-index: 5; }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pager-bottom { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); justify-content: space-between; }
.pager-nav { display: flex; gap: 6px; align-items: center; }
.table-wrap.table-fit table { table-layout: fixed; }
.td-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager-form { display: flex; align-items: center; gap: 4px; }
.title-main { font-weight: 600; }
.title-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── TEAM GRID ─────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.team-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  background: #fff; transition: all .12s;
}
.team-card:hover { box-shadow: var(--shadow-md); }
.team-card.is-muted { opacity: .5; }
.team-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.team-name { font-weight: 700; font-size: 14px; }
.team-role { font-size: 12px; color: var(--muted); margin-top: 1px; }
.team-group-tag { font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-lt); display: inline-flex; padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; }
.team-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.responsibilities-box { font-size: 12px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; padding: 8px 10px; background: #f9fafb; border-radius: var(--radius-xs); border: 1px solid var(--line); }
.bullet-list { padding-left: 18px; font-size: 13px; color: var(--text2); line-height: 1.7; }
.sticky-panel { position: sticky; top: 80px; }
.data-note { font-size: 12px; color: var(--muted); line-height: 1.5; padding: 10px; background: #f9fafb; border-radius: var(--radius-xs); border: 1px solid var(--line); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.is-muted { opacity: .5; }

/* ── FORM SHELL (Task + Meeting forms) ─────────── */
.form-shell {
  max-width: 900px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.form-title { font-size: 17px; margin: 0; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 12px; }
.field { min-width: 0; }
.span-12 { grid-column: span 12; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 5px; }
.control {
  width: 100%; box-sizing: border-box; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; padding: 9px 12px;
  font-size: 13px; color: var(--text); outline: none;
}
.control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.control.area { resize: vertical; min-height: 80px; }
.check-card {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fafbfc;
  padding: 10px 12px; border-radius: var(--radius-sm);
}
.check-card input { width: 16px; height: 16px; accent-color: var(--primary); }
.check-card-text { font-size: 13px; font-weight: 600; }
.form-actions { margin-top: 14px; display: flex; justify-content: flex-start; gap: 8px; }
.advanced { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fafbfc; }
.advanced summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text2); }
.adv-grid { margin-top: 10px; display: grid; gap: 10px; }
.inline-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.adv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── FOOTER ────────────────────────────────────── */
.footer {
  display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap;
  color: var(--muted2); font-size: 11px; margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ── MISC ──────────────────────────────────────── */
.center { text-align: center; }
.soft-panel { background: #f9fafb; border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 10px 12px; font-size: 13px; }
.hidden { display: none !important; }
mark.search-hl { background: rgba(37,99,235,.12); color: var(--primary); border-radius: 2px; padding: 0 2px; }
.no-results-row { display: none; }
.no-results-row.show { display: table-row; }

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty-state-icon { font-size: 36px; margin-bottom: 10px; opacity: .4; }
.empty-state-text { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.empty-state-sub { font-size: 12px; color: var(--muted2); }

/* ── ACTIVITY FEED ─────────────────────────────── */
.activity-feed { display: grid; gap: 4px; }
.activity-item {
  display: flex; gap: 8px; align-items: flex-start; padding: 6px 0;
  font-size: 12px; border-bottom: 1px solid #f3f4f6;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.activity-text { flex: 1; color: var(--text2); line-height: 1.5; }
.activity-text strong { font-weight: 600; }
.activity-time { color: var(--muted2); font-size: 11px; white-space: nowrap; flex-shrink: 0; }

/* ── SIDEBAR BACKDROP ──────────────────────────── */
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 199; background: rgba(0,0,0,.3); backdrop-filter: blur(2px); }
.sidebar-backdrop.show { display: block; }

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 1100px) { .archive-months { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) {
  .archive-months { grid-template-columns: repeat(3, 1fr); }
  .cols-2, .cards-4 { grid-template-columns: 1fr; }
  .kpi-row .kpi-box { flex: 1 1 140px; }
}
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0; z-index: 200; transform: translateX(-100%);
    transition: transform .2s cubic-bezier(.4,0,.2,1); width: 260px; height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger-btn { display: flex; }
  .topbar-search-input { width: 140px; }
  .topbar-search-input:focus { width: 200px; }
  .main { padding: 14px 14px 24px; }
  .page-title { font-size: 17px; }
  table { min-width: 580px; }
  .span-6, .span-4 { grid-column: span 12; }
  .form-shell { border-radius: var(--radius-sm); }
  .adv-two { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .archive-months { grid-template-columns: repeat(2, 1fr); }
  .kpi-row .kpi-box { flex: 1 1 100px; }
  .filter-strip { gap: 6px; }
  .fs-input { max-width: none; }
  .fs-select { flex: 1 1 120px; }
  .modal-card { max-width: 100%; border-radius: 12px; }
  .modal-row { grid-template-columns: 90px 1fr; }
}
