:root { color-scheme: dark; --bg:#282c32; --panel:#353a42; --inset:#2d3239; --raised:#414852; --line:#606975; --muted:#d0d6df; --text:#f8fafc; --accent:#ff8b50; --accent2:#ffb38b; --green:#78edb1; --red:#ff99a1; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--text); font:15px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; }
button,input,textarea,select { font:inherit; }
button { color:inherit; cursor:pointer; }
.shell { display:grid; grid-template-columns:250px minmax(0,1fr); min-height:100vh; }
aside { position:sticky; top:0; height:100vh; padding:24px 16px; border-right:1px solid var(--line); background:var(--panel); display:flex; flex-direction:column; }
.brand { display:flex; align-items:center; gap:12px; padding:0 8px 28px; }
.brand-mark { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:linear-gradient(145deg,var(--accent2),var(--accent)); color:var(--text); font-weight:900; }
.brand strong,.brand small { display:block; }.brand small { color:var(--muted); margin-top:1px; }
nav { display:grid; gap:7px; }
.nav { display:flex; justify-content:space-between; align-items:center; width:100%; padding:12px 14px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--muted); text-align:left; text-decoration:none; }
.nav:hover,.nav.active { color:var(--text); background:var(--raised); border-color:var(--line); }
.nav.active { box-shadow:inset 3px 0 var(--accent); }
.nav-alert-count { display:grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:999px; background:var(--error-bg); color:var(--text); font-size:11px; font-weight:850; box-shadow:0 0 0 3px #ff70421c; }.nav-alert-count[hidden] { display:none; }
.bot-control-card { margin-top:auto; display:grid; gap:11px; padding:14px; border:1px solid var(--green); border-radius:12px; background:linear-gradient(145deg,var(--inset),var(--inset)); box-shadow:0 12px 35px #0003; transition:.2s; }
.bot-control-copy { display:flex; align-items:center; gap:10px; min-width:0; }.bot-control-copy strong,.bot-control-copy small { display:block; }.bot-control-copy strong { font-size:11px; letter-spacing:.09em; }.bot-control-copy small { margin-top:2px; color:var(--muted); font-size:9px; line-height:1.35; }.bot-control-dot { flex:none; width:9px; height:9px; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px #35d07f1c,0 0 16px #35d07f99; }
.bot-toggle { width:100%; padding:9px 11px; border:1px solid var(--green); border-radius:9px; background:var(--inset); color:var(--green); font-size:10px; font-weight:850; letter-spacing:.04em; transition:.18s; }.bot-toggle:hover:not(:disabled) { border-color:var(--green); transform:translateY(-1px); }.bot-toggle:focus-visible { outline:2px solid var(--green); outline-offset:2px; }
.bot-control-card.off { border-color:var(--red); background:linear-gradient(145deg,var(--inset),var(--inset)); }.bot-control-card.off .bot-control-dot { background:var(--red); box-shadow:0 0 0 4px #ff59641c,0 0 16px #ff596477; }.bot-control-card.off .bot-control-copy small { color:var(--muted); }.bot-toggle.off { border-color:var(--red); background:var(--inset); color:var(--red); }.bot-control-card.busy { opacity:.68; }
.bot-control-card.degraded { border-color:var(--accent); background:linear-gradient(145deg,var(--inset),var(--inset)); }.bot-control-card.degraded .bot-control-dot { background:var(--warning-bg); box-shadow:0 0 0 4px #ffb45e22,0 0 16px #ffb45e77; }
.boundary { margin-top:10px; padding:15px; border:1px solid var(--line); border-radius:12px; background:var(--inset); }
.boundary .dot { display:inline-block; width:8px; height:8px; margin-right:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 4px #35d07f1c; }
.boundary[data-state="degraded"] { border-color:var(--accent); }.boundary[data-state="degraded"] .dot { background:var(--warning-bg); box-shadow:0 0 0 4px #ffb45e22; }.boundary[data-state="off"] .dot { background:var(--red); box-shadow:0 0 0 4px #ff596422; }
.boundary strong { font-size:12px; letter-spacing:.1em; }.boundary p { margin:8px 0 0; color:var(--muted); font-size:12px; }
main { min-width:0; padding:30px clamp(20px,4vw,58px) 60px; }
header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:28px; }
.eyebrow { margin:0 0 5px; color:var(--accent2); font-size:11px; font-weight:750; letter-spacing:.14em; }
h1,h2 { margin:0; letter-spacing:-.025em; }h1 { font-size:27px; }h2 { font-size:22px; }
.badges { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }.badge { padding:7px 10px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:12px; }.badge.ready { color:var(--green); border-color:var(--green); }.badge.pending { color:var(--accent); border-color:var(--accent); }.badge.locked { color:var(--accent); border-color:var(--accent); }.badge.error { color:var(--red); border-color:var(--red); }
.view { display:none; }.view.active { display:block; }
.panel { border:1px solid var(--line); border-radius:16px; background:var(--panel); box-shadow:0 8px 24px #0002; }.pad { padding:24px; }
.result-empty { margin:auto; display:grid; gap:5px; color:var(--muted); text-align:center; }
.data-unavailable,.system-alert { padding:16px; border:1px solid var(--red); border-radius:10px; background:var(--panel); color:var(--red); font-weight:700; }.system-alert { margin-bottom:16px; }.system-alert.degraded { border-color:var(--accent); background:var(--inset); color:var(--accent); }.audit-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:14px 0; }
input,textarea,select { width:100%; border:1px solid var(--line); border-radius:10px; outline:none; background:var(--inset); color:var(--text); padding:12px 13px; }input:focus,textarea:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px #ff6b2c14; }
button[type=submit],.primary { border:0; border-radius:10px; background:linear-gradient(140deg,var(--accent2),var(--accent)); color:var(--text); font-weight:800; padding:12px 18px; }
.lab-provider-bar { display:flex; align-items:end; justify-content:space-between; gap:14px; }.lab-provider-bar label { display:grid; grid-template-columns:auto 190px; align-items:center; gap:10px; color:var(--muted); font-size:12px; }.lab-provider-bar select { padding:8px 10px; }.lab-provider-bar small { color:var(--muted); }.provider-chip { display:inline-block; margin-bottom:7px; padding:3px 7px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
button:disabled { cursor:not-allowed; opacity:.5; }
.grid.two { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; }.panel h2 { margin-bottom:18px; }
.drop-zone { position:relative; min-height:300px; margin:20px 0; border:1px dashed var(--line); border-radius:13px; background:var(--inset); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; overflow:hidden; cursor:pointer; }.drop-zone:hover { border-color:var(--accent); }.drop-zone input { position:absolute; opacity:0; inset:0; cursor:pointer; }.drop-zone .camera { color:var(--accent2); font-size:30px; }.drop-zone small,.muted,.fine-print { color:var(--muted); }.drop-zone img { display:none; position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:var(--inset); }.drop-zone.has-image img { display:block; }
.field { display:grid; gap:7px; margin:16px 0; }.field span { color:var(--muted); font-size:13px; }.fine-print { font-size:11px; margin:12px 0 0; }
.benchmark { margin-bottom:5px; }.benchmark-note { margin-top:0; padding-left:10px; border-left:2px solid var(--line); }
.result-panel { min-height:530px; }.result-card { display:grid; gap:14px; }.result-status { display:flex; align-items:center; gap:10px; }.pill { padding:6px 9px; border-radius:999px; background:var(--inset); font-size:11px; font-weight:800; letter-spacing:.06em; }.pill.exact { color:var(--green); }.pill.candidate { color:var(--warning); }.pill.unresolved { color:var(--red); }.meter { height:8px; border-radius:999px; background:var(--inset); overflow:hidden; }.meter i { display:block; height:100%; background:linear-gradient(90deg,var(--accent),var(--green)); }.facts { display:grid; grid-template-columns:1fr 1fr; gap:10px; }.fact { padding:12px; border:1px solid var(--line); border-radius:10px; }.fact small,.fact b { display:block; }.fact small { color:var(--muted); }.code { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.narrow { max-width:800px; margin:0 auto; }.routine-list { display:grid; gap:12px; margin-top:26px; }.routine { border:1px solid var(--line); border-radius:12px; padding:15px; background:var(--inset); }.routine header { margin:0 0 10px; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }.routine ol { color:var(--muted); padding-left:20px; }.routine .draft,.routine .active { font-size:11px; }.routine .draft { color:var(--warning); }.routine .active { color:var(--green); }.routine-status { width:auto; padding:8px 11px; }
.routine-actions { display:flex; gap:8px; }.routine-actions button { width:auto; padding:8px 11px; }
.routine-editor { margin-top:16px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--inset); display:grid; grid-template-columns:1fr 1fr; gap:12px; }.routine-editor[hidden] { display:none; }.routine-editor label { display:grid; gap:6px; color:var(--muted); font-size:12px; }.routine-editor label:nth-child(n+3) { grid-column:1/-1; }.routine-editor input,.routine-editor textarea { width:100%; resize:vertical; }.routine-editor-actions { grid-column:1/-1; display:flex; gap:8px; }.routine-editor-actions button { width:auto; }.routine-editor > small { grid-column:1/-1; color:var(--muted); }
.teach-upload { display:flex; align-items:center; gap:12px; margin:14px 0; padding:14px; border:1px dashed var(--line); border-radius:12px; background:var(--inset); cursor:pointer; }.teach-upload:hover { border-color:var(--accent); }.teach-upload input { position:absolute; opacity:0; pointer-events:none; }.teach-upload-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:10px; background:var(--panel); color:var(--accent); font-size:24px; }.teach-upload b,.teach-upload small { display:block; }.teach-upload small { color:var(--muted); margin-top:3px; }.teach-media-preview { display:grid; grid-template-columns:100px minmax(0,1fr) 36px; align-items:center; gap:12px; margin:0 0 14px; padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--inset); }.teach-media-preview[hidden] { display:none; }.teach-media-preview img,.teach-media-preview video { display:block; width:100px; height:72px; border-radius:8px; object-fit:cover; background:var(--inset); }.teach-media-preview b,.teach-media-preview small { display:block; overflow-wrap:anywhere; }.teach-media-preview small { margin-top:4px; color:var(--muted); }.teach-media-preview button { border:0; background:transparent; color:var(--muted); font-size:24px; cursor:pointer; }
.section-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }.secondary { padding:8px 12px; border:1px solid var(--line); border-radius:9px; background:var(--inset); }.audit-list { display:grid; gap:8px; }.audit-row { display:grid; grid-template-columns:180px 170px 1fr; gap:14px; padding:12px; border-bottom:1px solid var(--line); }.audit-row time,.audit-row code { color:var(--muted); font-size:12px; }
.audit-layout,.meta-queue-list { display:grid; gap:16px; }.meta-queue-row { display:grid; grid-template-columns:minmax(180px,.7fr) minmax(220px,1fr) minmax(260px,1.5fr) auto auto; align-items:center; gap:14px; padding:14px; border:1px solid var(--line); border-left:3px solid var(--red); border-radius:11px; background:var(--inset); }.meta-queue-row.blocked { border-left-color:var(--accent); }.meta-queue-row > div:first-child { display:grid; gap:3px; }.meta-queue-row > div:first-child span { color:var(--red); font-size:10px; font-weight:800; letter-spacing:.1em; }.meta-queue-row.blocked > div:first-child span { color:var(--accent); }.meta-queue-row small,.meta-queue-row code,.meta-queue-row p,.meta-queue-facts { color:var(--muted); font-size:11px; overflow-wrap:anywhere; }.meta-queue-row p { margin:0; }.meta-queue-facts { display:flex; flex-wrap:wrap; gap:6px; }.meta-queue-facts span { padding:4px 7px; border:1px solid var(--line); border-radius:999px; }
#toast { position:fixed; right:22px; bottom:22px; max-width:380px; padding:12px 15px; border-radius:10px; background:var(--inset); box-shadow:0 15px 40px #0008; opacity:0; transform:translateY(10px); pointer-events:none; transition:.2s; }#toast.show { opacity:1; transform:none; }#toast.error { background:var(--error-bg); }
@media (max-width:850px) { .shell { grid-template-columns:1fr; }aside { position:static; height:auto; }nav { grid-template-columns:repeat(4,1fr); }.nav span,.boundary { display:none; }.bot-control-card { margin-top:14px; }main { padding:22px 15px 40px; }.grid.two { grid-template-columns:1fr; }.audit-row,.meta-queue-row { grid-template-columns:1fr; }.badges { display:none; } }
@media (max-width:560px) { nav { grid-template-columns:1fr 1fr; }.facts { grid-template-columns:1fr; }.drop-zone { min-height:230px; } }

/* Hermes Console */
main:has(#view-hermes.active) { padding-left:24px; padding-right:24px; }
.hermes-console-shell { min-height:700px; height:calc(100vh - 150px); display:grid; grid-template-rows:auto auto minmax(520px,1fr); overflow:hidden; }
.hermes-console-head { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0; padding:18px 20px; border-bottom:1px solid var(--line); background:linear-gradient(110deg,var(--inset),var(--inset) 55%); }
.hermes-console-head h2 { margin:0; }.hermes-console-head .muted { margin:5px 0 0; }
.hermes-console-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }.hermes-console-actions button { width:auto; white-space:nowrap; }
.hermes-status-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-bottom:1px solid var(--line); background:var(--inset); }
.hermes-status-grid > div { min-width:0; padding:12px 16px; border-right:1px solid var(--line); }.hermes-status-grid > div:last-child { border-right:0; }
.hermes-status-grid small,.hermes-status-grid b { display:block; overflow-wrap:anywhere; }.hermes-status-grid small { color:var(--muted); font-size:9px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }.hermes-status-grid b { margin-top:4px; color:var(--text); font-size:11px; }
.hermes-frame-wrap { position:relative; min-height:520px; overflow:hidden; background:var(--inset); }
.hermes-frame-wrap iframe { display:block; width:100%; height:100%; min-height:520px; border:0; background:var(--inset); }
.hermes-frame-loading { position:absolute; inset:0; z-index:2; display:grid; place-content:center; justify-items:center; gap:8px; padding:24px; background:radial-gradient(circle at center,var(--inset) 0,var(--inset) 68%); text-align:center; }.hermes-frame-loading[hidden] { display:none; }.hermes-frame-loading small { max-width:520px; color:var(--muted); }.hermes-frame-loading code { color:var(--accent); }
.hermes-loader { width:30px; height:30px; border:3px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:hermesSpin .8s linear infinite; }
@keyframes hermesSpin { to { transform:rotate(360deg); } }
.hermes-console-shell:fullscreen { width:100vw; height:100vh; min-height:0; border:0; border-radius:0; grid-template-rows:auto auto minmax(0,1fr); background:var(--inset); }
.hermes-console-shell:fullscreen .hermes-frame-wrap,.hermes-console-shell:fullscreen iframe { min-height:0; height:100%; }
.routine-schedule { display:grid; grid-template-columns:minmax(180px,1fr) auto; gap:8px; align-items:end; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }.routine-schedule label { display:grid; gap:5px; color:var(--muted); font-size:11px; }.routine-schedule input { max-width:180px; }.routine-schedule small { grid-column:1/-1; color:var(--muted); }
@media (max-width:900px) { .hermes-console-shell { height:auto; }.hermes-console-head { align-items:flex-start; flex-direction:column; }.hermes-console-actions { justify-content:flex-start; }.hermes-status-grid { grid-template-columns:1fr 1fr; }.hermes-status-grid > div:nth-child(2) { border-right:0; }.hermes-status-grid > div:nth-child(-n+2) { border-bottom:1px solid var(--line); } }
@media (max-width:560px) { main:has(#view-hermes.active) { padding-left:12px; padding-right:12px; }.hermes-status-grid { grid-template-columns:1fr; }.hermes-status-grid > div { border-right:0; border-bottom:1px solid var(--line); }.hermes-status-grid > div:nth-child(3) { border-bottom:1px solid var(--line); }.hermes-status-grid > div:last-child { border-bottom:0; }.hermes-console-actions { display:grid; grid-template-columns:1fr; width:100%; }.hermes-frame-wrap,.hermes-frame-wrap iframe { min-height:560px; } }

/* Hermes-inspired Agents fleet */
main:has(#view-agents.active) { padding-left:24px; padding-right:24px; }
.agents-workspace { min-height:680px; display:grid; grid-template-columns:290px minmax(0,1fr); overflow:hidden; background:linear-gradient(125deg,var(--inset),var(--inset) 58%); }
.agents-rail { min-width:0; display:flex; flex-direction:column; padding:18px 14px; border-right:1px solid var(--line); background:var(--inset); }
.agents-rail h2,.agent-detail h2 { margin:0; }.agents-rail-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 4px; }.agents-rail-head .eyebrow { margin-bottom:2px; }
.icon-button { display:grid; place-items:center; flex:none; width:34px; height:34px; padding:0; border:1px solid var(--line); border-radius:9px; background:var(--inset); color:var(--muted); font-size:18px; }.icon-button:hover:not(:disabled) { border-color:var(--line); color:var(--text); }
.agents-rail > .muted { min-height:36px; margin:10px 4px 16px; font-size:10px; line-height:1.45; }
.agents-list { display:grid; align-content:start; gap:7px; }
.agent-card { position:relative; display:grid; grid-template-columns:38px minmax(0,1fr) 9px; align-items:center; gap:10px; width:100%; min-width:0; padding:11px 10px; border:1px solid transparent; border-radius:11px; background:transparent; color:var(--muted); text-align:left; transition:background .16s,border-color .16s,transform .16s; }.agent-card:hover { border-color:var(--line); background:var(--inset); transform:translateX(1px); }.agent-card.active { border-color:var(--line); background:linear-gradient(100deg,var(--inset),var(--inset)); color:var(--text); box-shadow:inset 3px 0 var(--accent),0 12px 30px #0003; }.agent-card > span:nth-child(2) { min-width:0; }.agent-card b,.agent-card small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.agent-card b { font-size:12px; }.agent-card small { margin-top:3px; color:var(--muted); font-size:9px; }
.agent-avatar { display:grid; place-items:center; width:38px; height:38px; border:1px solid var(--line); border-radius:11px; background:linear-gradient(145deg,var(--panel),var(--inset)); color:var(--text); font-size:11px; font-weight:900; letter-spacing:-.02em; box-shadow:inset 0 1px #ffffff12; }.agent-avatar.supervisor { border-color:var(--accent); background:linear-gradient(145deg,var(--warning-bg),var(--inset)); color:var(--accent); }.agent-avatar.sales { border-color:var(--green); background:linear-gradient(145deg,var(--success-bg),var(--inset)); color:var(--green); }.agent-avatar.operations { border-color:var(--info); background:linear-gradient(145deg,var(--info-bg),var(--inset)); color:var(--info); }.agent-avatar.it { border-color:var(--line); background:linear-gradient(145deg,var(--info-bg),var(--inset)); color:var(--info); }.agent-avatar.large { width:58px; height:58px; border-radius:16px; font-size:16px; }
.agent-state-dot { display:block; width:8px; height:8px; border-radius:50%; background:var(--raised); box-shadow:0 0 0 3px #65707c18; }.agent-state-dot.online { background:var(--green); box-shadow:0 0 0 3px #35d07f1c,0 0 12px #35d07f55; }.agent-state-dot.degraded,.agent-state-dot.pending { background:var(--warning-bg); }.agent-state-dot.offline,.agent-state-dot.unconfigured { background:var(--raised); }.agent-state-dot.paused { background:var(--error-bg); }.agent-state-dot.standby { background:var(--raised); }
.agents-rail-foot { display:flex; align-items:flex-start; gap:9px; margin-top:auto; padding:14px 5px 2px; border-top:1px solid var(--line); color:var(--muted); }.agents-rail-foot .agent-state-dot { flex:none; margin-top:3px; }.agents-rail-foot small { font-size:9px; line-height:1.45; }
.agent-detail { min-width:0; display:grid; align-content:start; gap:18px; padding:26px; }.agent-detail-head { display:flex; align-items:center; justify-content:space-between; gap:22px; padding-bottom:20px; border-bottom:1px solid var(--line); }.agent-identity { min-width:0; display:flex; align-items:center; gap:14px; }.agent-identity > div { min-width:0; }.agent-name-line { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }.agent-detail-description { max-width:720px; margin:5px 0 0; font-size:12px; }.agent-status { display:inline-flex; align-items:center; min-height:22px; padding:4px 8px; border:1px solid var(--line); border-radius:999px; background:var(--inset); color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }.agent-status.online { border-color:var(--green); background:var(--inset); color:var(--green); }.agent-status.degraded { border-color:var(--warning); background:var(--inset); color:var(--accent); }.agent-status.paused { border-color:var(--red); background:var(--inset); color:var(--red); }.agent-status.standby { border-color:var(--line); background:var(--inset); color:var(--info); }
.agent-console-links { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }.agent-console-links .secondary { width:auto; white-space:nowrap; }.button-link { display:inline-flex; align-items:center; justify-content:center; color:var(--text); text-decoration:none; }
.agent-scope-panel { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:14px; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:var(--inset); }.agent-scope-panel > span { color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.12em; }.agent-scope-panel strong { min-width:0; color:var(--text); }.agent-scope-panel small { color:var(--muted); text-align:right; }
.agent-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:13px; overflow:hidden; background:var(--inset); }.agent-summary-grid > div { min-width:0; padding:16px; border-right:1px solid var(--line); }.agent-summary-grid > div:last-child { border-right:0; }.agent-summary-grid small,.agent-summary-grid strong,.agent-summary-grid span { display:block; overflow-wrap:anywhere; }.agent-summary-grid small { color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }.agent-summary-grid strong { margin-top:7px; color:var(--text); font-size:23px; letter-spacing:-.03em; }.agent-summary-grid span { margin-top:3px; color:var(--muted); font-size:9px; }
.agent-detail-grid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(300px,.9fr); gap:14px; }.agent-activity-card,.agent-controls-card { min-width:0; padding:18px; border:1px solid var(--line); border-radius:13px; background:var(--inset); }.agent-card-label { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.1em; }.agent-card-label time,.agent-card-label small { color:var(--muted); font-weight:500; letter-spacing:0; }.agent-activity-card > strong { display:block; color:var(--text); }.agent-activity-card > p { margin:7px 0 0; font-size:10px; line-height:1.5; }
.agent-controls { min-height:70px; display:grid; align-content:center; }.agent-control-guard { padding:12px 13px; border:1px solid var(--line); border-radius:10px; background:var(--inset); }.agent-control-guard b { color:var(--muted); font-size:11px; }.agent-control-guard p { margin:4px 0 0; color:var(--muted); font-size:10px; line-height:1.45; }.agent-control-guard code { color:var(--muted); }.agent-control-warning { margin:0 0 12px; color:var(--muted); font-size:10px; }.agent-control-actions { display:flex; flex-wrap:wrap; gap:8px; }.agent-control-actions button { width:auto; }.danger-outline { padding:10px 14px; border:1px solid var(--red); border-radius:10px; background:var(--inset); color:var(--red); font-weight:800; }
.agent-detail-tabs { display:flex; align-items:center; gap:5px; padding:4px; border:1px solid var(--line); border-radius:11px; background:var(--inset); }
.agent-detail-tab { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:8px 14px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); font-size:11px; font-weight:800; }
.agent-detail-tab:hover { color:var(--text); }.agent-detail-tab.active { border-color:var(--line); background:var(--inset); color:var(--text); box-shadow:0 8px 24px #0003; }.agent-detail-tab:focus-visible { outline:2px solid var(--accent2); outline-offset:2px; }
.training-tab-count { display:grid; place-items:center; min-width:19px; height:19px; padding:0 5px; border-radius:999px; background:var(--error-bg); color:var(--text); font-size:9px; }.training-tab-count[hidden] { display:none; }
.agent-tab-panel { min-width:0; display:grid; gap:18px; }.agent-tab-panel[hidden] { display:none; }
.agent-training-panel { align-content:start; }
.training-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin:0; padding:2px 0 0; }.training-head h3 { margin:0; font-size:19px; }.training-head .muted { max-width:720px; margin:5px 0 0; font-size:11px; }.training-head button { flex:none; width:auto; }
.training-sync { display:flex; align-items:flex-start; gap:11px; padding:13px 15px; border:1px solid var(--line); border-radius:11px; background:var(--inset); }.training-sync .agent-state-dot { flex:none; margin-top:4px; }.training-sync b,.training-sync small { display:block; }.training-sync b { color:var(--text); font-size:11px; }.training-sync small { margin-top:3px; color:var(--muted); font-size:9px; line-height:1.5; }
.training-counts { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--inset); }.training-counts > div { padding:12px 14px; border-right:1px solid var(--line); }.training-counts > div:last-child { border-right:0; }.training-counts small,.training-counts strong { display:block; }.training-counts small { color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }.training-counts strong { margin-top:4px; font-size:20px; }
.training-toolbar { display:grid; grid-template-columns:minmax(220px,1fr) 170px 170px; align-items:end; gap:10px; }.training-toolbar label { display:grid; gap:5px; color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }.training-toolbar input,.training-toolbar select { padding:9px 10px; font-size:11px; }
.training-workspace { min-width:0; display:grid; grid-template-columns:minmax(250px,330px) minmax(0,1fr); gap:13px; align-items:start; }
.training-list { min-width:0; display:grid; align-content:start; gap:7px; max-height:760px; overflow:auto; padding-right:3px; }.training-list > article { min-width:0; margin:0; }.training-list .result-empty { min-height:190px; padding:18px; border:1px dashed var(--line); border-radius:12px; }
.training-list-item { display:grid; gap:6px; width:100%; min-width:0; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--inset); color:var(--muted); text-align:left; }.training-list-item:hover { border-color:var(--line); background:var(--inset); }.training-list-item.active { border-color:var(--accent); background:linear-gradient(110deg,var(--inset),var(--inset)); box-shadow:inset 3px 0 var(--accent); }.training-list-item:focus-visible { outline:2px solid var(--accent2); outline-offset:2px; }.training-list-top { min-width:0; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }.training-list-top b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); font-size:11px; }.training-list-item > small,.training-list-item > span:last-child { color:var(--muted); font-size:9px; overflow-wrap:anywhere; }
.training-status { display:inline-flex; align-items:center; flex:none; min-height:20px; padding:3px 7px; border:1px solid var(--line); border-radius:999px; background:var(--inset); color:var(--muted); font-size:8px; font-style:normal; font-weight:850; letter-spacing:.05em; text-transform:uppercase; }.training-status.inbox { border-color:var(--warning); background:var(--inset); color:var(--accent); }.training-status.ready { border-color:var(--info); background:var(--inset); color:var(--info); }.training-status.active { border-color:var(--green); background:var(--inset); color:var(--green); }.training-status.archived { color:var(--muted); }.training-status.draft { border-color:var(--line); color:var(--muted); }.training-status.failed { border-color:var(--red); background:var(--inset); color:var(--red); }
.training-detail { min-width:0; min-height:360px; padding:17px; border:1px solid var(--line); border-radius:13px; background:var(--inset); outline:none; }.training-detail:focus-visible { border-color:var(--accent); box-shadow:0 0 0 3px #ff6b2c14; }.training-detail > .result-empty { min-height:320px; }.training-detail[aria-busy="true"] { opacity:.68; }
.training-editor { display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:12px; }.training-editor label { display:grid; align-content:start; gap:6px; color:var(--muted); font-size:11px; }.training-editor label > span { font-weight:750; }.training-editor input,.training-editor textarea,.training-editor select { font-size:11px; }.training-editor textarea { resize:vertical; line-height:1.55; }.training-editor label > small { color:var(--muted); font-size:9px; line-height:1.45; }
.training-detail-head { grid-column:1/-1; display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding-bottom:14px; border-bottom:1px solid var(--line); }.training-detail-head h3 { margin:0; color:var(--text); font-size:17px; }.training-detail-head small { display:block; margin-top:4px; color:var(--muted); font-size:9px; }.training-content-field,.training-validation,.training-editor-actions,.training-versions { grid-column:1/-1; }
.training-validation { display:grid; gap:3px; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--inset); }.training-validation b { font-size:10px; }.training-validation span,.training-validation li { color:var(--muted); font-size:9px; }.training-validation.passed { border-color:var(--green); background:var(--inset); }.training-validation.passed b { color:var(--green); }.training-validation.failed { border-color:var(--red); background:var(--inset); }.training-validation.failed b { color:var(--red); }.training-validation-issues { margin:6px 0 0; padding-left:18px; }
.training-editor-actions { display:flex; flex-wrap:wrap; gap:8px; }.training-editor-actions button { width:auto; }.training-editor-actions .publish { border-color:var(--green); background:var(--inset); color:var(--green); }
.training-versions { padding-top:4px; border-top:1px solid var(--line); }.training-versions summary { color:var(--muted); font-size:10px; font-weight:800; cursor:pointer; }.training-versions ul { display:grid; gap:6px; margin:10px 0 0; padding:0; list-style:none; }.training-versions li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 9px; border:1px solid var(--line); border-radius:8px; }.training-versions li b,.training-versions li small { display:block; }.training-versions li small { margin-top:2px; color:var(--muted); font-size:8px; }.training-versions li button { flex:none; width:auto; padding:6px 8px; font-size:9px; }
@media (max-width:1050px) { .agents-workspace { grid-template-columns:1fr; }.agents-rail { border-right:0; border-bottom:1px solid var(--line); }.agents-list { grid-template-columns:repeat(4,minmax(0,1fr)); }.agents-rail-foot { margin-top:16px; }.agent-card { grid-template-columns:36px minmax(0,1fr) 8px; }.agent-avatar { width:36px; height:36px; }.agent-summary-grid { grid-template-columns:1fr 1fr; }.agent-summary-grid > div:nth-child(2) { border-right:0; }.agent-summary-grid > div:nth-child(-n+2) { border-bottom:1px solid var(--line); } }
@media (max-width:900px) { .training-workspace { grid-template-columns:1fr; }.training-list { grid-template-columns:1fr 1fr; max-height:none; }.training-list .result-empty { grid-column:1/-1; }.training-detail { min-height:0; } }
@media (max-width:760px) { main:has(#view-agents.active) { padding-left:12px; padding-right:12px; }.agents-list { grid-template-columns:1fr 1fr; }.agent-detail { padding:18px; }.agent-detail-head { align-items:flex-start; flex-direction:column; }.agent-console-links { justify-content:flex-start; }.agent-scope-panel { grid-template-columns:1fr; gap:5px; }.agent-scope-panel small { text-align:left; }.agent-detail-grid { grid-template-columns:1fr; }.training-head { align-items:stretch; flex-direction:column; }.training-toolbar { grid-template-columns:1fr 1fr; }.training-toolbar label:first-child { grid-column:1/-1; }.training-counts { grid-template-columns:repeat(3,1fr); }.training-counts > div { border-bottom:1px solid var(--line); }.training-counts > div:nth-child(3) { border-right:0; }.training-counts > div:nth-child(n+4) { border-bottom:0; }.training-editor { grid-template-columns:1fr; }.training-editor > * { grid-column:1 !important; } }
@media (max-width:480px) { .agents-list,.agent-summary-grid,.training-list,.training-counts { grid-template-columns:1fr; }.agent-summary-grid > div,.training-counts > div { border-right:0; border-bottom:1px solid var(--line); }.agent-summary-grid > div:last-child,.training-counts > div:last-child { border-bottom:0; }.agent-console-links { display:grid; width:100%; }.agent-identity { align-items:flex-start; }.agent-avatar.large { width:48px; height:48px; border-radius:13px; }.agent-name-line { align-items:flex-start; flex-direction:column; gap:5px; }.agent-detail-tabs { width:100%; }.agent-detail-tab { flex:1; }.training-toolbar { grid-template-columns:1fr; }.training-toolbar label:first-child { grid-column:auto; }.training-editor-actions { display:grid; }.training-editor-actions button { width:100%; }.training-versions li { align-items:flex-start; flex-direction:column; }.training-versions li button { width:100%; } }

/* Dashboard and orders */
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.metric-card { display:grid; gap:8px; min-height:138px; padding:20px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(145deg,var(--inset),var(--inset)); box-shadow:0 18px 50px #0003; }
.metric-card small { color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.metric-card strong { font-size:30px; letter-spacing:-.04em; }
.metric-card span { color:var(--muted); font-size:12px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(320px,.6fr); gap:18px; }
.dashboard-orders,.system-list { display:grid; gap:8px; }
.dashboard-handoffs-panel { grid-column:1/-1; }.dashboard-handoffs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }.dashboard-handoff { display:flex; justify-content:space-between; gap:14px; padding:13px 14px; border:1px solid var(--line); border-radius:11px; background:var(--inset); }.dashboard-handoff > div { display:grid; gap:4px; }.dashboard-handoff span { color:var(--muted); font-size:11px; }.dashboard-handoff small { color:var(--accent); }
.dashboard-order { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:13px 14px; border:1px solid var(--line); border-radius:11px; background:var(--inset); }
.dashboard-order > div { display:grid; gap:3px; }.dashboard-order > div:last-child { justify-items:end; }
.dashboard-order span,.dashboard-order small { color:var(--muted); font-size:11px; }
.system-row { display:grid; grid-template-columns:minmax(0,1fr) auto 10px; gap:10px; align-items:center; padding:13px 0; border-bottom:1px solid var(--line); }
.system-row span { color:var(--muted); }.system-row i { width:8px; height:8px; border-radius:50%; background:var(--red); }.system-row i.ok { background:var(--green); }.system-row i.attention { background:var(--warning-bg); }
.order-filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.order-filters button { padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:var(--inset); color:var(--muted); }
.order-filters button.active { color:var(--text); border-color:var(--accent); background:var(--inset); }
.order-filters button span { color:var(--muted); }.order-filters button b { color:var(--muted); font-weight:800; }.order-filters button.active span,.order-filters button.active b { color:var(--accent); }
.orders-list { display:grid; gap:16px; }
.handoff-notice { display:flex; align-items:flex-start; gap:14px; margin-bottom:16px; padding:13px 15px; border:1px solid var(--line); border-radius:12px; background:var(--inset); }.handoff-notice > span { flex:0 0 auto; color:var(--green); font-size:11px; font-weight:800; letter-spacing:.08em; }.handoff-notice p { margin:0; color:var(--muted); font-size:12px; }.handoff-notice code { color:var(--text); }.handoff-filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }.handoff-filters button { padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:var(--inset); color:var(--muted); }.handoff-filters button.active { color:var(--text); border-color:var(--accent); background:var(--inset); }.handoffs-list { display:grid; gap:14px; }
.handoff-card { overflow:hidden; border:1px solid var(--line); border-radius:17px; background:linear-gradient(145deg,var(--inset),var(--inset)); box-shadow:0 16px 45px #0003; }.handoff-card.waiting { border-left:3px solid var(--accent); }.handoff-card.assigned { border-left:3px solid var(--info); }.handoff-card.resuming { border-left:3px solid var(--info); }.handoff-card.resolved { border-left:3px solid var(--green); opacity:.82; }.handoff-card header,.handoff-card footer { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:15px 17px; margin:0; background:var(--inset); }.handoff-person { display:flex; align-items:center; gap:11px; }.handoff-person > div { display:grid; gap:3px; }.handoff-person small { color:var(--muted); }.handoff-avatar { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; background:linear-gradient(145deg,var(--warning-bg),var(--error-bg)); color:var(--text); font-weight:850; }.handoff-badges { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:7px; }.handoff-status,.unread-chip,.new-message-chip { padding:5px 8px; border-radius:999px; font-size:9px; font-weight:800; letter-spacing:.06em; }.handoff-status.waiting { color:var(--accent); background:var(--inset); }.handoff-status.assigned { color:var(--info); background:var(--inset); }.handoff-status.resuming { color:var(--info); background:var(--panel); }.handoff-status.resolved { color:var(--green); background:var(--inset); }.unread-chip { color:var(--green); border:1px solid var(--green); background:var(--inset); }.new-message-chip { color:#fff; background:var(--red); }
.handoff-body { display:grid; grid-template-columns:minmax(220px,.8fr) minmax(300px,1.35fr) minmax(220px,.85fr); gap:12px; padding:16px 17px; }.handoff-body section { display:grid; align-content:start; gap:7px; min-width:0; padding:14px; border:1px solid var(--line); border-radius:11px; background:var(--inset); }.handoff-body small { color:var(--muted); text-transform:uppercase; letter-spacing:.09em; font-size:9px; }.handoff-body p { margin:0; color:var(--muted); overflow-wrap:anywhere; }.handoff-meta span { color:var(--red); font-size:10px; overflow-wrap:anywhere; }.handoff-meta em { color:var(--muted); font-size:10px; font-style:normal; }.handoff-meta.ok b { color:var(--green); }.handoff-meta.attention b { color:var(--accent); }.handoff-card footer code { color:var(--muted); font-size:10px; }.handoff-actions { display:flex; flex-wrap:wrap; gap:7px; }.handoff-action { width:auto; padding:8px 11px; border:1px solid var(--line); border-radius:9px; background:var(--inset); color:var(--text); }.handoff-action.assigned { color:var(--info); }.handoff-action.resolved { color:var(--green); }.handoff-action.waiting { color:var(--accent); }
.order-card { overflow:hidden; border:1px solid var(--line); border-radius:18px; background:linear-gradient(145deg,var(--inset),var(--inset)); box-shadow:0 18px 50px #0004; }
.order-card header,.order-card footer { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 18px; margin:0; background:var(--inset); }
.order-identity { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }.order-identity small,.order-total small { color:var(--muted); }.order-total { display:grid; justify-items:end; gap:2px; }.order-total strong { font-size:22px; }
.order-body { display:grid; grid-template-columns:minmax(260px,1.25fr) minmax(180px,.65fr) minmax(260px,1fr); gap:14px; padding:16px 18px; }
.order-body section { display:grid; align-content:start; gap:7px; min-width:0; padding:15px; border:1px solid var(--line); border-radius:12px; background:var(--inset); }.order-body small { color:var(--muted); text-transform:uppercase; letter-spacing:.1em; font-size:9px; }.order-body b,.order-body span,.order-body a { overflow-wrap:anywhere; }.order-body span,.order-phone { color:var(--muted); font-size:12px; }.order-product > a { color:var(--text); font-weight:750; text-decoration:none; }.order-product > a:hover { color:var(--accent); }
.sku-chip { width:max-content; max-width:100%; padding:5px 8px; border:1px solid var(--info); border-radius:7px; background:var(--inset); color:var(--info); font-size:11px; overflow-wrap:anywhere; }.order-phone { text-decoration:none; }.order-phone:hover { color:var(--text); }
.order-address strong { width:max-content; padding:4px 8px; border-radius:999px; background:var(--inset); color:var(--green); font-size:11px; }.order-address em { color:var(--muted); font-size:11px; font-style:normal; }.order-address.incomplete { border-color:var(--red); }.order-address.incomplete strong { background:var(--inset); color:var(--red); }
.order-pricing { display:flex; flex-wrap:wrap; gap:8px; }.order-pricing span { padding:7px 10px; border:1px solid var(--line); border-radius:8px; color:var(--muted); font-size:11px; }.order-pricing b { margin-left:4px; color:var(--text); }.order-pricing b.discount { color:var(--green); }
.order-status-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }.order-status-action { width:auto; padding:8px 11px; border:1px solid var(--line); border-radius:9px; background:var(--inset); color:var(--muted); font-size:11px; }.order-status-action:hover:not(:disabled) { transform:translateY(-1px); border-color:var(--line); }.order-status-action.processing { color:var(--warning); }.order-status-action.completed { color:var(--green); }.order-status-action.cancelled { color:var(--red); }.order-status-action.current { opacity:1; border-color:currentColor; background:var(--inset); cursor:default; }
.order-status { display:inline-flex; width:max-content; padding:4px 7px; border-radius:999px; background:var(--panel); color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.06em; }.order-status.new { color:var(--info); background:var(--inset); }.order-status.processing { color:var(--warning); background:var(--inset); }.order-status.completed { color:var(--green); background:var(--inset); }.order-status.cancelled { color:var(--red); background:var(--inset); }
@media (max-width:1100px) { .metric-grid { grid-template-columns:1fr 1fr; }.dashboard-grid { grid-template-columns:1fr; }.dashboard-handoffs-panel { grid-column:auto; }.dashboard-handoffs { grid-template-columns:1fr; }.order-body { grid-template-columns:1fr 1fr; }.order-address { grid-column:1/-1; }.handoff-body { grid-template-columns:1fr 1fr; }.handoff-meta { grid-column:1/-1; } }
@media (max-width:700px) { .metric-grid,.order-body,.handoff-body,.routine-editor { grid-template-columns:1fr; }.routine-editor label,.routine-editor label:nth-child(n+3),.routine-editor-actions,.routine-editor > small { grid-column:auto; }.order-address,.handoff-meta { grid-column:auto; }.order-card header,.order-card footer,.handoff-card header,.handoff-card footer,.handoff-notice { align-items:flex-start; flex-direction:column; }.order-total { justify-items:start; }.order-status-actions,.handoff-badges { justify-content:flex-start; }.section-head { align-items:flex-start; gap:12px; } }

/* Session login and role-based user administration */
.auth-page { min-height:100vh; background:radial-gradient(circle at 50% 10%,var(--inset) 0,var(--inset) 42%,var(--inset) 100%); }
.auth-shell { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card { width:min(440px,100%); padding:34px; border:1px solid var(--line); border-radius:22px; background:linear-gradient(155deg,var(--inset),var(--inset)); box-shadow:0 35px 110px #000b; }
.auth-brand { display:flex; align-items:center; gap:12px; margin-bottom:34px; }.auth-brand strong,.auth-brand small { display:block; }.auth-brand small { margin-top:3px; color:var(--muted); }
.auth-card h1 { margin-bottom:8px; font-size:30px; }.auth-copy { margin:0 0 24px; color:var(--muted); line-height:1.55; }
.auth-form { display:grid; gap:15px; }.auth-form label { display:grid; gap:7px; }.auth-form label span { color:var(--muted); font-size:12px; }.auth-form button { margin-top:5px; }
.auth-error { margin:16px 0 0; padding:11px 13px; border:1px solid var(--red); border-radius:10px; background:var(--inset); color:var(--red); }
.auth-security { margin:24px 0 0; padding-top:17px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; line-height:1.5; }
.account-menu { display:flex; align-items:center; gap:9px; }.account-identity { display:grid; justify-items:end; }.account-identity strong { font-size:12px; }.account-identity small { color:var(--muted); font-size:10px; text-transform:uppercase; }.account-menu button { width:auto; }
.users-layout { display:grid; grid-template-columns:minmax(300px,.7fr) minmax(520px,1.3fr); gap:18px; }.user-form,.users-list { display:grid; gap:13px; }.permission-picker { display:grid; grid-template-columns:1fr 1fr; gap:8px; }.permission-option { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; align-items:start; padding:10px; border:1px solid var(--line); border-radius:9px; background:var(--inset); }.permission-option input { width:16px; margin-top:2px; }.permission-option b,.permission-option small { display:block; }.permission-option b { font-size:11px; }.permission-option small { margin-top:3px; color:var(--muted); font-size:9px; line-height:1.35; }
.user-card { padding:16px; border:1px solid var(--line); border-radius:13px; background:var(--inset); }.user-card header { margin:0 0 14px; }.user-card header div { display:grid; gap:3px; }.user-card header small { color:var(--muted); }.user-card-grid { display:grid; grid-template-columns:1fr 150px 100px; gap:10px; align-items:end; }.user-card label { display:grid; gap:5px; color:var(--muted); font-size:10px; }.user-active { display:flex !important; align-items:center; gap:7px !important; padding-bottom:12px; }.user-active input { width:16px; }.user-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:13px; }.user-actions button { width:auto; }.user-password-reset { display:grid; grid-template-columns:minmax(180px,1fr) auto; gap:8px; margin-top:10px; }.role-chip { width:max-content; padding:4px 7px; border-radius:999px; background:var(--inset); color:var(--info); font-size:9px; text-transform:uppercase; }.role-chip.admin { background:var(--inset); color:var(--accent); }
dialog { width:min(440px,calc(100% - 30px)); padding:0; border:1px solid var(--line); border-radius:16px; background:var(--inset); color:var(--text); box-shadow:0 35px 100px #000c; }dialog::backdrop { background:#000a; }.dialog-body { padding:22px; }.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }.dialog-actions button { width:auto; }
[data-access-hidden="true"] { display:none !important; }
/* Readable grey surfaces for the retained management console. */
.shell .nav { color:var(--muted); }
.shell .nav.active { color:var(--text); }
.shell .metric-card,.shell .order-card,.shell .handoff-card { background:var(--inset); border-color:var(--line); box-shadow:0 5px 18px #0002; }
.shell .order-card header,.shell .order-card footer,.shell .handoff-card header,.shell .handoff-card footer { background:var(--raised); }
.shell .order-body section,.shell .handoff-body section,.shell .dashboard-order,.shell .dashboard-handoff,.shell .user-card,.shell .permission-option { background:var(--inset); border-color:var(--line); }
.shell .order-body .order-line { background:var(--panel); }
.shell .order-body small,.shell .order-body span,.shell .order-address em,.shell .order-phone,.shell .order-pricing span,.shell .metric-card span { color:var(--muted); font-size:13px; }
.shell .order-body small { font-size:11px; letter-spacing:.06em; }
.shell .order-body b { font-size:16px; }
.shell .order-line a { color:var(--info); text-underline-offset:3px; }
.shell .order-line a:hover { color:var(--text); }
.shell .sku-chip { background:var(--panel); color:var(--info); border-color:var(--info); font-size:12px; }
.shell .order-status { font-size:11px; font-weight:750; padding:5px 10px; }
.shell .order-status.completed { color:var(--green); }
.shell .order-pricing span { background:var(--inset); border-color:var(--line); }
.shell .order-total strong { font-size:26px; }
.shell .order-filters button,.shell .handoff-filters button,.shell .secondary,.shell .order-status-action,.shell .handoff-action { min-height:40px; font-size:13px; border-color:var(--line); background:var(--inset); color:var(--text); }
.shell .order-filters button.active,.shell .handoff-filters button.active { background:var(--warning-bg); border-color:var(--accent); color:var(--text); font-weight:750; }
.shell .order-filters button span,.shell .order-filters button b { color:var(--muted); }
.shell .order-filters button.active span,.shell .order-filters button.active b { color:var(--text); }
.shell .order-status-action.completed { color:var(--green); background:var(--panel); border-color:var(--green); }
.shell .order-status-action.processing { color:var(--warning); }
.shell .order-status-action.cancelled { color:var(--red); }
.shell .order-status-action.current { background:var(--panel); border-color:currentColor; }
.shell .order-identity small,.shell .dashboard-order span,.shell .dashboard-order small { font-size:13px; }
.shell .boundary { background:var(--inset); border-color:var(--line); }
.shell input,.shell textarea,.shell select { background:var(--inset); border-color:var(--line); color:var(--text); }
.shell input::placeholder,.shell textarea::placeholder { color:var(--muted); }
.shell button:focus-visible,.shell a:focus-visible { outline:3px solid var(--info); outline-offset:3px; }
.shell .order-filters button:hover,.shell .secondary:hover { border-color:var(--line); }
.shell .handoff-card.resolved { opacity:1; }
.shell .handoff-status,.shell .unread-chip { font-size:11px; }
.shell .handoff-body small { font-size:11px; color:var(--muted); }
.shell .handoff-meta span,.shell .handoff-meta em,.shell .handoff-card footer code,.shell .handoff-person small { font-size:12px; }
.shell .handoff-meta.historical b,.shell .handoff-meta.historical span,.shell .handoff-meta em { color:var(--muted); }
.shell .handoff-filters button b { font-weight:750; }
.shell .handoff-filters button:hover { border-color:var(--line); }
@media (max-width:1000px) { .users-layout { grid-template-columns:1fr; } }
@media (max-width:700px) { .account-identity { display:none; }.permission-picker,.user-card-grid { grid-template-columns:1fr; }.user-active { padding:5px 0; }.user-password-reset { grid-template-columns:1fr; } }
.handoff-evidence, .handoff-context { padding: 16px; border-top: 1px solid var(--line); }
.handoff-evidence h3 { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.handoff-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.handoff-media-grid figure { margin: 0; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.handoff-media-grid img, .handoff-media-grid video { display: block; width: 100%; height: 210px; object-fit: contain; background: var(--inset); border-radius: 4px; }
.handoff-media-grid figcaption { margin-top: 10px; font-size: 13px; color: var(--text); }
.handoff-media-grid a { color: var(--info); }
.handoff-media-unavailable { min-height: 100px; color: var(--accent); }
.handoff-context summary { cursor: pointer; font-weight: 700; color: var(--text); }
.handoff-context p { color: var(--muted); font-size: 12px; }
.handoff-context li { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); margin: 10px 0; line-height: 1.5; }
.order-copy-field { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; padding:10px 0; }
.order-copy-field + .order-copy-field { border-top:1px solid var(--line); }
.order-copy-content { display:grid; gap:5px; min-width:0; }
.shell .order-copy-content small { text-transform:none; letter-spacing:0; font-size:12px; }
.shell .order-copy-value { display:block; font-size:15px; line-height:1.45; color:var(--text); white-space:pre-wrap; user-select:text; overflow-wrap:anywhere; }
.shell .order-copy-value.missing { color:var(--muted); font-weight:400; }
.order-copy-button { min-width:80px; min-height:40px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--raised); color:var(--text); font-size:12px; font-weight:700; cursor:pointer; }
.order-copy-button:hover:not(:disabled) { background:var(--raised); border-color:var(--line); }
.order-copy-button:focus-visible { outline:3px solid var(--info); outline-offset:3px; }
.order-copy-button.copied { background:var(--success-bg); border-color:var(--green); color:var(--text); }
.order-copy-button:disabled { opacity:.5; cursor:default; }
.order-copy-buffer { position:fixed; left:-10000px; top:0; width:1px; height:1px; padding:0; border:0; }
.backup-result { padding:18px; border:1px solid var(--line); border-radius:10px; margin:20px 0; background:var(--panel); }
.backup-result.verified { background:var(--inset); color:var(--green); border-color:var(--line); }
.backup-result.failed { background:var(--raised); color:var(--red); border-color:var(--red); }
.backup-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.backup-metrics > div { display:grid; gap:9px; align-content:start; padding:18px; background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow-wrap:anywhere; }
.backup-metrics small,.backup-metrics span,.backup-download small { color:var(--muted); }
.backup-download { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:20px 0; }
.backup-download > div { display:grid; gap:8px; min-width:0; overflow-wrap:anywhere; }
.backup-download a { text-decoration:none; white-space:nowrap; }
.backup-notes { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); color:var(--muted); line-height:1.65; }
.learning-form { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:20px 0; }
.learning-history-tools { display:grid;grid-template-columns:minmax(220px,360px) 1fr;gap:18px;align-items:end;margin:20px 0; }
.learning-history-tools .muted { margin:0 0 10px; }
#learning-retired { margin:16px 0; }
#learning-retired summary { cursor:pointer;color:var(--info);font-weight:700; }
.learning-consent { grid-column:1/-1;display:flex;align-items:center;gap:12px;line-height:1.6; }
.learning-consent input { width:20px;height:20px;flex:0 0 20px;margin:0; }
.learning-range-note { overflow-wrap:anywhere; }
.learning-actions { display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:18px; }
.learning-charts { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:25px 0; }
.learning-charts section,.learning-proposal { background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:20px; }
.learning-charts ul { padding:0;list-style:none; }
.learning-charts li { display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line); }
.learning-charts b { white-space:nowrap; }
.learning-proposals { display:grid;gap:15px; }
.learning-cases { display:grid;gap:18px; }
.learning-case { min-width:0;overflow-wrap:anywhere;border-left:3px solid var(--accent); }
.learning-case > p { border-top:1px solid var(--line);padding-top:12px; }
.learning-case details { padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:8px; }
.learning-case summary { cursor:pointer;color:var(--info); }
.learning-case summary:focus-visible { outline:2px solid var(--info);outline-offset:4px; }
.learning-proposal p { line-height:1.75;max-width:1100px; }
#learning-report progress { width:100%;height:18px;accent-color:#69dca7; }
@media(max-width:1000px) { .learning-form,.learning-charts { grid-template-columns:1fr 1fr; } }
@media(max-width:600px) { .learning-form,.learning-charts,.learning-history-tools { grid-template-columns:1fr; } }
@media (max-width:1100px) { .backup-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .backup-metrics { grid-template-columns:1fr; } .backup-download { align-items:stretch; flex-direction:column; } .backup-download a { text-align:center; } }

#customer-provider-card[hidden] { display:none; }
#customer-provider-card { margin-top:16px; }
#customer-provider-card select { width:100%; min-width:0; }
#customer-provider-card small { line-height:1.5; color:var(--muted); }

.record-pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:18px}.record-page-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.record-page-buttons button.active{border-color:#a63e0c;background:#fff0e7;color:#813008;font-weight:700}.record-pagination small{color:#64748b}

.handoff-search {display:flex;flex-direction:column;gap:6px;margin:16px 0;max-width:440px;}
.handoff-search input {width:100%;}
