/* ============================================================
   EmMarkIA Flow — Design System v2.0
   Brand Palette: Navy #0B1220 · Cyan #00D2FF · Violet #7A3BFF · Magenta #FF00D9
   Typography: Poppins (headings) + Montserrat (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* === Design Tokens === */
:root {
  /* Brand */
  --navy: #0B1220;
  --navy-deep: #070D17;
  --navy-mid: #101B2E;
  --navy-surface: #162136;
  --cyan: #00D2FF;
  --cyan-soft: #00D2FF22;
  --cyan-glow: #00D2FF44;
  --violet: #7A3BFF;
  --violet-soft: #7A3BFF22;
  --magenta: #FF00D9;
  --magenta-soft: #FF00D920;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #00D2FF 0%, #7A3BFF 50%, #FF00D9 100%);
  --grad-sidebar: linear-gradient(180deg, #0B1220 0%, #101B2E 40%, #0E1628 100%);
  --grad-card-hover: linear-gradient(135deg, #00D2FF08, #7A3BFF08);
  --grad-accent: linear-gradient(135deg, #00D2FF, #7A3BFF);
  --grad-cta: linear-gradient(135deg, #7A3BFF 0%, #FF00D9 100%);

  /* Neutral */
  --ink: #1A2332;
  --ink-light: #3D4F63;
  --muted: #7B8FA3;
  --line: #E4E9F0;
  --line-light: #EEF2F7;
  --canvas: #F4F6FA;
  --surface: #FFFFFF;
  --soft: #F8FAFB;

  /* Semantic */
  --green: #10B981;
  --green-soft: #D1FAE5;
  --gold: #F59E0B;
  --gold-soft: #FEF3C7;
  --red: #EF4444;
  --red-soft: #FEE2E2;
  --blue: #3B82F6;
  --blue-soft: #DBEAFE;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(11, 18, 32, 0.04);
  --shadow-md: 0 4px 16px rgba(11, 18, 32, 0.06);
  --shadow-lg: 0 12px 40px rgba(11, 18, 32, 0.08);
  --shadow-xl: 0 20px 60px rgba(11, 18, 32, 0.12);
  --shadow-glow: 0 0 30px rgba(0, 210, 255, 0.15);
  --shadow-violet: 0 4px 20px rgba(122, 59, 255, 0.2);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  font-family: 'Montserrat', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* === Layout Shell === */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

/* === Sidebar === */
.sidebar {
  background: var(--grad-sidebar);
  color: #fff;
  padding: 28px 16px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 10px 36px;
}

.brand-mark {
  height: 44px;
  width: 44px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Glow effect behind logo */
.brand-mark::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  background: var(--grad-brand);
  opacity: 0.25;
  z-index: -1;
  filter: blur(8px);
}

.brand-mark span,
.brand-mark i { display: none; }

.brand-word strong {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-word strong span { display: none; }

.brand-word small {
  display: block;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 8px;
  margin-top: 4px;
  text-transform: uppercase;
}

.side-caption {
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 800;
  margin: 4px 14px 14px;
  text-transform: uppercase;
}

/* Nav */
.nav-list { display: grid; gap: 4px; }

.nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  position: relative;
}

.nav-list a svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
}

.nav-list a.active {
  background: rgba(0, 210, 255, 0.1);
  color: #fff;
  font-weight: 700;
}

.nav-list a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--grad-brand);
}

.nav-count {
  margin-left: auto;
  background: rgba(0, 210, 255, 0.15);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  min-width: 22px;
  text-align: center;
}

/* Side bottom */
.side-bottom { margin-top: auto; }

.demo-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  margin: 22px 6px;
}

.demo-dot, .chip-dot {
  display: inline-block;
  background: var(--green);
  width: 7px;
  height: 7px;
  border-radius: 100%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.avatar-row {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 2px 0;
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 38px;
  height: 38px;
}

.avatar-row strong { display: block; font-size: 11px; }
.avatar-row small {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 4px;
}

/* === Main area === */
.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* === Topbar === */
.topbar {
  min-height: 72px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-left, .top-actions { display: flex; align-items: center; gap: 10px; }

.crumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.crumbs strong {
  color: var(--ink);
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

.crumbs svg { width: 14px; height: 14px; }

.header-chip {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  background: var(--soft);
}

.header-chip .chip-dot { background: var(--cyan); }

/* === Content === */
.content {
  padding: 32px 36px 48px;
  max-width: 1510px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* === Footer === */
.footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 36px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

/* === Page Header === */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-title {
  font-family: 'Poppins', sans-serif;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
  color: var(--navy);
}

.page-subtitle {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin: 8px 0 0;
}

.head-right {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}

/* === Buttons === */
.btn {
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--grad-accent);
  color: white;
  box-shadow: var(--shadow-violet);
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(122, 59, 255, 0.35);
}

.btn-subtle {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-light);
}

.btn-subtle:hover { background: var(--soft); border-color: var(--cyan); color: var(--ink); }

.btn-light { background: var(--cyan-soft); color: var(--violet); }

.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: #FDD; }

.btn-sm { height: 32px; font-size: 11px; padding: 0 12px; }

.btn:disabled { cursor: not-allowed; opacity: 0.45; transform: none !important; }

/* Icon button */
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-light);
  border-radius: var(--radius-xs);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  transition: all var(--transition);
}

.icon-button:hover { border-color: var(--cyan); color: var(--cyan); }
.icon-button svg { width: 18px; height: 18px; }
.menu-button { display: none; }

/* === Stats Grid === */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line-light);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  min-width: 0;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--cyan-soft);
}

