:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --bg: #090f1d;
  --panel: #111a2b;
  --line: #263550;
  --text: #f3f7ff;
  --muted: #96a8c4;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --purple: #8b5cf6;
  --red: #ef6b6b;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  padding: 18px 12px;
  background: #0d1525;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand { display: grid; grid-template-columns: 40px 1fr; align-items: center; padding: 0 8px 17px; border-bottom: 1px solid var(--line); }
.brand > span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue);
  color: #06132b;
  font-size: 12px;
  font-weight: 900;
}
.brand strong { font-size: 13px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 9px; }
.sidebar-nav { min-height: 0; flex: 1; display: grid; align-content: start; gap: 10px; padding: 12px 3px; overflow-y: auto; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { width: 0; height: 0; }
.nav-group { display: grid; gap: 2px; }
.nav-group-title { display: flex; align-items: center; gap: 7px; margin: 0 7px 4px; color: #7e8692; }
.nav-group-title::after { content: ""; min-width: 12px; height: 1px; flex: 1; background: #2a2f37; }
.nav-group-title span { width: 24px; height: 20px; display: grid; place-items: center; border: 1px solid #353b45; border-radius: 5px; background: #171a20; color: #818a97; font-size: 10px; font-weight: 900; letter-spacing: .03em; }
.nav-group-title strong { color: #969eaa; font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.sidebar-nav a { position: relative; display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 7px 9px; border: 1px solid transparent; border-radius: 7px; color: #afb5bf; font-size: 13px; font-weight: 650; line-height: 1.2; }
.sidebar-nav a::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border: 1px solid #68717d; border-radius: 2px; background: transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #172b4d; color: #fff; }
.sidebar-foot {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 13px 9px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 9px;
  font-size: 10px;
  color: var(--muted);
}
.sidebar-foot strong { color: #eef4ff; font-size: 11px; }
.sidebar-foot span { margin-top: -5px; color: var(--blue-light); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-foot small { display: none; }
.sidebar-foot form { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.sidebar-foot button { border: 0; background: none; color: #c7cdd6; padding: 0; font-size: 10px; cursor: pointer; }

.content { margin-left: 224px; min-height: 100vh; padding: 38px 44px; max-width: 1700px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head.compact { align-items: center; }
.page-head h1 { font-size: 34px; margin: 3px 0 5px; letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); }
.queue-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; font-weight: 750; }
.queue-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #71809a; }
.queue-status.ready::before { background: var(--blue-light); box-shadow: 0 0 0 3px #3b82f622; }
.queue-status.missing::before { background: #ef6b6b; box-shadow: 0 0 0 3px #ef6b6b22; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 11px !important; color: var(--blue-light) !important; font-weight: 800; }

.button { border: 0; border-radius: 9px; padding: 12px 17px; font: inherit; font-weight: 800; cursor: pointer; display: inline-block; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #5291f7; }
.muted { background: #293750; color: #fff; }
.danger { background: var(--red); color: #260707; }
.full { width: 100%; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.stats article, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.stats article { padding: 20px; }
.stats article.accent { border-color: #326fc8; background: #10213d; }
.stats span, .stats small { display: block; color: var(--muted); }
.stats strong { display: block; font-size: 34px; margin: 7px 0; }
.head-actions { display: flex; gap: 10px; }
.dashboard-head { align-items: center; }
.dashboard-active { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(280px, 1.5fr) auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 14px 17px; border: 1px solid #326fc8; border-radius: 12px; background: #10213d; }
.dashboard-active > div { display: flex; align-items: center; gap: 11px; }
.dashboard-active small, .dashboard-active strong { display: block; }
.dashboard-active small { color: var(--blue-light); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-active strong { margin-top: 3px; font-size: 13px; }
.dashboard-active p { margin: 0; overflow: hidden; color: #b8c8dd; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-active a { color: var(--blue-light); font-size: 12px; font-weight: 800; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue-light); box-shadow: 0 0 0 6px #60a5fa20; animation: live-pulse 1.8s ease-in-out infinite; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.dashboard-kpis.reviewer-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-kpis > a { position: relative; min-width: 0; min-height: 174px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); display: flex; flex-direction: column; transition: border-color .18s, transform .18s, box-shadow .18s; }
.dashboard-kpis > a:hover { transform: translateY(-2px); border-color: #4b5563; box-shadow: 0 15px 38px #0000002b; }
.dashboard-kpis > a.attention { border-color: #326fc8; background: linear-gradient(145deg, #102442, #111a2b); }
.dashboard-kpis span, .dashboard-kpis small { display: block; color: var(--muted); }
.dashboard-kpis span { font-size: 11px; font-weight: 750; }
.dashboard-kpis strong { display: block; margin: 11px 0 5px; font-size: 32px; letter-spacing: -.04em; }
.dashboard-kpis small { min-height: 28px; font-size: 10px; line-height: 1.4; }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.dashboard-kpis .kpi-head > span:last-child { color: #adb4bf; font-size: 11px; font-weight: 750; }
.kpi-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid !important; place-items: center; border: 1px solid #353d48; border-radius: 9px; background: #1d222a; color: #83aff1 !important; }
.kpi-icon svg { width: 16px; height: 16px; fill: currentColor; }
.kpi-bottom { min-height: 20px; display: flex !important; align-items: flex-end; margin-top: auto; padding-top: 12px; }
.kpi-line { position: relative; width: 100%; height: 5px; overflow: hidden; border-radius: 99px; background: #2b313b; }
.kpi-line b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.dashboard-kpis .kpi-link { color: #84adf0; font-size: 10px; font-weight: 800; }
.dashboard-kpis .kpi-link b { margin-left: 3px; color: inherit; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.dashboard-layout > .panel { min-width: 0; height: 100%; display: flex; flex-direction: column; }
.dashboard-layout .panel-head { margin-bottom: 18px; }
.dashboard-layout .panel-head > strong { color: var(--blue-light); font-size: 12px; }
.donut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.donut-grid.single { grid-template-columns: 1fr; }
.reviewer-layout .category-panel { grid-column: 1 / -1; }
.dashboard-progress .donut-grid { flex: 1; align-items: center; }
.donut-card { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #0e192b; }
.donut { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--value) * 1%), #263650 0); }
.donut.multi { background: conic-gradient(var(--blue) calc(var(--reviewed) * 1%), var(--red) 0 calc(var(--handled) * 1%), #263650 0); }
.donut::before { content: ""; grid-area: 1 / 1; width: 62px; height: 62px; border-radius: 50%; background: #0e192b; }
.donut span { z-index: 1; grid-area: 1 / 1; font-size: 17px; font-weight: 900; }
.donut-card strong { display: block; font-size: 12px; }
.donut-card p { margin: 5px 0 2px; font-size: 11px; }
.donut-card small { color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: #263650; }
.chart-legend i.blue { background: var(--blue); }
.chart-legend i.red { background: var(--red); }
.activity-chart { height: 164px; display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 5px; padding: 24px 5px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 40px, #26355055 41px); }
.activity-column { height: 100%; display: grid; grid-template-rows: 17px 1fr 20px; align-items: end; justify-items: center; min-width: 0; }
.activity-column > span { color: var(--muted); font-size: 9px; }
.activity-column > i { width: min(18px, 80%); min-height: 2px; border-radius: 5px 5px 1px 1px; background: linear-gradient(#60a5fa, #2563eb); }
.activity-column > small { align-self: center; color: #7284a0; font-size: 8px; }
.activity-axis { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 9px; }
.category-progress + .category-progress { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.category-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.category-progress > div:first-child strong { font-size: 13px; }
.category-progress > div:first-child span { color: var(--muted); font-size: 11px; }
.stacked-progress { display: flex; height: 10px; margin: 11px 0; overflow: hidden; border-radius: 99px; background: #263650; }
.stacked-progress i { height: 100%; }
.stacked-progress .reviewed { background: var(--blue); }
.stacked-progress .rejected { background: var(--red); }
.stacked-progress .pending { background: #42516a; }
.category-progress dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.category-progress dl div { padding: 8px 10px; border-radius: 8px; background: #0e192b; }
.category-progress dt { color: var(--muted); font-size: 9px; }
.category-progress dd { margin: 3px 0 0; font-size: 13px; font-weight: 850; }
.coverage-list { flex: 1; display: grid; align-content: space-between; gap: 11px; }
.coverage-list > div { display: grid; grid-template-columns: 78px minmax(80px, 1fr) 60px 45px; align-items: center; gap: 9px; font-size: 10px; }
.coverage-list > div > span { color: var(--muted); }
.coverage-list > div > strong { text-align: right; }
.coverage-list > div > small { color: var(--muted); text-align: right; }
.coverage-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #263650; }
.coverage-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.model-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model-slots > div { display: grid; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #0e192b; }
.model-slots span, .model-slots small { color: var(--muted); font-size: 10px; }
.model-slots strong { font-size: 13px; overflow-wrap: anywhere; }
.version-list { margin-top: 16px; }
.mini-title { display: flex; justify-content: space-between; padding: 0 2px 7px; color: var(--muted); font-size: 10px; }
.mini-title a { color: var(--blue-light); }
.version-list > div:not(.mini-title) { display: grid; grid-template-columns: minmax(80px, .65fr) minmax(120px, 1fr) auto; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); }
.version-list > div > strong { font-size: 11px; }
.version-list > div > span { color: var(--muted); font-size: 10px; }
.dashboard-job { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.dashboard-job:first-of-type { border-top: 0; }
.job-mark { width: 8px; height: 34px; border-radius: 99px; background: #42516a; }
.job-mark.completed { background: var(--blue); }
.job-mark.running, .job-mark.queued { background: #f4ce6c; }
.job-mark.failed { background: var(--red); }
.dashboard-job > div:nth-child(2) { min-width: 0; }
.dashboard-job strong, .dashboard-job small { display: block; }
.dashboard-job strong { font-size: 11px; }
.dashboard-job small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-job > div:last-child { display: grid; justify-items: end; gap: 5px; }
.dashboard-job time { color: var(--muted); font-size: 9px; }
.recent-panel .dashboard-job { flex: 1; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 22px; }
.panel h2 { margin: 4px 0; font-size: 19px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 22px; }
.panel-head > a { color: var(--blue-light); font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 55px; align-items: center; gap: 12px; margin: 18px 0; font-size: 13px; }
.bar { height: 8px; background: #23314a; border-radius: 99px; overflow: hidden; }
.bar i { height: 100%; display: block; background: var(--blue); }
.bar.purple i { background: var(--purple); }
.hint { font-size: 12px !important; line-height: 1.55; color: var(--muted); margin-top: 22px; }

.list-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.list-row small { display: block; color: var(--muted); margin-top: 3px; }
.pill { padding: 5px 9px; border-radius: 99px; background: #293750; color: #d7e1f1; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.pill.reviewed, .pill.processed, .pill.frozen, .pill.completed { background: #173b70; color: #8fc1ff; }
.pill.ready, .pill.active { background: #173b70; color: #8fc1ff; }
.pill.test_ready { background: #44381a; color: #f4ce6c; }
.pill.inactive { background: #293750; color: #b8c5d9; }
.pill.rejected, .pill.failed { background: #4b2020; color: #ffaaa7; }
.pill.pending, .pill.new, .pill.queued, .pill.draft { background: #44381a; color: #f4ce6c; }
.pill.cancel_requested { background: #44381a; color: #f4ce6c; }
.pill.cancelled { background: #293750; color: #b8c5d9; }

.tabs { display: flex; gap: 5px; padding: 4px; background: #10192a; border: 1px solid var(--line); border-radius: 10px; }
.tabs a { padding: 8px 11px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.tabs a:hover { background: #20375d; color: #fff; }
.tabs a.active { background: var(--blue); color: #fff; box-shadow: 0 4px 12px #2563eb3d; }

.review-workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(350px, .75fr); gap: 22px; align-items: stretch; }
.crop-stage { min-width: 0; }
.crop-stage > img { width: 100%; height: calc(100vh - 190px); min-height: 500px; object-fit: contain; background: #eef1f5; border-radius: 14px; padding: 20px; }
.crop-meta { display: flex; gap: 12px; color: var(--muted); font-size: 11px; padding: 11px 2px; overflow-wrap: anywhere; }
.review-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; align-content: start; gap: 10px; }
.suggestion { padding: 13px; border: 1px solid #315a93; border-radius: 10px; background: #11233f; margin-bottom: 6px; }
.suggestion > div { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.suggestion > strong { display: block; margin-top: 7px; color: #d7e9ff; overflow-wrap: anywhere; }
.review-panel label, .datasets label, .login-card label { font-weight: 750; font-size: 13px; display: grid; gap: 8px; }
textarea, input { width: 100%; border: 1px solid #415373; background: #121c2e; color: #fff; border-radius: 9px; padding: 12px; font: inherit; }
select { width: 100%; border: 1px solid #415373; background: #121c2e; color: #fff; border-radius: 9px; padding: 12px; font: inherit; }
textarea:focus, input:focus { outline: 3px solid #3b82f633; border-color: var(--blue); }
.review-panel textarea { font-size: 20px; line-height: 1.45; margin-bottom: 3px; }

.table-wrap { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
td small { display: block; color: var(--muted); margin-top: 4px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.label-cell { font-size: 15px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 2px; color: var(--blue-light); }
.pager span { color: var(--muted); font-size: 12px; }
.pager .disabled { opacity: .3; pointer-events: none; }
.pager.inside { padding: 14px 18px; border-top: 1px solid var(--line); }
.table-action { display: inline-block; padding: 7px 11px; border: 1px solid #3b6cb0; border-radius: 7px; color: #9bc7ff; font-size: 12px; font-weight: 800; }
.table-action:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.table-action { background: transparent; cursor: pointer; font-family: inherit; }
.image-dialog { width: min(1050px, calc(100vw - 40px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 1px solid #344d73; border-radius: 17px; background: #101a2b; color: var(--text); box-shadow: 0 28px 90px #000b; }
.image-dialog::backdrop { background: #020713cc; backdrop-filter: blur(5px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: #101a2bf2; backdrop-filter: blur(10px); }
.dialog-head h2 { margin: 3px 0 0; font-size: 20px; overflow-wrap: anywhere; }
.dialog-close { border: 0; background: transparent; color: #c8d6ea; cursor: pointer; }
.dialog-actions .dialog-close { background: #293750; color: #fff; }
.dialog-head .dialog-close { width: 36px; height: 36px; border-radius: 9px; background: #263650; font-size: 23px; line-height: 1; }
.dialog-image { position: relative; min-height: 420px; display: grid; place-items: center; margin: 18px 22px; overflow: hidden; border-radius: 12px; background: #eef2f7; }
.dialog-image.row-preview { min-height: 260px; }
.dialog-image img { display: block; max-width: 100%; max-height: 68vh; object-fit: contain; }
.image-loading { display: none; position: absolute; color: #41506a; font-weight: 800; }
.image-dialog.loading .image-loading { display: block; }
.image-dialog.loading .dialog-image { background: linear-gradient(110deg, #e7ecf3 30%, #f7f9fc 45%, #e7ecf3 60%); background-size: 220% 100%; animation: image-shimmer 1.4s infinite; }
.dialog-details { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 0 22px; }
.dialog-details div, .decision-card > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #131f33; }
.dialog-details span, .decision-card span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.dialog-details strong, .decision-card strong { display: block; overflow-wrap: anywhere; font-size: 13px; text-transform: capitalize; }
.decision-card { display: grid; grid-template-columns: .65fr 1.35fr; gap: 10px; padding: 0 22px 12px; }
.decision-card > div:last-child strong { font-size: 18px; text-transform: none; }
.dialog-key { margin: 14px 22px 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 22px 22px; }
.confirmation-dialog { width: min(560px, calc(100vw - 40px)); }
.confirmation-body { padding: 22px; }
.confirmation-body > p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.confirmation-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.confirmation-details div { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #131f33; }
.confirmation-details span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.confirmation-details strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
@keyframes image-shimmer { to { background-position-x: -220%; } }
.datasets { align-items: start; }
.datasets .panel { display: grid; gap: 14px; }
.version { margin-bottom: 14px; }
.version-counts { display: flex; flex-wrap: wrap; gap: 9px 20px; color: var(--muted); font-size: 12px; }
.version-counts b { color: #fff; }
.empty { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); border: 1px dashed #344563; border-radius: 14px; }
.empty strong { color: #fff; font-size: 18px; }
.empty.small { min-height: 120px; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% 15%, #17366b, #090f1d 46%); }
.login-card { width: min(420px, calc(100% - 32px)); padding: 32px; border: 1px solid var(--line); border-radius: 17px; background: #10192a; display: grid; gap: 16px; }
.login-card h1 { font-size: 31px; margin: 0; }
.login-card > p { margin: 0; color: var(--muted); }
.login-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: var(--blue); color: #06132b; font-weight: 900; }
.alert { background: #4b2020; color: #ffaaa7; padding: 11px; border-radius: 8px; font-size: 13px; }
.job-notice { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #315a93; border-radius: 10px; background: #11233f; color: #cfe3ff; }
.job-notice.warning { border-color: #826a2b; background: #382f18; color: #f6d981; }
.section-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 720px; margin-bottom: 28px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #0d1627; }
.section-tabs a { display: grid; grid-template-columns: 34px 1fr; padding: 12px 14px; border-radius: 9px; color: var(--muted); }
.section-tabs a > span { grid-row: 1 / 3; color: #6680a6; font-size: 11px; font-weight: 900; }
.section-tabs strong { color: #d9e4f5; font-size: 13px; }
.section-tabs small { margin-top: 3px; font-size: 10px; }
.section-tabs a.active { background: #193760; box-shadow: 0 5px 18px #02071355; }
.section-tabs a.active > span { color: #79b4ff; }
.scan-button { min-width: 142px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.scan-button:disabled { cursor: wait; opacity: .82; }
.button-spinner { display: none; width: 15px; height: 15px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.scan-button.loading .button-spinner, .scan-button:disabled .button-spinner { display: block; }
.active-job { display: grid; grid-template-columns: 52px 1fr; gap: 17px; margin-bottom: 22px; padding: 20px; border: 1px solid #386fb8; border-radius: 14px; background: linear-gradient(120deg, #102548, #111b2e); box-shadow: 0 14px 45px #02081755; }
.active-job-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: #1d4f91; }
.active-job-icon span { width: 22px; height: 22px; border: 3px solid #78b4ff55; border-top-color: #8bc1ff; border-radius: 50%; animation: spin .9s linear infinite; }
.active-job-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.active-job h2 { margin: 3px 0 6px; font-size: 20px; }
.active-job-body > p { margin: 0 0 15px; color: var(--muted); }
.progress-track { position: relative; height: 9px; overflow: hidden; border-radius: 99px; background: #253752; }
.progress-track i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.progress-track.indeterminate i { width: 38%; animation: scan-progress 1.35s ease-in-out infinite; }
.progress-meta { display: flex; justify-content: space-between; gap: 15px; margin-top: 9px; color: #9eb3d1; font-size: 11px; }
.scan-starting[hidden] { display: none; }
.pill.running { background: #173b70; color: #9bc7ff; }
.history-progress { min-width: 105px; display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.mini-progress { position: relative; width: 100%; height: 5px; overflow: hidden; border-radius: 99px; background: #263650; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.mini-progress.moving i { position: absolute; animation: scan-progress 1.35s ease-in-out infinite; }
.job-stats { margin-top: -6px; }
.jobs-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; }
.table-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 22px 16px; }
.table-title h2 { margin: 4px 0 0; }
.table-title > small { max-width: 260px; color: var(--muted); line-height: 1.45; text-align: right; }
.next-step { margin-top: 18px; border-style: dashed; }
.next-step p:last-child { max-width: 900px; color: var(--muted); line-height: 1.6; }
.crop-browser { padding: 0; overflow: hidden; margin-bottom: 18px; }
.date-coverage-panel { padding: 0; overflow: hidden; margin-bottom: 18px; }
.crop-filter { display: grid; gap: 17px; padding: 0 22px 20px; border-bottom: 1px solid var(--line); background: #111c2f; }
.filter-title { padding-left: 0; padding-right: 0; }
.filter-title p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.filter-title p strong { color: #cfe2ff; }
.filter-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; align-items: end; }
.compact-filters { grid-template-columns: 1fr 1fr 1.1fr 1.1fr 1.1fr auto; }
.filter-grid label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.filter-submit { min-height: 45px; }
.selection-strip { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #0f192a; }
.selection-strip div { padding: 14px 18px; border-right: 1px solid var(--line); }
.selection-strip div:last-child { border-right: 0; }
.selection-strip span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.selection-strip strong { font-size: 13px; }
.selection-history-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.batch-summary { display: flex; flex-direction: column; }
.batch-summary h2 { margin: 5px 0 2px; }
.batch-summary > strong { display: block; margin-top: 8px; font-size: 46px; line-height: 1; }
.batch-summary > span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.batch-summary dl { display: grid; gap: 8px; margin: 22px 0; }
.batch-summary dl div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.batch-summary dt { color: var(--muted); font-size: 11px; }
.batch-summary dd { margin: 0; font-size: 12px; font-weight: 800; text-align: right; }
.batch-summary > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.locked-action:disabled { cursor: not-allowed; opacity: .55; }
.crop-preview-table { border-radius: 0; }
.crop-history { padding: 0; overflow: hidden; }
.training-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.training-launch { display: grid; gap: 16px; }
.training-launch > h2 { margin-top: -10px; }
.training-launch form { display: grid; gap: 14px; }
.training-launch label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.runtime-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #0e192b; }
.runtime-status > div { display: grid; gap: 4px; min-width: 0; }
.runtime-status strong { font-size: 13px; }
.runtime-status span { color: var(--muted); font-size: 11px; }
.runtime-status > b { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; background: #1c3762; color: #9bc7ff; font-size: 10px; text-transform: uppercase; }
.runtime-status.ready { border-color: #326fc8; background: #10213d; }
.runtime-status.missing { border-color: #826a2b; background: #382f18; }
.machine-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #0e192b; }
.machine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.machine-head span { font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.machine-head small { color: var(--muted); font-size: 10px; }
.machine-item { display: grid; gap: 4px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.machine-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.machine-item-head strong { font-size: 11px; color: var(--blue-light); }
.machine-item-head b { font-size: 12px; }
.machine-item > span { overflow-wrap: anywhere; font-size: 12px; font-weight: 750; }
.machine-item > small, .machine-availability small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.machine-meter { height: 5px; margin-top: 4px; overflow: hidden; border-radius: 99px; background: #253550; }
.machine-meter i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.machine-meter.gpu i { background: #8b5cf6; }
.machine-availability { display: grid; grid-template-columns: 40px 1fr; gap: 3px 9px; align-items: center; padding: 11px 13px; }
.machine-availability span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.machine-availability strong { font-size: 12px; }
.machine-availability small { grid-column: 2; }
.training-dataset { display: grid; gap: 5px; padding: 14px; border: 1px solid #315a93; border-radius: 10px; background: #11233f; }
.training-dataset span, .training-dataset small { color: var(--muted); font-size: 11px; }
.training-dataset strong { font-size: 20px; }
.training-facts { display: grid; gap: 7px; margin: 0; }
.training-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.training-facts dt { color: var(--muted); font-size: 11px; }
.training-facts dd { margin: 0; font-size: 12px; font-weight: 800; }
.training-history { padding: 0; overflow: hidden; }
.model-test-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.model-test-form { display: grid; gap: 15px; }
.model-test-form > h2 { margin-top: -9px; }
.model-test-form label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.model-test-form label small { color: var(--muted); font-weight: 500; }
.model-test-history { padding: 0; overflow: hidden; }
.prediction-result { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); gap: 22px; align-items: center; margin-bottom: 18px; padding: 18px; border: 1px solid #386fb8; border-radius: 14px; background: #101d33; }
.prediction-result.correct { border-color: #2d8a58; background: #10291e; }
.prediction-result.wrong { border-color: #a64c4c; background: #2c171c; }
.prediction-result > img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: #eef2f7; }
.prediction-result h2 { margin: 6px 0 18px; font-size: 28px; overflow-wrap: anywhere; }
.prediction-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.prediction-meta span { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.prediction-meta b { margin-left: 5px; color: #fff; }
.test-thumb { display: inline-flex; align-items: center; gap: 8px; color: var(--blue-light); font-size: 11px; font-weight: 800; }
.test-thumb img { width: 70px; height: 38px; object-fit: contain; border-radius: 5px; background: #eef2f7; }
.test-result-summary { display: grid; justify-items: start; gap: 5px; }
.test-result-summary small { margin: 0; line-height: 1.35; }
.action-column { width: 1%; white-space: nowrap; text-align: right; }
.model-test-dialog { width: min(1280px, calc(100vw - 40px)); height: min(800px, calc(100vh - 40px)); overflow: hidden; }
body:has(.model-test-dialog[open]) { overflow: hidden; }
.model-test-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.model-test-dialog .dialog-head > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.model-test-dialog-body { display: grid; grid-template-columns: 280px 250px minmax(0, 1fr); min-height: 0; overflow: hidden; }
.model-test-whole { min-height: 0; padding: 20px 0 20px 22px; overflow: hidden; border-right: 1px solid var(--line); }
.model-test-whole .dialog-image { min-height: 0; height: min(420px, 55vh); margin: 12px 20px 12px 0; }
.model-test-whole > p:last-child { margin: 0 20px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.model-test-output { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; gap: 12px; padding: 20px; overflow: hidden; border-right: 1px solid var(--line); }
.whole-result-text { display: grid; align-content: start; gap: 9px; min-height: 0; margin: 0; padding: 14px; overflow: hidden; border: 1px solid #3b4655; border-radius: 10px; background: #191e25; }
.whole-result-text span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.whole-result-text strong { min-height: 0; overflow: auto; color: #f3f6fa; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.model-test-output-facts { display: grid; gap: 8px; }
.model-test-output-facts > div { padding: 11px 12px; border: 1px solid #343b46; border-radius: 9px; background: #171b21; }
.model-test-output-facts span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.model-test-output-facts strong { display: block; font-size: 13px; }
.model-test-row-results { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.model-test-row-head { padding: 20px 18px 15px; }
.model-test-row-head h3 { margin: 5px 0 0; font-size: 17px; }
.model-test-summary { grid-template-columns: repeat(3, 1fr); padding-bottom: 18px; }
.model-test-dialog .detected-row-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.model-test-dialog .detected-row-list article:first-child { border-top: 0; }
.model-test-dialog .detected-row-list article { grid-template-columns: 32px 150px minmax(0, 1fr); gap: 12px; padding: 13px 16px; }
.model-test-dialog .detected-row-list img { height: 76px; }
.prediction-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.prediction-option { min-width: 0; padding: 10px 12px; border: 1px solid #363d48; border-radius: 9px; background: #181c22; }
.prediction-option.fine-tuned { border-color: #345b91; background: #172131; }
.prediction-option > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.prediction-option span { color: var(--muted); font-size: 10px; font-weight: 750; }
.prediction-option small { flex: 0 0 auto; margin: 0; padding: 3px 6px; border-radius: 999px; background: #252b34; color: #bdc7d5; font-size: 9px; font-weight: 800; }
.prediction-option.fine-tuned small { background: #213b60; color: #a8ceff; }
.prediction-option strong { font-size: 15px; line-height: 1.25; }
.expected-row-text { grid-column: 1 / -1; margin: 0; padding: 2px 3px; }
.whole-image-result { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(500px, 1.3fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.whole-image-preview { display: grid; gap: 13px; }
.whole-image-preview > img { width: 100%; max-height: 520px; object-fit: contain; border-radius: 10px; background: #eef2f7; }
.whole-image-preview > p:last-child { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.detected-results { padding: 0; overflow: hidden; }
.detected-row-list { display: grid; }
.detected-row-list article { display: grid; grid-template-columns: 32px minmax(150px, .7fr) minmax(220px, 1.3fr) 80px; gap: 12px; align-items: center; padding: 13px 17px; border-top: 1px solid var(--line); }
.detected-row-list img { width: 100%; height: 72px; object-fit: contain; border-radius: 7px; background: #eef2f7; }
.row-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #1e3a66; color: #9bc7ff; font-size: 11px; font-weight: 900; }
.detected-row-list small { display: block; margin: 3px 0; color: var(--muted); font-size: 10px; }
.detected-row-list strong { display: block; overflow-wrap: anywhere; font-size: 15px; }
.row-confidence { display: grid; gap: 6px; justify-items: end; color: var(--muted); font-size: 11px; }
.correct-text { color: #70dda0; }
.wrong-text { color: #ff9995; }
.multi-line-result { display: block; max-width: 340px; white-space: pre-line; overflow-wrap: anywhere; }
.production-readiness { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #0e192b; }
.production-readiness > p { margin: 0 0 4px; }
.production-readiness > div { display: flex; justify-content: space-between; font-size: 12px; }
.ready-text { color: #70dda0; }
.blocked-text { color: #f1c75b; }
.model-version-grid { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.model-publish-form { display: grid; gap: 15px; }
.model-publish-form > h2 { margin-top: -9px; }
.model-publish-form label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.model-flow ol { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: release-step; }
.model-flow li { counter-increment: release-step; display: grid; grid-template-columns: 34px 90px 1fr; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #0e192b; }
.model-flow li::before { content: counter(release-step); width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #1e3a66; color: #9bc7ff; font-size: 11px; font-weight: 900; }
.model-flow li span { color: var(--muted); font-size: 11px; }
.models-table { padding: 0; overflow: hidden; }
.user-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; align-items: start; }
.user-create { display: grid; gap: 15px; position: sticky; top: 24px; }
.user-create h2 { margin-top: -8px; }
.user-create label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.form-help { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.user-list { padding: 0; overflow: hidden; }
.account-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.role-badge { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: #c5d3e7; font-size: 10px; font-weight: 800; }
.account-table-wrap { border-top: 1px solid var(--line); }
.account-table { min-width: 760px; }
.account-table th, .account-table td { padding: 15px 14px; }
.account-table th:first-child, .account-table td:first-child { padding-left: 22px; }
.account-table th:last-child, .account-table td:last-child { padding-right: 22px; }
.account-table td { color: #d4dfee; font-size: 11px; }
.account-table td:first-child strong { display: block; color: #fff; font-size: 13px; }
.account-table .disabled-row { opacity: .62; background: #0d1524; }
.actions-heading { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.row-actions form { margin: 0; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #355079; border-radius: 9px; background: #14243d; color: #8fc1ff; cursor: pointer; }
.icon-button:hover { border-color: var(--blue-light); background: #1a345d; color: #fff; }
.icon-button:disabled { cursor: not-allowed; opacity: .28; }
.icon-button svg { width: 16px; height: 16px; fill: currentColor; }
.icon-button.danger-icon { border-color: #713c46; background: #321d27; color: #ff9995; }
.account-dialog { width: min(520px, calc(100vw - 32px)); }
.account-dialog-body { display: grid; gap: 15px; padding: 22px; }
.account-dialog-body label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.account-dialog-body label small { color: #f4ce6c; font-size: 10px; font-weight: 500; }
.account-dialog .dialog-head p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.log-toolbar { margin-bottom: 18px; }
.log-toolbar form { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 12px; align-items: end; }
.log-toolbar label { display: grid; gap: 7px; color: #cbd7e9; font-size: 12px; font-weight: 750; }
.log-toolbar > p { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.log-viewer { padding: 0; overflow: hidden; }
.log-viewer-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #0e192b; }
.log-viewer-head strong, .log-viewer-head span { display: block; }
.log-viewer-head strong { font-size: 13px; }
.log-viewer-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.log-viewer-head > span { margin: 0; white-space: nowrap; }
.log-viewer pre { max-height: 68vh; margin: 0; padding: 18px; overflow: auto; background: #080e19; color: #c7d6eb; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Calm dark theme: neutral surfaces with blue reserved for actions and focus. */
:root {
  --bg: #0a0c0f;
  --panel: #14171c;
  --surface: #101318;
  --surface-raised: #191d24;
  --line: #2b3038;
  --text: #eef1f5;
  --muted: #989faa;
  --blue: #3b82f6;
  --blue-light: #75aaff;
  --purple: #9b87f5;
  --green: #67c58c;
  --amber: #d6ad59;
  --red: #e57373;
}
body { background: radial-gradient(circle at 58% -15%, #171b22 0, var(--bg) 38%); }
::selection { background: #315b91; color: #fff; }
* { scrollbar-color: #3a414c #101318; }
.sidebar { background: #0e1014; border-color: #242932; }
.brand > span { background: #2563eb; color: #fff; box-shadow: 0 7px 20px #2563eb2b; }
.sidebar-nav a { color: #a6adb8; }
.sidebar-nav a:hover { border-color: #292f38; background: #181c22; color: #f2f4f7; }
.sidebar-nav a:hover::before { border-color: #85909e; }
.sidebar-nav a.active { border-color: #343c48; background: #1c2027; color: #fff; box-shadow: inset 2px 0 var(--blue), 0 5px 14px #00000018; }
.sidebar-nav a.active::before { border-color: #75aaff; background: #4d8df4; box-shadow: 0 0 0 3px #3b82f61c; }
.stats article, .panel, .dashboard-kpis > a { background: var(--panel); border-color: var(--line); box-shadow: 0 12px 34px #00000018; }
.stats article.accent, .dashboard-kpis > a.attention { border-color: #39414c; background: var(--panel); box-shadow: inset 3px 0 var(--blue), 0 12px 34px #00000018; }
.dashboard-active, .active-job { border-color: #3b4655; background: linear-gradient(120deg, #191d24, #13161b); }
.active-job-icon { background: #202733; }
.donut-card, .category-progress dl div, .model-slots > div, .runtime-status,
.machine-card, .production-readiness, .model-flow li, .dialog-details div,
.decision-card > div, .confirmation-details div { background: var(--surface); border-color: var(--line); }
.donut::before { background: var(--surface); }
.muted { background: #252a32; color: #e8ebef; }
.muted:hover { background: #303640; }
.danger { background: #6e3035; color: #fff; }
.tabs, .section-tabs { background: #101318; }
.tabs a:hover, .section-tabs a:hover { background: #20252d; }
.tabs a.active { background: #222832; color: #fff; box-shadow: inset 0 -2px var(--blue); }
.section-tabs a.active { background: #20252d; box-shadow: inset 3px 0 var(--blue); }
.suggestion, .training-dataset, .job-notice { border-color: #364151; background: #181d24; color: #dce5f2; }
.runtime-status.ready { border-color: #3d4856; background: #171b21; }
.prediction-result { border-color: #343b46; background: #15191f; }
.login-page { background: radial-gradient(circle at 50% 10%, #242a33, #0a0c0f 48%); }
.login-card { background: #14171c; }
.row-number, .model-flow li::before { background: #242a33; color: #9fc2f8; }
.crop-filter, .selection-strip { background: #111419; }
textarea, input, select { border-color: #3a414c; background: #101318; }
textarea:hover, input:hover, select:hover { border-color: #515a67; }
textarea:focus, input:focus, select:focus { outline: 3px solid #3b82f626; border-color: var(--blue); }
th { background: #111419; color: #8f97a3; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #181c22; }
.image-dialog, .dialog-head { background: #14171c; border-color: var(--line); }
.dialog-head { background: #14171cf2; }
.dialog-head .dialog-close { background: #242932; }
.table-action { border-color: #465365; color: #a9c9ff; }
.table-action:hover { background: #2563eb; border-color: #2563eb; }
.icon-button { border-color: #39414c; background: #1b1f26; color: #b9c4d4; }
.icon-button:hover { border-color: #5e6b7d; background: #252b34; color: #fff; }
.log-viewer-head { background: #111419; }

.pill { border: 1px solid #3a414b; background: #242931; color: #cbd1da; }
.pill.reviewed, .pill.processed, .pill.completed, .pill.ready, .pill.active {
  border-color: #315f45; background: #182b21; color: #7bd69e;
}
.pill.frozen { border-color: #554d82; background: #242039; color: #b9aaff; }
.pill.running { border-color: #355c92; background: #192b44; color: #8dbbff; }
.pill.pending, .pill.new, .pill.queued, .pill.draft, .pill.cancel_requested, .pill.test_ready {
  border-color: #66542e; background: #2d2618; color: #e2bd68;
}
.pill.rejected, .pill.failed { border-color: #704044; background: #321d20; color: #ff9b9b; }
.pill.inactive, .pill.cancelled { border-color: #3a414b; background: #23272e; color: #abb2bd; }

.category-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .025em;
  white-space: nowrap;
}
.category-pill.two_digit { border-color: #315b91; background: #182a42; color: #8ebcff; }
.category-pill.three_digit { border-color: #5c4f91; background: #27213e; color: #c0afff; }
.category-count { display: inline-flex !important; align-items: center; gap: 7px; }
.category-progress > div:first-child .category-pill { font-size: 11px; }
.crop-meta .category-pill { color: #8ebcff; }
.crop-meta .category-pill.three_digit { color: #c0afff; }

.ocr-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.ocr-metric {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 5px 14px;
  padding: 14px 17px;
}
.ocr-metric span { color: var(--muted); font-size: 11px; font-weight: 750; }
.ocr-metric strong { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; font-size: 24px; line-height: 1; }
.ocr-metric small { color: #aeb5c0; font-size: 10px; line-height: 1.45; }
.ocr-filter-panel { margin-bottom: 14px; padding: 13px 17px; }
.ocr-filter-panel form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.ocr-filter-panel label { display: grid; gap: 5px; color: #cbd1da; font-size: 10px; font-weight: 750; }
.ocr-filter-panel input, .ocr-filter-panel select { padding: 9px 11px; }
.ocr-filter-panel .button { padding-top: 10px; padding-bottom: 10px; }
.ocr-request-table { padding: 0; overflow: hidden; }
.ocr-request-table .table-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.ocr-request-table .table-title h2 { margin: 4px 0 0; }
.ocr-request-table .table-title > small { max-width: 290px; color: var(--muted); text-align: right; line-height: 1.5; }
.ocr-table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.ocr-table-actions small { max-width: 240px; color: var(--muted); text-align: right; line-height: 1.45; }
.ocr-table-actions .button { white-space: nowrap; }
.compact-active-job { margin-bottom: 18px; }
.bulk-approval-dialog { width: min(720px, calc(100vw - 40px)); }
.bulk-approval-dialog .confirmation-details { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ocr-request-table table { min-width: 1120px; }
.ocr-request-table td > small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.ocr-request-table td:first-child strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ocr-request-table form { margin: 0; }
.inline-link {
  display: inline-flex;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #91bbfa;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.inline-link:hover { color: #fff; }
.danger-link { color: #f38f8f; }
.candidate-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pill.uploaded, .pill.approved { border-color: #315f45; background: #182b21; color: #7bd69e; }
.pill.uploading { border-color: #355c92; background: #192b44; color: #8dbbff; }
.pill.expired, .pill.not_requested, .pill.not_eligible {
  border-color: #3a414b;
  background: #23272e;
  color: #abb2bd;
}
#ocr-request-dialog .decision-card strong { white-space: pre-wrap; overflow-wrap: anywhere; }
#ocr-request-dialog .dialog-details strong { overflow-wrap: anywhere; }

.flow-page-head { align-items: center; }
.flow-page-head > div:first-child { max-width: 850px; }
.flow-category-pair { display: flex; gap: 8px; }
.flow-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.flow-summary article { min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.flow-summary-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; font-size: 11px; font-weight: 900; }
.flow-summary-icon.live { border: 1px solid #315b91; background: #182a42; color: #8ebcff; }
.flow-summary-icon.async { border: 1px solid #66542e; background: #2d2618; color: #e2bd68; }
.flow-summary-icon.human { border: 1px solid #554d82; background: #242039; color: #b9aaff; }
.flow-summary strong, .flow-summary small { display: block; }
.flow-summary strong { margin-bottom: 6px; font-size: 15px; }
.flow-summary small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.flow-board { margin-bottom: 18px; padding: 0; overflow: hidden; }
.flow-section-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.flow-section-head h2 { margin-top: 5px; }
.flow-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #3a414b; border-radius: 99px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.flow-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.flow-badge.live { border-color: #315b91; background: #182a42; color: #8ebcff; }
.flow-badge.live::before { background: #60a5fa; box-shadow: 0 0 0 4px #3b82f61c; }
.flow-badge.controlled { border-color: #554d82; background: #242039; color: #b9aaff; }
.flow-badge.controlled::before { background: #9b87f5; }
.live-flow { display: grid; grid-template-columns: minmax(190px, 1fr) 95px minmax(190px, 1fr) 95px minmax(190px, 1fr); align-items: stretch; gap: 8px; padding: 25px 23px 18px; }
.flow-node { position: relative; min-width: 0; padding: 18px; border: 1px solid #343b46; border-radius: 13px; background: #111419; overflow: hidden; }
.flow-node::after { content: ""; position: absolute; inset: auto -25px -30px auto; width: 90px; height: 90px; border-radius: 50%; opacity: .08; }
.flow-node.app-node::after { background: #60a5fa; }
.flow-node.laravel-node::after { background: #e57373; }
.flow-node.python-node { border-color: #395d91; background: linear-gradient(145deg, #15233a, #111419); }
.flow-node.python-node::after { background: #9b87f5; }
.flow-node-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 14px; border: 1px solid #3d4653; border-radius: 11px; background: #20252d; color: #d8dee8; font-size: 9px; font-weight: 900; letter-spacing: .04em; }
.app-node .flow-node-icon { color: #8ebcff; }
.laravel-node .flow-node-icon { color: #f19b9b; }
.python-node .flow-node-icon { border-color: #465b85; color: #c0afff; }
.flow-node > small { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.flow-node h3 { margin: 6px 0 14px; font-size: 19px; }
.flow-node ul, .flow-ownership ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.flow-node li, .flow-ownership li { position: relative; padding-left: 14px; color: #c1c7d0; font-size: 13px; line-height: 1.45; }
.flow-node li::before, .flow-ownership li::before { content: ""; position: absolute; top: .55em; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #606a77; }
.flow-arrow { display: grid; place-content: center; justify-items: center; color: #87909d; text-align: center; }
.flow-arrow::after { content: "→"; order: -1; margin-bottom: 6px; color: #6699e8; font-size: 26px; line-height: 1; }
.flow-arrow strong { color: #c8ced7; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.flow-arrow span { margin-top: 4px; font-size: 10px; }
.response-lane { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 23px 24px; padding: 12px 15px; border: 1px solid #315b91; border-radius: 11px; background: #121d2c; }
.response-lane > span { color: #8ebcff; font-size: 24px; }
.response-lane strong, .response-lane small { display: block; }
.response-lane strong { font-size: 14px; }
.response-lane small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.response-lane b { padding: 6px 10px; border-radius: 99px; background: #182a42; color: #8ebcff; font-size: 11px; white-space: nowrap; }
.flow-divider { display: flex; align-items: center; gap: 12px; color: #858e9a; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.flow-divider::before, .flow-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.storage-flow { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr); align-items: center; gap: 7px; padding: 20px 23px 16px; }
.flow-store { min-height: 116px; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; align-items: start; padding: 15px; border: 1px solid #343b46; border-radius: 12px; background: #111419; }
.flow-store > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #222831; color: #b8c0cc; font-size: 10px; font-weight: 900; }
.mysql-store > span { color: #8ebcff; }
.redis-store > span { color: #ef9898; }
.s3-store > span { color: #e2bd68; }
.flow-store small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.flow-store h3 { margin: 5px 0 8px; font-size: 16px; }
.flow-store p { margin: 0; color: #afb6c0; font-size: 12px; line-height: 1.5; }
.store-connector { height: 1px; background: linear-gradient(90deg, #4c5665, #7b8490); }
.store-connector::after { content: "›"; display: block; position: relative; top: -10px; color: #8a94a1; font-size: 18px; text-align: right; }
.consent-note { display: flex; gap: 11px; margin: 0 23px 23px; padding: 13px 15px; border-left: 3px solid #d6ad59; border-radius: 5px 9px 9px 5px; background: #1e1b14; font-size: 13px; line-height: 1.5; }
.consent-note strong { flex: 0 0 auto; color: #e2bd68; }
.consent-note span { color: #bdb6a7; }
.learning-track { display: grid; grid-template-columns: repeat(11, minmax(0, auto)); align-items: stretch; padding: 24px 23px 18px; overflow-x: auto; }
.learning-track article { min-width: 143px; min-height: 190px; padding: 15px; border: 1px solid #343b46; border-radius: 11px; background: #111419; }
.learning-track article > span { width: 26px; height: 26px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 8px; background: #242039; color: #b9aaff; font-size: 10px; font-weight: 900; }
.learning-track small, .learning-track strong { display: block; }
.learning-track small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.learning-track strong { margin-top: 6px; font-size: 14px; }
.learning-track p { margin: 10px 0 0; color: #aab1bc; font-size: 12px; line-height: 1.5; }
.learning-track > i { width: 20px; display: grid; place-items: center; color: #8274c4; font-size: 16px; font-style: normal; }
.model-return { display: flex; align-items: center; gap: 13px; margin: 0 23px 23px; padding: 13px 15px; border: 1px solid #554d82; border-radius: 11px; background: #1b1927; }
.model-return > span { color: #b9aaff; font-size: 24px; }
.model-return strong, .model-return small { display: block; }
.model-return strong { font-size: 14px; }
.model-return small { margin-top: 5px; color: #b5aec8; font-size: 12px; line-height: 1.5; }
.flow-ownership { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.flow-ownership article { min-height: 220px; }
.flow-ownership h2 { margin: 7px 0 17px; }
.flow-ownership li { font-size: 13px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan-progress { 0% { left: -38%; } 55% { left: 58%; } 100% { left: 110%; } }
@keyframes live-pulse { 50% { opacity: .55; transform: scale(.85); } }

@media (max-width: 1000px) {
  .sidebar { width: 190px; }
  .content { margin-left: 190px; padding: 28px 24px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .dashboard-kpis { grid-template-columns: 1fr 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .review-workspace { grid-template-columns: 1fr; }
  .crop-stage > img { height: 48vh; min-height: 320px; }
  .grid-two { grid-template-columns: 1fr; }
  .selection-history-grid { grid-template-columns: 1fr; }
  .training-grid { grid-template-columns: 1fr; }
  .model-test-grid, .prediction-result, .whole-image-result { grid-template-columns: 1fr; }
  .prediction-comparison { grid-template-columns: 1fr; }
  .model-test-dialog-body { grid-template-columns: 240px 210px minmax(0, 1fr); }
  .model-test-dialog .detected-row-list article { grid-template-columns: 28px 120px minmax(0, 1fr); }
  .model-version-grid { grid-template-columns: 1fr; }
  .user-layout { grid-template-columns: 1fr; }
  .user-create { position: static; }
  .detected-row-list article { grid-template-columns: 32px minmax(120px, .8fr) minmax(180px, 1.2fr) 70px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .log-toolbar form { grid-template-columns: 1fr 1fr; }
  .log-toolbar form .button { grid-column: 1 / -1; }
  .ocr-metric-grid { grid-template-columns: 1fr 1fr; }
  .ocr-filter-panel form { grid-template-columns: 1fr 1fr; }
  .ocr-filter-panel form .button { grid-column: 1 / -1; }
  .flow-summary { grid-template-columns: 1fr; }
  .live-flow { grid-template-columns: 1fr; }
  .flow-arrow { min-height: 48px; }
  .flow-arrow::after { content: "↓"; margin-bottom: 4px; }
  .storage-flow { grid-template-columns: 1fr; }
  .store-connector { width: 1px; height: 24px; justify-self: center; }
  .store-connector::after { content: "⌄"; top: 6px; left: -5px; }
  .flow-ownership { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .sidebar { position: static; width: auto; }
  .brand { max-width: 230px; }
  .sidebar-nav { grid-template-columns: 1fr 1fr; overflow: visible; }
  .sidebar-nav .nav-group:only-child { grid-column: 1 / -1; }
  .sidebar-foot { display: none; }
  .content { margin-left: 0; padding: 22px 15px; }
  .stats { grid-template-columns: 1fr; }
  .dashboard-kpis, .donut-grid, .model-slots { grid-template-columns: 1fr; }
  .dashboard-kpis.reviewer-kpis { grid-template-columns: 1fr; }
  .dashboard-active { grid-template-columns: 1fr; }
  .dashboard-active p { white-space: normal; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1; text-align: center; }
  .coverage-list > div { grid-template-columns: 72px 1fr 50px; }
  .coverage-list > div > small { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .tabs { overflow: auto; max-width: 100%; }
  .section-tabs { grid-template-columns: 1fr; }
  .filter-grid, .selection-strip { grid-template-columns: 1fr; }
  .log-toolbar form { grid-template-columns: 1fr; }
  .log-toolbar form .button { grid-column: 1; }
  .ocr-metric-grid, .ocr-filter-panel form { grid-template-columns: 1fr; }
  .ocr-filter-panel form .button { grid-column: 1; }
  .ocr-request-table .table-title { align-items: flex-start; flex-direction: column; }
  .ocr-request-table .table-title > small { text-align: left; }
  .model-test-dialog { height: calc(100vh - 20px); overflow-y: auto; }
  .model-test-dialog[open] { display: block; }
  .model-test-dialog-body { display: block; overflow: visible; }
  .model-test-whole, .model-test-output { padding-right: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .model-test-whole .dialog-image { margin-right: 0; }
  .model-test-output { min-height: 420px; }
  .model-test-dialog .detected-row-list { max-height: 70vh; }
  .model-test-dialog .detected-row-list article { grid-template-columns: 28px minmax(0, 1fr); }
  .model-test-dialog .detected-row-list article > img,
  .model-test-dialog .detected-row-list article > .prediction-comparison { grid-column: 2; }
  .flow-category-pair { width: 100%; }
  .response-lane { grid-template-columns: 28px 1fr; }
  .response-lane b { grid-column: 2; width: fit-content; }
  .flow-section-head { align-items: flex-start; flex-direction: column; }
  .consent-note { flex-direction: column; }
  .flow-ownership { grid-template-columns: 1fr; }
  .selection-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .image-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .dialog-image { min-height: 280px; margin: 12px; }
  .dialog-details, .decision-card { grid-template-columns: 1fr 1fr; padding-left: 12px; padding-right: 12px; }
  .confirmation-details { grid-template-columns: 1fr; }
  .confirmation-dialog .dialog-actions { flex-direction: column-reverse; }
  .confirmation-dialog .dialog-actions .button { width: 100%; text-align: center; }
  .detected-row-list article { grid-template-columns: 28px 1fr; }
  .detected-row-list article > div { grid-column: 2; }
  .row-confidence { justify-items: start; }
}
