/* Soldek.ai — Operator Portal. Light, data-dense insurer console sharing the
   customer app's design language: white surfaces, navy text, orange accent,
   hairline borders, soft shadows. Tokens mirror app/app.css. */
:root {
  --bg: #f7f6f4;
  --panel: #ffffff;
  --sidebar: #fbfaf8;
  --text: #0a2540;
  --muted: #5c6b7f;
  --line: #eceae6;
  --line-2: #d8d5d0;
  --accent: #ea580c;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #ffffff);
  --accent-line: color-mix(in srgb, var(--accent) 35%, #ffffff);
  --accent-ring: color-mix(in srgb, var(--accent) 18%, #ffffff);
  --ok: #067647; --ok-bg: #e7f6ee;
  --warn: #b54708; --warn-bg: #fdf0e6;
  --bad: #d92d20; --bad-bg: #fdecea;
  --info: #175cd3; --info-bg: #eaf1fd;
  --shadow: 0 1px 2px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 4px 12px rgba(10, 37, 64, 0.06), 0 16px 40px rgba(10, 37, 64, 0.10);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--bad); font-size: 0.85rem; min-height: 1.1em; margin-top: 10px; text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }

.orb {
  display: inline-block; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--accent);
  background: radial-gradient(circle at 50% 38%, var(--accent-soft), #fff 70%);
}
.orb--sm { width: 24px; height: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: 0.15s;
}
.btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--block { width: 100%; }
.btn--ghost { background: #fff; border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn--sm { padding: 7px 14px; font-size: 0.82rem; }
.btn--ok { background: var(--ok); color: #fff; }
.btn--ok:hover { filter: brightness(1.08); }
.btn--bad { background: #fff; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, #ffffff); }
.btn--bad:hover { background: var(--bad-bg); }

/* ---------------- connect ---------------- */
.connect {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft), transparent 65%),
    var(--bg);
}
.connect__card {
  width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow); padding: 42px 32px; text-align: center;
  position: relative; overflow: hidden;
}
.connect__card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.connect__card .orb { margin-bottom: 22px; }
.connect h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; }
.connect .muted { line-height: 1.55; margin: 0 0 24px; font-size: 0.93rem; }
.connect input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px;
  font: inherit; margin-bottom: 12px; background: #fff; color: var(--text);
}
.connect input::placeholder { color: var(--muted); }
.connect input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.connect__foot {
  margin-top: 24px; font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.connect__foot .dot, .pill i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  margin-right: 7px; vertical-align: middle;
}

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--sidebar); color: var(--text); display: flex; flex-direction: column;
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
}
.side__brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; flex-shrink: 0; }
.side__name { font-weight: 700; letter-spacing: -0.01em; }
.side__role { font-size: 0.72rem; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; }
.nav__item {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  background: transparent; border: 0; color: var(--muted); font: inherit; font-weight: 500;
  font-size: 0.92rem; text-align: left; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  transition: 0.15s;
}
.nav__item:hover { background: rgba(10, 37, 64, 0.05); color: var(--text); }
.nav__item.is-active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav__badge { background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.side__foot { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); flex-shrink: 0; }
.side__link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.82rem; text-align: left; padding: 6px 8px; cursor: pointer; text-decoration: none; border-radius: 8px; }
.side__link:hover { color: var(--text); background: rgba(10, 37, 64, 0.05); }

.content { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h2 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.pill { font-size: 0.72rem; color: var(--ok); display: inline-flex; align-items: center;
  padding: 5px 11px; border: 1px solid color-mix(in srgb, var(--ok) 30%, #ffffff);
  background: var(--ok-bg); border-radius: 999px; font-weight: 600; }
.pill i { background: var(--ok); }
.view { padding: 24px 28px 44px; }

/* ---------------- KPI cards ---------------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kpi__label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.kpi__value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.kpi__sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.kpi--hero .kpi__value { font-size: 2.05rem; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel__head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.panel__body { padding: 16px 20px; }
.panel__hint { font-size: 0.8rem; color: var(--muted); }

/* ---------------- loss-ratio bars ---------------- */
.lrbar { margin-bottom: 14px; }
.lrbar:last-child { margin-bottom: 0; }
.lrbar__top { display: flex; justify-content: space-between; font-size: 0.86rem; margin-bottom: 6px; }
.lrbar__name { font-weight: 500; text-transform: capitalize; }
.lrbar__val { font-variant-numeric: tabular-nums; }
.lrbar__track { height: 10px; border-radius: 999px; background: #eeece8; overflow: hidden; position: relative; }
.lrbar__fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.lrbar__meta { font-size: 0.74rem; color: var(--muted); margin-top: 5px; }
.is-ok { background: #12a35c; } .is-warn { background: #e8930c; } .is-bad { background: #e2483d; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag--ok { color: var(--ok); background: var(--ok-bg); }
.tag--warn { color: var(--warn); background: var(--warn-bg); }
.tag--bad { color: var(--bad); background: var(--bad-bg); }
.tag--info { color: var(--info); background: var(--info-bg); }

/* ---------------- tables ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 11px 14px;
  background: var(--sidebar); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable:hover { background: var(--bg); cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* approvals */
.queue { display: grid; gap: 14px; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.qcard__main { min-width: 0; }
.qcard__title { font-weight: 600; }
.qcard__meta { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.section-h { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 6px 0 10px; }

/* modal */
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 37, 64, 0.35); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal__card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; width: min(560px, 92vw);
  max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg); padding: 26px; }
.modal__x { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 1.5rem; color: var(--muted); cursor: pointer; }
.modal__x:hover { color: var(--text); }

.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); text-transform: capitalize; }

@media (max-width: 1040px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; overflow: visible; }
  .side__foot { flex-direction: row; border: 0; }
}
