/* Jola brand tokens. Navy, orange and light orange come from the official Jola logo files.
   Grays are tints of the navy, checked for WCAG AA text contrast on both surfaces.
   Brand orange is 2.7:1 on white, so it is decoration only, never text or a sole state signal. */
:root {
  --jola-navy: #34394d;
  --jola-orange: #f07f25;
  --jola-orange-light: #f39358;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #34394d;
  --ink-2: #575c6e;
  --ink-3: #6b7082;
  --line: #e3e5ea;
  --line-strong: #c9ccd5;
  --accent: #34394d;
  --accent-ink: #ffffff;
  --ok: #2f6b4f;
  --ok-bg: #e7f0eb;
  --warn: #8a5a12;
  --warn-bg: #f6eddd;
  --err: #9b2c2c;
  --err-bg: #f6e4e2;
  --info: #34394d;
  --info-bg: #e8eaf0;
  --radius: 6px;
  /* Jola web typography: Roboto Flex for UI, Roboto Serif Bold for display, Roboto Mono for callouts.
     Verdana is the brand's web-safe replacement. */
  --font: "Roboto Flex", Verdana, sans-serif;
  --display: "Roboto Serif", Georgia, serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
.brand span { font-weight: 500; font-size: 15px; padding-left: 12px; border-left: 1px solid var(--line-strong); line-height: 20px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 32px; }
.topnav { display: flex; gap: 24px; }
.topnav a, .account a { color: var(--ink-3); font-weight: 500; }
.topnav a:hover, .account a:hover { color: var(--ink); text-decoration: none; }
.topnav a.active, .account a.active { color: var(--ink); }
.account { display: flex; align-items: center; gap: 12px; padding-left: 24px; border-left: 1px solid var(--line); }
.service-status { color: var(--ink-3); font-size: 13px; display: flex; gap: 20px; }
.service-status:empty { display: none; }
.service-status:empty + .account { border-left: 0; padding-left: 0; }

.login { max-width: 400px; margin: 72px auto 0; }
.login-logo { height: 44px; width: auto; display: block; margin-bottom: 28px; }
.tagline { color: var(--ink-3); margin-top: 48px; font-size: 12px; line-height: 16px; }
.tagline-dot { color: var(--jola-orange); font-weight: 700; }
.login h1 { margin-bottom: 32px; }
.login input { width: 100%; }
.form-error { color: var(--err); margin: 0; min-height: 1.5em; }
.check-list { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); max-height: 280px; overflow-y: auto; }
.service-status b { color: var(--ink); font-weight: 500; }

.container { max-width: 1320px; margin: 0 auto; padding: 48px 40px 96px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.eyebrow { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
/* Brand scale: page titles use H4 (32/40) in Semibold, panel titles use H6 (20/24) in Medium. */
h1 { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 20px; line-height: 24px; font-weight: 500; margin: 0 0 16px; }
.sub { color: var(--ink-2); margin: 8px 0 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 48px; }
.tile { background: var(--surface); padding: 20px 24px; }
.tile .label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.tile .value { font-family: var(--display); font-size: 28px; line-height: 36px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 32px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-body { padding: 24px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { font-size: 10px; margin-left: 4px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf8; }
td.url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
td.url div { overflow: hidden; text-overflow: ellipsis; }
td.url a { color: var(--ink); }
td.num, th.num { text-align: right; }
td.muted, .muted { color: var(--ink-3); }
td.actions { text-align: right; }
.row-link { cursor: pointer; }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-3); }

.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.stale, .badge.queued { background: var(--warn-bg); color: var(--warn); }
.badge.rendering, .badge.miss { background: var(--info-bg); color: var(--info); }
.badge.error { background: var(--err-bg); color: var(--err); }

.tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.tabs a { white-space: nowrap; padding: 12px 0; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--jola-orange); }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

button, .btn {
  font: 500 13px/1 var(--font);
  font-family: var(--font);
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
button:hover { border-color: var(--ink-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: #262a3a; border-color: #262a3a; }
button.danger { color: var(--err); }
button.danger:hover { border-color: var(--err); }
button.small { padding: 6px 10px; font-size: 12px; }
button.link, .btn.link { border: 0; background: none; padding: 4px 3px; color: var(--accent); display: inline-block; }
.btn.link:hover { text-decoration: underline; }
button.link.danger { color: var(--err); }
button:disabled { opacity: 0.5; cursor: default; }

input[type="text"], input[type="search"], input[type="number"], input[type="url"], input[type="email"], input[type="password"], select, textarea {
  font: 400 14px/1.4 var(--font);
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="search"] { width: 320px; }
textarea { width: 100%; font-family: var(--mono); font-size: 13px; resize: vertical; }

.form { display: grid; gap: 20px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; }
.field .hint { color: var(--ink-3); font-size: 12px; }
.check { display: flex; gap: 10px; align-items: center; }
.form-actions { display: flex; gap: 12px; }

.token-box { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.token-box code { font-family: var(--mono); font-size: 13px; word-break: break-all; flex: 1; }
.callout { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 24px; }
.callout p { margin: 4px 0 0; }

.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; margin: 0; display: grid; gap: 14px; }
.fieldset legend { font-weight: 600; padding: 0 6px; }
.field-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .field-row { grid-template-columns: 1fr; } }
.section-title { margin: 8px 0 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 0 0 28px; }
.facts dt { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.facts dd { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
.meter-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.meter-fill.near { background: var(--warn); }
.meter-fill.at, .meter-fill.over { background: var(--err); }
.meter-status { margin: 12px 0 0; color: var(--ink-2); }
.queue-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--line); }
.queue-banner[hidden] { display: none; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); color: var(--ink-3); }
.pager .toolbar { gap: 8px; }

.danger-zone { border-color: var(--err-bg); }
.danger-zone .panel-head { border-bottom-color: var(--err-bg); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; font-weight: 500; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--err); }

@media (max-width: 860px) {
  .topbar { padding: 14px 16px; }
  .service-status { display: none; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-left, .topbar-right { gap: 16px; }
  .account { padding-left: 0; border-left: 0; }
  .container { padding: 32px 16px 64px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 26px; }
  .grid-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  input[type="search"] { width: 100%; }
  .tabs { gap: 20px; overflow-x: auto; }
}
