/* ─────────────────────────────────────────────────────────────
   ResumeAI – Main Stylesheet
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #0f1117;
  --bg-2: #161b27;
  --bg-3: #1e2535;
  --border: #2a3146;
  --accent: #6366f1;
  --accent-hover: #4f52d9;
  --accent-light: rgba(99,102,241,0.15);
  --green: #22c55e;
  --green-light: rgba(34,197,94,0.15);
  --yellow: #eab308;
  --yellow-light: rgba(234,179,8,0.15);
  --red: #ef4444;
  --red-light: rgba(239,68,68,0.15);
  --text: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --sidebar-w: 240px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: 'Inter', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── LAYOUT ── */
body { display: flex; min-height: 100vh; }

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.logo-title { font-weight: 700; font-size: 16px; }
.logo-sub { font-size: 11px; color: var(--text-2); }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  transition: all .18s;
  text-align: left;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-item i { width: 18px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.stats-card { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-2);
}
.stat-row span:last-child {
  background: var(--bg-3);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  color: var(--text);
}

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

.tab-panel { display: none; flex: 1; flex-direction: column; padding: 32px; }
.tab-panel.active { display: flex; }

/* ── PANEL HEADER ── */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.panel-header h1 { font-size: 22px; font-weight: 700; }
.subtext { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: 8px;
  cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600;
  transition: background .18s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 500;
  transition: all .18s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red); border-radius: 8px;
  cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600;
  transition: all .18s;
  white-space: nowrap;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-danger-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 10px;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 500;
  transition: all .18s;
  white-space: nowrap;
}
.btn-danger-sm:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer;
  transition: all .18s;
  font-size: 14px;
}
.btn-icon:hover { background: var(--border); color: var(--text); }

.btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 500;
  transition: all .18s;
}
.btn-sm:hover { background: var(--border); color: var(--text); }

/* ── SEARCH & FILTER ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
}
.search-bar i { color: var(--text-3); font-size: 13px; }
.search-bar input {
  background: transparent;
  border: none; outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  width: 180px;
}

.filter-group { display: flex; gap: 8px; }
select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}
select:focus { border-color: var(--accent); }

/* ── TABLE ── */
.table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

thead tr {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: left;
  user-select: none;
}
th.col-check { width: 40px; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-3); }

td {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

.empty-row td { padding: 0; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-3);
}
.empty-state i { font-size: 40px; }
.empty-state p { font-size: 14px; text-align: center; }

/* ── SCORE BADGES ── */
.score-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
/* Score colour scheme:
   Very High = LIGHT green, High = green, Medium = yellow, Low + Very Low = red */
.score-very-high { background: rgba(34,197,94,0.18);  color: #4ade80; }   /* light green */
.score-high      { background: var(--green-light);    color: var(--green); }
.score-medium    { background: var(--yellow-light);   color: var(--yellow); }
.score-low       { background: var(--red-light);      color: var(--red); }
.score-very-low  { background: var(--red-light);      color: var(--red); }
.score-na        { background: var(--bg-3);           color: var(--text-3); }

/* ── SKILLS CHIPS ── */
.skill-chip {
  display: inline-block;
  padding: 2px 8px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent);
  font-size: 11px; font-weight: 500;
  margin: 1px 2px;
}

