/* ============================================
   SIMULADOR DE TROCA iPHONE — Design System
   Dark Professional Theme
   ============================================ */

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

:root {
  /* Core palette */
  --bg:          #0b1929;
  --surface:     #0f2236;
  --surface-2:   #152d45;
  --surface-3:   #1a3553;
  --border:      rgba(255,255,255,0.07);
  --border-med:  rgba(255,255,255,0.12);

  /* Accent — teal */
  --accent:       #00c9a0;
  --accent-hover: #00e0b4;
  --accent-dim:   rgba(0,201,160,0.15);
  --accent-glow:  0 0 20px rgba(0,201,160,0.25);

  /* Semantic */
  --blue:    #3b82f6;
  --blue-dim: rgba(59,130,246,0.15);
  --green:   #00c9a0;
  --red:     #ef4444;
  --red-dim: rgba(239,68,68,0.15);
  --orange:  #f59e0b;
  --orange-dim: rgba(245,158,11,0.15);

  /* Text */
  --text:       #e2f0fb;
  --text-muted: rgba(226,240,251,0.55);
  --text-dim:   rgba(226,240,251,0.30);
  --white:      #ffffff;

  /* Misc */
  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.5);
  --shadow-accent: 0 4px 24px rgba(0,201,160,0.20);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--accent);
  color: #0b1929;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0,201,160,0.35);
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-med);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--accent); }

.btn-success   { background: var(--green); color: #0b1929; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-med);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }
.btn-full { width: 100%; }

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}
.card-body { padding: 22px; }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input[readonly] {
  background: var(--surface);
  color: var(--text-muted);
  cursor: default;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300c9a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-select option { background: var(--surface-2); color: var(--text); }

/* ============================================
   CHOICE CARDS
   ============================================ */
.choice-grid { display: grid; gap: 10px; }
.choice-grid-2 { grid-template-columns: 1fr 1fr; }
.choice-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.choice-grid-4 { grid-template-columns: 1fr 1fr; }

.choice-card {
  border: 1.5px solid var(--border-med);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  background: var(--surface-2);
  user-select: none;
}
.choice-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(0,201,160,0.1);
}
.choice-card .choice-icon  { font-size: 26px; margin-bottom: 6px; display: block; }
.choice-card .choice-label { font-size: 12px; font-weight: 600; color: var(--text); }
.choice-card .choice-sublabel { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 600;
}
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-green  { background: var(--accent-dim); color: var(--accent); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-gray   { background: var(--surface-3);  color: var(--text-muted); }

/* ============================================
   STEPS PROGRESS BAR (Simulator)
   ============================================ */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.step-item { display: flex; align-items: center; gap: 0; }
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-med);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}
.step-circle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 12px rgba(0,201,160,0.3);
}
.step-circle.done {
  border-color: var(--accent);
  background: var(--accent);
  color: #0b1929;
}
.step-line {
  width: 48px;
  height: 2px;
  background: var(--border-med);
  transition: background 0.3s;
}
.step-line.done { background: var(--accent); }

/* ============================================
   RESULT CARD
   ============================================ */
.result-value-range {
  text-align: center;
  padding: 28px 24px;
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(0,201,160,0.3);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.result-value-range::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(0,201,160,0.08) 0%, transparent 70%);
}
.result-label {
  font-size: 11px;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  position: relative;
}
.result-range {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 8px 0 4px;
  color: var(--accent);
  position: relative;
}
.result-disclaimer { font-size: 11px; opacity: 0.6; position: relative; }

/* ============================================
   MODEL PICKER
   ============================================ */
.model-series-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.series-tab {
  padding: 7px 14px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border-med);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: all 0.15s;
}
.series-tab:hover  { border-color: var(--accent); color: var(--accent); }
.series-tab.active { background: var(--accent); border-color: var(--accent); color: #0b1929; }

.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.model-card {
  border: 1.5px solid var(--border-med);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface-2);
  text-align: center;
}
.model-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.model-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(0,201,160,0.1);
}
.model-card .model-name { font-size: 13px; font-weight: 700; color: var(--text); }
.model-card .model-year { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.storage-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.storage-btn {
  padding: 9px 16px;
  border: 1.5px solid var(--border-med);
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: all 0.15s;
}
.storage-btn:hover   { border-color: var(--accent); color: var(--accent); }
.storage-btn.selected { background: var(--accent); border-color: var(--accent); color: #0b1929; }

/* ============================================
   TABLES
   ============================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

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

.sidebar-logo {
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo h2 span.logo-dot {
  width: 30px; height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
}
.sidebar-logo h2 span.logo-dot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sidebar-logo p { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

.sidebar-nav { padding: 12px 10px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0,201,160,0.2);
  font-weight: 600;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 10px;
}

.admin-content {
  margin-left: 230px;
  min-height: 100vh;
  background: var(--bg);
}

/* ============================================
   TOPBAR
   ============================================ */
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-topbar h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: rgba(0,201,160,0.3);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
  background: var(--surface-2);
}
.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Accent stat card */
.stat-card.accent {
  background: linear-gradient(135deg, rgba(0,201,160,0.15) 0%, rgba(0,201,160,0.05) 100%);
  border-color: rgba(0,201,160,0.3);
}
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.accent::before { opacity: 1; }

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

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-med);
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
}
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

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