.stat-card:hover::before { opacity: 1; }

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.stat-icon {
  height: 36px;
  width: 36px;
  background: var(--cyan-soft);
  color: var(--violet);
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}

.stat-icon svg { height: 17px; width: 17px; }

.stat-number {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  color: var(--navy);
  font-size: 34px;
  letter-spacing: -1px;
  margin: 14px 0 8px;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.stat-foot b { color: var(--green); }

/* === Panels === */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-light);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  min-width: 0;
  transition: box-shadow var(--transition);
}

.panel:hover { box-shadow: var(--shadow-lg); }

.panel-pad { padding: 24px; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0;
  color: var(--navy);
}

.panel-sub {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0 0;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: none;
  padding: 4px;
  transition: color var(--transition);
}

.link-button:hover { color: var(--cyan); }
.link-button svg { width: 14px; height: 14px; }

/* === Stage Bars === */
.stage-bars { display: grid; gap: 14px; }

.stage-row {
  display: grid;
  grid-template-columns: 95px 1fr 28px;
  gap: 12px;
  align-items: center;
}

.stage-name { font-size: 11px; font-weight: 600; color: var(--muted); }

.stage-track {
  height: 10px;
  border-radius: 10px;
  background: var(--line-light);
  overflow: hidden;
}

.stage-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-bar.draft    { background: #94A3B8; }
.stage-bar.sent     { background: var(--cyan); }
.stage-bar.approved { background: var(--green); }
.stage-bar.converted { background: var(--violet); }
.stage-bar.rejected { background: var(--red); }

.stage-value { font-size: 11px; font-weight: 750; color: var(--ink-light); text-align: right; }

/* === Tip Box === */
.tip {
  background: linear-gradient(135deg, var(--cyan-soft), var(--violet-soft));
  border: 1px solid rgba(0, 210, 255, 0.15);
  border-radius: 12px;
  margin-top: 22px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--navy-mid);
  font-size: 11px;
  line-height: 1.6;
}

.tip svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--violet); }

/* === Focus List (priority tasks) === */
.focus-list { display: grid; gap: 10px; }