/* ── TABLE FOOTER ── */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 0;
  font-size: 12px;
  color: var(--text-3);
}
.pagination { display: flex; gap: 4px; }
.page-btn {
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-3); color: var(--text-2);
  cursor: pointer; font-size: 12px; font-family: var(--font);
  transition: all .15s;
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── ACTION BUTTONS IN TABLE ── */
.actions { display: flex; gap: 6px; }
.action-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: none; cursor: pointer;
  font-size: 12px; transition: all .15s;
}
.action-view { background: var(--accent-light); color: var(--accent); }
.action-view:hover { background: var(--accent); color: #fff; }
.action-edit { background: var(--bg-3); color: var(--text-2); }
.action-edit:hover { background: var(--border); color: var(--text); }
.action-score { background: var(--yellow-light); color: var(--yellow); }
.action-score:hover { background: var(--yellow); color: #000; }
.action-delete { background: var(--red-light); color: var(--red); }
.action-delete:hover { background: var(--red); color: #fff; }
.action-pass { background: var(--green-light); color: var(--green); }
.action-pass:hover { background: var(--green); color: #fff; }
.action-fail { background: var(--red-light); color: var(--red); }
.action-fail:hover { background: var(--red); color: #fff; }

/* ── REVIEW STATUS BADGE ── */
.review-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-pass    { background: var(--green-light);  color: var(--green);  }
.status-fail    { background: var(--red-light);    color: var(--red);    }
.status-pending { background: var(--bg-3);         color: var(--text-3); }

/* ── BULK ACTION BAR ── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
  flex-wrap: wrap;
  /* hidden by default */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-bottom: 0;
  padding: 0 16px;
  border-width: 0;
  transition: max-height .25s ease, opacity .2s ease, margin-bottom .25s ease, padding .2s ease, border-width .1s ease;
}
.bulk-bar.visible {
  max-height: 80px;
  opacity: 1;
  margin-bottom: 12px;
  padding: 10px 16px;
  border-width: 1px;
}
.bulk-bar-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  margin-right: 4px;
}
.bulk-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: none; border-radius: 7px;
  cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.bulk-btn-pass   { background: var(--green-light); color: var(--green); }
.bulk-btn-pass:hover   { background: var(--green);   color: #fff; }
.bulk-btn-fail   { background: var(--red-light);   color: var(--red); }
.bulk-btn-fail:hover   { background: var(--red);     color: #fff; }
.bulk-btn-delete { background: rgba(239,68,68,0.08); color: var(--red); border: 1px solid var(--red); }
.bulk-btn-delete:hover { background: var(--red); color: #fff; }
.bulk-btn-clear  { background: var(--bg-2); color: var(--text-3); border: 1px solid var(--border); }
.bulk-btn-clear:hover  { background: var(--border); color: var(--text); }
.bulk-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── IMPORT PAGE ── */
.import-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
}
.import-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.import-card h2 {
  font-size: 17px; font-weight: 700;
  margin-bottom: 8px; display: flex; align-items: center; gap: 10px;
}
.import-card p { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }

.step-badge {
  display: inline-flex; align-items: center;
  padding: 3px 12px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent);
  font-size: 11px; font-weight: 700;
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em;
}
.step-badge.success { background: var(--green-light); color: var(--green); }

/* ── FOLDER MANAGER ── */
.folder-manager {
  margin-bottom: 14px;
}
.folder-manager label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  display: block;
  margin-bottom: 6px;
}
.folder-manager select {
  flex: 1;
  min-width: 0;
}
.folder-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── FORM GROUPS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.form-group small { font-size: 11px; color: var(--text-3); }
.form-group small a { color: var(--accent); text-decoration: none; }
.form-group small a:hover { text-decoration: underline; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  outline: none;
  transition: border-color .18s;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* Select inside form-group — ensure full width */
.form-group select {
  width: 100%;
}

/* Select with optgroups — improved styling */
select optgroup {
  color: var(--text-3);
  font-weight: 600;
  font-size: 12px;
}
select option {
  color: var(--text);
  font-weight: 400;
  padding: 4px 8px;
}

.badge-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-3); color: var(--text-3);
  font-size: 10px; font-weight: 700; cursor: help;
  border: 1px solid var(--border);
}

/* ── FILE LIST ── */
.file-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
#file-count-label { font-size: 12px; color: var(--text-3); margin-left: auto; }
.file-list {
  max-height: 280px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: border-color .15s;
}
.file-item:hover { border-color: var(--accent); }
.file-item.selected { border-color: var(--accent); background: var(--accent-light); }
.file-item input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }
.file-icon { font-size: 18px; color: var(--text-3); }
.file-icon.pdf { color: #ef4444; }
.file-icon.doc { color: #3b82f6; }
.file-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-status { font-size: 11px; color: var(--text-3); }
.file-status.done { color: var(--green); }
.file-status.error { color: var(--red); }

/* ── PROGRESS ── */
.progress-bar-track {
  width: 100%; height: 8px;
  background: var(--bg-3); border-radius: 20px;
  overflow: hidden; margin: 12px 0;
}
.progress-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 20px;
  transition: width .4s ease;
}
.progress-log {
  max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 12px;
}
.log-line {
  font-size: 12px; color: var(--text-2);
  padding: 4px 8px; border-radius: 4px;
  background: var(--bg-3);
}
.log-line.success { color: var(--green); }
.log-line.error { color: var(--red); }

/* ── SETTINGS ── */
.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 900px;
}
.settings-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.settings-card.full-width { grid-column: 1 / -1; }
.settings-card h3 {
  font-size: 15px; font-weight: 700;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}

/* Settings card — AI card spans full width since it has more fields */
.settings-card.card-wide {
  grid-column: 1 / -1;
}

.range-input { width: 100%; accent-color: var(--accent); cursor: pointer; }

/* ── CONCURRENCY BADGE ── */
.concurrency-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 22px;
  padding: 0 7px;
  background: var(--accent); color: #fff;
  border-radius: 20px; font-size: 12px; font-weight: 700;
  margin-left: 8px; vertical-align: middle;
  transition: background .2s;
}

/* ── CONCURRENCY INFO GRID (settings card) ── */
.concurrency-info-grid {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 12px;
}
.concurrency-info-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-2);
  padding: 6px 10px;
  background: var(--bg-3); border-radius: 6px;
}
.conc-val {
  font-weight: 700; color: var(--accent);
  min-width: 36px; flex-shrink: 0;
}
.danger-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  gap: 16px;
}
.danger-row:last-child { border-bottom: none; }
.danger-row strong { font-size: 14px; }
.danger-row p { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.modal.modal-xl { max-width: 860px; }
.modal.modal-sm { max-width: 420px; }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; color: var(--text-2);
  transition: all .15s;
}
.modal-close:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

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

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.col-span-2 { grid-column: 1 / -1; }

