/* ============================================
   ProposalPulse — Global Styles
   Stack: Vanilla CSS | Dark Enterprise SaaS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── CSS Variables ─────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:    #09090B;
  --bg-s1:      #18181B;
  --bg-s2:      #27272A;
  --bg-s3:      #3F3F46;

  /* Borders */
  --border:     #3F3F46;
  --border-sm:  #27272A;

  /* Text */
  --text-1:     #FAFAFA;
  --text-2:     #A1A1AA;
  --text-3:     #71717A;

  /* Accents */
  --indigo:     #6366F1;
  --indigo-dim: rgba(99, 102, 241, 0.15);
  --indigo-glow:rgba(99, 102, 241, 0.3);
  --green:      #22C55E;
  --green-dim:  rgba(34, 197, 94, 0.15);
  --amber:      #F59E0B;
  --amber-dim:  rgba(245, 158, 11, 0.15);
  --red:        #EF4444;
  --red-dim:    rgba(239, 68, 68, 0.15);
  --pink:       #EC4899;
  --pink-dim:   rgba(236, 72, 153, 0.15);

  /* Typography */
  --font-ui:    'Outfit', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --sidebar-w:  240px;
  --header-h:   60px;
  --radius:     8px;
  --radius-sm:  6px;
  --radius-lg:  12px;

  /* Transitions */
  --t-fast:     120ms ease;
  --t-med:      220ms ease;
  --t-slow:     350ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ─── Typography ─────────────────────────────── */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--text-2); }

.mono { font-family: var(--font-mono); }
.text-1 { color: var(--text-1); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }

/* ─── Layout — App Shell ─────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────── */
.app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-s1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
  width: calc(var(--sidebar-w) - 20px);
}

.header-logo .logo-mark {
  width: 28px; height: 28px;
  background: var(--indigo);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.header-spacer { flex: 1; }

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.plan-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--indigo-dim);
  color: var(--indigo);
  border: 1px solid var(--indigo-glow);
}

.plan-badge.free   { background: var(--bg-s2); color: var(--text-3); border-color: var(--border); }
.plan-badge.starter{ background: var(--indigo-dim); color: var(--indigo); border-color: var(--indigo-glow); }
.plan-badge.pro    { background: rgba(236,72,153,0.12); color: var(--pink); border-color: rgba(236,72,153,0.3); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ─── Sidebar ─────────────────────────────────── */
.app-sidebar {
  background: var(--bg-s1);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 8px 6px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--bg-s2); color: var(--text-1); }
.nav-item.active { background: var(--indigo-dim); color: var(--indigo); }
.nav-item .nav-icon { width: 16px; text-align: center; flex-shrink: 0; }

.nav-spacer { flex: 1; }

.sidebar-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── Main Content ───────────────────────────── */
.app-main {
  overflow-y: auto;
  padding: 28px;
  min-height: calc(100vh - var(--header-h));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.btn-primary:hover:not(:disabled) {
  background: #5153e8;
  box-shadow: 0 0 0 3px var(--indigo-glow);
}

.btn-secondary {
  background: var(--bg-s2);
  color: var(--text-1);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-s3); border-color: #52525b; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-s2); color: var(--text-1); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; border-radius: var(--radius); }
.btn-xl { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); font-weight: 600; }

/* ─── Cards ──────────────────────────────────── */
.card {
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-sm { padding: 14px 16px; }
.card-lg { padding: 28px; border-radius: var(--radius-lg); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ─── Metric Cards ───────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

.metric-delta {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.metric-delta.up   { color: var(--green); }
.metric-delta.down { color: var(--red); }

/* ─── Table ──────────────────────────────────── */
.table-wrap {
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.table-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-sm);
  color: var(--text-1);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--t-fast);
}

tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

/* Live row */
tbody tr.row-live {
  border-left: 2px solid var(--pink);
  background: rgba(236, 72, 153, 0.04);
  animation: rowPulse 2s ease-in-out infinite;
}

@keyframes rowPulse {
  0%, 100% { background: rgba(236,72,153,0.04); }
  50%       { background: rgba(236,72,153,0.08); }
}

/* ─── Status Badges ──────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-indigo { background: var(--indigo-dim); color: var(--indigo); }
.badge-pink   { background: var(--pink-dim);   color: var(--pink); }
.badge-gray   { background: var(--bg-s2);      color: var(--text-3); }

/* Live pulse badge */
.badge-live {
  background: var(--pink-dim);
  color: var(--pink);
  animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(236,72,153,0.3); }
  50%     { box-shadow: 0 0 0 4px rgba(236,72,153,0); }
}

/* Dot indicators */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-amber  { background: var(--amber); }
.dot-red    { background: var(--red); }
.dot-pink   { background: var(--pink); animation: dotPulse 1.5s ease infinite; }
.dot-gray   { background: var(--text-3); }

@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(236,72,153,0.5); transform: scale(1); }
  50%     { box-shadow: 0 0 0 5px rgba(236,72,153,0); transform: scale(1.15); }
}

