:root{--bg:#f6f7f9;--card:#fff;--ink:#1d2430;--muted:#5d6878;--line:#dfe3ea;--brand:#1f5f8b;--brand-ink:#fff;
--ok:#1e7a4f;--ok-bg:#e3f4ea;--warn:#8a5a00;--warn-bg:#fff3d6;--high:#b3261e;--high-bg:#fde7e5;--crit:#fff;--crit-bg:#9b1c1c;--star:#c47f00}
*{box-sizing:border-box}body{margin:0;font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink)}
a{color:var(--brand)}header{background:var(--brand);color:var(--brand-ink);padding:10px 16px;display:flex;gap:16px;align-items:center;flex-wrap:wrap}
header a{color:#fff;text-decoration:none;font-weight:500}header .brand{font-weight:700;margin-right:auto}header form{margin:0}
header button{background:transparent;border:1px solid #ffffff80;color:#fff;padding:4px 10px;border-radius:6px;cursor:pointer}
main{max-width:1100px;margin:0 auto;padding:16px}h1{font-size:1.4rem;margin:.2rem 0 1rem}h2{font-size:1.1rem;margin:1.4rem 0 .6rem}
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:14px;margin-bottom:14px}
.grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.stat{font-size:1.8rem;font-weight:700}.muted{color:var(--muted)}.small{font-size:.85rem}
table{width:100%;border-collapse:collapse;background:var(--card)}th,td{padding:8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
th{font-size:.8rem;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}
.tbl-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px}
.badge{display:inline-block;padding:2px 8px;border-radius:99px;font-size:.78rem;font-weight:600}
.sev-info{background:#e8eef5;color:#33475b}.sev-warning{background:var(--warn-bg);color:var(--warn)}
.sev-high{background:var(--high-bg);color:var(--high)}.sev-critical{background:var(--crit-bg);color:var(--crit)}
.ok{background:var(--ok-bg);color:var(--ok)}
.flash{background:#e8f1f8;border:1px solid #b8d2e6;padding:10px 12px;border-radius:8px;margin-bottom:12px}
.flash.err{background:var(--high-bg);border-color:#f2b8b3}
input,select,textarea{font:inherit;padding:8px;border:1px solid var(--line);border-radius:6px;width:100%;background:#fff}
textarea{min-height:38px}label{display:block;font-size:.85rem;color:var(--muted);margin:6px 0 2px}
.btn{display:inline-block;background:var(--brand);color:#fff;border:0;padding:9px 14px;border-radius:7px;cursor:pointer;font-weight:600;text-decoration:none;white-space:nowrap}
.btn.alt{background:#fff;color:var(--brand);border:1px solid var(--brand)}.btn.danger{background:var(--high)}.btn.sm{padding:5px 10px;font-size:.85rem}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.row>*{flex:1 1 180px}
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.tabs a{padding:6px 12px;border-radius:99px;background:#fff;border:1px solid var(--line);text-decoration:none}
.tabs a.on{background:var(--brand);color:#fff;border-color:var(--brand)}
.sheet-row{display:grid;grid-template-columns:minmax(180px,1.4fr) auto minmax(160px,1.6fr);gap:10px;align-items:start;padding:10px 0;border-bottom:1px solid var(--line)}
.sheet-row.err{background:var(--high-bg);margin:0 -14px;padding:10px 14px}.sheet-row .why{color:var(--high);font-size:.85rem;grid-column:1/-1}
.choice{display:flex;gap:6px;flex-wrap:wrap}.choice label{margin:0;display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:6px;padding:6px 9px;color:var(--ink);cursor:pointer;background:#fff}
.choice input{width:auto;margin:0}.star{color:var(--star);font-weight:700}
.done-by{font-size:.8rem;color:var(--muted)}.meter{height:10px;background:#e7ebf0;border-radius:99px;overflow:hidden}
.meter>span{display:block;height:100%;background:var(--brand)}.meter.hot>span{background:var(--high)}
.sticky{position:sticky;bottom:0;background:var(--bg);padding:10px 0;display:flex;gap:10px;justify-content:flex-end;border-top:1px solid var(--line)}
.thumbs{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}.thumbs img{height:110px;border-radius:6px;border:1px solid var(--line);object-fit:cover}
.cam video{width:100%;max-width:640px;border-radius:8px;background:#000;display:block;margin-top:10px}
.chat-layout{display:grid;grid-template-columns:260px 1fr;gap:14px}.rooms a{display:block;padding:9px 10px;border-radius:7px;text-decoration:none;color:var(--ink)}
.rooms a.on{background:#e8f1f8}.rooms .unread{background:var(--brand);color:#fff;border-radius:99px;padding:0 7px;font-size:.75rem;margin-left:6px}
.msgs{height:min(60vh,560px);overflow-y:auto;display:flex;flex-direction:column;gap:6px;padding:4px}
.msg{max-width:78%;padding:8px 11px;border-radius:12px;background:#eef1f5;white-space:pre-wrap;word-wrap:break-word}
.msg.me{align-self:flex-end;background:#d9e9f5}.msg .who{font-size:.75rem;color:var(--muted);margin-bottom:2px}
.msg.call{align-self:center;background:var(--ok-bg);text-align:center}
.call-frame{width:100%;height:calc(100vh - 170px);min-height:420px;border:0;border-radius:10px;background:#111}
.status-requested{background:#e8eef5;color:#33475b}.status-approved{background:#e3ecfb;color:#1f4f99}.status-ordered{background:var(--warn-bg);color:var(--warn)}
.status-delivered{background:var(--ok-bg);color:var(--ok)}.status-declined{background:var(--high-bg);color:var(--high)}
header{row-gap:6px}
@media (max-width:760px){.chat-layout{grid-template-columns:1fr}}
@media (max-width:640px){.sheet-row{grid-template-columns:1fr}main{padding:12px}}