.modal-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }

.modal-body { padding: 22px; }
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================
   TOAST
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  max-width: 300px;
  border: 1px solid rgba(255,255,255,0.1);
}
.toast-success { background: #065f46; border-color: var(--accent); color: var(--accent); }
.toast-error   { background: #7f1d1d; border-color: var(--red); color: #fca5a5; }
.toast-info    { background: #1e3a5f; border-color: var(--blue); color: #93c5fd; }

@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 12px;
  border: 1px solid var(--border-med);
  transition: all 0.2s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  left: 2px; top: 2px;
  transition: all 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent-dim); border-color: var(--accent); }
.toggle input:checked + .toggle-slider:before {
  background: var(--accent);
  transform: translateX(18px);
}

/* ============================================
   ADMIN SECTION CONTENT
   ============================================ */
.admin-section { padding: 24px; }

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filters-row .form-input,
.filters-row .form-select {
  padding: 8px 12px;
  font-size: 12px;
  max-width: 200px;
}

/* ============================================
   GOAL ROWS (Commission brackets)
   ============================================ */
.goals-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.goal-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}
.goal-row:last-child { margin-bottom: 0; }

/* ============================================
   DASHBOARD
   ============================================ */
.dash-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}

/* ============================================
   SIMULATOR — Public pages
   ============================================ */
.sim-container {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.sim-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sim-header-logo { color: var(--text); font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sim-header-logo .logo-pill {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
}
.sim-header-logo .logo-pill img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sim-header-sub  { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.sim-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px 80px;
}

.sim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  padding: 28px 26px;
}

.sim-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.sim-step-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 20px;
}

.step-actions { display: flex; gap: 10px; margin-top: 24px; }

.icloud-warning {
  background: rgba(245,158,11,0.1);
  border: 1.5px solid rgba(245,158,11,0.4);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  margin-top: 18px;
}
.icloud-warning h4 { color: var(--orange); font-size: 15px; margin-bottom: 6px; }
.icloud-warning p  { color: rgba(245,158,11,0.8); font-size: 12px; line-height: 1.5; }

/* Desired iPhone box */
.desired-box {
  background: var(--surface-2);
  border: 1px solid rgba(0,201,160,0.25);
  border-radius: 14px;
  padding: 18px;
  margin-top: 24px;
}
.desired-box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   RESULT SUMMARY LIST
   ============================================ */
.result-summary-list { list-style: none; }
.result-summary-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.result-summary-list li:last-child { border-bottom: none; }
.result-summary-list li strong { color: var(--text); }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,201,160,0.07) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.login-screen::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border-med);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-logo { margin-bottom: 16px; }
.login-logo img { height: 44px; width: auto; display: inline-block; }
.login-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }

.login-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.login-type-tab {
  padding: 10px;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  transition: all .15s;
  font-family: inherit;
}
.login-type-tab:hover   { border-color: var(--accent); color: var(--accent); }
.login-type-tab.active  { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ============================================
   ROLE BADGE
   ============================================ */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}

/* ============================================
   MENU BUTTON (mobile)
   ============================================ */
.menu-btn {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  padding: 6px 10px;
  line-height: 1;
  transition: background 0.15s;
  z-index: 110;
  position: relative;
}
.menu-btn:hover { background: var(--surface-3); }
@media(max-width:768px) { .menu-btn { display: block; } }

/* Botão ✕ dentro do sidebar — só aparece no mobile */
.sidebar-close-btn {
  display: none;
  background: var(--surface-3);
  border: 1px solid var(--border-med);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.sidebar-close-btn:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 768px) {
  .sidebar-close-btn { display: block; }
}

/* ============================================
   SIDEBAR OVERLAY (mobile backdrop)
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
}
.sidebar-overlay.active { display: block; }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-med); }

/* ============================================
   RESPONSIVE — Tablet (≤ 768px)
   ============================================ */
