/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Colors */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --blue-50: #eff6ff;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --purple-50: #f5f3ff;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;

  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --red-50: #fef2f2;
  --red-500: #ef4444;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-bg: var(--gray-900);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

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

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--blue-500), var(--purple-500));
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: -.3px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-400);
  transition: all .2s ease;
  cursor: pointer;
  position: relative;
}

.nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-link:hover {
  background: rgba(255,255,255,.06);
  color: var(--gray-200);
}

.nav-link.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--blue-500);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--blue-600);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--green-500);
}

.status-pill.small { font-size: .75rem; }

.status-dot {
  width: 8px; height: 8px;
  background: var(--green-500);
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ========================================
   MOBILE HEADER
   ======================================== */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
  padding: 0 16px;
  z-index: 150;
  gap: 12px;
}

.menu-toggle {
  background: none; border: none;
  font-size: 1.2rem; color: var(--gray-700);
  cursor: pointer;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover { background: var(--gray-100); }

.mobile-title {
  flex: 1;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 190;
}

.overlay.active { display: block; }

/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
  margin-left: var(--sidebar-w);
  padding: 32px 36px 48px;
  min-height: 100vh;
}

/* ========================================
   PAGE SECTIONS
   ======================================== */
.page { display: none; animation: pageFadeIn .35s ease; }
.page.active { display: block; }

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

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

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.4px;
}

.page-subtitle {
  font-size: .88rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 28px 0 16px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
}

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.btn-primary:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* ========================================
   MINI STATS (Lead Page top row)
   ======================================== */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.mini-stat {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-xs);
}

.mini-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.3px;
}

.mini-stat-label {
  font-size: .78rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ========================================
   SEARCH BAR
   ======================================== */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: .9rem;
}

.search-bar input {
  width: 100%;
  padding: 11px 16px 11px 42px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .9rem;
  color: var(--gray-800);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-bar input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.search-bar input::placeholder { color: var(--gray-400); }

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}

.card-head h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head h3 i {
  color: var(--gray-500);
}

/* ========================================
   TABLE
   ======================================== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td {
  background: var(--blue-50);
}

.row-highlight-next td {
  background: #f0f7ff !important;
}

/* Lead-specific cells */
.cell-name {
  font-weight: 600;
  color: var(--gray-900);
}

.cell-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .82rem;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.cell-rep {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--blue-600);
}

.cell-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.cell-status.synced {
  background: var(--green-50);
  color: var(--green-600);
}

.cell-status.sent {
  background: var(--blue-50);
  color: var(--blue-600);
}

.cell-status.skipped {
  background: var(--gray-100);
  color: var(--gray-500);
}

.cell-msg {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-500);
  font-style: italic;
}

.cell-time {
  font-size: .8rem;
  color: var(--gray-400);
  white-space: nowrap;
}

/* Brand Badges */
.cell-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.cell-brand.hyundai {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.2);
}

.cell-brand.vinfast {
  background: #f0fdf4;
  color: #0d9488;
  border: 1px solid rgba(13, 148, 136, 0.2);
}

.cell-brand.truck {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.2);
}

.cell-brand.mitsubishi {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid rgba(190, 24, 93, 0.2);
}

/* Brand Filter Bar */
.brand-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.brand-chip {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s ease;
  box-shadow: var(--shadow-xs);
}

.brand-chip:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.brand-chip.active {
  background: var(--gray-900);
  color: #fff;
  border-color: var(--gray-900);
}

.brand-chip.hyundai.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.brand-chip.vinfast.active {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}

.brand-chip.truck.active {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}

.brand-chip.mitsubishi.active,
.rep-brand-chip.mitsubishi.active,
.crm-brand-chip.mitsubishi.active {
  background: #be185d;
  border-color: #be185d;
  color: #fff;
}

.crm-brand-chip {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s ease;
  box-shadow: var(--shadow-xs);
}

.crm-brand-chip:hover {
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.crm-brand-chip.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: var(--white);
}

