:root {
  color-scheme: dark;
  --bg: #081016;
  --surface: #101b23;
  --surface-2: #15242e;
  --line: #263945;
  --text: #eef5f7;
  --muted: #93a7b2;
  --accent: #39d98a;
  --accent-2: #27b574;
  --danger: #ff6b6b;
  --warning: #ffbf5a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 18% 0%, #102a2d 0, transparent 32%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.topbar { height: 78px; padding: 0 clamp(22px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8,16,22,.86); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #062113; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgba(255,191,90,.12); }
.dot.ok { background: var(--accent); box-shadow: 0 0 0 4px rgba(57,217,138,.12); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,107,107,.12); }
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.auth-layout { min-height: calc(100vh - 132px); display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(36px, 8vw, 110px); align-items: center; padding: 62px 0; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.intro-panel h1, .page-heading h1 { margin: 0; max-width: 780px; font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.045em; }
.lead { max-width: 660px; color: #bed0d7; font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }
.feature-list { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; color: #cfdee3; }
.feature-list li { display: flex; gap: 14px; align-items: center; }
.feature-list span { color: var(--accent); font-family: ui-monospace, monospace; }
.auth-card, .panel, .metric { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(21,36,46,.97), rgba(12,23,30,.97)); box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.auth-card { padding: clamp(26px, 4vw, 42px); border-radius: 22px; }
.auth-card h2, .panel h2 { margin: 0; font-size: 25px; }
.muted { color: var(--muted); line-height: 1.55; }
.form-stack, .policy-form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #d7e3e7; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #34505e; border-radius: 10px; padding: 12px 13px; background: #09141a; color: var(--text); outline: none; }
textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57,217,138,.12); }
.button { min-height: 44px; border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 800; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #062113; }
.button.primary:hover { background: #55e39f; }
.button.secondary { width: 100%; background: transparent; color: var(--text); border: 1px solid #3a5360; }
.button.quiet { background: #14242d; color: var(--text); border: 1px solid var(--line); }
#password-reset-request { width: 100%; margin-top: 12px; }
#password-recovery-form { margin-top: 20px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message { min-height: 22px; margin-bottom: 0; color: var(--muted); font-size: 13px; }
.message.error { color: var(--danger); }
.message.success { color: var(--accent); }
.dashboard { padding: 52px 0 72px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.page-heading h1 { font-size: clamp(38px, 5vw, 60px); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.metric { padding: 22px; border-radius: 16px; }
.metric span, .metric small { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 8px 0 4px; font-size: 22px; overflow: hidden; text-overflow: ellipsis; }
.metric-link { position:relative; min-width:0; color:var(--text); text-align:left; cursor:pointer; transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease; }
.metric-link::after { content:""; position:absolute; inset:0; border-radius:16px; box-shadow:inset 0 0 0 0 var(--accent); transition:box-shadow .16s ease; pointer-events:none; }
.metric-link:hover { transform:translateY(-2px); border-color:rgba(57,217,138,.58); box-shadow:0 28px 72px rgba(0,0,0,.3); }
.metric-link:hover::after { box-shadow:inset 3px 0 var(--accent); }
.metric-link:focus-visible { outline:3px solid rgba(57,217,138,.34); outline-offset:3px; border-color:var(--accent); }
.metric-link em { display:block; margin-top:14px; color:var(--accent); font-size:12px; font-style:normal; font-weight:850; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr .55fr; gap: 18px; }
.panel { padding: 28px; border-radius: 18px; }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; }
.badge { align-self: start; padding: 6px 9px; border-radius: 99px; background: rgba(57,217,138,.12); color: var(--accent); font-size: 11px; font-weight: 800; }
.policy-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
.policy-form .button { align-self: end; }
.result { margin-top: 20px; padding: 15px; border-radius: 10px; border: 1px solid var(--line); }
.result.ok { border-color: rgba(57,217,138,.45); color: var(--accent); background: rgba(57,217,138,.06); }
.result.bad { border-color: rgba(255,107,107,.45); color: #ff9090; background: rgba(255,107,107,.06); }
.result.neutral { color: var(--muted); }
.identity-panel dl { margin: 26px 0; display: grid; gap: 18px; }
.identity-panel dl div { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.identity-panel dt { color: var(--muted); font-size: 12px; }
.identity-panel dd { margin: 7px 0 0; overflow-wrap: anywhere; }
.security-note { padding: 13px; border-radius: 10px; background: #0b171e; color: var(--muted); font-size: 12px; line-height: 1.5; }
footer { padding: 18px 20px 32px; color: #70858f; text-align: center; font-size: 12px; }
.scope-banner { display:flex; align-items:center; gap:16px; margin-bottom:18px; padding:14px 18px; border:1px solid rgba(57,217,138,.3); border-radius:14px; background:rgba(57,217,138,.07); }
.scope-banner strong { color:var(--accent); white-space:nowrap; }
.scope-banner span { color:#bed0d7; font-size:13px; }
.tabs { display:flex; gap:8px; margin:0 0 18px; overflow-x:auto; padding-bottom:2px; }
.tab { border:1px solid var(--line); border-radius:10px; padding:11px 15px; color:var(--muted); background:#0d1920; white-space:nowrap; font-weight:750; }
.tab.active { color:#062113; border-color:var(--accent); background:var(--accent); }
.tab.disabled { opacity:.45; cursor:not-allowed; }
.two-col { display:grid; grid-template-columns:minmax(330px,.65fr) minmax(0,1.35fr); gap:18px; }
.data-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:22px; }
.data-form .wide { grid-column:1/-1; }
.check-label { display:flex; align-items:center; gap:10px; min-height:44px; padding-top:22px; }
.check-label input { width:18px; height:18px; }
.table-panel { min-width:0; }
.table-wrap { overflow:auto; margin-top:20px; border:1px solid var(--line); border-radius:12px; }
table { width:100%; border-collapse:collapse; min-width:620px; }
th, td { padding:13px 14px; text-align:left; border-bottom:1px solid var(--line); font-size:13px; }
th { color:#b8cad1; background:#0b171e; font-size:11px; letter-spacing:.06em; text-transform:uppercase; }
tbody tr:nth-child(even) { background:rgba(255,255,255,.018); }
tbody tr:last-child td { border-bottom:0; }
.shipment-row { cursor:pointer; transition:background .15s ease, box-shadow .15s ease; }
.shipment-row:hover, .shipment-row:focus-visible { background:rgba(57,217,138,.08); box-shadow:inset 3px 0 var(--accent); outline:none; }
.vehicle-row { cursor:pointer; transition:background .15s ease, box-shadow .15s ease; }
.vehicle-row:hover, .vehicle-row:focus-visible { background:rgba(57,217,138,.08); box-shadow:inset 3px 0 var(--accent); outline:none; }
.inline-form { display:grid; grid-template-columns:1fr 1fr 1fr auto; gap:10px; align-items:end; }
.checks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:22px; }
.checks span { padding:12px; border-radius:10px; color:#cfe0e5; background:#0b171e; font-size:13px; }
.proposal-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:22px; }
.proposal { display:grid; gap:7px; padding:17px; border:1px solid rgba(57,217,138,.32); border-radius:13px; background:rgba(57,217,138,.05); }
.proposal span { color:#d7e3e7; }
.proposal small { color:var(--warning); line-height:1.4; }
.proposal.warning { border-color:rgba(255,191,90,.32); background:rgba(255,191,90,.05); }
.empty { color:var(--muted); }
.panel h3 { margin-top:28px; }
.panel dl { display:grid; gap:16px; }
.panel dt { color:var(--muted); font-size:12px; }
.panel dd { margin:5px 0 0; overflow-wrap:anywhere; }
.pool-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:18px; }
.pool-steps span { display:flex; align-items:center; gap:10px; padding:13px 15px; border:1px solid var(--line); border-radius:12px; background:#0b171e; color:#cfe0e5; }
.pool-steps b { display:grid; place-items:center; width:25px; height:25px; border-radius:50%; background:var(--accent); color:#062113; }
.consent { padding:13px; border:1px solid rgba(57,217,138,.35); border-radius:10px; background:rgba(57,217,138,.06); }
.pool-board { margin-top:18px; }
.pool-columns { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.stack-list { display:grid; gap:10px; }
.pool-item { display:grid; gap:8px; padding:14px; border:1px solid var(--line); border-radius:12px; background:#0b171e; }
.pool-item strong { color:#eef6f8; }
.pool-item span,.pool-item small { color:var(--muted); line-height:1.4; }
.pool-item .button { width:100%; min-height:38px; }
.status-chip { justify-self:start; padding:4px 8px; border-radius:99px; background:rgba(57,217,138,.12); color:var(--accent)!important; font-size:11px; font-weight:800; }
.status-chip.ready { background:rgba(57,217,138,.16); color:#9af0bf!important; }
.status-chip.blocked { background:rgba(255,92,92,.16); color:#ffb3b3!important; }
.operation-details { margin-top:16px; border-top:1px solid var(--line); padding-top:12px; }
.operation-details summary { cursor:pointer; font-weight:800; color:var(--accent); }
.shipment-groups { display:grid; gap:24px; }
.list-filters { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 0; }
.list-filters button { min-height:36px; padding:7px 11px; border:1px solid var(--line); border-radius:999px; background:#0b171e; color:var(--muted); font-size:12px; font-weight:800; }
.list-filters button b { display:inline-grid; min-width:21px; min-height:21px; place-items:center; margin-left:5px; border-radius:999px; background:#142831; color:#dbe8ec; }
.list-filters button:hover,.list-filters button:focus-visible { color:var(--text); border-color:rgba(57,217,138,.5); outline:none; }
.list-filters button.active { color:#062113; border-color:var(--accent); background:var(--accent); }
.list-filters button.active b { background:rgba(6,33,19,.14); color:#062113; }
.filter-note { margin:10px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.pool-item.interactive-card { cursor:pointer; transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.pool-item.interactive-card:hover { border-color:rgba(57,217,138,.55); background:#0d1d24; transform:translateY(-1px); }
.pool-item.interactive-card:focus-visible { outline:3px solid rgba(57,217,138,.35); outline-offset:3px; border-color:var(--accent); }
.shipment-groups section { display:grid; gap:10px; }
.shipment-groups h3 { margin:0; color:var(--text); font-size:15px; }
.detail-back { margin-bottom:18px; }
.detail-heading { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:18px; }
.detail-heading h2 { margin:0; font-size:clamp(28px,4vw,42px); }
.detail-layout { display:grid; grid-template-columns:minmax(280px,.7fr) minmax(0,1.3fr); gap:18px; }
.detail-summary { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:22px; }
.detail-summary div { padding:12px; border:1px solid var(--line); border-radius:10px; background:#0b171e; }
.detail-dialog { width:min(1040px,calc(100vw - 32px)); max-height:calc(100vh - 32px); padding:0; border:1px solid var(--line); border-radius:20px; box-shadow:0 28px 80px rgba(0,0,0,.55); background:var(--panel); color:var(--text); }
.detail-dialog::backdrop { background:rgba(2,9,13,.72); backdrop-filter:blur(3px); }
.dialog-shell { padding:24px; overflow:auto; max-height:calc(100vh - 32px); }
.document-layout { display:grid; grid-template-columns:1.25fr .75fr; gap:18px; margin-top:18px; }
.document-upload { background:#0b171e; border:1px solid var(--line); border-radius:16px; padding:18px; }
.document-list { display:grid; gap:10px; }
.document-card { display:flex; align-items:center; justify-content:space-between; gap:16px; background:#0b171e; border:1px solid var(--line); border-radius:14px; padding:14px 16px; }
.document-card div { display:grid; gap:5px; min-width:0; }
.document-card strong { overflow-wrap:anywhere; }
.document-card small { color:var(--muted); }
.document-preview { margin-top:18px; background:#0b171e; border:1px solid var(--line); border-radius:16px; padding:14px; }
.document-preview iframe { width:100%; height:min(62vh,640px); border:1px solid var(--line); border-radius:10px; background:#fff; }
.workspace-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-top:18px; }
.wide-panel { grid-column:1/-1; }
.compact-form { margin-top:16px; }
.timeline-list { display:grid; gap:10px; margin:18px 0; }
.timeline-item { display:grid; grid-template-columns:34px 1fr; gap:12px; padding:14px; border:1px solid var(--line); border-radius:13px; background:#0b171e; }
.timeline-item b { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; color:#062113; background:var(--accent); }
.timeline-item div { display:grid; gap:5px; }
.timeline-item span,.timeline-item small { color:var(--muted); line-height:1.4; }
.fieldset-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:0; padding:16px; border:1px solid var(--line); border-radius:12px; }
.fieldset-grid legend { padding:0 8px; color:var(--accent); font-size:12px; font-weight:800; }
.fieldset-grid .wide { grid-column:1/-1; }
.template-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:18px; }
.template-card { display:grid; gap:8px; padding:15px; border:1px solid var(--line); border-radius:13px; background:#0b171e; }
.template-card small,.template-card span { color:var(--muted); }
.template-card.interactive-card { cursor:pointer; transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.template-card.interactive-card:hover { border-color:rgba(57,217,138,.55); background:#0d1d24; transform:translateY(-1px); }
.template-card.interactive-card:focus-visible { outline:3px solid rgba(57,217,138,.35); outline-offset:3px; border-color:var(--accent); }
.checklist-layout { grid-template-columns:minmax(0,2fr) minmax(340px,1fr); align-items:start; }
.checklist-layout > .panel { min-width:0; }
.checklist-layout > .panel:last-child { position:sticky; top:92px; }
.checklist-layout > .panel:last-child .template-grid { grid-template-columns:1fr; }
.checklist-builder { display:grid; gap:10px; margin-top:12px; }
.checklist-builder-row { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; align-items:end; padding:14px; border:1px solid var(--line); border-radius:12px; background:#0b171e; }
.checklist-builder-row .builder-label { grid-column:span 2; }
.checklist-builder-row .wide-row { grid-column:span 2; }
.checklist-run { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:18px; padding:18px; border:1px solid rgba(57,217,138,.35); border-radius:14px; background:rgba(57,217,138,.04); }
.checklist-run h3,.checklist-run button { grid-column:1/-1; }
.checklist-run .checklist-section { grid-column:1/-1; margin:12px 0 0; padding:10px 0 5px; border-bottom:1px solid var(--line); color:var(--accent); }
.checklist-run input[type="checkbox"] { width:20px; height:20px; }
.builder-guide { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:18px 0 4px; }
.builder-guide span { display:flex; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:10px; background:#0b171e; color:var(--muted); font-size:12px; }
.builder-guide b { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--accent); color:#062113; }
.template-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.template-actions .button { flex:1 1 130px; }
.network-banner { display:flex; align-items:center; gap:10px; margin-bottom:14px; padding:10px 14px; border:1px solid rgba(57,217,138,.3); border-radius:12px; background:rgba(57,217,138,.06); color:var(--muted); font-size:12px; }
.network-banner .network-dot { width:9px; height:9px; border-radius:50%; background:var(--accent); }
.network-banner.offline { border-color:rgba(255,191,90,.45); background:rgba(255,191,90,.08); }
.network-banner.offline .network-dot { background:var(--warning); }
.network-banner #queue-label { margin-left:auto; }
.network-banner .button { min-height:34px; padding:7px 11px; }
.driver-shell { max-width:760px; margin:0 auto; }
.driver-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.driver-steps { list-style:none; margin:24px 0; padding:0; display:grid; gap:10px; }
.driver-steps li { display:flex; gap:13px; align-items:center; padding:14px; border:1px solid var(--line); border-radius:13px; background:#0b171e; }
.driver-steps b { display:grid; place-items:center; min-width:34px; height:34px; border-radius:50%; background:var(--accent); color:#062113; }
.driver-steps span,.driver-steps strong,.driver-steps small { display:block; }
.driver-steps small { margin-top:4px; color:var(--muted); }
.driver-task-list { display:grid; gap:12px; }
.driver-task { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:16px; border:1px solid var(--line); border-radius:14px; background:#0b171e; }
.driver-task div,.driver-task strong,.driver-task span { display:block; }
.driver-task span { margin-top:5px; color:var(--muted); }
.defect-card p { margin:4px 0 0; color:#ffce8a; font-size:12px; line-height:1.45; }
.document-actions { display:flex!important; grid-auto-flow:column; gap:8px!important; align-items:center; }
.document-actions .button { width:auto; min-height:38px; }
.button.danger { color:#ff9c9c; border-color:rgba(255,107,107,.4); }
@media (max-width: 1050px) {
  .checklist-layout { grid-template-columns:1fr; }
  .checklist-layout > .panel:last-child { position:static; }
}
@media (max-width: 860px) {
  .auth-layout, .dashboard-grid, .two-col, .detail-layout, .document-layout, .workspace-grid { grid-template-columns: 1fr; }
  .auth-layout { padding-top: 42px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .proposal-grid { grid-template-columns:1fr; }
  .inline-form { grid-template-columns:1fr 1fr; }
  .pool-columns { grid-template-columns:1fr; }
  .wide-panel { grid-column:auto; }
  .checklist-builder-row { grid-template-columns:1fr 1fr; }
  .checklist-builder-row .builder-label,.checklist-builder-row .wide-row { grid-column:1/-1; }
}
@media (max-width: 560px) {
  main { width: min(100% - 26px, 1180px); }
  .topbar { padding: 0 14px; }
  .topbar-status { font-size: 0; }
  .policy-form, .data-form { grid-template-columns: 1fr; }
  .data-form .wide { grid-column:auto; }
  .metric-grid { grid-template-columns:1fr; }
  .scope-banner { align-items:flex-start; flex-direction:column; gap:6px; }
  .inline-form, .checks { grid-template-columns:1fr; }
  .page-heading { align-items: start; }
  .pool-steps { grid-template-columns:1fr; }
  .detail-dialog { width:calc(100vw - 16px); max-height:calc(100vh - 16px); }
  .dialog-shell { padding:16px; max-height:calc(100vh - 16px); }
  .document-card { align-items:flex-start; flex-direction:column; }
  .fieldset-grid,.checklist-run,.checklist-builder-row { grid-template-columns:1fr; }
  .checklist-builder-row .builder-label,.checklist-builder-row .wide-row { grid-column:auto; }
  .fieldset-grid .wide,.checklist-run h3,.checklist-run button { grid-column:auto; }
  .document-actions { grid-auto-flow:row; width:100%; }
  .builder-guide { grid-template-columns:1fr 1fr; }
  .network-banner { align-items:flex-start; flex-wrap:wrap; }
  .network-banner #queue-label { width:100%; margin-left:19px; }
  .driver-task { align-items:stretch; flex-direction:column; }
  .driver-task .button { width:100%; min-height:52px; }
  .field-mode input,.field-mode select,.field-mode textarea,.field-mode .button { min-height:52px; font-size:16px; }
}
