:root {
  --ink: #17202a;
  --muted: #5d6d7e;
  --line: #dde5ec;
  --soft: #f5f8fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #0ea5a4;
  --paper: #ffffff;
  --bg: #eef3f6;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 10px 30px rgba(18, 38, 63, 0.10);
}

* { box-sizing: border-box; }

/* The hidden attribute must always win over display rules below
   (.modal-backdrop uses display:flex, the views use display:grid). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 70%, #102a43 100%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #7dd3c8; box-shadow: 0 0 0 4px rgba(125,211,200,0.25);
}
.brand .title { font-weight: 700; font-size: 17px; }
.brand .sub { font-size: 12px; color: #cdeef0; }
.topmeta { font-size: 13px; color: #d7f2f0; text-align: right; }

/* Tabs + interviewer identity in the top bar */
.tabs { display: flex; gap: 6px; }
.tab {
  background: rgba(255,255,255,0.10); color: #e6fffb; border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab:hover { background: rgba(255,255,255,0.18); }
.tab.active { background: #fff; color: var(--brand-dark); border-color: #fff; }
.whoami { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ivname { font-size: 13px; color: #fff; font-weight: 700; cursor: pointer; }
.ivname .switch { font-weight: 400; color: #b7f4ee; font-size: 11px; }
.ivname:hover .switch { text-decoration: underline; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-head {
  display: flex; gap: 8px; padding: 12px;
  border-bottom: 1px solid var(--line);
}
.sidebar-head input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px;
}
.sidebar-head button {
  width: 40px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--soft); font-size: 20px; cursor: pointer; color: var(--brand);
}
.filters { display: flex; gap: 6px; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.applicant-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.applicant-list li {
  padding: 10px 12px; border-radius: 10px; cursor: pointer; margin-bottom: 4px;
  border: 1px solid transparent;
}
.applicant-list li:hover { background: var(--soft); }
.applicant-list li.active { background: #e6f3f1; border-color: #bfe3dd; }
.al-name { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.al-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; font-weight: 700; }
.b-notstarted { background: #eef2f5; color: #64748b; }
.b-inprogress { background: #fef3c7; color: #92400e; }
.b-completed  { background: #dcfce7; color: #166534; }
.score-pill { font-size: 11px; font-weight: 700; color: var(--brand-dark); }

/* Panel */
.panel { overflow-y: auto; padding: 26px 32px; }
.empty { max-width: 560px; margin: 60px auto; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); }

.ivhead {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 8px;
}
.ivhead h1 { margin: 0; font-size: 26px; }
.ivhead .who { color: var(--muted); font-size: 14px; margin-top: 4px; }
.scorecard {
  min-width: 150px; text-align: center; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; background: var(--paper); box-shadow: var(--shadow);
}
.scorecard .big { font-size: 34px; font-weight: 800; color: var(--brand); line-height: 1; }
.scorecard .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.scorecard .prog { font-size: 12px; color: var(--muted); margin-top: 6px; }

.catblock { margin-top: 22px; }
.catblock h3 {
  font-size: 15px; color: var(--brand-dark); margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.wtag { font-size: 10.5px; background: #e6f3f1; color: var(--brand-dark); padding: 2px 8px; border-radius: 999px; }
.catbar { height: 2px; background: var(--line); margin-bottom: 12px; }

.q {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 12px; background: var(--paper);
}
.q .qtext { font-weight: 600; margin-bottom: 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.hint.look { color: #15803d; }
.hint.flag { color: #b91c1c; }
.hint b { font-weight: 700; }
details.guide { margin: 6px 0 10px; }
details.guide summary { font-size: 12px; color: var(--brand); cursor: pointer; }

.scorerow { display: flex; align-items: center; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.srate { display: flex; gap: 5px; }
.srate button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 700; color: var(--muted);
}
.srate button.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.srate button.clear { width: auto; padding: 0 10px; font-weight: 500; font-size: 12px; }
.q textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-family: inherit; font-size: 13.5px; resize: vertical; min-height: 46px;
}
.saved { font-size: 11px; color: var(--good); opacity: 0; transition: opacity .2s; }
.saved.show { opacity: 1; }

.outcome {
  margin-top: 26px; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; background: var(--soft);
}
.outcome h3 { margin: 0 0 12px; color: var(--brand-dark); }
.outcome .field { margin-bottom: 12px; }
.outcome label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.outcome input, .outcome select, .outcome textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-family: inherit; font-size: 14px;
}
.outcome textarea { min-height: 70px; resize: vertical; }
.rec-row { display: flex; gap: 10px; align-items: flex-end; }
.rec-row .field { flex: 1; }
.btn {
  background: var(--brand); color: #fff; border: none; border-radius: 9px;
  padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.btn:hover { background: var(--brand-dark); }
.note-scale { font-size: 12px; color: var(--muted); margin-top: 6px; }
.as-who { font-size: 12px; font-weight: 400; color: var(--muted); }

/* Other interviewers' input */
.others {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  background: #fbfdff; margin-top: 14px;
}
.others-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.other-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px dashed var(--line); }
.other-row:first-of-type { border-top: none; }
.other-name { font-weight: 600; min-width: 120px; }
.other-pct { font-weight: 700; color: var(--brand-dark); }
.other-summary { flex-basis: 100%; font-size: 13px; color: var(--muted); padding-left: 2px; }

/* Recommendation badges (shared) */
.rec-badge, .mini-rec {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; display: inline-block;
}
.rec-strong { background: #dcfce7; color: #166534; }
.rec-hire   { background: #d1fae5; color: #047857; }
.rec-maybe  { background: #fef3c7; color: #92400e; }
.rec-no     { background: #fee2e2; color: #b91c1c; }
.rec-none   { background: #eef2f5; color: #64748b; }

.rev-tag { font-size: 10.5px; background: #eef4f8; color: #475569; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }

/* Interviewer modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 42, 67, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: 16px; padding: 28px; width: min(440px, 92vw);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal h2 { margin: 0 0 6px; color: var(--brand-dark); }
.modal-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.modal input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 15px; margin-bottom: 12px;
}
.modal-known { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.known-name {
  background: var(--soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--brand-dark); margin: 2px;
}
.known-name:hover { background: #e6f3f1; }
.modal .btn { width: 100%; }

/* ---------------------------- Analysis view ---------------------------- */
.analysis { padding: 26px 32px; overflow-y: auto; height: calc(100vh - 60px); }
.an-head h1 { margin: 0 0 4px; }
.muted { color: var(--muted); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat-n { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.an-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-bottom: 16px; }
.an-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.an-card h3 { margin: 0 0 14px; color: var(--brand-dark); font-size: 16px; }

.rec-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rec-card { border-radius: 12px; padding: 14px; text-align: center; }
.rec-card .rec-n { font-size: 26px; font-weight: 800; }
.rec-card .rec-l { font-size: 12px; font-weight: 700; }

.cat-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cat-name { flex: 0 0 210px; font-size: 13px; font-weight: 600; }
.cat-bar { flex: 1; height: 10px; background: #eef2f5; border-radius: 999px; overflow: hidden; }
.cat-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); }
.cat-val { flex: 0 0 96px; text-align: right; font-weight: 700; color: var(--brand-dark); font-size: 13px; }
.cat-n { font-weight: 400; color: var(--muted); font-size: 11px; }

.an-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.an-table th { text-align: left; color: #134e4a; background: #e6f3f1; padding: 9px 10px; border: 1px solid var(--line); font-size: 12px; }
.an-table td { padding: 9px 10px; border: 1px solid var(--line); vertical-align: top; }
.an-table.board tr.dim { opacity: 0.55; }
.rank { font-weight: 800; color: var(--brand); width: 52px; }
.lb-name { font-weight: 700; }
.lb-sub { font-size: 12px; color: var(--muted); }
.avg-pill { background: var(--brand); color: #fff; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.lb-count { text-align: center; }
.lb-reviews { line-height: 2; }
.mini-rec { margin: 1px 2px; }

@media (max-width: 860px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .an-grid { grid-template-columns: 1fr; }
}
