/* ============================================
   SOLARTRACK CRM — DESIGN SYSTEM
   Palette: Volcanic Solar — Orange/Amber + Dark
   Fonts: Bricolage Grotesque + Plus Jakarta Sans
   ============================================ */

:root {
  --bg-base:       #0D0F14;
  --bg-surface:    #13161E;
  --bg-card:       #1A1E2A;
  --bg-card-hover: #1F2435;
  --bg-input:      #0F1219;

  --border:        #252A38;
  --border-light:  #2E3447;

  --text-primary:  #F0F2F8;
  --text-secondary:#8B93A8;
  --text-muted:    #555E75;

  --orange:        #FF6B2B;
  --orange-light:  #FF8C55;
  --orange-glow:   rgba(255,107,43,0.15);
  --amber:         #FFB347;
  --amber-glow:    rgba(255,179,71,0.12);
  --yellow:        #FFD700;

  --hot:           #FF4444;
  --hot-bg:        rgba(255,68,68,0.12);
  --warm:          #FF8C00;
  --warm-bg:       rgba(255,140,0,0.12);
  --cold:          #4FC3F7;
  --cold-bg:       rgba(79,195,247,0.12);
  --converted:     #4CAF50;
  --converted-bg:  rgba(76,175,80,0.12);
  --lost:          #9E9E9E;
  --lost-bg:       rgba(158,158,158,0.12);
  --new:           #AB47BC;
  --new-bg:        rgba(171,71,188,0.12);
  --visit:         #26C6DA;
  --visit-bg:      rgba(38,198,218,0.12);

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     18px;
  --radius-xl:     24px;

  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-modal:  0 20px 60px rgba(0,0,0,0.7);
  --shadow-glow:   0 0 30px rgba(255,107,43,0.2);

  --sidebar-w:     260px;
  --topbar-h:      68px;

  --font-display:  'Bricolage Grotesque', sans-serif;
  --font-body:     'Plus Jakarta Sans', sans-serif;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(255,107,43,0.4);
}

.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--orange-light), var(--amber));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 2px; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--orange-glow);
  color: var(--orange-light);
  border: 1px solid rgba(255,107,43,0.25);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--orange);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-label { font-family: var(--font-body); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 20px; cursor: pointer;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: border-color 0.2s;
}

.search-box:focus-within { border-color: var(--orange); }
.search-icon { font-size: 14px; }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px; width: 200px;
}
.search-box input::placeholder { color: var(--text-muted); }

.btn-add-lead {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  color: white; border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(255,107,43,0.35);
}

.btn-add-lead:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255,107,43,0.5);
}

