/* ================================================================== *
 *  HireVox AI — White/Blue Professional Theme                         *
 * ================================================================== */

/* ── Reset & Design Tokens ───────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-section: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --indigo-600: #4f46e5;
  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --red-50: #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 150ms cubic-bezier(.4,0,.2,1);
}

/* ── Base ────────────────────────────────────────────────────────── */
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg-alt);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Layout Shell ────────────────────────────────────────────────── */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-600), var(--indigo-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
  flex-shrink: 0;
}
.logo h1 {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text-primary); margin: 0; line-height: 1.2;
}
.logo-tagline {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 1px;
}
.navbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── User Menu ───────────────────────────────────────────────────── */
.user-menu { position: relative; }
.user-menu-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.user-menu-trigger:hover { background: var(--bg-alt); border-color: var(--blue-500); }
.user-menu-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200; padding: 4px 0;
}
.user-menu-dropdown.open { display: block; }
.user-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px; background: none; border: none;
  color: var(--text-secondary); font-size: 0.82rem; cursor: pointer;
  white-space: nowrap; text-align: left; transition: background 0.15s;
}
.user-menu-item:hover { background: var(--bg-alt); color: var(--text-primary); }
.user-menu-item-danger { color: var(--red-500); }
.user-menu-item-danger:hover { background: var(--red-50); color: var(--red-600); }
.user-menu-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  font-family: var(--font);
}
.btn:hover { background: var(--bg-alt); border-color: var(--blue-500); color: var(--text-primary); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--indigo-600));
  border-color: var(--blue-600); color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-500), #6366f1);
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-outline {
  background: transparent; border: 1px solid var(--blue-500);
  color: var(--blue-600);
}
.btn-outline:hover {
  background: var(--blue-50); border-color: var(--blue-600);
}
.btn-ghost {
  background: none; border: none; color: var(--text-muted); padding: 4px;
}
.btn-ghost:hover { color: var(--red-500); }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 16px;
}

/* ── Stats Row ───────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px;
}
.stat-value {
  font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text-primary);
}
.stat-value.blue { color: var(--blue-600); }
.stat-value.green { color: var(--green-600); }
.stat-value.amber { color: var(--amber-600); }
.stat-value.red { color: var(--red-500); }

/* ── Section helpers ─────────────────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px; letter-spacing: -0.2px;
}
.section-subtitle {
  font-size: 0.85rem; color: var(--text-secondary); margin-top: -12px;
  margin-bottom: 16px;
}

/* ── Forms ────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
}
input, select, textarea {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}
select {
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
textarea { resize: vertical; min-height: 80px; }

/* ── Table ────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  padding: 12px 16px; text-align: left; font-weight: 600;
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted); background: var(--bg-alt);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary); white-space: normal;
  word-break: break-word; line-height: 1.5;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--blue-50); }
.badge {
  display: inline-flex; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-green { background: var(--green-50); color: var(--green-600); }
.badge-red { background: var(--red-50); color: var(--red-500); }
.badge-amber { background: var(--amber-50); color: var(--amber-600); }
.badge-blue { background: var(--blue-50); color: var(--blue-600); }
.empty-state {
  padding: 48px 20px; text-align: center;
  color: var(--text-muted); font-size: 0.88rem;
}

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 100; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px; max-width: 92vw; max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed; top: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; color: #fff;
  animation: slideIn 0.25s ease;
  box-shadow: var(--shadow-md);
}
.toast-success { background: var(--green-600); }
.toast-error { background: var(--red-500); }
.toast-info { background: var(--blue-600); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 6px 22px;
  font-size: 0.72rem; color: var(--text-muted);
}
.site-footer a { color: var(--blue-600); text-decoration: none; }
.site-footer a:hover { color: var(--blue-700); }
.footer-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 16px;
}
.footer-copy { opacity: 0.6; }
body { padding-bottom: 56px; }

/* ── Page Header (dashboard) ─────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-size: 1.4rem; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.3px;
}
.page-header p {
  font-size: 0.88rem; color: var(--text-secondary); margin-top: 4px;
}

/* ── Spinner ─────────────────────────────────────────────────────── */
.spin { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.animate-slide-up { animation: slideUp 0.4s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ── Evaluation score bar ────────────────────────────────────────── */
.score-bar {
  display: flex; align-items: center; gap: 8px;
}
.score-bar-track {
  flex: 1; height: 6px; border-radius: 3px; background: var(--bg-section);
  overflow: hidden;
}
.score-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.5s ease;
}
.score-bar-fill.good { background: var(--green-500); }
.score-bar-fill.average { background: var(--amber-500); }
.score-bar-fill.poor { background: var(--red-500); }
.score-label {
  font-size: 0.85rem; font-weight: 700; min-width: 36px; text-align: right;
}

/* ── Phone input ─────────────────────────────────────────────────── */
.phone-wrap { display: flex; align-items: stretch; }
.phone-prefix {
  display: flex; align-items: center; padding: 0 10px;
  background: var(--bg-section); border: 1px solid var(--border);
  border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
  user-select: none;
}
.phone-wrap input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--mono); letter-spacing: 1px;
}

/* ── Scroll to top ───────────────────────────────────────────────── */
.scroll-top {
  position: fixed; bottom: 68px; right: 24px; z-index: 90;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue-600); border: none; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
  transform: translateY(12px);
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--blue-500); transform: translateY(-2px); }
.scroll-top svg { width: 18px; height: 18px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .shell { padding: 16px 16px 72px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .navbar { padding: 0 16px; }
  .navbar-inner { height: 52px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-footer { padding: 8px 12px; gap: 4px 12px; font-size: 0.65rem; }
  body { padding-bottom: 48px; }
  .scroll-top { width: 36px; height: 36px; bottom: 58px; right: 16px; }
  .scroll-top svg { width: 16px; height: 16px; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.4rem; }
}
