:root {
  color-scheme: dark;
  --bg: #0c0a09;
  --panel: rgba(25, 20, 16, 0.94);
  --panel-2: #211a14;
  --line: #4a3827;
  --line-soft: rgba(224, 169, 84, 0.16);
  --gold: #e0a954;
  --gold-bright: #f1c875;
  --copper: #aa5e27;
  --text: #f4ead8;
  --muted: #a99a84;
  --good: #76c893;
  --bad: #e06c75;
  --warn: #e0a954;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background:
  radial-gradient(circle at 18% 12%, rgba(168, 82, 26, 0.16), transparent 30rem),
  radial-gradient(circle at 82% 18%, rgba(216, 151, 58, 0.08), transparent 28rem),
  linear-gradient(145deg, #0b0908 0%, #100d0b 48%, #080706 100%); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 32px 32px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ember { position: fixed; width: 220px; height: 220px; border-radius: 50%; filter: blur(95px); opacity: .17; pointer-events: none; }
.ember-one { background: #a44a16; top: 10%; left: -90px; }
.ember-two { background: #d28b36; right: -100px; bottom: 8%; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); background: linear-gradient(155deg, rgba(35,27,20,.98), rgba(18,14,11,.98)); box-shadow: var(--shadow); border-radius: 22px; position: relative; overflow: hidden; }
.login-card::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(241,200,117,.08); border-radius: inherit; pointer-events: none; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold-bright); font-weight: 900; letter-spacing: .08em; background: #17110d; margin-bottom: 24px; box-shadow: inset 0 0 24px rgba(224,169,84,.1); }
h1, h2, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; letter-spacing: .02em; margin-bottom: 4px; }
h2 { font-size: 1.08rem; margin-bottom: 0; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 800; margin-bottom: 6px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .78rem; }
label { display: grid; gap: 7px; color: #d8c9b4; font-size: .8rem; font-weight: 700; }
input { width: 100%; color: var(--text); background: #100d0b; border: 1px solid #4b3929; border-radius: 9px; padding: 11px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,169,84,.12); }
.login-card label { margin-top: 16px; }
.form-error { color: var(--bad); min-height: 1.2em; margin: 14px 0 0; font-size: .82rem; }
.app-shell { width: min(1540px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 34px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 4px; backdrop-filter: blur(18px); background: linear-gradient(to bottom, rgba(12,10,9,.96), rgba(12,10,9,.72), transparent); }
.brand-row, .topbar-actions, .service-title-row, .control-buttons, .section-heading, .form-actions, .document-buttons { display: flex; align-items: center; }
.brand-row { gap: 14px; }
.brand-row img { border: 1px solid var(--line); }
.brand-row h1 { font-size: 1.3rem; }
.topbar-actions, .control-buttons, .document-buttons { gap: 8px; flex-wrap: wrap; }
main { display: grid; gap: 16px; }
.panel, .metric-card { border: 1px solid var(--line-soft); background: var(--panel); box-shadow: 0 14px 42px rgba(0,0,0,.22); border-radius: 14px; }
.panel { padding: 20px; }
.control-rail { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-color: rgba(224,169,84,.25); background: linear-gradient(115deg, rgba(38,29,21,.98), rgba(20,16,13,.96)); }
.service-title-row { gap: 10px; margin-bottom: 4px; }
.button { border: 1px solid #5a432e; background: #261d16; color: var(--text); padding: 9px 13px; border-radius: 8px; cursor: pointer; text-decoration: none; font-weight: 800; font-size: .78rem; transition: transform .12s, border-color .12s, background .12s, opacity .12s; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--gold); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.button.primary { color: #1c1309; border-color: var(--gold-bright); background: linear-gradient(180deg, #f0c572, #c98736); }
.button.warning { border-color: #9b6828; background: #3b2b18; }
.button.danger { border-color: #8e3d3f; background: #361b1c; }
.button.ghost { background: rgba(17,13,11,.62); }
.button.small { padding: 6px 9px; font-size: .7rem; }
.button.full { width: 100%; margin-top: 20px; }
.status-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; border: 1px solid currentColor; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.status-chip.good { color: var(--good); background: rgba(118,200,147,.08); }
.status-chip.bad { color: var(--bad); background: rgba(224,108,117,.08); }
.status-chip.warning { color: var(--warn); background: rgba(224,169,84,.08); }
.status-chip.neutral { color: var(--muted); background: rgba(169,154,132,.06); }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.metric-card { padding: 17px; min-width: 0; }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-size: .72rem; }
.metric-card strong { display: block; margin: 8px 0 6px; font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 16px; }
.lower-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.job-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.job-form .wide { grid-column: 1 / -1; }
.toggle-row { grid-template-columns: auto 1fr; align-items: center; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--gold); }
.form-actions { gap: 12px; }
.progress-track { height: 9px; border-radius: 99px; background: #0c0907; border: 1px solid #3d2c1f; overflow: hidden; margin-bottom: 18px; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, #8f4d20, #e3ad58); transition: width .35s ease; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.detail-list div { background: var(--panel-2); padding: 10px; min-width: 0; }
.detail-list dt { color: var(--muted); font-size: .7rem; }
.detail-list dd { margin: 4px 0 0; font-weight: 800; font-size: .82rem; word-break: break-word; }
.error-box { margin-top: 14px; padding: 12px; border: 1px solid #7d3539; background: rgba(120,40,45,.15); color: #f1a1a7; border-radius: 8px; font-size: .8rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: .65rem; }
code { color: #e8c17b; }
.empty-cell { color: var(--muted); text-align: center; padding: 28px; }
.bad-text { color: var(--bad); }
.result-stack { display: grid; gap: 10px; max-height: 600px; overflow: auto; }
.result-card { border: 1px solid var(--line-soft); background: #16110e; border-radius: 10px; padding: 13px; }
.result-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.result-card-head small { display: block; color: var(--muted); margin-top: 4px; }
.reason-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.reason-tag { color: #e3b874; border: 1px solid #5c422a; border-radius: 999px; padding: 3px 7px; font-size: .66rem; }
pre { margin: 0; background: #0a0807; color: #cdbda6; border: 1px solid #36271c; border-radius: 8px; padding: 13px; overflow: auto; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.logs-panel pre { min-height: 420px; max-height: 600px; }
.documents-panel pre { max-height: 650px; min-height: 180px; }
footer { display: flex; justify-content: space-between; color: #756956; padding: 20px 4px 0; font-size: .72rem; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(420px, calc(100% - 44px)); background: #211913; border: 1px solid var(--gold); color: var(--text); padding: 12px 15px; border-radius: 9px; box-shadow: var(--shadow); font-size: .82rem; }
.toast.good { border-color: var(--good); }
.toast.bad { border-color: var(--bad); }
@media (max-width: 1160px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } .content-grid, .lower-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app-shell { width: min(100% - 18px, 1540px); } .topbar, .control-rail { align-items: flex-start; flex-direction: column; } .topbar-actions, .control-buttons { width: 100%; } .topbar-actions .button, .control-buttons .button { flex: 1; } .metric-grid { grid-template-columns: repeat(2, 1fr); } .job-form { grid-template-columns: 1fr; } .job-form .wide { grid-column: auto; } .section-heading { align-items: flex-start; flex-direction: column; } .document-buttons { width: 100%; } .panel { padding: 15px; } .login-card { padding: 28px; } }
@media (max-width: 460px) { .metric-grid { grid-template-columns: 1fr; } .detail-list { grid-template-columns: 1fr; } footer { flex-direction: column; gap: 5px; } }