/* ============ PAGES ============ */
.page {
  display: none;
  padding: 28px;
  flex: 1;
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

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

/* ============ STATS GRID ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-total::before    { background: linear-gradient(90deg, var(--orange), var(--amber)); }
.stat-converted::before{ background: linear-gradient(90deg, var(--converted), #81C784); }
.stat-visits::before   { background: linear-gradient(90deg, var(--visit), #4DD0E1); }
.stat-pipeline::before { background: linear-gradient(90deg, var(--yellow), var(--amber)); }
.stat-followup::before { background: linear-gradient(90deg, #AB47BC, #CE93D8); }
.stat-hot::before      { background: linear-gradient(90deg, var(--hot), #FF8A80); }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-light);
}

.stat-icon {
  font-size: 32px;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-trend {
  font-size: 12px;
  color: var(--text-muted);
  position: absolute;
  top: 14px; right: 14px;
}

/* ============ CONVERSION SECTION ============ */
.conversion-section, .recent-section, .today-followups {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}

.view-all {
  font-size: 13px;
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.view-all:hover { color: var(--amber); }

.conversion-bars { display: flex; flex-direction: column; gap: 14px; }

.conv-bar-item {}
.conv-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.conv-bar-track {
  height: 8px;
  background: var(--bg-surface);
  border-radius: 4px;
  overflow: hidden;
}

.conv-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}

.conv-bar-fill.hot       { background: linear-gradient(90deg, var(--hot), #FF8A80); }
.conv-bar-fill.warm      { background: linear-gradient(90deg, var(--warm), var(--amber)); }
.conv-bar-fill.cold      { background: linear-gradient(90deg, var(--cold), #81D4FA); }
.conv-bar-fill.converted { background: linear-gradient(90deg, var(--converted), #81C784); }
.conv-bar-fill.lost      { background: linear-gradient(90deg, var(--lost), #BDBDBD); }

/* ============ RECENT LEADS ============ */
.recent-leads-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-lead-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.recent-lead-item:hover {
  border-color: var(--orange);
  background: var(--bg-card-hover);
}

.lead-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  color: white;
}

.recent-lead-info { flex: 1; }
.recent-lead-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.recent-lead-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.recent-lead-right { text-align: right; }
.recent-lead-value { font-size: 14px; font-weight: 700; color: var(--amber); }
.recent-lead-time  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============ TODAY FOLLOWUPS ============ */
.followup-list { display: flex; flex-direction: column; gap: 10px; }

.followup-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--orange);
  cursor: pointer;
  transition: all 0.2s;
}

.followup-item:hover { background: var(--bg-card-hover); }
.followup-item.overdue { border-left-color: var(--hot); }
.followup-item.tomorrow { border-left-color: var(--warm); }

.fu-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fu-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.fu-date { font-size: 12px; color: var(--orange); font-weight: 600; margin-left: auto; }

/* ============ LEADS TABLE ============ */
.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover { border-color: var(--orange); color: var(--orange); }
.filter-tab.active {
  background: var(--orange-glow);
  border-color: var(--orange);
  color: var(--orange-light);
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.leads-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.leads-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.leads-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leads-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}

.leads-table tbody tr:hover { background: var(--bg-card-hover); }
.leads-table tbody tr:last-child td { border-bottom: none; }

.lead-name-cell { display: flex; align-items: center; gap: 10px; }
.lead-name-text { font-weight: 600; color: var(--text-primary); }
.lead-city-text { font-size: 12px; color: var(--text-muted); }

.mobile-cell { font-family: monospace; font-size: 13px; color: var(--text-secondary); }

.kw-badge {
  background: var(--amber-glow);
  color: var(--amber);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.value-cell { font-weight: 700; color: var(--amber); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-new        { background: var(--new-bg);       color: var(--new); }
.status-hot        { background: var(--hot-bg);        color: var(--hot); }
.status-warm       { background: var(--warm-bg);       color: var(--warm); }
.status-cold       { background: var(--cold-bg);       color: var(--cold); }
.status-site_visit { background: var(--visit-bg);      color: var(--visit); }
.status-converted  { background: var(--converted-bg);  color: var(--converted); }
.status-lost       { background: var(--lost-bg);       color: var(--lost); }

.followup-cell { font-size: 12px; color: var(--text-secondary); }
.followup-cell.overdue { color: var(--hot); font-weight: 600; }
.followup-cell.today   { color: var(--orange); font-weight: 600; }

.source-badge {
  font-size: 12px;
  color: var(--text-muted);
}

.action-btns { display: flex; gap: 6px; }

.btn-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-glow); }
.btn-icon.delete:hover { border-color: var(--hot); color: var(--hot); background: var(--hot-bg); }

/* ============ PIPELINE ============ */
.pipeline-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 140px);
}

.pipeline-col {
  min-width: 220px;
  max-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pipeline-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

.new-header       { background: rgba(171,71,188,0.1); color: var(--new); }
.hot-header       { background: var(--hot-bg);        color: var(--hot); }
.warm-header      { background: var(--warm-bg);       color: var(--warm); }
.cold-header      { background: var(--cold-bg);       color: var(--cold); }
.visit-header     { background: var(--visit-bg);      color: var(--visit); }
.converted-header { background: var(--converted-bg);  color: var(--converted); }
.lost-header      { background: var(--lost-bg);       color: var(--lost); }

.col-count {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.pipeline-cards {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.pipe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.pipe-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.pipe-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.pipe-card-city { font-size: 11px; color: var(--text-muted); }
.pipe-card-value { font-size: 13px; font-weight: 700; color: var(--amber); margin-top: 8px; }
.pipe-card-kw   { font-size: 11px; color: var(--text-muted); }
.pipe-card-fu   { font-size: 11px; color: var(--orange); margin-top: 6px; }

/* ============ FOLLOW-UPS PAGE ============ */
.followups-container { }

.followup-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fu-tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.fu-tab:hover { border-color: var(--orange); color: var(--orange); }
.fu-tab.active {
  background: var(--orange-glow);
  border-color: var(--orange);
  color: var(--orange-light);
}

.followup-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.fu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid var(--orange);
}

.fu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.fu-card.overdue { border-left-color: var(--hot); }
.fu-card.tomorrow { border-left-color: var(--warm); }
.fu-card.done { border-left-color: var(--converted); opacity: 0.7; }

.fu-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fu-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.fu-card-date { font-size: 12px; font-weight: 600; }
.fu-card-date.overdue { color: var(--hot); }
.fu-card-date.today   { color: var(--orange); }
.fu-card-date.tomorrow{ color: var(--warm); }
.fu-card-date.future  { color: var(--text-muted); }

.fu-card-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.fu-card-notes { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* ============ SITE VISITS PAGE ============ */
.sitevisits-container {}

.sv-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.sv-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.sv-stat-val {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800;
  color: var(--orange);
}

.sv-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.sv-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.sv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.sv-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--visit); }

.sv-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sv-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sv-card-date { font-size: 13px; color: var(--visit); font-weight: 600; }
.sv-card-address { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.sv-card-kw { font-size: 13px; color: var(--amber); font-weight: 600; }

/* ============ MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.modal-detail { max-width: 560px; }
.modal-small  { max-width: 400px; }

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

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

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--hot-bg); color: var(--hot); border-color: var(--hot); }

.modal-body { padding: 24px; }

/* ============ FORM ============ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { margin-bottom: 16px; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

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

.form-group select option { background: var(--bg-card); }
.form-group textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-cancel {
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover { border-color: var(--border-light); color: var(--text-primary); }

.btn-save {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  color: white;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(255,107,43,0.35);
}

.btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,107,43,0.5); }

.btn-delete-confirm {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--hot);
  color: white;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-confirm:hover { background: #cc0000; }

/* ============ DETAIL MODAL ============ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.detail-item { }
.detail-item-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-item-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

.detail-notes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-style: italic;
}

.detail-actions { display: flex; gap: 10px; }

.btn-edit-detail {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange);
  background: var(--orange-glow);
  color: var(--orange);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-detail:hover { background: var(--orange); color: white; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  z-index: 999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--converted); }
.toast.error   { border-left: 4px solid var(--hot); }
.toast.info    { border-left: 4px solid var(--orange); }

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

.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.empty-state-sub  { font-size: 13px; margin-top: 6px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sv-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .search-box input { width: 120px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-tabs { gap: 4px; }
  .filter-tab { padding: 5px 10px; font-size: 12px; }
}