/* Avenor Opportunity Desk — visual direction taken from the supplied mockup:
   indigo accent, neutral surfaces, compact rows, restrained decoration. */

:root {
  color-scheme: light dark;
  --bg:      light-dark(#f3f5f8, #111a27);
  --panel:   light-dark(#ffffff, #1b2737);
  --panel-2: light-dark(#f8fafc, #16212f);
  --text:    light-dark(#1c2b42, #e7edf8);
  --muted:   light-dark(#62718a, #aab9cf);
  --line:    light-dark(#e1e7f0, #334359);
  --accent:  light-dark(#354cd4, #bac4ff);
  --accent-ink: light-dark(#ffffff, #16203a);
  --soft:    light-dark(#eef0ff, #2e365c);
  --ok:      light-dark(#0c7a4d, #5ed6a4);
  --ok-bg:   light-dark(#e6f6ee, #16352a);
  --warn:    light-dark(#9a5b00, #ffc978);
  --warn-bg: light-dark(#fdf3e2, #3b2d14);
  --bad:     light-dark(#a4302c, #ff9a97);
  --bad-bg:  light-dark(#fdecec, #3a1f1f);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); }
h1 { font-size: 19px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 6px; font-weight: 600; }
h3 { font-size: 12px; margin: 16px 0 6px; font-weight: 600; color: var(--muted); }
p  { margin: 0 0 8px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------ chrome --- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: .04em; }
.monogram {
  width: 24px; height: 24px; border-radius: 7px; background: var(--accent);
  color: var(--accent-ink); display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.tag { color: var(--muted); font-weight: 500; font-size: 10.5px; letter-spacing: .09em; }
.whoami { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.whoami strong { color: var(--text); font-weight: 600; }

.shell { display: flex; min-height: calc(100vh - 45px); }
.sidebar {
  width: 196px; flex: 0 0 196px; padding: 16px 12px;
  background: var(--panel); border-right: 1px solid var(--line);
}
.sidebar-label {
  font-size: 10px; letter-spacing: .1em; color: var(--muted);
  margin: 14px 8px 6px; font-weight: 600;
}
.sidebar-label:first-child { margin-top: 0; }
.nav {
  display: block; width: 100%; text-align: left; padding: 7px 9px;
  border: 0; border-radius: 8px; background: none; color: var(--text);
  font: inherit; cursor: pointer; text-decoration: none; margin-bottom: 1px;
}
.nav:hover { background: var(--panel-2); }
.nav[aria-current="page"] { background: var(--soft); color: var(--accent); font-weight: 600; }
.sidefoot { margin-top: 22px; padding: 9px; font-size: 11px; color: var(--muted);
            border-top: 1px solid var(--line); }

.main { flex: 1; padding: 18px 22px 40px; min-width: 0; }
.eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 3px; }

/* ------------------------------------------------------------ pieces --- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.profilebar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.profile {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--text); font: inherit; cursor: pointer; text-decoration: none;
}
.profile:hover { border-color: var(--accent); }
.profile[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.count { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }

.metrics { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.metric strong { display: block; font-size: 21px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: 11px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.tab {
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text); font: inherit; cursor: pointer;
  text-decoration: none; font-size: 12px;
}
.tab[aria-current="page"] { background: var(--soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tab[aria-current="page"] .n { color: inherit; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.field.search { flex: 1 1 240px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.button {
  font: inherit; font-size: 12px; padding: 6px 11px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; text-decoration: none; display: inline-block;
}
.button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { opacity: .92; color: var(--accent-ink); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; align-items: center; }

/* ------------------------------------------------------------- queue --- */

.queue { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1080px) { .queue { grid-template-columns: 1fr; } }

.list, .detail {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.detail { padding: 14px 16px; }

.listhead {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12px;
}
.listhead .spacer { flex: 1; }

.row {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}
.row:last-of-type { border-bottom: 0; }
.row.selected { background: var(--soft); }
.row .score {
  width: 40px; flex: 0 0 40px; text-align: center; font-weight: 650;
  font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.row .score small { display: block; font-size: 8.5px; letter-spacing: .07em; color: var(--muted); font-weight: 500; }
.row .score.none { color: var(--muted); font-size: 12px; font-weight: 500; }
.job {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0;
  font: inherit; color: inherit; cursor: pointer; padding: 2px 0; text-decoration: none;
  display: block;
}
.job .title {
  display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.job:hover .title { color: var(--accent); }
.job .sub { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 1px; }

.fit { font-weight: 600; }
.fit.suitable { color: var(--ok); }
.fit.review   { color: var(--warn); }
.fit.unsuitable { color: var(--bad); }
.fit.pending  { color: var(--muted); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--soft); color: var(--accent);
}
.badge.suitable { background: var(--ok-bg); color: var(--ok); }
.badge.review { background: var(--warn-bg); color: var(--warn); }
.badge.unsuitable { background: var(--bad-bg); color: var(--bad); }
.badge.neutral { background: var(--panel-2); color: var(--muted); }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel-2);
  font-size: 12px; flex-wrap: wrap;
}
.pager .group { display: flex; align-items: center; gap: 6px; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.evidence {
  background: var(--panel-2); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: 7px;
  padding: 8px 10px; margin-bottom: 6px; font-size: 12px;
}
.evidence span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.callout {
  background: var(--soft); border-radius: 7px; padding: 9px 11px;
  font-size: 12px; margin: 10px 0;
}
.callout.warn { background: var(--warn-bg); color: var(--warn); }
.callout.bad  { background: var(--bad-bg); color: var(--bad); }

.notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--soft); border-radius: var(--radius); padding: 9px 13px;
  margin-bottom: 12px; font-size: 12.5px;
}

.desc { white-space: pre-wrap; max-height: 260px; overflow-y: auto; font-size: 12.5px;
        border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; background: var(--panel-2); }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.wrap { overflow-x: auto; }

.log { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: 0; }
.log strong { font-weight: 600; }
.log p { margin: 1px 0; }

.permissions { display: grid; gap: 3px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin: 8px 0; }
.permissions label { display: flex; align-items: center; gap: 5px; font-size: 12px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 340px; }
.login-card .field { margin-bottom: 10px; font-size: 12px; }
.login-card input { width: 100%; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

.fixture-flag {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  background: var(--warn-bg); color: var(--warn); padding: 2px 7px; border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  .button, .profile, .tab { transition: border-color .12s, background .12s, color .12s; }
}
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 14px; }
}

.cites { margin: 4px 0 0; padding-left: 16px; color: var(--muted); font-size: 11.5px; }
.cites li { margin: 1px 0; }
.evidence.gap { border-left-color: var(--warn); }
.count .rv { opacity: .75; font-weight: 400; }

.chip { display:inline-block; padding:0 7px; border:1px solid var(--line); border-radius:999px; font-size:10.5px; }
.chip.ok { color: var(--ok); border-color: var(--ok); }
.button.skip-one { padding:3px 9px; font-size:11px; color: var(--warn); border-color: var(--warn); white-space:nowrap; }
.client-facts { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:12px; margin:10px 0 8px; }
.client-facts b { font-weight:600; }
.answer { border-left:2px solid var(--line); padding:4px 0 8px 10px; margin:8px 0; }
.answer .q { font-size:12px; margin-bottom:4px; }

.chip.warn { color: var(--warn); border-color: var(--warn); }

.live-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 4px 18px rgba(0,0,0,.12); font-size: 12.5px; }
.live-bar[hidden] { display: none; }
@keyframes newrow { from { background: var(--ok-bg); } to { background: transparent; } }
.row.new-row { animation: newrow 6s ease-out; }

.callout.service-offer { border-left: 3px solid var(--accent); }
.callout.service-offer .offer-quote { margin: 6px 0 2px; font-style: italic; }
.warn-text { color: var(--warn); }