/* ── DETAIL MODAL ── */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 20px;
}
.detail-item label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 4px; }
.detail-item span { font-size: 14px; color: var(--text); }
.detail-resume-text {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; font-size: 12px; color: var(--text-2);
  max-height: 220px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}

/* ── TOAST ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow);
  font-size: 13px; min-width: 260px;
  animation: slideIn .25s ease;
}
.toast.toast-success { border-color: var(--green); }
.toast.toast-error { border-color: var(--red); }
.toast.toast-info { border-color: var(--accent); }
.toast i { font-size: 16px; }
.toast.toast-success i { color: var(--green); }
.toast.toast-error i { color: var(--red); }
.toast.toast-info i { color: var(--accent); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── MISC HELPERS ── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-success { color: var(--green); }
.text-warning { color: var(--yellow); font-size: 12px; }

/* ── HELP BANNER ── */
.help-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 18px;
}
.help-banner i { color: var(--accent); flex-shrink: 0; }
.btn-link {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-family: var(--font);
  font-size: 13px; font-weight: 600;
  text-decoration: underline; padding: 0;
}
.btn-link:hover { color: #a5b4fc; }

/* ── GUIDE MODAL ── */
.modal.modal-guide { max-width: 760px; }
.guide-body { padding: 0 !important; }

.guide-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--bg-3);
}
.guide-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border: none; border-bottom: 3px solid transparent;
  background: transparent; color: var(--text-2);
  cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600;
  transition: all .18s; margin-bottom: -1px;
}
.guide-tab:hover { color: var(--text); }
.guide-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.guide-panel { display: none; padding: 24px; overflow-y: auto; max-height: calc(80vh - 160px); }
.guide-panel.active { display: block; }

.guide-intro {
  background: var(--bg-3);
  border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 0 8px 8px 0;
  margin-bottom: 24px; font-size: 13px; color: var(--text-2);
}
.guide-intro strong { color: var(--text); }

.guide-steps { display: flex; flex-direction: column; gap: 20px; }

.guide-step {
  display: flex; gap: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.guide-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.guide-step-body { flex: 1; min-width: 0; }
.guide-step-body h4 {
  font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text);
}
.guide-step-body p { font-size: 13px; color: var(--text-2); margin-bottom: 10px; line-height: 1.7; }
.guide-step-body p:last-child { margin-bottom: 0; }
.guide-step-body a { color: var(--accent); }

.guide-img-placeholder {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2); border: 1px dashed var(--border);
  border-radius: 8px; font-size: 12px; color: var(--text-3);
  margin-top: 10px;
}

.guide-tip {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  background: var(--accent-light); border-radius: 8px;
  font-size: 12px; color: var(--text-2);
  margin-top: 10px; line-height: 1.6;
}
.guide-tip i { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.guide-tip.success { background: var(--green-light); }
.guide-tip.success i { color: var(--green); }
.guide-tip.warning { background: var(--yellow-light); }
.guide-tip.warning i { color: var(--yellow); }
.guide-tip code {
  background: rgba(255,255,255,0.1); padding: 1px 5px; border-radius: 4px;
  font-family: monospace; font-size: 11px;
}

.guide-tag-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.guide-tag {
  padding: 4px 10px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text-2);
}
.guide-tag.highlight { background: var(--accent); color: #fff; border-color: var(--accent); }
.guide-arrow { color: var(--text-3); font-size: 11px; }

.guide-url-demo {
  padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; font-family: monospace; color: var(--text-2);
  word-break: break-all; margin: 10px 0;
}
.guide-url-highlight {
  background: var(--accent); color: #fff;
  padding: 1px 4px; border-radius: 4px;
}

/* ── MODEL TABLE (used in guide and potentially elsewhere) ── */
.model-table {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-top: 10px; font-size: 12px;
}
.model-row {
  display: grid; grid-template-columns: 1fr 2fr 1.2fr 2fr;
  padding: 9px 12px; gap: 8px; align-items: center;
  border-bottom: 1px solid var(--border);
}
.model-row:last-child { border-bottom: none; }
.model-row.header {
  background: var(--bg-2); color: var(--text-3);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em;
}
.model-row.recommended { background: rgba(99,102,241,0.08); }
.model-row code {
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px;
  font-size: 11px; font-family: monospace;
}

/* Model row section headers (spanning full width) */
.model-row td[colspan] {
  grid-column: 1 / -1;
}
.model-row:has(td[colspan]) {
  display: block;
}

.badge-green { background: var(--green-light); color: var(--green); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }

/* ── GUIDE LIST ── */
.guide-list {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px;
}
.guide-list li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text-2);
}
.guide-list li i { margin-top: 2px; flex-shrink: 0; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .settings-layout { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .header-actions { gap: 6px; }
  .model-row { grid-template-columns: 1fr 1fr; }
  .guide-tag-row { gap: 4px; }
  .guide-step { flex-direction: column; gap: 12px; }
}
