/* ========== Design tokens ========== */
:root {
  --bg: #0a0b14;
  --bg-elevated: #13141f;
  --bg-hover: #1a1c2a;
  --border: #23242f;
  --border-subtle: #1a1c26;
  --text: #f5f5f7;
  --text-muted: #9b9da8;
  --text-faded: #5a5c68;

  --pop: #3a56e8;
  --pop-soft: rgba(58, 86, 232, 0.15);
  --pop-light: #a0b4ff;

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.12);
  --gray: #6b7280;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

  --sidebar-w: 240px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(at 0% 0%, rgba(58, 86, 232, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(58, 86, 232, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faded); }

.loading-state {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; color: var(--text-muted); font-family: var(--font-mono);
}

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

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
}

/* ========== Sidebar ========== */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px;
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pop), #1f3acc);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; color: white;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(58, 86, 232, 0.4);
}
.brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-text span { color: var(--pop-light); }

.nav-section {
  display: flex; flex-direction: column; gap: 2px;
}
.nav-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500;
  color: var(--text-faded);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0 8px 6px; margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--pop-soft);
  color: var(--pop-light);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--border);
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.nav-item.active .badge { background: var(--pop); color: white; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.sidebar-footer .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pop), #6b3acc);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: white; font-size: 12px;
}

/* ========== Main content ========== */
.main {
  padding: 24px 32px 80px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 600px) {
  .main { padding: 16px 14px 100px; }
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--text-faded); }
.btn.primary {
  background: var(--pop);
  border-color: var(--pop);
  color: white;
}
.btn.primary:hover { background: #2d44c5; border-color: #2d44c5; }
.btn.danger { color: var(--red); }
.btn svg { width: 14px; height: 14px; }

/* Pending notes alert in header */
.pending-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--yellow-soft);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
}
.pending-banner-icon {
  width: 28px; height: 28px;
  background: var(--yellow);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 700;
  font-family: var(--font-mono);
}
.pending-banner button { margin-left: auto; }

/* ========== Stats grid (dashboard) ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent, var(--pop));
  opacity: 0.6;
}
.stat-card.pop { --accent: var(--pop); }
.stat-card.green { --accent: var(--green); }
.stat-card.yellow { --accent: var(--yellow); }
.stat-card.orange { --accent: var(--orange); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-value .unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}
.stat-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Section card ========== */
.section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-body { padding: 20px; }
.section-body.no-pad { padding: 0; }

/* ========== Tables ========== */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.table tr { cursor: pointer; transition: background 0.1s ease; }
.table tr:hover td { background: var(--bg-hover); }
.table tr:last-child td { border-bottom: none; }

.table .name {
  font-weight: 600;
  color: var(--text);
}
.table .city {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .table td {
    padding: 4px 0;
    border: none;
  }
  .table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-faded);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-block;
    margin-right: 8px;
    min-width: 80px;
  }
}

/* ========== Status pills ========== */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pill.cold { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.pill.contacted { background: var(--pop-soft); color: var(--pop-light); }
.pill.interested { background: var(--green-soft); color: var(--green); }
.pill.demo_scheduled { background: var(--green-soft); color: var(--green); }
.pill.proposal_sent { background: var(--orange-soft); color: var(--orange); }
.pill.won { background: var(--green-soft); color: var(--green); }
.pill.lost, .pill.not_interested { background: var(--red-soft); color: var(--red); }
.pill.follow_up_later { background: var(--yellow-soft); color: var(--yellow); }
.pill.pending_launch { background: var(--yellow-soft); color: var(--yellow); }
.pill.active { background: var(--green-soft); color: var(--green); }

/* Lead score badge */
.score {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.score.high { background: var(--green-soft); color: var(--green); border-color: rgba(34, 197, 94, 0.3); }
.score.med { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(234, 179, 8, 0.3); }
.score.low { background: var(--red-soft); color: var(--red); border-color: rgba(239, 68, 68, 0.3); }

/* Industry tag */
.industry {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== Filters ========== */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.filter-input, .filter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
}
.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--pop);
}
.filter-input { flex: 1; min-width: 180px; }
.filter-input::placeholder { color: var(--text-faded); }
.filter-select { cursor: pointer; }

.filter-clear {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 7px 10px;
}
.filter-clear:hover { color: var(--text); }

