:root {
  --bg: #f4f5f8; --surface: #fff; --ink: #18202f; --muted: #667085; --line: #e3e6ec;
  --brand: #1d3c78; --brand-ink: #fff; --brand-soft: #e8eefb;
  --ok: #18794e; --ok-soft: #e3f4ea; --bad: #b42318; --bad-soft: #fde8e6;
  --wait: #9a5b00; --wait-soft: #fdf1dc; --info-soft: #e8f1fd;
  --r1: #2457c5; --r2: #7a3ec4; --hr: #0f7a6c;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: 1.1rem; margin: .35rem 0 .15rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.small { font-size: .84rem; }
.muted { color: var(--muted); }
.warn { color: var(--wait); }
.ok { color: var(--ok); }
.danger { color: var(--bad) !important; }
.req { color: var(--bad); }
[hidden] { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.25rem; padding: .6rem 1.25rem; background: var(--brand); color: var(--brand-ink); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none !important; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fff; color: var(--brand); font-weight: 800; letter-spacing: -.03em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { opacity: .75; font-size: .75rem; }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; }
.nav a { color: rgba(255,255,255,.82); padding: .45rem .7rem; border-radius: 7px; white-space: nowrap; text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.on { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.who { display: flex; align-items: center; gap: .6rem; margin-left: auto; font-size: .85rem; }
.who-role { background: rgba(255,255,255,.16); padding: .1rem .5rem; border-radius: 99px; font-size: .75rem; }
.logout { color: #fff; opacity: .85; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 1.25rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #c6cbd4; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #163064; }
.btn-ghost { background: transparent; }
.btn-small { padding: .3rem .6rem; font-size: .82rem; font-weight: 600; }
.btn-join { font-size: 1rem; padding: .7rem 1.2rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.linkbtn:hover { text-decoration: underline; }
input, select, textarea { font: inherit; color: inherit; padding: .5rem .6rem; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a9bff0; outline-offset: 0; border-color: var(--brand); }
input[readonly] { background: #f6f7f9; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; color: #344054; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; }
textarea { resize: vertical; }
.form-error { color: var(--bad); font-size: .88rem; margin: .4rem 0; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.panel h2:not(:first-child) { margin-top: 1.4rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem 1rem; }
.grid-form .span2 { grid-column: span 2; }
.form-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.copyrow { display: flex; gap: .5rem; margin: .3rem 0 .6rem; }
.copyrow input { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

/* Flash */
.flash { padding: .7rem .9rem; border-radius: 8px; margin-bottom: .8rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: #0e5a39; border-color: #bfe3cd; }
.flash-error { background: var(--bad-soft); color: #8a1c12; border-color: #f6c6c0; }
.flash-warn { background: var(--wait-soft); color: #6d4100; border-color: #f2d9a8; }
.flash-info { background: var(--info-soft); color: #1d3c78; border-color: #c7d9f6; }

/* Filters & stats */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { min-width: 130px; }
.filters .grow { flex: 1; min-width: 180px; }
.stats { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; min-width: 120px; box-shadow: var(--shadow); }
.stats b { display: block; font-size: 1.35rem; }
.stats span { font-size: .8rem; color: var(--muted); }
.stats.compact { margin: 0; }
.stats.compact > div { padding: .4rem .8rem; min-width: 0; }
.stats.compact b { font-size: 1.1rem; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .6rem .75rem; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table select { width: auto; padding: .3rem .45rem; font-size: .85rem; }
.row-cancel { opacity: .55; }
.row-att { background: #fffaf0; }
form.inline { display: inline; }
.report th.grp { text-align: center; background: #f0f3f9; color: var(--brand); }
.report .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; box-shadow: 1px 0 0 var(--line); }
.report thead .sticky { background: #fafbfc; }

/* Badges & pills */
.idchip { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; font-weight: 600; color: #344054; background: #eef1f6; border: 1px solid #dde2ea; padding: .05rem .4rem; border-radius: 5px; white-space: nowrap; vertical-align: middle; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; color: #fff; white-space: nowrap; }
.badge-r1 { background: var(--r1); } .badge-r2 { background: var(--r2); } .badge-hr { background: var(--hr); }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .12rem .55rem; border-radius: 99px; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-wait { background: var(--wait-soft); color: var(--wait); }
.pill-next { background: var(--brand); color: #fff; }
.sel-ok { border-color: #8fd0ab; background: var(--ok-soft); }
.sel-bad { border-color: #f1a49b; background: var(--bad-soft); }
.res-selected { background: var(--ok-soft); color: var(--ok); border-color: #8fd0ab; }
.res-pooled { background: var(--wait-soft); color: var(--wait); border-color: #eccb8d; }
.res-rejected { background: var(--bad-soft); color: var(--bad); border-color: #f1a49b; }

/* Tabs */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .55rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; font-weight: 600; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* Interviewer cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.card-next { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.card-cancel { opacity: .6; }
.card-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-time { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: auto; }
.card-meta { margin: 0 0 .8rem; color: var(--muted); font-size: .9rem; }
.card-actions { display: flex; gap: .5rem; margin-bottom: .7rem; flex-wrap: wrap; }
.more summary { cursor: pointer; color: var(--brand); font-size: .88rem; font-weight: 600; margin: .3rem 0; }
.kv { display: grid; grid-template-columns: 9.5rem 1fr; gap: .3rem .8rem; margin: .5rem 0; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.result-form { margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.result-title { font-weight: 700; margin-bottom: .5rem; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .4rem; }
.result-grid label { font-size: .78rem; }
.result-done { margin-top: .8rem; padding: .6rem .75rem; background: var(--ok-soft); color: #0e5a39; border-radius: 8px; font-size: .88rem; }

/* Attention */
.attention { border: 1px solid #f2d9a8; background: #fffbf3; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.attention h2 { color: var(--wait); }
.count { display: inline-block; background: var(--wait); color: #fff; font-size: .75rem; border-radius: 99px; padding: .05rem .5rem; vertical-align: middle; }
.panel:not(.attention) .count { background: var(--muted); }
.att-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.att-list li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .6rem 0; border-top: 1px solid #f3e6cc; align-items: center; }
.att-list li > div { grid-column: 1; }
.att-list li > a { grid-column: 2; grid-row: 1 / span 2; }
.approve-row { display: flex; align-items: flex-end; gap: .7rem; padding: .7rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.approve-row .grow { flex: 1; min-width: 220px; align-self: center; }
.approve-row label { min-width: 200px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .55rem 0; border-top: 1px solid #eef0f3; }
.timeline li:first-child { border-top: 0; }
.pager { display: flex; gap: .3rem; flex-wrap: wrap; margin: 1rem 0; }
.pager a { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

.auth-card { max-width: 440px; margin: 3rem auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: .4rem; }
.auth-card .g_id_signin { margin: 1.2rem 0; min-height: 44px; }
.dev-login { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; padding: .8rem; border: 1px dashed var(--wait); border-radius: 8px; }

/* Phones */
@media (max-width: 720px) {
  .wrap { padding: 1rem; }
  .topbar { padding: .55rem 1rem; gap: .6rem; }
  .who { margin-left: auto; } .who-name { display: none; }
  .nav { order: 3; flex-basis: 100%; }
  .grid-form .span2 { grid-column: auto; }
  .cards { grid-template-columns: 1fr; }
  .table:not(.report) thead { display: none; }
  .table:not(.report), .table:not(.report) tbody, .table:not(.report) tr, .table:not(.report) td { display: block; width: 100%; }
  .table:not(.report) tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .table:not(.report) td { border: 0; padding: .25rem .8rem; }
  .table:not(.report) td[data-l]::before { content: attr(data-l); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .filters label { min-width: calc(50% - .3rem); flex: 1; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: .3rem; }
}