.crm-brand-chip.hyundai.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.crm-brand-chip.vinfast.active { background: #0d9488; border-color: #0d9488; color: #fff; }
.crm-brand-chip.truck.active { background: #b45309; border-color: #b45309; color: #fff; }

.chip-count {
  background: rgba(0,0,0,0.08);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 700;
}

.brand-chip.active .chip-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Empty State */
.table-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--gray-400);
}

.table-empty i {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
  color: var(--gray-300);
}

.table-empty p {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.table-empty span {
  font-size: .85rem;
}

/* ========================================
   CONFIG CARDS (Settings page)
   ======================================== */
.config-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.config-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.config-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.config-icon.blue { background: var(--blue-50); color: var(--blue-600); }
.config-icon.green { background: var(--green-50); color: var(--green-600); }

.config-card h4 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.config-card p {
  font-size: .82rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ========================================
   REPS GRID (Settings page)
   ======================================== */
.reps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.rep-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}

.rep-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.rep-card.next {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

/* Rep Brand Filter Chips */
.rep-brand-chip {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 6px 14px;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s ease;
  box-shadow: var(--shadow-xs);
}

.rep-brand-chip:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.rep-brand-chip.active {
  background: var(--gray-900);
  color: #fff;
  border-color: var(--gray-900);
}

.rep-brand-chip.hyundai.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.rep-brand-chip.vinfast.active { background: #0d9488; border-color: #0d9488; color: #fff; }
.rep-brand-chip.truck.active { background: #b45309; border-color: #b45309; color: #fff; }

/* Rep Actions */
.rep-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-rep-edit {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.btn-rep-edit:hover {
  background: var(--blue-50);
  color: var(--blue-600);
  border-color: var(--blue-200);
}

.rep-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rep-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue-600);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: .95rem;
  flex-shrink: 0;
}

.rep-info h4 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--gray-900);
}

.rep-info p {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.rep-info .rep-leads {
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue-600);
  margin-top: 2px;
}

.next-label {
  position: absolute;
  top: -9px; right: 14px;
  background: var(--blue-600);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Toggle */
.toggle {
  width: 44px; height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background .3s;
  flex-shrink: 0;
}

.toggle.on { background: var(--green-500); }

.toggle-knob {
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.toggle.on .toggle-knob { transform: translateX(20px); }

/* ========================================
   STAT CARDS (Reports page)
   ======================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  font-size: 1.2rem;
}

.stat-card.purple .stat-card-icon { background: var(--purple-50); color: var(--purple-600); }
.stat-card.green .stat-card-icon { background: var(--green-50); color: var(--green-600); }
.stat-card.blue .stat-card-icon { background: var(--blue-50); color: var(--blue-600); }
.stat-card.amber .stat-card-icon { background: var(--amber-50); color: var(--amber-600); }

.stat-card-body {
  display: flex;
  flex-direction: column;
}

.stat-card-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.3px;
}

.stat-card-label {
  font-size: .78rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 1px;
}

/* ========================================
   CUSTOM POPUP MODAL DIALOG
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

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

.modal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--gray-200);
}

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

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--gray-800);
  background: var(--gray-200);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ========================================
   LOG CONSOLE
   ======================================== */
.log-console {
  background: var(--gray-900);
  color: var(--gray-300);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .8rem;
  padding: 16px 20px;
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.6;
}

.log-line { margin-bottom: 2px; }
.log-line.INFO { color: #60a5fa; }
.log-line.SUCCESS { color: #34d399; }
.log-line.WARN { color: #fbbf24; }

.log-empty {
  color: var(--gray-500);
  padding: 40px 0;
  text-align: center;
  font-family: var(--font);
  font-size: .85rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }

  .mobile-header { display: flex; }
  .overlay.active { display: block; }

  .main {
    margin-left: 0;
    padding: 72px 16px 36px;
  }

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

  .page-title { font-size: 1.3rem; }
}

@media (max-width: 500px) {
  .mini-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-row { grid-template-columns: 1fr; }
  .config-row { grid-template-columns: 1fr; }
  .reps-grid { grid-template-columns: 1fr; }
}
