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

:root {
  /* ── Luma Design Tokens ── */
  --color-primary:       #3730A3;
  --color-primary-light: #EEF2FF;
  --color-accent:        #F59E0B;
  --color-accent-light:  #FFFBEB;
  --color-surface:       #F8FAFC;
  --color-card:          #FFFFFF;
  --color-text:          #0F172A;
  --color-muted:         #94A3B8;
  --color-border:        #E2E8F0;
  --color-sidebar:       #0F172A;
  --color-success:       #10B981;
  --color-warning:       #F59E0B;
  --color-error:         #F43F5E;

  /* ── Legacy aliases (kept while migrating component classes) ── */
  --blue:    var(--color-primary);
  --blue-dk: #312E81;
  --green:   var(--color-success);
  --red:     var(--color-error);
  --yellow:  var(--color-warning);
  --gray:    #6B7280;
  --bg:      var(--color-surface);
  --card:    var(--color-card);
  --text:    var(--color-text);
  --muted:   var(--color-muted);
  --border:  var(--color-border);
  --sidebar: var(--color-sidebar);
  --sidebar-w: 220px;
}

body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: var(--sidebar); display: flex; flex-direction: column; padding: 24px 0; position: fixed; top: 0; left: 0; height: 100vh; z-index: 10; }
.sidebar-brand { color: #fff; font-size: 20px; font-weight: 700; padding: 0 24px 28px; letter-spacing: -.5px; display: flex; align-items: center; }
.sidebar-brand .brand-accent { color: var(--color-accent); margin-left: 2px; font-size: 13px; line-height: 1; position: relative; top: -3px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: #94A3B8; text-decoration: none; font-size: 14px; font-weight: 500; transition: background 100ms, color 100ms; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #EEF2FF; color: #3730A3; border-left-color: #3730A3; }
.sidebar nav a.liz-nav { color: #F59E0B; }
.sidebar nav a.liz-nav:hover { color: #F59E0B; background: rgba(245,158,11,.08); text-decoration: none; border-left-color: #F59E0B; }
.sidebar nav a.liz-nav.active { color: #F59E0B; border-left-color: #F59E0B; background: rgba(245,158,11,.1); }
.sidebar nav a .icon { font-size: 16px; width: 20px; text-align: center; }
/* Sidebar user section */
.sidebar-user { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar-user-links { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.sidebar-user-links a { color: #94A3B8; text-decoration: none; font-size: 11px; transition: color 100ms; }
.sidebar-user-links a:hover { color: #fff; text-decoration: none; }
.sidebar-user-sep { color: rgba(255,255,255,.25); font-size: 11px; }

/* ── Main ── */
.main { margin-left: var(--sidebar-w); flex: 1; padding: 32px 36px; max-width: 1100px; }
/* ── Typography scale ── */
.page-title { font-size: 24px; font-weight: 700; color: #0F172A; margin-bottom: 6px; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
h2.section-heading { font-size: 18px; font-weight: 600; color: #1E293B; }
.card-label { font-size: 14px; font-weight: 500; color: #334155; }
.body-text { font-size: 14px; font-weight: 400; color: #475569; }
.caption { font-size: 12px; font-weight: 400; color: #94A3B8; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-top-width: 3px; transition: transform 150ms ease, box-shadow 150ms ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-card .num { font-size: 36px; font-weight: 700; line-height: 1; }
.stat-card .lbl { font-size: 14px; font-weight: 500; color: #64748B; margin-top: 6px; }
.stat-card.blue  { border-top-color: #3730A3; }
.stat-card.green { border-top-color: #10B981; }
.stat-card.violet { border-top-color: #7C3AED; }
.stat-card.blue .num  { color: var(--blue); }
.stat-card.green .num { color: var(--green); }
.stat-card.violet .num { color: #7C3AED; }
.stat-card.yellow .num { color: var(--yellow); }
.stat-card.red .num { color: var(--red); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; transition: background 150ms, opacity .15s, transform .1s; }
.btn:active { transform: scale(.97); }
/* System button classes */
.btn-primary  { background: #3730A3; color: #fff; }
.btn-primary:hover  { background: #312E81; text-decoration: none; color: #fff; }
.btn-secondary { background: #fff; color: #334155; border: 1px solid #CBD5E1; }
.btn-secondary:hover { background: #F8FAFC; text-decoration: none; }
.btn-liz  { background: #F59E0B; color: #fff; }
.btn-liz:hover  { background: #D97706; text-decoration: none; color: #fff; }
.btn-danger { background: #F43F5E; color: #fff; }
.btn-danger:hover { background: #E11D48; text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: #475569; border: none; }
.btn-ghost:hover { background: #F1F5F9; text-decoration: none; }
/* Legacy aliases kept for existing code */
.btn-success { background: var(--green); color: #fff; }
.btn-amber   { background: var(--color-accent); color: #fff; }
.btn-amber:hover { background: #D97706; text-decoration: none; color: #fff; }
.btn-gray    { background: var(--border); color: var(--text); }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--color-primary-light); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { background: var(--bg); color: var(--muted); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-green  { background: #DCFCE7; color: #15803D; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-teal   { background: #CCFBF1; color: #0F766E; }
.badge-gray   { background: #F1F5F9; color: #475569; }
.badge-yellow { background: #FEF9C3; color: #A16207; }
.badge-red    { background: #FEE2E2; color: #B91C1C; }
/* Work type badges */
.badge-remote  { background: #CCFBF1; color: #0F766E; }
.badge-hybrid  { background: #E0E7FF; color: #3730A3; }
.badge-onsite  { background: #F1F5F9; color: #475569; }

/* ── Search filter ── */
.table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.search-input:focus { border-color: var(--blue); }
select.filter-sel { padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card); cursor: pointer; }

/* ── Pipeline status dropdown (job table) ── */
select.pipeline-sel { border: none; border-radius: 5px; font-size: 12px; font-weight: 600; padding: 3px 6px; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; padding-right: 20px; }
select.pipeline-sel-saved          { background-color: #F1F5F9; color: #475569; }
select.pipeline-sel-applied        { background-color: #E0E7FF; color: #3730A3; }
select.pipeline-sel-phone-screen   { background-color: #DBEAFE; color: #1D4ED8; }
select.pipeline-sel-interview      { background-color: #EDE9FE; color: #6D28D9; }
select.pipeline-sel-final-round    { background-color: #F3E8FF; color: #7C3AED; }
select.pipeline-sel-offer          { background-color: #D1FAE5; color: #065F46; }
select.pipeline-sel-rejected       { background-color: #FFE4E6; color: #BE123C; }
select.pipeline-sel-withdrawn      { background-color: #F3F4F6; color: #6B7280; }
select.pipeline-sel-archived       { background-color: #F3F4F6; color: #9CA3AF; }

/* ── Log terminal ── */
.log-box { background: #0F172A; color: #94A3B8; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 13px; border-radius: 10px; padding: 18px; height: 340px; overflow-y: auto; line-height: 1.7; }
.log-box .line-log  { color: #CBD5E1; }
.log-box .line-job  { color: #60A5FA; font-weight: 600; }
.log-box .line-done { color: #34D399; font-weight: 600; }
.log-box .line-err  { color: #F87171; }
.log-box .line-review { color: #FBBF24; font-weight: 700; }

/* ── Confirm overlay ── */
.confirm-box { display: none; background: #1E293B; border: 1px solid #334155; border-radius: 10px; padding: 20px; margin-top: 14px; }
.confirm-box.show { display: block; }
.confirm-box p { color: #E2E8F0; margin-bottom: 14px; font-size: 14px; }
.confirm-btns { display: flex; gap: 10px; }

/* ── Settings form ── */
.form-section { margin-bottom: 28px; }
.form-section h3 { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; color: #334155; margin-bottom: 4px; }
.field input, .field textarea, .field select { width: 100%; height: 40px; padding: 0 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 150ms, box-shadow 150ms; }
.field textarea { height: auto; padding: 9px 13px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #6366F1; box-shadow: 0 0 0 2px rgba(99,102,241,.2); }
.field input.error, .field textarea.error, .field select.error { border-color: #FB7185; }
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-hint.error { color: #F43F5E; }

/* ── Form utility aliases (Sprint 4) ── */
.form-label { display: block; font-size: 14px; font-weight: 500; color: #334155; margin-bottom: 4px; }
.form-helper { font-size: 12px; color: #94A3B8; margin-top: 4px; }
.form-helper.error { color: #F43F5E; }
.form-input { width: 100%; min-height: 40px; padding: 0 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 150ms, box-shadow 150ms; }
.form-input:focus { border-color: #6366F1; box-shadow: 0 0 0 2px rgba(99,102,241,.2); }
.form-input.error { border-color: #FB7185; }
textarea.form-input { min-height: 80px; padding: 9px 13px; resize: vertical; }
.managed-key-badge { display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:500; color:#166534; background:#f0fdf4; border:1px solid #86efac; border-radius:6px; padding:7px 12px; }
.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.answer-row { display: flex; gap: 8px; }
.answer-row input:first-child { flex: 0 0 160px; font-size: 12px; background: #F8FAFC; }

.toast { position: fixed; bottom: 28px; right: 28px; background: var(--green); color: #fff; padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: 14px; display: none; }
.toast.show { display: block; }

/* ── Chip input ── */
.chip-input-wrap { display:flex; flex-wrap:wrap; gap:6px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--card); cursor:text; min-height:44px; align-items:center; transition:border-color .15s; }
.chip-input-wrap:focus-within { border-color:var(--color-primary); }
.chip { display:inline-flex; align-items:center; gap:4px; background:var(--color-primary-light); color:var(--color-primary); font-size:13px; font-weight:500; padding:3px 8px 3px 10px; border-radius:99px; }
.chip-remove { background:none; border:none; color:var(--color-primary); cursor:pointer; font-size:16px; line-height:1; padding:0 1px; opacity:.6; }
.chip-remove:hover { opacity:1; }
.chip-text { border:none; outline:none; font-size:14px; font-family:inherit; background:transparent; min-width:160px; flex:1; padding:2px 0; }

/* ── Usage pill ── */
.usage-pill { font-size:.75rem; color:#64748b; padding:2px 8px; border-radius:999px; border:1px solid #e2e8f0; background:#f8fafc; white-space:nowrap; }
.usage-pill-warn { color:#b45309; border-color:#fde68a; background:#fffbeb; }

/* ── Apply page ── */
.apply-hero { text-align: center; padding: 40px 0 28px; }
.apply-hero .big-num { font-size: 56px; font-weight: 800; color: var(--blue); line-height: 1; }
.apply-hero .sub { color: var(--muted); font-size: 15px; margin-top: 8px; }
.progress-bar-wrap { background: var(--border); border-radius: 99px; height: 8px; margin: 18px 0; }
.progress-bar { background: var(--blue); height: 8px; border-radius: 99px; width: 0%; transition: width .4s; }

/* ── Status dot column ── */
.status-dot-cell { width: 20px; padding-right: 0 !important; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-applied { background: var(--green); box-shadow: 0 0 0 3px #DCFCE7; }
.dot-closed  { background: #CBD5E1; }
.dot-new     { background: #93C5FD; }

/* ── Liz context bar ── */
.liz-context-bar { display:flex; align-items:center; gap:14px; background:var(--color-primary-light); border:1px solid #C7D2FE; border-radius:10px; padding:14px 18px; margin-bottom:20px; }
.liz-context-icon { font-size:22px; flex-shrink:0; }
.liz-context-name { font-size:14px; font-weight:600; color:var(--color-text); margin-bottom:5px; }
.liz-context-role { font-weight:400; color:var(--color-muted); }
.liz-context-badges { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.liz-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:12px; font-weight:600; white-space:nowrap; text-decoration:none; }
.liz-badge-green { background:#DCFCE7; color:#15803D; }
.liz-badge-amber { background:#FEF3C7; color:#92400E; }
.liz-badge-gray  { background:#F1F5F9; color:#475569; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
