/* Sechosti workspace theme — shared by the Tenant Console and Customer Portal.
   Derived from the UX Pilot reference (01-console-overview.html / 06-portal-home.html).
   One palette, one set of components; no conflicting duplicate blocks. */

:root{
  color-scheme:dark;
  --base:#0b1020; --panel:#141b2e; --panel-2:#111a2d; --edge:#243049;
  --ink:#e6ebf5; --muted:#8a95ad; --accent:#38bdf8; --accent-ink:#04121c;
  --green:#22c55e; --amber:#f59e0b; --red:#ef4444; --grey:#64748b;
}
*{box-sizing:border-box}
body{margin:0;background:var(--base);color:var(--ink);font:14px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
button,input,select,textarea{font:inherit;border:1px solid var(--edge);border-radius:6px;background:#10182b;color:var(--ink);padding:6px 12px}
button{cursor:pointer}
button:hover{border-color:var(--accent)}
button:disabled{opacity:.45;cursor:default}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
[hidden]{display:none!important}
.skip{position:absolute;left:-10000px}
.skip:focus{left:1rem;top:1rem;z-index:5}

/* Shell */
.layout{display:grid;grid-template-columns:14rem minmax(0,1fr);min-height:100vh}
.reference-console .layout{display:grid;grid-template-columns:14rem minmax(0,1fr);min-height:calc(100vh - 32px);border:1px solid var(--edge);border-radius:10px;margin:16px;overflow:clip}
.rail{background:var(--panel-2);border-right:1px solid var(--edge);padding:1.1rem;display:flex;flex-direction:column;gap:1.4rem}
.mark{display:flex;gap:.55rem;align-items:center;color:var(--ink);font-weight:700}
.mark img{width:1.8rem;height:1.8rem}
.mark small{display:block;font-weight:400}
.rail nav{display:grid;gap:.25rem;align-content:start}
.rail nav a{color:var(--muted);padding:.55rem .65rem;border-radius:6px}
.rail nav a[aria-current]{color:#a9e5ff;background:#18324a;font-weight:600}
.console-content{min-width:0}

/* Top bars */
.topbar{min-height:0;display:flex;gap:.7rem;align-items:center;justify-content:space-between;border-bottom:1px solid var(--edge);padding:12px 16px;background:var(--panel)}
.brandbar{display:flex;gap:1.5rem;align-items:center;justify-content:space-between;border-bottom:1px solid var(--edge);flex-wrap:wrap;padding:12px 20px;background:var(--panel)}
.brandbar nav{display:flex;gap:1rem;flex-wrap:wrap}
.brandbar nav a[aria-current]{color:var(--ink);border-bottom:2px solid var(--accent)}

/* Layout helpers */
.wrap{padding:16px;min-width:0;max-width:none}
.portal{max-width:78rem;margin:auto;padding:16px 20px}
.notice{color:var(--muted);margin:0 0 .8rem;font-size:12px}
.actions,.bar,.row{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap}
.bar{justify-content:space-between}
h1,h2,h3,p{margin-top:0}
h1{font-size:18px;margin-bottom:.25rem;letter-spacing:-.02em}
h2{font-size:13px;color:var(--muted);font-weight:500;margin-bottom:.5rem}
h3{font-size:15px;margin-bottom:.5rem}
.muted,small,#feedback{color:var(--muted)}
.small{font-size:12px;color:var(--muted)}
.eyebrow{font-size:11px;letter-spacing:.08em;color:var(--accent);text-transform:uppercase;font-weight:600}

/* Stat cards */
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0}
.card,.tile{background:var(--panel);border:1px solid var(--edge);border-radius:8px;padding:14px;min-width:0}
.tile span,.card h3{display:block;color:var(--muted);font-size:13px;font-weight:500}
.tile strong{display:block;font-size:26px;font-weight:600;margin:.35rem 0 .1rem;letter-spacing:-.02em}
.big{font-size:26px;font-weight:600;letter-spacing:-.02em}

/* Grids */
.main-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:12px;margin-top:12px}
.main-grid.even{grid-template-columns:repeat(2,minmax(0,1fr))}
.main-grid.threat-selected{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
.threat-selected #fleet-panel{display:none}

/* Tables */
.table-wrap{overflow:auto;margin-top:.75rem;scrollbar-color:#53678c var(--panel)}
table{width:100%;border-collapse:collapse;text-align:left}
th,td{padding:8px;border-bottom:1px solid var(--edge);font-size:13px}
th{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap}
td button{padding:6px 12px}

/* Buttons */
.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:700;border-radius:6px;padding:6px 12px;display:inline-block;font-size:12px}
.primary:hover{text-decoration:none;background:#7dd3fc}
.ghost{border:1px solid var(--edge);border-radius:6px;padding:6px 12px;color:var(--ink);display:inline-block;font-size:12px;background:transparent}
.ghost:hover{border-color:var(--accent)}
button.danger{border-color:var(--red);color:var(--red);background:transparent}

/* Badges & pills */
.badge{display:inline-block;padding:2px 8px;border-radius:999px;background:transparent;border:1px solid currentColor;font-size:11px;white-space:nowrap}
.badge.good,.badge.ok{color:#22c55e}
.badge.warn{color:#f59e0b}
.badge.bad,.badge.danger{color:#fb7885}
.badge.muted{color:var(--muted)}
.pill{display:inline-block;padding:2px 8px;border-radius:999px;border:1px solid;font-size:11px;white-space:nowrap}
.p-ok{color:var(--green);border-color:var(--green)}
.p-med{color:var(--amber);border-color:var(--amber)}
.p-high{color:var(--red);border-color:var(--red)}
.p-grey{color:var(--muted);border-color:var(--edge)}

/* Fleet bar + lists */
.fleet{margin:.8rem 0;height:6px;width:100%;display:flex;overflow:hidden;border-radius:3px;background:#26354e}
.fleet span{height:100%}
.bar-track{height:6px;border-radius:3px;background:var(--edge);overflow:hidden}
.bar-track>span{display:block;height:100%;background:var(--green)}
.list{list-style:none;margin:.65rem 0 0;padding:0}
.list li{padding:.7rem 0;border-bottom:1px solid var(--edge)}
.list li:last-child{border-bottom:0}
.list .row{justify-content:space-between}
.row{padding:.6rem 0;border-bottom:1px solid var(--edge)}
.row:last-child{border-bottom:0}

/* Filters */
.filters{margin-top:.6rem}
.filters select,.filters input{min-width:0}
.filters input{flex:1}

/* Banners */
.banner,.portal-hero{background:var(--panel);border:1px solid var(--edge);border-radius:10px;padding:18px;margin-bottom:16px}
.banner.warn,.portal-hero{border-color:#5b4a1f}
.banner h2{font-size:18px;color:var(--ink);margin-bottom:6px}
.portal-hero{display:block}
.portal-hero h1{font-size:18px}

/* Drawer / threat detail */
.drawer{width:min(100% - 2rem,42rem);max-height:85vh;overflow:auto;background:var(--panel);color:var(--ink);border:1px solid var(--edge);border-radius:10px;padding:clamp(1rem,3vw,2rem);margin:0 0 0 auto}
.drawer::backdrop{background:#040914bf}
.drawer dt{color:var(--muted)}
.drawer dd{margin:0 0 .6rem;overflow-wrap:anywhere}
.drawer pre{background:var(--base);padding:.8rem;border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere}
.threat-detail h2{font-size:18px;color:var(--ink)}
.threat-detail dl{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 14px}
.threat-detail dd{margin:0;overflow-wrap:anywhere}
.threat-detail pre{white-space:pre-wrap;overflow-wrap:anywhere}

/* Compact console view */
.compact-console th{display:none}
.compact-console tr{display:flex;flex-wrap:wrap;align-items:center;border-bottom:1px solid var(--edge)}
.compact-console td{border:0}
.compact-console td:first-child{font-weight:600;flex-grow:1}
.reference-console:not(.compact-console) #breadcrumb{display:block}

/* Portal specifics */
.reference-portal .brandbar .mark small{display:inline;margin-left:4px;font-size:inherit;font-weight:inherit}
.reference-portal .brandbar .mark img{display:none}
.report-links a{display:block;border-top:1px solid var(--edge);padding:.7rem 0}
.portal-stack{display:grid;gap:1rem;align-content:start}

/* Forms */
.brand-row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:end}
.brand-row label{display:grid;gap:.3rem;font-size:.82rem;color:var(--muted);font-weight:600}
.brand-notice{padding:.7rem .9rem;border-radius:8px;margin-bottom:1rem;font-size:.9rem}
.brand-notice.info{background:color-mix(in srgb,var(--accent) 12%,transparent);border:1px solid color-mix(in srgb,var(--accent) 40%,transparent)}
.brand-notice.warn{background:color-mix(in srgb,var(--amber) 14%,transparent);border:1px solid color-mix(in srgb,var(--amber) 45%,transparent)}
.brand-notice.danger{background:color-mix(in srgb,var(--red) 14%,transparent);border:1px solid color-mix(in srgb,var(--red) 45%,transparent)}
.brand-empty{text-align:center;color:var(--muted);padding:2.5rem 1rem;border:1px dashed var(--edge);border-radius:8px}
.mono,code{font-family:ui-monospace,"Cascadia Code",Consolas,monospace}
.token-box{font-family:ui-monospace,"Cascadia Code",Consolas,monospace;background:var(--panel-2);border:1px solid var(--edge);border-radius:6px;padding:.7rem;word-break:break-all}

/* Responsive */
@media(max-width:1050px){
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .main-grid,.main-grid.threat-selected,.main-grid.even{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:800px){
  .layout,.reference-console .layout{grid-template-columns:minmax(0,1fr)}
  .rail{border-right:0;border-bottom:1px solid var(--edge)}
  .rail nav{display:flex;flex-wrap:wrap}
  .reference-console .topbar{flex-wrap:wrap}
  .threat-selected .threat-detail{order:-1}
}
@media(max-width:640px){
  .stats{grid-template-columns:1fr}
  .filters input{flex-basis:100%}
  .drawer{width:100%;border-radius:0}
}
/* The tenant console fills the viewport. */
.reference-console .layout {
  margin:0;
  min-height:100vh;
  border:0;
  border-radius:0;
}

/* Tenant workspace chrome */
.reference-console .layout { grid-template-columns:16rem minmax(0,1fr); overflow:visible; }
.reference-console .rail { background:#141d30; gap:1rem; padding:0 14px 20px; }
.reference-console .rail .mark { min-height:64px; padding:0 8px; border-bottom:1px solid var(--edge); font-size:16px; }
.reference-console .rail .mark img { width:34px; height:34px; border:1px solid #244766; background:#142a40; border-radius:7px; }
.reference-console .rail nav a { display:flex; align-items:center; gap:11px; min-height:44px; padding:10px 12px; }
.reference-console .rail nav a[aria-current] { color:#38caff; background:#172c42; box-shadow:inset 0 0 0 1px #244766; }
.rail-icon { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nav-section { color:var(--muted); text-transform:uppercase; letter-spacing:.06em; font-size:11px; font-weight:700; margin:20px 12px 2px; }
.nav-count { margin-left:auto; font-size:12px; background:#492a38; color:#ff9ba6; padding:2px 6px; border-radius:4px; }
.reference-console .topbar { position:sticky; top:0; z-index:3; min-height:64px; padding:9px 24px; background:#141d30; }
.console-menu { position:relative; }
.console-menu summary { display:flex; align-items:center; gap:10px; min-height:42px; padding:7px 11px; border:1px solid var(--edge); border-radius:6px; cursor:pointer; }
.console-menu summary::-webkit-details-marker { display:none; }
.console-menu summary::after { content:""; width:6px; height:6px; border:solid var(--muted); border-width:0 1.5px 1.5px 0; transform:rotate(45deg); margin:0 3px 3px auto; }
.console-menu small,.console-menu strong { display:block; }
.tenant-menu { width:min(24%,255px); min-width:155px; }
.tenant-avatar,.profile-avatar { display:grid; place-items:center; flex:none; width:30px; height:30px; font-weight:700; color:#45ccff; background:#193650; border-radius:5px; }
.profile-avatar { border-radius:50%; background:#26314d; color:#e2d6ff; }
.profile-menu summary { border-color:transparent; }
.profile-menu summary:hover { border-color:var(--edge); }
.menu-panel { position:absolute; z-index:5; inset:calc(100% + 5px) auto auto 0; min-width:100%; width:max-content; max-width:min(330px,85vw); background:#141d30; border:1px solid #344460; border-radius:7px; box-shadow:0 12px 30px #0007; padding:10px; }
.menu-panel a { display:block; padding:8px 6px; }
.menu-panel p { margin:0; }
.notifications summary::after { display:none; }
.notifications .menu-panel { left:auto; right:0; }
#console-search { position:relative; display:flex; align-items:center; flex:1; gap:10px; color:var(--muted); background:#10192b; border:1px solid var(--edge); border-radius:6px; padding:0 12px; }
#console-query { width:100%; border:0; padding:11px 0; background:transparent; }
#console-search kbd { white-space:nowrap; border:1px solid var(--edge); border-radius:4px; padding:2px 5px; font-size:11px; }
.reference-console .wrap { padding:clamp(16px,2.25vw,32px); }
.reference-console .overview-heading h1 { font-size:clamp(24px,2.4vw,32px); }
.reference-console .overview-heading { margin-bottom:16px; }
.reference-console .tile { min-height:125px; padding:20px; background:#141d30; }
.reference-console .tile strong { font-size:30px; }
.reference-console .card h2 { font-size:16px; color:var(--ink); font-weight:650; }
.reference-console .list .row { padding:12px; border:1px solid var(--edge); border-radius:6px; background:#0e1627; margin-bottom:8px; }
.reference-portal .brandbar .mark img { display:block; }
@media(max-width:970px) {
  .reference-console .layout { grid-template-columns:13rem minmax(0,1fr); }
  .reference-console .topbar { flex-wrap:wrap; }
  #console-search { order:1; flex-basis:100%; }
}
@media(max-width:720px) {
  .reference-console .layout { grid-template-columns:minmax(0,1fr); }
  .reference-console .rail nav { display:flex; flex-wrap:wrap; }
  .reference-console .rail nav .nav-section { flex-basis:100%; }
  .reference-console .topbar { position:relative; }
}