.focus-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.focus-item:hover {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.focus-item .bubble {
  height: 32px;
  width: 32px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  color: var(--gold);
  background: var(--gold-soft);
  flex: none;
}

.focus-item .bubble svg { width: 15px; height: 15px; }
.focus-content { min-width: 0; flex: 1; }
.focus-title { font-size: 12px; font-weight: 700; margin: 0 0 4px; color: var(--navy); }
.focus-sub { font-size: 10px; color: var(--muted); line-height: 1.6; }
.focus-amount { font-weight: 800; font-size: 12px; color: var(--navy); white-space: nowrap; }

/* === Tables === */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-light);
}

.toolbar-left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.search-box {
  display: flex;
  gap: 9px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 40px;
  min-width: 260px;
  color: var(--muted);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.search-box svg { width: 16px; height: 16px; }

.search-box input {
  border: 0;
  outline: none;
  color: var(--ink);
  min-width: 0;
  font-size: 12px;
  width: 100%;
  background: transparent;
}

.select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-light);
  padding: 0 14px;
  background: var(--surface);
  max-width: 100%;
  transition: border-color var(--transition);
}

.select:focus { border-color: var(--cyan); }

.mini-meta { color: var(--muted); font-size: 11px; }

.table-wrap { overflow: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 725px;
}

.data-table thead { background: var(--soft); }

.data-table th {
  padding: 14px 20px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line-light);
  white-space: nowrap;
}

.data-table td {
  font-size: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink-light);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: 0; }

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: var(--grad-card-hover); }

.table-main { font-size: 12px; font-weight: 700; color: var(--navy); }
.table-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }

.mono {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink-light);
  font-family: 'Montserrat', monospace;
}

.money {
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.badge i {
  display: inline-block;
  height: 6px;
  width: 6px;
  border-radius: 100%;
  background: currentColor;
}

.badge.draft     { color: #64748B; background: #F1F5F9; }
.badge.sent      { color: #0891B2; background: #ECFEFF; }
.badge.approved  { color: #059669; background: #D1FAE5; }
.badge.converted { color: var(--violet); background: var(--violet-soft); }
.badge.rejected  { color: var(--red); background: var(--red-soft); }
.badge.overdue   { color: #D97706; background: var(--gold-soft); }
.badge.done      { color: var(--green); background: var(--green-soft); }
.badge.upcoming  { color: #0284C7; background: #E0F2FE; }

/* === Tiny Actions === */
.tiny-action {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--violet);
  background: transparent;
  border: 0;
  font-weight: 700;
  font-size: 11px;
  padding: 6px;
  transition: color var(--transition);
}

.tiny-action:hover { color: var(--cyan); }
.tiny-action svg { height: 14px; width: 14px; }

/* === Shortcuts === */
.shortcuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.shortcut:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--cyan-soft);
}

.shortcut-icon {
  height: 40px;
  width: 40px;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}

.shortcut-icon svg { width: 18px; height: 18px; }

.shortcut strong {
  font-size: 12px;
  display: block;
  font-family: 'Poppins', sans-serif;
  color: var(--navy);
}

.shortcut small {
  font-size: 10px;
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.shortcut > svg { margin-left: auto; width: 17px; height: 17px; color: var(--muted); }

/* === Empty state === */
.empty {
  padding: 55px 15px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  color: var(--muted);
}

.empty svg { width: 36px; height: 36px; color: var(--cyan); opacity: 0.5; }
.empty strong { font-size: 14px; color: var(--navy); font-family: 'Poppins', sans-serif; }
.empty p { font-size: 12px; max-width: 340px; line-height: 1.6; margin: 0; }

/* === Followup summary === */
.followup-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.summary-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-light);
  padding: 18px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.summary-tile:hover {
  box-shadow: var(--shadow-md);
}

.summary-tile .round-icon {
  background: var(--grad-accent);
  color: #fff;
  border-radius: 50%;
  height: 42px;
  width: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.summary-tile .round-icon svg { width: 19px; height: 19px; }

.summary-tile strong {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: block;
  color: var(--navy);
}

.summary-tile small { font-size: 11px; color: var(--muted); }

/* === Demo banner === */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--cyan-soft), var(--violet-soft));
  border: 1px solid rgba(0, 210, 255, 0.12);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--navy-mid);
  margin-bottom: 24px;
}

