/* SPDX-License-Identifier: GPL-3.0-only */
/* DynaGraphics' front panel: deep blue glass with a red accent, as the derby package. */
:root {
  --bg: #07101f; --panel: #0d1a33; --panel2: #12234a; --line: #1f3566; --text: #e8eefc; --muted: #93a4c8;
  --blue: #2f6bff; --blue2: #1d4fd1; --red: #e0283f; --green: #22c07a; --amber: #f2a93b;
  --radius: 10px; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, "Segoe UI", Inter, Roboto, sans-serif; }
body { background: radial-gradient(1200px 600px at 80% -10%, #12306e55, transparent), var(--bg); min-height: 100vh; }
[hidden] { display: none !important; }
h2 { font-size: 16px; margin: 0 0 8px; } h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); }
a { color: #8fb1ff; }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: #ff7a8a; min-height: 1em; margin: 6px 0 0; }
.grow { flex: 1 1 auto; min-width: 160px; }
input, select, textarea, button, .button {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
button, .button { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .button:hover { border-color: #3a5aa8; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(180deg, var(--blue), var(--blue2)); border-color: #2a5ee6; }
button.danger { background: #3a1220; border-color: #7a2234; color: #ffd5db; }
button.link { background: none; border: 0; color: #8fb1ff; padding: 0; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
label.check { flex-direction: row; align-items: center; gap: 6px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0; }
.row.end { justify-content: flex-end; } .row.wrap { flex-wrap: wrap; }
.card { background: linear-gradient(180deg, var(--panel), #0b1630); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.brand { font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.brand .sub { font-weight: 400; color: var(--muted); font-size: 12px; }
.mark { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, var(--blue) 60%, var(--red) 60%); display: inline-block; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #08132a; }
.who { color: var(--muted); }

.power { display: grid; grid-template-columns: minmax(220px, 1.2fr) 1fr auto; gap: 10px 18px; align-items: center; padding: 12px 20px; background: #0a1730; border-bottom: 1px solid var(--line); }
.power-state { display: flex; gap: 10px; align-items: center; }
.power-title { font-weight: 600; }
.power-busy { color: var(--amber); }
.power-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.power .error { grid-column: 1 / -1; margin: 0; min-height: 0; }
.run-name { width: 200px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #5a6a8a; box-shadow: 0 0 0 3px #ffffff10; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.wait { background: var(--amber); animation: pulse 1s infinite alternate; }
.dot.err { background: var(--red); }
@keyframes pulse { to { opacity: .35; } }

.tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 12px 10px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--red); }
.count { background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
main { padding: 16px 20px 40px; max-width: 1500px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.col { min-width: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tpl { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.tpl .thumb { aspect-ratio: 16 / 9; background: #050b18; display: block; width: 100%; object-fit: contain; border-bottom: 1px solid var(--line); }
.tpl .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.tpl .name { font-weight: 600; } .tpl .id { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.versions { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); background: #0a1428; cursor: pointer; }
.chip.sel { outline: 1px solid var(--blue); }
.state-approved { color: #7ff0b8; border-color: #1f6b4a; } .state-pending { color: #ffd38a; border-color: #7a5a22; }
.state-rejected { color: #ff9aa6; border-color: #7a2234; } .state-draft, .state-replaced { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { padding: 4px 8px; font-size: 12px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.table td { border-bottom: 1px solid #16284f; padding: 7px 8px; vertical-align: top; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.list-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: #0b1630; }
.list-item .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 9px; background: #16284f; color: var(--muted); }
.badge.live { background: var(--red); color: #fff; } .badge.preparing { background: #7a5a22; color: #fff; } .badge.cloud { background: #1d3f8a; color: #cfe0ff; }
.badge.done { background: #143a2a; color: #7ff0b8; } .badge.failed { background: #4a1220; color: #ffb3bd; }
.log { font-size: 12px; color: var(--muted); margin: 6px 0 0; padding-left: 16px; }
.progress { height: 6px; background: #16284f; border-radius: 3px; overflow: hidden; margin: 6px 0; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--blue), #7aa2ff); width: 0; transition: width .4s; }
.preview { width: 100%; aspect-ratio: 16 / 9; height: auto; background: #050b18; border-radius: 8px; border: 1px solid var(--line); display: block; }
.reply { white-space: pre-wrap; background: #050b18; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 360px; overflow: auto; font-family: var(--mono); font-size: 12px; }
.route { padding: 6px 10px; border-radius: 8px; background: #0a1428; border: 1px solid var(--line); display: inline-block; }
.route.ollama { border-color: #1f6b4a; } .route.bedrock { border-color: #2a5ee6; }
.history .list-item { cursor: pointer; }
.studio-card { max-width: 820px; }
.alerts { background: #4a0f1c; border-bottom: 1px solid #a3203a; padding: 8px 20px; }
.alert { color: #ffe1e6; font-size: 13px; padding: 2px 0; }
.alert b { color: #fff; }
.readiness { margin: 6px 0 0; padding: 6px 8px; border-radius: 8px; background: #0a1428; border: 1px solid var(--line); }
.readiness.ok { border-color: #1f6b4a; } .readiness.bad { border-color: #7a2234; }
.studio-wait { width: min(460px, 100%); }
.items-editor td input, .items-editor td select { width: 100%; padding: 4px 6px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; width: min(720px, calc(100vw - 32px)); padding: 18px; }
dialog::backdrop { background: #000a; }
dialog .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.totals { font-size: 18px; font-weight: 600; margin: 10px 0; }
.notes { color: var(--muted); font-size: 12px; padding-left: 18px; }

@media (max-width: 900px) {
  .power { grid-template-columns: 1fr; }
  .power-actions { justify-content: flex-start; }
  .cols { grid-template-columns: 1fr; }
  main { padding: 12px 16px 32px; }
  .run-name { width: 100%; }
  .top { padding: 12px 16px; } .top .brand .sub { display: none; }
  .power { padding: 12px 16px; } .tabs { padding: 0 8px; }
  dialog .grid2 { grid-template-columns: 1fr; }
}
@media print {
  .top, .power, .tabs, .toolbar, #signin { display: none !important; }
  body, .card, .list-item { background: #fff !important; color: #000 !important; }
  .table td, .table th { color: #000; border-color: #bbb; }
}