/* ========== Detail view (slide-over panel) ========== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.detail-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 100%;
  max-width: 580px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.detail-panel.open { transform: translateX(0); }

.detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.detail-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}

.close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.close-btn:hover { background: var(--bg-hover); color: var(--text); }

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.detail-section { margin-bottom: 24px; }
.detail-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) {
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
}

.field {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  min-height: 48px;
}
.field-content { flex: 1; min-width: 0; }
.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faded);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-value {
  font-size: 13px;
  word-break: break-all;
}
.field-value.empty { color: var(--text-faded); font-style: italic; }
.field-value.mono { font-family: var(--font-mono); font-size: 12px; }
.copy-btn {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.copy-btn:hover { background: var(--bg-hover); color: var(--pop-light); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--green); }

.pitch-block {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  position: relative;
}
.pitch-block.angle { font-style: italic; color: var(--text-muted); }
.pitch-block .copy-btn {
  position: absolute;
  top: 8px; right: 8px;
}

/* Activity timeline */
.activity-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.activity-item {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; gap: 12px; align-items: flex-start;
}
.activity-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 12px; height: 12px; color: var(--text-muted); }
.activity-content { flex: 1; min-width: 0; }
.activity-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faded);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.activity-text {
  font-size: 13px;
  line-height: 1.5;
}
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ========== Quick note modal ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
}
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--pop);
  box-shadow: 0 0 0 3px var(--pop-soft);
}

/* ========== Pending notes list (in modal) ========== */
.pending-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
}
.pending-item {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.pending-item-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.pending-item-title {
  font-weight: 600;
  font-size: 13px;
}
.pending-item-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faded);
}
.pending-item-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.pending-item-delete {
  color: var(--red);
  font-size: 11px;
  margin-top: 6px;
  font-family: var(--font-mono);
}

.command-block {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #d4d4d4;
  max-height: 300px;
  overflow-y: auto;
}

/* ========== Funnel chart (analytics) ========== */
.funnel {
  display: flex; flex-direction: column; gap: 6px;
}
.funnel-stage {
  display: flex; align-items: center; gap: 12px;
}
.funnel-stage-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 130px;
  flex-shrink: 0;
}
.funnel-stage-bar {
  flex: 1;
  height: 28px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.funnel-stage-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--pop), #6b88ff);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; padding: 0 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: white;
  transition: width 0.4s ease;
}
.funnel-stage:nth-child(2) .funnel-stage-fill { background: linear-gradient(90deg, #4665e8, #7591ff); }
.funnel-stage:nth-child(3) .funnel-stage-fill { background: linear-gradient(90deg, #5573e8, #8499ff); }
.funnel-stage:nth-child(4) .funnel-stage-fill { background: linear-gradient(90deg, #6580e8, #94a3ff); }
.funnel-stage:nth-child(5) .funnel-stage-fill { background: linear-gradient(90deg, #748ee8, #a3aeff); }
.funnel-stage:nth-child(6) .funnel-stage-fill { background: linear-gradient(90deg, var(--green), #4ade80); }

/* ========== Today's tasks ========== */
.task-list {
  display: flex; flex-direction: column;
  gap: 1px;
}
.task-item {
  padding: 12px 20px;
  display: flex; gap: 12px; align-items: center;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid var(--border-subtle);
}
.task-item:hover { background: var(--bg-hover); }
.task-item:last-child { border-bottom: none; }
.task-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}
.task-dot.overdue { background: var(--red); }
.task-content { flex: 1; min-width: 0; }
.task-name { font-weight: 600; font-size: 13px; }
.task-detail { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.task-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== Templates view ========== */
.template-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.template-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.template-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}
.template-card-key {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.template-card-body { padding: 20px; }
.template-block {
  margin-bottom: 16px;
}
.template-block:last-child { margin-bottom: 0; }
.template-block-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.template-block-content {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.template-block-content ul {
  margin: 4px 0 4px 20px;
}
.template-block-content li { margin-bottom: 4px; }

/* ========== Mobile bottom nav ========== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 6px 0;
  z-index: 50;
  justify-content: space-around;
  backdrop-filter: blur(20px);
  background: rgba(19, 20, 31, 0.92);
}
.mobile-nav .nav-item {
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  font-size: 10px;
}
.mobile-nav .nav-item svg { width: 18px; height: 18px; }
.mobile-nav .badge { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: flex; align-items: center; gap: 8px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

@media (max-width: 900px) {
  .toast { bottom: 80px; }
}

/* ========== Mobile FAB ========== */
.fab {
  display: none;
  position: fixed;
  bottom: 90px; right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--pop);
  color: white;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(58, 86, 232, 0.5);
  z-index: 60;
  transition: all 0.15s ease;
}
.fab:active { transform: scale(0.95); }
.fab svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .fab { display: flex; }
}

/* ========== Utility ========== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