@media (max-width: 768px) {

  /* ── Sidebar ── */
  .sidebar { transform: translateX(-100%); transition: transform 0.28s ease; box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,0.5); }
  .admin-content { margin-left: 0; }

  /* ── Topbar ── */
  .admin-topbar { padding: 0 14px; }
  .admin-topbar h1 { font-size: 14px; }
  #topbar-date { display: none; }       /* oculta data no mobile — sem espaço */

  /* ── Admin section ── */
  .admin-section { padding: 14px; }

  /* ── Section toolbar: empilha verticalmente ── */
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .section-toolbar > .btn,
  .section-toolbar > button { width: 100%; justify-content: center; }

  /* ── Filter row: empilha e ocupa 100% ── */
  .filters-row { flex-direction: column; width: 100%; }
  .filters-row .form-input,
  .filters-row .form-select { max-width: 100% !important; width: 100%; }

  /* ── Stat cards: 2 × 2 ── */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* ── Cards de resumo de comissões: 2 × 2 ── */
  #comm-summary-cards { grid-template-columns: 1fr 1fr !important; }

  /* ── Grids de 2 colunas → 1 coluna (settings, fees, etc.) ── */
  #section-settings > div,
  #section-fees > div { grid-template-columns: 1fr !important; }

  /* ── Dashboard ── */
  .dash-tables-grid { grid-template-columns: 1fr; }

  /* ── Negociação ── */
  #section-negotiation > div:first-child { grid-template-columns: 1fr !important; }

  /* ── Simulador (choice grids) ── */
  .choice-grid-3 { grid-template-columns: 1fr 1fr; }
  .model-grid    { grid-template-columns: 1fr 1fr; }

  /* ── Tables: scroll horizontal com toque ── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .table-wrap table { min-width: 520px; }

  /* ── Modal: bottom-sheet no mobile ── */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }

  /* ── Stat value não overflow ── */
  .stat-card .stat-value {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ============================================
   RESPONSIVE — Mobile pequeno (≤ 600px)
   Oculta colunas menos críticas nas tabelas
   ============================================ */
@media (max-width: 600px) {

  /* COMISSÕES — oculta "Data" (col 2) e "Bônus Negociação" (col 6) */
  #section-commissions table thead th:nth-child(2),
  #section-commissions table tbody td:nth-child(2),
  #section-commissions table thead th:nth-child(6),
  #section-commissions table tbody td:nth-child(6) { display: none; }

  /* VENDAS — oculta "Faturamento" (col 4), "Vendedor" (col 6) e "Data" (col 8) */
  #section-sales table thead th:nth-child(4),
  #section-sales table tbody td:nth-child(4),
  #section-sales table thead th:nth-child(6),
  #section-sales table tbody td:nth-child(6),
  #section-sales table thead th:nth-child(8),
  #section-sales table tbody td:nth-child(8) { display: none; }

  /* LEADS — oculta "Valor Estimado" (col 4) e "Data" (col 5) */
  #section-leads table thead th:nth-child(4),
  #section-leads table tbody td:nth-child(4),
  #section-leads table thead th:nth-child(5),
  #section-leads table tbody td:nth-child(5) { display: none; }

  /* ESTOQUE — oculta "Entrada" (col 6) */
  #section-inventory table thead th:nth-child(6),
  #section-inventory table tbody td:nth-child(6) { display: none; }

  /* Tabelas menores no mobile pequeno */
  .table-wrap table { min-width: 360px; font-size: 12px; }
  thead th { padding: 9px 10px; }
  tbody td  { padding: 10px 10px; }
}

/* ============================================
   RESPONSIVE — Mobile muito pequeno (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
  .choice-grid-2 { grid-template-columns: 1fr 1fr; }
  .choice-grid-4 { grid-template-columns: 1fr 1fr; }
  .model-grid    { grid-template-columns: 1fr 1fr; }
  .result-range  { font-size: 26px; }
  .sim-card      { padding: 22px 18px; }
  .admin-section { padding: 12px; }
  .card-header   { padding: 14px 16px; }
  .card-body     { padding: 16px; }

  /* Stat cards ainda menores */
  .stat-card { padding: 14px 12px; }
  .stat-card .stat-icon  { width: 32px; height: 32px; font-size: 15px; margin-bottom: 10px; }
  .stat-card .stat-value { font-size: 16px; }
  .stat-card .stat-label { font-size: 10px; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-700 { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.divider    { height: 1px; background: var(--border); margin: 16px 0; }
.scroll-thin::-webkit-scrollbar { width: 4px; height: 4px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
.page-section { padding: 24px; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}

/* Highlight text accent */
.text-accent { color: var(--accent); }
.text-red    { color: var(--red); }
.text-green  { color: var(--accent); }
.text-orange { color: var(--orange); }
.text-blue   { color: var(--blue); }

/* Info box */
.info-box {
  background: var(--blue-dim);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: #93c5fd;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Trade-in section inside modal */
.tradein-section {
  background: var(--surface-2);
  border: 1px solid rgba(0,201,160,0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 14px;
}
.tradein-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
