/* Broker AI customer portal — light, friendly, self-contained (no CDN/fonts). Brand-consistent
   with the operator dashboard (indigo accent) but a lighter top-nav chrome for customers. */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #e6e8ee;
  --border-strong: #d3d7e0;
  --text: #1a1f36;
  --muted: #6b7280;
  --faint: #9aa1ac;
  --accent: #4f46e5;
  --accent-weak: #eef0fe;
  --accent-hover: #4338ca;
  --green: #0f9d58;
  --green-weak: #e6f4ec;
  --red: #dc2626;
  --red-weak: #fdecec;
  --amber: #b45309;
  --amber-weak: #fef3e2;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 23px; font-weight: 660; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 620; margin: 0 0 4px; }
.muted { color: var(--muted); }

/* ---- top nav ---- */
.topnav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topnav-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 26px; padding: 0 24px; height: 60px; }
.topnav .brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.topnav .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.tabs { display: flex; gap: 4px; }
.tabs a { color: var(--muted); padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 550; }
.tabs a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--accent-weak); color: var(--accent); }
.topnav .who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topnav .who .org { font-weight: 600; }
.topnav .who .user { color: var(--muted); }
.topnav .who .logout { color: var(--red); }

/* ---- layout ---- */
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 24px 56px; }
.page-head { margin-bottom: 22px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 22px 24px; }
.cards { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px; }
.notice h2 { margin-bottom: 4px; }

/* ---- usage card ---- */
.usage-card .usage-head { display: flex; align-items: flex-start; justify-content: space-between; }
.usage-card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.usage-card .big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.usage-card .big .used { color: var(--accent); }
.bar-track { height: 12px; background: #eceef5; border-radius: 999px; overflow: hidden; margin: 20px 0 12px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #6d63f0, var(--accent)); border-radius: 999px; transition: width .3s ease; }
.bar-fill.warn { background: linear-gradient(90deg, #eab308, var(--amber)); }
.bar-fill.full { background: linear-gradient(90deg, #ef4444, var(--red)); }
.usage-foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }

/* ---- meta card ---- */
.meta-card { display: flex; flex-direction: column; }
.meta-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.meta-row:first-child { padding-top: 0; }
.meta-row .label { color: var(--muted); font-size: 13px; }
.meta-row .val { font-weight: 600; }
.meta-actions { margin-top: auto; padding-top: 16px; }

/* ---- banners ---- */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-radius: var(--radius); margin-bottom: 18px; font-size: 13.5px; }
.banner.red { background: var(--red-weak); border: 1px solid #f0c4c4; color: #8a1f1f; }
.banner.amber { background: var(--amber-weak); border: 1px solid #f3d9a8; color: #7a4a0a; }
.banner .btn { flex: 0 0 auto; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: var(--green-weak); color: var(--green); }
.badge.red { background: var(--red-weak); color: var(--red); }
.badge.amber { background: var(--amber-weak); color: var(--amber); }

/* ---- tables ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.scroll-x { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); font-weight: 600; padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.linkish { font-weight: 550; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 560; cursor: pointer; transition: background .12s, border-color .12s; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }

/* ---- forms / login ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.form input { padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; }
.form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.form .actions { margin-top: 4px; }
.form .btn { justify-content: center; width: 100%; }
.error { color: var(--red); background: var(--red-weak); border: 1px solid #f0c4c4; padding: 9px 12px; border-radius: 9px; font-size: 13px; }
.empty { color: var(--muted); padding: 34px; text-align: center; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 372px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
.login-card .brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.login-card .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.login-card .sub { color: var(--muted); margin: 6px 0 22px; font-size: 13px; }
.login-card .foot { color: var(--muted); font-size: 12.5px; margin: 18px 0 0; text-align: center; }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .topnav-inner { gap: 14px; padding: 0 14px; }
  .topnav .who .org { display: none; }
  .wrap { padding: 20px 14px 40px; }
}
