/* ============================================================
   Tornet VAS Hub — Global Stylesheet
   Light / white professional theme
   ============================================================ */

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

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --text: #1e293b;
  --text-muted: #64748b;
  --green: #16a34a;
  --green-light: #22c55e;
  --red: #dc2626;
  --red-light: #f87171;
  --amber: #d97706;
  --amber-light: #f59e0b;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --purple: #7c3aed;
  --sidebar-w: 230px;
  --topbar-h: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
}

html, body { height: 100%; font-size: 14px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  overflow: hidden;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
#layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: #1e293b;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: #f1f5f9;
}

.sidebar-logo-text span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: #94a3b8;
}

nav {
  flex: 1;
  padding: 12px 8px;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 8px 8px 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  text-decoration: none;
}

.nav-item:hover { background: #334155; color: #f1f5f9; }
.nav-item.active { background: rgba(79,70,229,0.25); color: #a5b4fc; }
.nav-item.active .nav-icon { color: #a5b4fc; }

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* ─── MAIN COLUMN ────────────────────────────────────────── */
#main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TOPBAR ─────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

#topbar-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

#topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 8px;
}

/* ─── APP AREA ───────────────────────────────────────────── */
#app {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

/* ─── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1;
  color: var(--text);
}

.stat-card .stat-value.green { color: var(--green); }
.stat-card .stat-value.red   { color: var(--red); }
.stat-card .stat-value.amber { color: var(--amber); }
.stat-card .stat-value.accent { color: var(--accent); }

/* ─── TABLES ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}

thead tr {
  background: var(--surface2);
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  background: var(--surface);
  border-top: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:hover { background: #f8fafc; }

td {
  padding: 10px 14px;
  vertical-align: middle;
}

td.actions { white-space: nowrap; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger  { background: var(--red); color: #fff; }
.btn-warning { background: var(--amber); color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); opacity: 1; }
.btn-icon    { background: transparent; border: none; color: var(--text-muted); padding: 4px 6px; font-size: 1rem; }
.btn-icon:hover { color: var(--text); opacity: 1; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-xs { padding: 2px 8px; font-size: 0.75rem; }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-admin    { background: #ede9fe; color: #6d28d9; }
.badge-manager  { background: #dbeafe; color: #1d4ed8; }
.badge-employee { background: #dcfce7; color: #15803d; }
.badge-viewer   { background: #f1f5f9; color: #475569; }

/* ─── STATUS PILLS ───────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-pending        { background: #f1f5f9; color: #475569; }
.pill-in-progress    { background: #dbeafe; color: #1d4ed8; }
.pill-blocked        { background: #fee2e2; color: #dc2626; }
.pill-pass, .pill-completed, .pill-approved { background: #dcfce7; color: #15803d; }
.pill-fail, .pill-dropped { background: #fee2e2; color: #dc2626; }
.pill-skip           { background: #ede9fe; color: #7c3aed; }
.pill-new            { background: #e0e7ff; color: #4338ca; }
.pill-pending-review { background: #fef3c7; color: #d97706; }
.pill-not-started    { background: #f8fafc; color: #64748b; }
.pill-pushed-back    { background: #fef3c7; color: #d97706; }
.pill-delayed        { background: #ffedd5; color: #c2410c; }

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-wrap {
  background: var(--surface2);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  background: var(--accent);
}

.progress-bar.green { background: var(--green); }
.progress-bar.amber { background: var(--amber); }
.progress-bar.red   { background: var(--red); }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-control::placeholder { color: #94a3b8; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2364748b'%3E%3Cpath d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  appearance: none;
  cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── FILTERS ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .form-control { max-width: 180px; }
.filter-bar select.form-control { max-width: 180px; }

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(2px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── TOASTS ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease;
  max-width: 340px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--amber); }

/* ─── COMMENTS ───────────────────────────────────────────── */
.comment-thread {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.comment-meta strong { color: var(--text); }

.comment-text { font-size: 0.875rem; color: var(--text); }

.comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.comment-form textarea {
  flex: 1;
  min-height: 54px;
  max-height: 120px;
}

/* ─── ACTIVITY FEED ──────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.activity-item:last-child { border-bottom: none; }

.activity-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e0e7ff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 0.875rem; line-height: 1.5; color: var(--text); }
.activity-text strong { color: var(--text); }
.activity-meta { font-size: 0.76rem; color: var(--text-muted); margin-top: 3px; display: flex; gap: 10px; align-items: center; }

/* ─── SERVICE CARDS ──────────────────────────────────────── */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
  flex-wrap: wrap;
}

.service-card-header:hover { background: #fafbfc; }

.service-card-body {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.step-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.step-pill {
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s, opacity 0.15s;
  user-select: none;
}

.step-pill:hover { transform: scale(1.04); }
.step-pill:active { transform: scale(0.97); }

.step-pill.not-started { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.step-pill.in-progress { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.step-pill.blocked     { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.step-pill.pass        { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.step-pill.fail        { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

/* ─── TASK CARDS ─────────────────────────────────────────── */
.task-cards { display: flex; flex-direction: column; gap: 10px; }

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  flex-wrap: wrap;
}

.task-card-header:hover { background: #fafbfc; }

.task-card-body {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.task-meta span { display: flex; align-items: center; gap: 4px; }

/* ─── COMPLEXITY STARS ───────────────────────────────────── */
.complexity {
  display: inline-flex;
  gap: 2px;
  font-size: 0.85rem;
}
.complexity .star { color: #e2e8f0; }
.complexity .star.on { color: var(--amber); }

/* ─── PERMISSION MATRIX ──────────────────────────────────── */
.perm-matrix {
  display: grid;
  grid-template-columns: 1fr repeat(4, auto);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.85rem;
}

.perm-matrix-header {
  display: contents;
}

.perm-matrix-header > div {
  background: var(--surface2);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}

.perm-matrix-header > div:first-child { text-align: left; }

.perm-row {
  display: contents;
}

.perm-row > div {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.perm-row > div:first-child { justify-content: flex-start; font-weight: 500; }

.perm-row input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ─── DASHBOARD ──────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ─── INLINE EDIT ────────────────────────────────────────── */
.inline-status select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 3px 6px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.inline-status select:focus { border-color: var(--accent); }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 0.875rem; }

/* ─── LOADING ────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  justify-content: center;
}

.pagination-info { color: var(--text-muted); font-size: 0.85rem; }

/* ─── NOTES INLINE ───────────────────────────────────────── */
.notes-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.83rem;
}

.notes-cell:hover { color: var(--text); }

/* ─── INLINE TEXT EDIT ───────────────────────────────────── */
.editable {
  border-bottom: 1px dashed var(--border);
  cursor: text;
  outline: none;
  padding: 2px 4px;
  border-radius: 3px;
  min-width: 60px;
  transition: background 0.15s;
  color: var(--text);
}
.editable:hover, .editable:focus { background: var(--surface2); border-color: var(--accent); }

/* ─── MOBILE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 199;
  }
  #sidebar.open ~ #sidebar-overlay { display: block; }

  #app { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar .form-control { max-width: 140px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── UTILS ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.bold { font-weight: 600; }
.w-full { width: 100%; }

/* ─── NOTES EDITOR ───────────────────────────────────────── */
.notes-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
