/* Sentinel — corporate-standard log console */
*{box-sizing:border-box}
:root{
  --bg:#eef0f3; --surface:#ffffff; --surface-2:#f8f9fb; --surface-3:#f1f2f5;
  --border:#e2e5ea; --border-2:#ebedf1; --border-strong:#d4d8de;
  --text:#12151b; --text-2:#4c5563; --text-3:#8991a0;
  --accent:#1a2333; --accent-h:#0d131c; --accent-soft:#eef0f4;
  --err:#d92d3f; --err-bg:#fdeced; --err-br:#f7c6cb;
  --warn:#b8720a; --warn-bg:#fdf3e2; --warn-br:#eeddab;
  --info:#2f6fdc; --info-bg:#eaf1fd; --info-br:#c9dcf8;
  --dbg:#6b7280; --dbg-bg:#eef0f3;
  --ok:#0a9d5c;
  --sidebar-w:272px;
  --shadow-xs:0 1px 2px rgba(16,24,40,.04);
  --shadow:0 1px 3px rgba(16,24,40,.06),0 4px 10px -6px rgba(16,24,40,.08);
  --shadow-lg:0 20px 50px -20px rgba(16,24,40,.35);
  --mono:ui-monospace,'SF Mono','JetBrains Mono',Menlo,Consolas,monospace;
  --sans:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
*{scrollbar-width:thin;scrollbar-color:#c7ccd4 transparent}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:13.5px;-webkit-font-smoothing:antialiased}

/* ===================== shell ===================== */
.shell{display:flex;min-height:100vh}

/* ===================== sidebar ===================== */
.side{width:var(--sidebar-w);flex-shrink:0;background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;height:100vh;position:sticky;top:0}
.side-brand{display:flex;align-items:center;gap:11px;padding:18px 18px 16px}
.side-brand .mark{width:32px;height:32px;border-radius:9px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(150deg,#2b3543,#12151b);color:#fff;font-weight:800;font-size:15px;
  box-shadow:0 4px 12px -4px rgba(18,21,27,.5)}
.side-brand .txt b{font-size:14.5px;font-weight:680;letter-spacing:-.01em;display:block;line-height:1.2}
.side-brand .txt span{font-size:10.5px;color:var(--text-3);letter-spacing:.01em}

.side-env{padding:0 12px 14px;display:flex;flex-direction:column;gap:6px}
.envbtn{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:9px;border:1px solid transparent;
  background:transparent;cursor:pointer;text-align:left;font-family:inherit;transition:.13s}
.envbtn div b{display:block;font-size:12.5px;font-weight:610;color:var(--text-2);line-height:1.25}
.envbtn div small{font-size:10px;color:var(--text-3)}
.envbtn:hover{background:var(--surface-2)}
.envbtn.on{background:var(--accent-soft);border-color:var(--border)}
.envbtn.on div b{color:var(--text)}
.envdot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.envdot.cr{background:#2f6fdc}.envdot.vm{background:#0a9d5c}

.side-search{margin:0 12px 10px;display:flex;align-items:center;gap:8px;height:34px;padding:0 10px;
  border:1px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--text-3)}
.side-search input{border:0;background:transparent;flex:1;font-size:12.5px;color:var(--text);height:100%;outline:none;font-family:inherit}
.side-label{padding:4px 18px 6px;font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-3);display:flex;align-items:center;gap:8px}
.cnt-badge{background:var(--surface-3);color:var(--text-2);padding:1px 7px;border-radius:20px;font-size:10px;font-weight:700}
.side-list{flex:1;overflow-y:auto;padding:0 8px 10px}
.side-loading{padding:14px;color:var(--text-3);font-size:12px}
.svc-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:8px;cursor:pointer;transition:.11s;
  font-size:12.5px;color:var(--text-2);margin-bottom:1px}
.svc-item:hover{background:var(--surface-2)}
.svc-item.active{background:var(--accent);color:#fff}
.svc-item .sdot{width:6px;height:6px;border-radius:50%;background:var(--border-strong);flex-shrink:0}
.svc-item.active .sdot{background:#7fd6a0}
.svc-item .sname{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.svc-item .serr{font-size:9.5px;font-weight:700;background:var(--err);color:#fff;border-radius:20px;padding:1px 6px;flex-shrink:0}
.svc-item.active .serr{background:rgba(255,255,255,.25)}

.side-foot{padding:12px 18px;border-top:1px solid var(--border-2);display:flex;flex-direction:column;gap:8px}
.who{font-size:11.5px;color:var(--text-2);display:flex;align-items:center;gap:7px}
.who b{color:var(--text);font-weight:640}
.dotgood{width:6px;height:6px;border-radius:50%;background:#12b76a;box-shadow:0 0 0 3px rgba(18,183,106,.16)}
.side-foot a{font-size:11.5px;color:var(--text-3);text-decoration:none}
.side-foot a:hover{color:var(--text)}

/* ===================== main ===================== */
.main{flex:1;min-width:0;display:flex;flex-direction:column}

.cmdbar{display:flex;align-items:center;gap:14px;height:52px;padding:0 24px;background:var(--surface);
  border-bottom:1px solid var(--border-2)}
.crumb{font-size:13px;color:var(--text-3);display:flex;align-items:center;gap:8px}
.crumb #crumbSvc{color:var(--text);font-weight:620}
.crumb .sep{color:var(--border-strong)}
.cmdgrow{flex:1}
.mode{display:flex;border:1px solid var(--border);border-radius:9px;overflow:hidden;height:32px}
.mode button{border:0;background:var(--surface);color:var(--text-2);padding:0 14px;font-size:12px;font-weight:590;
  cursor:pointer;font-family:inherit;display:flex;align-items:center;gap:6px}
.mode button.on{background:var(--accent);color:#fff}
.mode button:not(.on):hover{background:var(--surface-2)}
.pulse{width:7px;height:7px;border-radius:50%;background:currentColor}
.mode button.on .pulse,.btn.live .pulse{background:#fff;animation:blip 1.2s infinite}
@keyframes blip{50%{opacity:.35}}

.querybar{display:flex;gap:10px;align-items:center;padding:14px 24px;background:var(--surface);
  border-bottom:1px solid var(--border);flex-wrap:wrap;position:relative}
.qsearch{flex:1;min-width:220px;display:flex;align-items:center;gap:9px;height:38px;padding:0 13px;
  border:1px solid var(--border);border-radius:9px;background:var(--surface-2);color:var(--text-3);transition:.14s}
.qsearch:focus-within{border-color:var(--accent);background:var(--surface);box-shadow:0 0 0 3px rgba(26,35,51,.08)}
.qsearch input{border:0;background:transparent;flex:1;font-size:13px;color:var(--text);height:100%;outline:none;font-family:inherit}
.ctl{display:flex;align-items:center;gap:9px;cursor:pointer;user-select:none;min-width:260px;height:38px;padding:0 13px;
  border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);font-size:13px;transition:.14s}
.ctl:hover{border-color:var(--border-strong)}
.ctl .cal{color:var(--text-3)}
.ctl .car{margin-left:auto;color:var(--text-3);font-size:10px}
.f{position:relative}
.f input[type=number]{height:38px;border:1px solid var(--border);border-radius:9px;padding:0 11px;font-size:13px;
  font-family:inherit;color:var(--text);background:var(--surface)}
.btn{height:38px;padding:0 18px;border:0;border-radius:9px;font-weight:610;font-size:13px;cursor:pointer;font-family:inherit;
  background:var(--accent);color:#fff;transition:.14s;display:inline-flex;align-items:center;gap:8px;box-shadow:var(--shadow-xs)}
.btn:hover{background:var(--accent-h)}
.btn.live.on{background:var(--err)}
.hide{display:none!important}

/* ===================== KPI strip ===================== */
.kpis{display:flex;gap:1px;background:var(--border);border-bottom:1px solid var(--border);margin:0}
.kpi{flex:1;background:var(--surface);padding:13px 22px;display:flex;flex-direction:column;gap:4px}
.klabel{font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-3)}
.kval{font-size:21px;font-weight:680;letter-spacing:-.02em;color:var(--text);font-variant-numeric:tabular-nums}
.kpi.err .kval{color:var(--err)}
.kpi.warn .kval{color:var(--warn)}

/* ===================== result panel ===================== */
.result{margin:0;background:var(--surface);flex:1;display:flex;flex-direction:column;min-height:0}

.histwrap{padding:14px 24px 10px;border-bottom:1px solid var(--border-2);background:var(--surface-2)}
.histinfo{display:flex;justify-content:space-between;font-size:11px;color:var(--text-3);margin-bottom:8px;font-weight:640;letter-spacing:.02em}
.histtip{color:var(--text-2);font-weight:520;font-variant-numeric:tabular-nums}
.hist{display:flex;align-items:flex-end;gap:2px;height:60px}
.hbar{flex:1;min-width:2px;display:flex;flex-direction:column-reverse;border-radius:2px 2px 0 0;overflow:hidden;
  cursor:pointer;opacity:.92;transition:opacity .12s,transform .12s;min-height:2px;background:var(--border-2)}
.hbar:hover{opacity:1;transform:scaleY(1.02)}
.hseg{width:100%}
.hseg.error{background:var(--err)}.hseg.warning{background:var(--warn)}
.hseg.information{background:var(--info)}.hseg.other,.hseg.debug{background:#a2aab8}
.histaxis{display:flex;justify-content:space-between;font-size:10.5px;color:var(--text-3);margin-top:6px;font-variant-numeric:tabular-nums}

.filterbar{display:flex;align-items:center;gap:12px;padding:11px 24px;border-bottom:1px solid var(--border-2);flex-wrap:wrap}
.levels{display:flex;gap:6px;flex-wrap:wrap}
.lvpill{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:8px;border:1px solid var(--border);
  background:var(--surface);cursor:pointer;font-size:11.5px;font-weight:600;color:var(--text-2);transition:.13s;user-select:none}
.lvpill .swz{width:7px;height:7px;border-radius:2px}
.lvpill .n{font-variant-numeric:tabular-nums;color:var(--text-3);font-weight:640}
.lvpill.off{opacity:.42}
.lvpill.on{color:var(--text);border-color:var(--border-strong);background:var(--surface-3)}
.lvpill[data-l=error] .swz{background:var(--err)}.lvpill[data-l=warning] .swz{background:var(--warn)}
.lvpill[data-l=information] .swz{background:var(--info)}.lvpill[data-l=debug] .swz{background:var(--dbg)}
.lvpill[data-l=other] .swz{background:#a2aab8}
.fsearch{display:flex;align-items:center;gap:7px;height:32px;padding:0 11px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface-2);color:var(--text-3);min-width:190px;flex:1;max-width:320px}
.fsearch input{border:0;height:auto;padding:0;background:transparent;flex:1;font-size:12.5px;color:var(--text);outline:none;font-family:inherit}
.stats{font-size:11.5px;color:var(--text-3);font-variant-numeric:tabular-nums;margin-left:auto}
.stats b{color:var(--text);font-weight:640}
.fbactions{display:flex;gap:7px}
.tgl{height:32px;padding:0 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text-2);
  font-size:11.5px;cursor:pointer;font-family:inherit;transition:.13s;font-weight:560}
.tgl.on{background:var(--accent);color:#fff;border-color:var(--accent)}
.chip{height:32px;padding:0 13px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text-2);
  font-size:11.5px;cursor:pointer;transition:.14s;display:inline-flex;align-items:center;gap:6px;font-family:inherit;font-weight:560}
.chip:hover{color:var(--text);border-color:var(--border-strong)}
.chip.dl{background:var(--accent);color:#fff;border-color:var(--accent)}
.chip.dl:disabled{opacity:.4;cursor:not-allowed}

/* log table */
.loghead{display:flex;gap:14px;padding:8px 24px;font-size:10px;font-weight:730;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-3);border-bottom:1px solid var(--border-2);background:var(--surface-2);flex-shrink:0}
.loghead .c-time{width:120px}.loghead .c-lvl{width:74px}.loghead .c-msg{flex:1}
.logbody{margin:0;flex:1;min-height:0;overflow-y:auto;background:var(--surface);font-family:var(--mono);font-size:12.3px}
.logrow{display:flex;gap:14px;padding:5px 24px;border-bottom:1px solid var(--border-2);cursor:pointer;
  border-left:3px solid transparent;line-height:1.55;transition:background .1s}
.logrow:nth-child(even){background:rgba(0,0,0,.008)}
.logrow:hover{background:var(--surface-2)}
.logrow .t{width:120px;flex-shrink:0;color:var(--text-3);font-variant-numeric:tabular-nums;font-size:11.8px}
.logrow .b{width:74px;flex-shrink:0}
.badge{display:inline-block;padding:2px 8px;border-radius:5px;font-size:10px;font-weight:740;letter-spacing:.03em;font-family:var(--sans)}
.badge.error{color:var(--err);background:var(--err-bg)}
.badge.warning{color:var(--warn);background:var(--warn-bg)}
.badge.information{color:var(--info);background:var(--info-bg)}
.badge.debug{color:var(--dbg);background:var(--dbg-bg)}
.badge.other{color:var(--text-2);background:var(--surface-3)}
.logrow .m{flex:1;color:#242a33;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.logbody.wrap .logrow .m{white-space:pre-wrap;word-break:break-word}
.logrow.open .m{white-space:pre-wrap;word-break:break-word}
.logrow.lv-error{border-left-color:var(--err);background:rgba(217,45,63,.035)}
.logrow.lv-error:hover,.logrow.lv-error.open{background:rgba(217,45,63,.06)}
.logrow.lv-warning{border-left-color:var(--warn)}
.logrow .m .det{display:block;margin-top:7px;padding:11px 13px;background:var(--surface-3);border:1px solid var(--border-2);
  border-radius:8px;color:#333a45;white-space:pre-wrap;word-break:break-word;font-size:11.8px}
.empty{padding:70px 16px;text-align:center;color:var(--text-3);font-family:var(--sans);font-size:13px}
.emptybig{font-size:16px;color:var(--text-2);font-weight:620;margin-bottom:8px}
.logbody::-webkit-scrollbar,.side-list::-webkit-scrollbar{width:11px}
.logbody::-webkit-scrollbar-thumb,.side-list::-webkit-scrollbar-thumb{background:#ccd1d8;border-radius:7px;border:3px solid var(--surface)}

/* ===================== date range popover ===================== */
.pop{position:absolute;z-index:60;top:44px;left:0;display:none;background:var(--surface);border:1px solid var(--border);
  border-radius:14px;box-shadow:var(--shadow-lg);overflow:hidden}
.pop.open{display:block}
.popcols{display:flex}
.presets{width:168px;padding:12px;border-right:1px solid var(--border-2);display:flex;flex-direction:column;gap:3px}
.presets .ph{font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-3);margin:2px 6px 6px;font-weight:720}
.pchip{padding:8px 11px;border-radius:8px;font-size:12.5px;color:var(--text);cursor:pointer;transition:.12s}
.pchip:hover{background:var(--surface-2)}
.calside{padding:14px 16px;width:296px}
.calhead{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.calhead .mo{font-weight:660;font-size:13.5px}
.nav{width:30px;height:30px;border-radius:8px;border:1px solid var(--border);background:var(--surface);cursor:pointer;color:var(--text-2);font-size:15px;transition:.13s}
.nav:hover{background:var(--surface-2);color:var(--text)}
.dow{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:3px}
.dow span{text-align:center;font-size:10.5px;color:var(--text-3);padding:4px 0;font-weight:620}
.grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.day{text-align:center;padding:8px 0;font-size:12.5px;border-radius:7px;cursor:pointer;transition:.1s;color:var(--text);position:relative}
.day.out{color:#c3c9d2;cursor:default}
.day:hover:not(.out){background:var(--surface-2)}
.day.inrange{background:rgba(26,35,51,.07);border-radius:0}
.day.start,.day.end{background:var(--accent);color:#fff;font-weight:640}
.day.start{border-radius:7px 0 0 7px}.day.end{border-radius:0 7px 7px 0}.day.start.end{border-radius:7px}
.day.today:not(.start):not(.end)::after{content:'';position:absolute;bottom:4px;left:50%;transform:translateX(-50%);width:4px;height:4px;border-radius:50%;background:var(--accent)}
.times{display:flex;gap:10px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border-2)}
.times .tf{flex:1;display:flex;flex-direction:column;gap:5px}
.times label{font-size:10.5px;color:var(--text-3);text-transform:uppercase;letter-spacing:.04em;font-weight:620}
.times input{height:36px;width:100%;border:1px solid var(--border);border-radius:8px;padding:0 9px;font-family:inherit;font-size:12.5px}
.popft{display:flex;align-items:center;gap:10px;padding:11px 16px;border-top:1px solid var(--border-2);background:var(--surface-2)}
.popft .rng{flex:1;font-size:12px;color:var(--text-2);font-variant-numeric:tabular-nums}
.popft .cx{padding:8px 14px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-2);cursor:pointer;font-size:12.5px}
.popft .ap{padding:8px 18px;border-radius:8px;border:0;background:var(--accent);color:#fff;cursor:pointer;font-weight:620;font-size:12.5px}

@media(max-width:900px){
  .shell{flex-direction:column}
  .side{width:100%;height:auto;position:static;border-right:0;border-bottom:1px solid var(--border)}
  .side-list{max-height:220px}
  .kpis{flex-wrap:wrap}.kpi{min-width:45%}
  .loghead{display:none}
}
