/* ============================================================
   QuestionnaireAI — Complete Stylesheet
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow: hidden;
}

/* ===== CSS VARIABLES ===== */
:root {
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-hover-bg: #1E293B;
  --sidebar-active: #6366F1;
  --sidebar-active-bg: rgba(99,102,241,.15);
  --sidebar-w: 240px;

  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: rgba(99,102,241,.1);

  --success: #10B981;
  --success-light: rgba(16,185,129,.12);
  --warning: #F59E0B;
  --warning-light: rgba(245,158,11,.12);
  --danger: #EF4444;
  --danger-light: rgba(239,68,68,.12);
  --info: #3B82F6;
  --info-light: rgba(59,130,246,.12);

  --bg: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  --topbar-h: 64px;
  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
}

/* ===== LAYOUT ===== */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-icon { width: 32px; height: 32px; flex-shrink: 0; }
.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(148,163,184,.5);
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  position: relative;
  cursor: pointer;
}
.nav-item:hover { background: var(--sidebar-hover-bg); color: #fff; }
.nav-item.active { background: var(--sidebar-active-bg); color: #fff; }
.nav-item.active .nav-icon { color: var(--primary); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.nav-badge.hidden { display: none; }

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--sidebar-text);
  border-radius: var(--r-sm);
}
.ai-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.ai-indicator.ai-on .ai-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.ai-indicator.ai-on #ai-indicator-text { color: var(--success); }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
#page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ===== VIEW CONTAINER ===== */
#view-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.indigo { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }

.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.stat-delta { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }

.btn-outline { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--bg); border-color: #CBD5E1; }

.btn-ghost { background: transparent; color: var(--text-3); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }
.btn-icon { padding: 7px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: #B45309; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-gray { background: #F1F5F9; color: var(--text-2); }
.badge-purple { background: var(--primary-light); color: var(--primary); }

/* confidence badges */
.conf-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.conf-high { background: var(--success-light); color: var(--success); }
.conf-med { background: var(--warning-light); color: #B45309; }
.conf-low { background: var(--danger-light); color: var(--danger); }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { border-bottom: 1px solid var(--border); }
th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-3);
  white-space: nowrap;
}
td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFBFD; }
.td-truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .15s ease;
}
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 22px; line-height: 1;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: all .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 360px;
  animation: toastIn .2s ease;
}
.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }
.toast.warning { background: #78350F; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone svg { width: 40px; height: 40px; color: var(--text-3); margin: 0 auto 12px; display: block; }
.upload-zone p { font-size: 13px; color: var(--text-2); }
.upload-zone span { font-weight: 600; color: var(--primary); }
.upload-zone .upload-meta { font-size: 11px; color: var(--text-3); margin-top: 6px; }
#file-input-hidden { display: none; }

/* ===== PROGRESS ===== */
.progress-bar-wrap { background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 20px; background: var(--primary); transition: width .4s; }
.progress-bar-fill.green { background: var(--success); }
.progress-bar-fill.amber { background: var(--warning); }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 1px solid var(--border); gap: 0; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px;
  border: none; background: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.search-input-wrap { position: relative; flex: 1; max-width: 340px; }
.search-input-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3);
}
.search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-family: inherit; font-size: 13px;
  background: var(--bg);
  outline: none;
}
.search-input:focus { border-color: var(--primary); background: #fff; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 14px; display: block; opacity: .4; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* ===== ANSWER ROW ===== */
.answer-row { transition: background .15s; }
.answer-cell { max-width: 300px; }
.answer-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.answer-text.approved { color: #065F46; }
.answer-text.rejected { color: #991B1B; text-decoration: line-through; }
.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  font-weight: 600;
}

/* ===== GENERATING OVERLAY ===== */
.gen-overlay {
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.gen-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-progress { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.gen-log {
  margin-top: 16px;
  background: #0F172A;
  border-radius: var(--r-sm);
  padding: 12px;
  text-align: left;
  max-height: 140px;
  overflow-y: auto;
}
.gen-log-line { font-size: 11px; font-family: monospace; color: #94A3B8; line-height: 1.7; }
.gen-log-line.done { color: #34D399; }
.gen-log-line.err { color: #F87171; }

/* ===== TRUST CENTER ===== */
.trust-preview {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.trust-preview-header {
  background: var(--text);
  color: #fff;
  padding: 24px;
  display: flex; align-items: center; gap: 14px;
}
.trust-preview-body { padding: 24px; }
.cert-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.cert-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px; font-weight: 600;
  background: var(--success-light); color: var(--success);
  border: 1px solid rgba(16,185,129,.2);
}
.cert-chip svg { width: 13px; height: 13px; }

/* ===== KB LIST ===== */
.kb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
.kb-item:hover { background: #FAFBFD; }
.kb-item:last-child { border-bottom: none; }
.kb-item-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kb-item-icon.doc { background: var(--info-light); color: var(--info); }
.kb-item-icon.qa { background: var(--success-light); color: var(--success); }
.kb-item-icon svg { width: 16px; height: 16px; }
.kb-item-info { flex: 1; min-width: 0; }
.kb-item-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-item-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.kb-item-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ===== ANALYTICS ===== */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.bar-label { width: 140px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: var(--bg); border-radius: 20px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: var(--primary); transition: width .6s; }
.bar-val { width: 40px; text-align: right; font-weight: 700; color: var(--text); }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); }
.section-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ===== INLINE EDIT ===== */
.inline-edit-wrap { display: flex; align-items: flex-start; gap: 6px; }
.inline-textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--primary);
  font-family: inherit; font-size: 12.5px;
  resize: none;
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
  line-height: 1.5;
}
.inline-edit-actions { display: flex; flex-direction: column; gap: 3px; }

/* ===== GRID ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== HELPERS ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-3); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--bg); color: var(--text-2);
  border: 1px solid var(--border);
}

/* ===== QUESTIONNAIRE DETAIL ===== */
.q-detail-header {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 16px;
}
.q-detail-info { flex: 1; }
.q-detail-name { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.q-detail-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-detail-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.review-progress {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 20px;
}
.review-stat { text-align: center; }
.review-stat-val { font-size: 22px; font-weight: 800; color: var(--text); }
.review-stat-label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.review-bar { flex: 1; }
.review-bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-bottom: 6px; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 32px; }
.settings-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.api-key-wrap { position: relative; }
.api-key-wrap .form-input { padding-right: 80px; font-family: monospace; font-size: 12px; }
.api-key-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--text-3); font-weight: 600; padding: 4px 8px;
}
.api-key-toggle:hover { color: var(--primary); }

/* ===== ACTIVITY FEED ===== */
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.activity-dot.green { background: var(--success); }
.activity-dot.blue { background: var(--info); }
.activity-dot.amber { background: var(--warning); }
.activity-dot.purple { background: var(--primary); }
.activity-text { font-size: 12.5px; color: var(--text-2); }
.activity-text strong { font-weight: 600; color: var(--text); }
.activity-time { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, #E2E8F0 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== 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; }

/* ===== CHECKLIST ===== */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.checklist li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer;
}
.checklist li input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.checklist li.checked { color: var(--success); font-weight: 500; }

/* ===== CATEGORY PILLS ===== */
.category-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cat-pill {
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--card); color: var(--text-3);
  transition: all .15s;
}
.cat-pill:hover, .cat-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== NUMBER INPUT ===== */
.number-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #sidebar { width: 64px; min-width: 64px; }
  .brand-name, .nav-section-label, .nav-item span:not(.nav-icon), #ai-indicator-text { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-brand { justify-content: center; padding: 16px 8px; }
}
@media (max-width: 600px) {
  #view-container { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