.demo-banner svg { width: 20px; height: 20px; flex: none; color: var(--violet); }

.demo-banner p { font-size: 11px; line-height: 1.7; margin: 0; }

.demo-banner strong { color: var(--navy); }

/* === Modals === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 13, 23, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px;
  animation: fadeIn 0.2s ease;
}

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

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

.modal {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  max-height: 93vh;
  overflow: auto;
  width: min(760px, 100%);
  animation: slideUp 0.25s ease;
}

.modal-head {
  padding: 24px 28px;
  border-bottom: 1px solid var(--line-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-head h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0;
  color: var(--navy);
}

.modal-head p { font-size: 11px; color: var(--muted); margin: 6px 0 0; }

.modal-body { padding: 24px 28px; }

.modal-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  background: var(--soft);
  border-radius: 0 0 20px 20px;
}

/* === Form === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.form-field.wide { grid-column: 1 / -1; }

.form-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-light);
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  min-width: 0;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-field small { color: var(--muted); font-size: 10px; }

/* === Item Block === */
.item-block {
  margin-top: 20px;
  border: 1px solid var(--line-light);
  padding: 18px;
  border-radius: var(--radius);
  background: var(--soft);
}

.item-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.item-block-head strong {
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(100px, 2.3fr) minmax(55px, .7fr) minmax(100px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.item-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  min-width: 0;
  background: var(--surface);
  transition: border-color var(--transition);
}

.item-row input:focus {
  border-color: var(--cyan);
  outline: none;
}

.remove-item {
  height: 34px;
  width: 34px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #FECACA;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  transition: all var(--transition);
}

.remove-item:hover { background: #FDD; }
.remove-item svg { width: 14px; }

.form-total {
  text-align: right;
  font-weight: 800;
  color: var(--navy);
  margin-top: 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

.amount-breakdown { margin-top: 18px; display: grid; gap: 10px; }
.amount-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--ink-light); }
.amount-row strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-row-total { border-top: 1px solid var(--line); padding-top: 12px; color: var(--navy); font-size: 14px; font-weight: 800; }
.tax-note { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; }
.client-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; background: var(--soft); border: 1px solid var(--line-light); border-radius: var(--radius-sm); margin: 8px 0; }
.client-details .wide { grid-column: 1 / -1; }
.client-details small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.client-details strong { display: block; font-size: 11px; color: var(--navy); overflow-wrap: anywhere; }
#quote-client-info:empty { display: none; }

.notice {
  background: linear-gradient(135deg, var(--cyan-soft), var(--violet-soft));
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--navy-mid);
  font-size: 11px;
  line-height: 1.65;
  margin-top: 18px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.notice svg { flex-shrink: 0; }

/* === Drawer === */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 13, 23, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer {
  background: var(--surface);
  max-width: min(540px, 100%);
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 50px rgba(0, 0, 0, 0.12);
  animation: slideInRight 0.25s ease;
}

.drawer-head {
  padding: 26px 28px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-light);
}

.drawer-head h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 0;
  letter-spacing: -0.4px;
  color: var(--navy);
}

.drawer-content { padding: 24px 28px; overflow: auto; flex: 1; }

.drawer-amount {
  font-family: 'Poppins', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 10px 0;
  color: var(--navy);
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
  margin: 22px 0;
}

.kv small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kv strong { font-size: 12px; color: var(--navy); }

.section-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 800;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-light);
}

.detail-items { width: 100%; border-collapse: collapse; }

