/* BlueAI MLOps console. Tables first, the BlueAI navy for the bar and the primary action, a
   lighter navy for links, colour kept for state. System fonts only (no CDN). Monospace only for
   code, hashes and commits. */

:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Noto Sans Mono", Menlo, Consolas, monospace;

  /* BlueAI brand: navy and the cyan of the drop in the logo. */
  --brand: #0f2e4d;
  --brand-deep: #0b2239;
  --drop: #7ed6f7;

  --page: #f3f6f9;
  --paper: #ffffff;
  --ink: #14212e;
  --ink-soft: #5a6776;
  --line: #dbe2ea;
  --line-soft: #ebeff4;
  --wash: #f6f8fb;
  --sea: #1b5e8f;        /* links and selection, a lighter step of the brand navy */
  --sea-dark: #0f2e4d;
  --sea-wash: #e6f0f8;

  --ok: #1a7f37;
  --warn: #9a6700;
  --err: #c62828;
  --idle: #8b95a1;

  --series: #257de0;     /* chart: correct requests */
  --critical: #dc3c3d;   /* chart: failed requests */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
p { margin: 0 0 10px; }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--ink); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -40px; background: var(--ink); color: #fff; padding: 6px 12px; z-index: 10; }
.skip-link:focus { top: 8px; }
.faint { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ top bar */
.topbar { background: var(--brand); color: #fff; }
.topbar-in { display: flex; align-items: stretch; gap: 36px; min-height: 56px; }
.product { display: flex; align-items: center; gap: 10px; color: #fff; white-space: nowrap; }
.product:hover { text-decoration: none; }
.product img { display: block; }
.product-name { font-size: 15px; font-weight: 600; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.product-node { color: #a9bccf; font-size: 13px; }
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs a {
  display: flex; align-items: center; padding: 0 12px; color: #c3d1de;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.tabs a:hover { color: #fff; text-decoration: none; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--drop); font-weight: 600; }
.tabs a:focus-visible, .topbar-end a:focus-visible, .product:focus-visible { outline-color: var(--drop); }
.topbar-end { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.topbar-end a { color: #c3d1de; }
.topbar-end a:hover { color: #fff; }
.topbar-end a::after { content: " ↗"; font-size: 11px; }
.account { padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, 0.25); font-weight: 500; }

.statusline { background: var(--paper); border-bottom: 1px solid var(--line); }
.services { list-style: none; margin: 0; padding: 7px 0; display: flex; gap: 22px; font-size: 12.5px; }
.services li::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: var(--idle);
}
.services li.up::before { background: var(--ok); }
.services li.degraded::before { background: var(--warn); }
.services li.down::before { background: var(--err); }
.services li.faint { margin-left: auto; }
.services li.faint::before { display: none; }

/* ------------------------------------------------------------------ page scaffolding */
.page { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.footer { display: flex; align-items: center; gap: 16px; padding-bottom: 28px; color: var(--ink-soft); font-size: 12.5px; }
.footer img { flex: none; opacity: 0.85; }
.footer p { margin: 0; }

.h1 { font-size: 22px; line-height: 1.3; }
.h2 { font-size: 16px; line-height: 1.4; }
.h3 { font-size: 14px; }
.count { color: var(--ink-soft); font-weight: 400; margin-left: 4px; }
.page-head { margin-bottom: 18px; }
.page-head .h1 { margin-bottom: 2px; }
.page-head p { margin: 0; }
.section, .panel, .side-box, .sdk-form {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.section { padding: 16px 20px 18px; margin-bottom: 20px; }
.panel { padding: 4px 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.hint { color: var(--ink-soft); max-width: 75ch; }
.hint.wide { margin-top: 6px; margin-bottom: 20px; }
.empty { color: var(--ink-soft); padding: 10px 0; max-width: 80ch; }
.traffic { margin-top: 12px; color: var(--ink-soft); }
.crumbs { margin: 0 0 2px; color: var(--ink-soft); }
.label { display: block; font-weight: 600; margin-bottom: 4px; }
.error-text { color: var(--err); margin: 4px 0 0; }

.notices:empty { display: none; }
.notice { border-left: 3px solid var(--sea); background: var(--sea-wash); padding: 10px 14px; margin-bottom: 20px; }
.notice p { margin: 0; }
.notice-ok { border-left-color: var(--ok); background: #eef7f0; }
.notice-err { border-left-color: var(--err); background: #fbeeee; }

/* ------------------------------------------------------------------ state text */
.st { white-space: nowrap; }
.st::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: 1px; background: var(--idle);
}
.st-ok::before { background: var(--ok); }
.st-warn { color: var(--warn); }
.st-warn::before { background: var(--warn); }
.st-err { color: var(--err); }
.st-err::before { background: var(--err); }
.st + .st { margin-left: 10px; }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  font: inherit; font-weight: 500; padding: 5px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.btn:hover { background: var(--wash); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.link-btn { font: inherit; color: var(--sea); background: none; border: 0; padding: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
input[type="text"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid #c5ced8; border-radius: 6px; padding: 5px 9px; width: 100%;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--sea); outline-offset: 0; border-color: var(--sea); }

/* ------------------------------------------------------------------ tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-soft); }
.table thead th { font-weight: 500; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-top: 4px; white-space: nowrap; font-size: 13px; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 600; }
.table .num { text-align: right; padding-right: 20px; }
.table tbody tr:hover { background: var(--wash); }
.table .sub { color: var(--ink-soft); font-weight: 400; font-size: 12.5px; }
.table .reason { max-width: 46ch; }
.table .actions { text-align: right; white-space: nowrap; padding-right: 0; }
.table tr.current th:first-child { box-shadow: inset 3px 0 0 var(--ok); padding-left: 10px; }
.table tbody th:first-child { padding-left: 10px; }
.table thead th:first-child, .table td:first-child { padding-left: 10px; }

.mname-org { color: var(--ink-soft); }
a .mname { color: var(--sea); }
a .mname-org { color: #5f8b98; }


/* ------------------------------------------------------------------ models hub */
.hub { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.facet-title { font-size: 13px; color: var(--ink-soft); font-weight: 500; margin: 4px 0 6px; }
.facet-list { list-style: none; margin: 0 0 24px; padding: 0; }
.facet-list a { display: flex; justify-content: space-between; padding: 3px 8px; margin-left: -8px; border-radius: 6px; color: var(--ink); }
.facet-list a:hover { background: var(--wash); text-decoration: none; }
.facet-list a:hover { background: var(--paper); }
.facet-list a[aria-current="true"] { background: var(--paper); color: var(--brand); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
.hub-head { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.hub-head .h1 { white-space: nowrap; }
.hub-head input[type="search"] { max-width: 360px; margin-left: auto; }
.model-list { list-style: none; margin: 0; padding: 0; }
.model-list li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.model-list li:last-child { border-bottom: 0; }
.model-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.model-link { font-size: 15px; font-weight: 600; }
.model-metric { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.model-metric strong { color: var(--ink); font-weight: 600; }
.model-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 3px; color: var(--ink); font-size: 13px; }

/* ------------------------------------------------------------------ model page */
.model-head { margin-bottom: 20px; }
.model-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.tags { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; font-size: 12.5px; color: var(--ink-soft); background: var(--paper); }
.tags li:first-child { border-color: #b9d3ea; background: var(--sea-wash); color: var(--brand); }
.model-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.model-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.side-box { padding: 14px 16px 16px; }
.side-box .h3 { margin-bottom: 8px; }
.side-status { margin-bottom: 8px; }
.side-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
#side-result { margin-top: 10px; }
#side-result .response { max-height: 220px; min-height: 0; }

/* ------------------------------------------------------------------ model card */
.mc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.mc-block { padding: 14px 0 10px; border-top: 1px solid var(--line-soft); min-width: 0; }
.mc-block .h3 { margin-bottom: 8px; }
.mc-block p { max-width: 64ch; }
.mc-block .kv { margin-bottom: 8px; }
.table.compact { width: auto; min-width: 360px; margin-top: 4px; }
.quote { border-left: 2px solid var(--line); padding-left: 10px; color: var(--ink-soft); }
.table a[aria-current="true"] { font-weight: 700; text-decoration: underline; }

/* ------------------------------------------------------------------ code, editor, responses */
.code-block { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 18px; overflow: hidden; background: var(--paper); }
.code-head { display: flex; justify-content: space-between; padding: 4px 10px; font-size: 12px; color: var(--ink-soft); background: var(--wash); border-bottom: 1px solid var(--line); }
.code-block pre, .response { margin: 0; padding: 10px 12px; overflow: auto; background: var(--wash); max-height: 420px; line-height: 1.55; }
.code-block pre { background: #fbfcfd; }
.editor { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: #fbfcfd; }
.response { border: 1px solid var(--line); border-radius: 6px; min-height: 280px; }
.result-line { display: flex; gap: 14px; align-items: baseline; margin: 0 0 8px; min-height: 21px; }

/* ------------------------------------------------------------------ inference */
.infer-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.infer-head select { width: auto; min-width: 300px; }
.btn-push { margin-left: auto; }
.endpoint { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--ink-soft); }
.endpoint code { color: var(--ink); overflow-wrap: anywhere; }
.verb { font-weight: 700; font-size: 12px; color: var(--ok); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.split > .section { margin-bottom: 0; }
#playground { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
#client-code { margin-bottom: 20px; }
#client-code .code-block { background: var(--paper); margin-bottom: 0; }
.pane-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.pane-head .label { margin: 0; }
.pane-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.langs { border: 0; margin: 0; padding: 0; display: flex; gap: 2px; }
.langs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.langs label { padding: 3px 9px; border-radius: 6px; cursor: pointer; color: var(--ink-soft); }
.langs input:checked + label { background: var(--sea-wash); color: var(--sea-dark); font-weight: 600; }
.langs input:focus-visible + label { outline: 2px solid var(--sea); }
.warnings { color: var(--warn); padding-left: 18px; margin: 10px 0 0; }

/* ------------------------------------------------------------------ sdk */
.sdk-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 240px; gap: 12px; align-items: end; margin-bottom: 8px; padding: 14px 16px; max-width: 920px; }
.sdk-code { margin-top: 24px; max-width: 920px; }
.sdk-code .code-block { background: var(--paper); }
.sdk-code .h2 { margin-top: 8px; }

/* ------------------------------------------------------------------ chart */
.chart { margin: 0 0 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-soft); }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--ink-soft); font: 11px var(--font); }
.chart .bar-ok { fill: var(--series); }
.chart .bar-err { fill: var(--critical); }
.chart .p95 { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; }
.legend { list-style: none; display: flex; gap: 14px; margin: 0; padding: 0; font-size: 12.5px; color: var(--ink-soft); }
.legend li { display: flex; align-items: center; gap: 5px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.swatch-ok { background: var(--series); }
.swatch-err { background: var(--critical); }
.swatch-line { width: 14px; border-top: 1px dashed var(--ink); }

/* ------------------------------------------------------------------ dialog */
.dialog { border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; width: min(480px, calc(100vw - 32px)); color: var(--ink); }
.dialog::backdrop { background: rgba(28, 36, 48, 0.4); }
.dialog .h2 { margin-bottom: 8px; }
.dialog p { color: var(--ink-soft); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#dialogo-aprobar-error .notice { margin: 10px 0 0; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .model-layout, .split, .mc-grid { grid-template-columns: minmax(0, 1fr); }
  .sdk-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar-in { flex-wrap: wrap; gap: 8px 16px; padding-top: 10px; }
  .product-node { display: none; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .tabs a { padding: 8px 10px; }
  .hub { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .facets { display: flex; gap: 24px; flex-wrap: wrap; }
  .hub-head { flex-wrap: wrap; }
  .hub-head input[type="search"] { max-width: none; margin-left: 0; }
  .table { display: block; overflow-x: auto; }
  .wrap { padding: 0 14px; }
}
@media (forced-colors: active) {
  .st::before, .services li::before { forced-color-adjust: none; border: 1px solid CanvasText; }
  .chart .bar-ok { fill: CanvasText; }
  .chart .bar-err { fill: Mark; }
}
@media print {
  .topbar, .footer, .btn, .model-side .side-box:first-child { display: none !important; }
}

/* ------------------------------------------------------------------ sign-in and decisions */
.topbar-btn { font: inherit; color: #c3d1de; background: none; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.topbar-btn:hover { color: #fff; border-color: #fff; }
.login-main { flex: 1; display: grid; place-items: start center; padding-top: 64px; padding-bottom: 64px; }
.login-box { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 24px 26px 20px; }
.login-box .h1 { margin-bottom: 6px; }
.login-box input { margin-bottom: 14px; }
.login-box input[type="password"] { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid #c5ced8; border-radius: 6px; padding: 5px 9px; width: 100%; }
.login-submit { width: 100%; justify-content: center; margin: 4px 0 14px; }
.preview { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.preview .kv { margin: 8px 0 10px; }
.preview-confirm { margin-top: 12px; }