/* ─── Inputs & Forms ─────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 13.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-glow);
}

.form-input::placeholder { color: var(--text-3); }
.form-select { cursor: pointer; appearance: none; }
.form-textarea { min-height: 90px; resize: vertical; }

.form-hint {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 5px;
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle {
  position: relative;
  width: 36px; height: 20px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-s3);
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}

.toggle input:checked + .toggle-track { background: var(--indigo); border-color: var(--indigo); }

.toggle-track::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-label { font-size: 13.5px; color: var(--text-1); }

/* ─── Skeleton Loading ───────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-s2) 25%,
    var(--bg-s3) 50%,
    var(--bg-s2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; }
.skeleton-row   { height: 48px; margin-bottom: 1px; border-radius: 0; }

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

.toast {
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  max-width: 360px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  pointer-events: all;
  animation: toastIn var(--t-slow) forwards;
}

.toast.toast-live { border-left: 3px solid var(--pink); }
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-out { animation: toastOut 280ms ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.95); }
}

.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.toast-msg   { font-size: 12px; color: var(--text-2); }

/* ─── Modals ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

.modal-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: modalIn var(--t-slow) forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.modal-desc  { color: var(--text-2); font-size: 13.5px; margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── Empty State ────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}

.empty-icon { margin-bottom: 20px; opacity: 0.5; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-desc  { font-size: 13.5px; color: var(--text-3); max-width: 340px; margin-bottom: 24px; }

/* ─── Tabs ───────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast);
}

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

/* ─── Progress Bar ───────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--bg-s3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--indigo);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ─── Horizontal Bar Chart ───────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-item { display: flex; align-items: center; gap: 12px; }

.bar-label {
  width: 80px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-2);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-s2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--indigo-dim), var(--indigo));
  display: flex;
  align-items: center;
  padding-right: 10px;
  justify-content: flex-end;
  transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
  min-width: 4px;
}

.bar-fill.top {
  background: linear-gradient(90deg, rgba(99,102,241,0.4), var(--indigo));
  box-shadow: 4px 0 12px var(--indigo-glow);
}

.bar-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-1);
  white-space: nowrap;
}

.bar-end-label {
  width: 80px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
  flex-shrink: 0;
}

/* ─── Copy Link Input ────────────────────────── */
.copy-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-input {
  flex: 1;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  outline: none;
  cursor: text;
}

/* ─── Upload Drop Zone ───────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-med);
  background: var(--bg-s1);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--indigo);
  background: var(--indigo-dim);
}

.drop-zone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.drop-zone-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.drop-zone-sub { font-size: 13px; color: var(--text-3); }

/* ─── Steps / Wizard ─────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-number {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.step.active .step-number { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.step.done .step-number { background: var(--green-dim); border-color: var(--green); color: var(--green); }

.step-label { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.step.active .step-label { color: var(--text-1); }
.step.done .step-label { color: var(--green); }

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

/* ─── Notification Bell ──────────────────────── */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-s2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 15px;
  transition: all var(--t-fast);
}

.notif-btn:hover { border-color: var(--indigo); color: var(--indigo); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--pink);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-s1);
}

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

/* ─── Actions Row ────────────────────────────── */
.actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ─── Timeline ───────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-sm);
  position: relative;
}

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

.timeline-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  padding-top: 4px;
}

.timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--indigo);
  flex-shrink: 0;
}

.timeline-line {
  flex: 1;
  width: 1px;
  background: var(--border-sm);
  margin-top: 4px;
}

.timeline-content { flex: 1; }
.timeline-heading { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 3px; }
.timeline-meta { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.timeline-expand { margin-top: 10px; }

/* ─── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-s3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* ─── Misc Utils ─────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ─── Auth Page ──────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 20px;
}

.auth-card {
  background: var(--bg-s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 28px;
}

.auth-logo .logo-mark {
  width: 32px; height: 32px;
  background: var(--indigo);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.auth-title { font-size: 1.3rem; margin-bottom: 6px; }
.auth-sub   { color: var(--text-2); margin-bottom: 28px; font-size: 14px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-3);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: var(--header-h);
    left: -100%;
    z-index: 200;
    width: 260px;
    height: calc(100vh - var(--header-h));
    transition: left var(--t-slow);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .app-sidebar.mobile-open { left: 0; }

  .sidebar-toggle {
    display: flex;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-s2);
    align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
  }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); }

  .app-main { padding: 16px; }

  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 769px) {
  .sidebar-toggle { display: none; }
  .mobile-overlay { display: none; }
}

/* ─── Animations ─────────────────────────────── */
.fade-in {
  animation: fadeIn 300ms ease forwards;
}

.slide-up {
  animation: slideUp 350ms cubic-bezier(0.16,1,0.3,1) forwards;
}

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

/* ─── PDF Viewer Specific ────────────────────── */
.pdf-viewer-wrap {
  background: #1a1a1a;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-toolbar {
  background: var(--bg-s1);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#pdf-canvas-container {
  overflow-y: auto;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #111;
}

#pdf-canvas {
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* ─── Glow Effects ───────────────────────────── */
.glow-indigo { box-shadow: 0 0 20px var(--indigo-glow); }
.glow-green  { box-shadow: 0 0 10px rgba(34,197,94,0.3); }
.glow-pink   { box-shadow: 0 0 10px rgba(236,72,153,0.3); }

/* ─── Plan Usage Bar ─────────────────────────── */
.usage-bar {
  margin-top: 6px;
}

.usage-track {
  height: 6px;
  background: var(--bg-s2);
  border-radius: 6px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--indigo), #818cf8);
  transition: width 0.6s ease;
}

.usage-fill.warning { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.usage-fill.danger  { background: linear-gradient(90deg, var(--red), #f87171); }

/* ─── Info Box ───────────────────────────────── */
.info-box {
  background: var(--indigo-dim);
  border: 1px solid var(--indigo-glow);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.info-box.warning { background: var(--amber-dim); border-color: rgba(245,158,11,0.3); }
.info-box.success { background: var(--green-dim); border-color: rgba(34,197,94,0.3); }
.info-box.danger  { background: var(--red-dim); border-color: rgba(239,68,68,0.3); }

/* ─── Color Picker ───────────────────────────── */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  padding: 2px;
}

/* ─── Kbd ────────────────────────────────────── */
kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: var(--bg-s2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}