.detail-items th {
  font-size: 10px;
  text-align: left;
  color: var(--muted);
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-items td {
  font-size: 11px;
  color: var(--ink-light);
  padding: 12px 6px;
  border-bottom: 1px solid var(--line-light);
}

.detail-items td:last-child, .detail-items th:last-child { text-align: right; }

.detail-total {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: var(--navy);
}

/* === Activity Timeline === */
.activity-list { display: grid; gap: 16px; margin-top: 18px; }

.activity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.activity-dot {
  width: 10px;
  height: 10px;
  background: var(--grad-accent);
  border: 3px solid var(--cyan-soft);
  border-radius: 100%;
  box-sizing: content-box;
}

.activity-stem {
  width: 1px;
  background: var(--line);
  min-height: 20px;
  flex: 1;
}

.activity-text {
  font-size: 11px;
  color: var(--ink-light);
  line-height: 1.5;
  flex: 1;
}

.activity-text small {
  font-size: 10px;
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.drawer-actions {
  padding: 18px 28px;
  border-top: 1px solid var(--line-light);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--soft);
}

.drawer-actions .btn { flex: 1; }

/* === Toast === */
.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 120;
}

.toast {
  background: var(--navy);
  color: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  padding: 14px 18px;
  font-size: 12px;
  max-width: 420px;
  margin-top: 10px;
  animation: slideUp 0.25s ease;
  border-left: 3px solid var(--cyan);
}

.toast.error {
  background: #7F1D1D;
  border-left-color: var(--red);
}

/* === Utilities === */
.mobile-shade { display: none; }
.p-small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.hint-text { font-size: 10px; color: var(--muted); }
.right { text-align: right; }
.flex-grow { flex: 1; }
.mt16 { margin-top: 16px; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1220px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .topbar { padding: 12px 24px; }
  .content { padding: 26px 24px; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr) minmax(280px, .78fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { padding-left: 6px; }
}

@media (max-width: 920px) {
  .shell { display: block; }

  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 272px;
    box-shadow: 16px 0 50px rgba(3, 10, 20, 0.2);
  }

  .shell.show-menu .sidebar { transform: translateX(0); }

  .shell.show-menu .mobile-shade {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(7, 13, 23, 0.4);
  }

  .menu-button { display: grid; }
  .header-chip { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .topbar { min-height: 64px; }
}

@media (max-width: 650px) {
  .topbar { padding: 12px 16px; }
  .topbar .btn-primary { height: 36px; padding: 0 10px; font-size: 11px; }
  .crumbs > span:first-child, .crumbs svg { display: none; }
  .content { padding: 20px 16px 36px; }
  .footer { padding: 16px; flex-wrap: wrap; line-height: 1.6; }
  .page-head { flex-wrap: wrap; }
  .page-title { font-size: 24px; }
  .grid-stats, .followup-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px 14px; }
  .stat-number { font-size: 26px; }
  .stat-label { font-size: 10px; }
  .shortcuts { grid-template-columns: 1fr; }
  .summary-tile { padding: 14px 12px; }
  .summary-tile .round-icon { height: 34px; width: 34px; }
  .summary-tile strong { font-size: 22px; }
  .summary-tile small { font-size: 10px; }
  .table-toolbar { padding: 14px; }
  .search-box { min-width: 0; flex: 1; }
  .table-toolbar, .toolbar-left { align-items: stretch; }
  .toolbar-left { width: 100%; }
  .stage-row { grid-template-columns: 78px 1fr 25px; gap: 8px; }
  .panel-pad { padding: 18px; }
  .modal-backdrop { padding: 10px; }
  .modal-head, .modal-body, .modal-foot { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.wide { grid-column: auto; }
  .item-row { grid-template-columns: 1fr 52px 80px 28px; gap: 5px; }
  .item-row input { padding: 8px 6px; }
  .remove-item { width: 28px; }
  .drawer-head, .drawer-content, .drawer-actions { padding: 18px; }
  .drawer-actions { flex-direction: column; }
  .nav-count { margin-left: auto; }
}
