/* Liquid glass in black, white and grey. Colour is kept for problems only. */
:root {
  --navy: #18181b;
  --red: #b4232f;
  --ink: #18181b;
  --muted: #55555e;
  --line: rgba(24, 24, 27, 0.1);
  --glass: rgba(255, 255, 255, 0.56);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --down: #18181b;
  --full: #b4232f;
  --near: #c98a2b;
  --busy: #6b6b74;
  --healthy: #a9a9b2;
  --critical: #b4232f;
  --major: #a8691a;
  --warning: #6b6b74;
  --radius: 22px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #e9e9ec; }
body { margin: 0; min-height: 100vh; font: 14px/1.5 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ink); }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(46vw 40vw at 6% 6%, rgba(255, 255, 255, 0.95), transparent 65%),
    radial-gradient(40vw 40vw at 96% 10%, rgba(113, 113, 122, 0.22), transparent 62%),
    radial-gradient(50vw 42vw at 80% 96%, rgba(255, 255, 255, 0.8), transparent 62%),
    radial-gradient(42vw 36vw at 8% 96%, rgba(82, 82, 91, 0.18), transparent 62%),
    linear-gradient(160deg, #f4f4f5, #e4e4e7 55%, #ededf0);
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 13px; font-weight: 700; }
a { color: var(--navy); }
input { accent-color: var(--ink); }
.muted { color: var(--muted); font-size: 12px; }
.error { color: var(--full); min-height: 1em; }

.glass {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), var(--glass) 40%, rgba(255, 255, 255, 0.46));
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.35), 0 18px 44px -22px rgba(24, 24, 27, 0.38), 0 2px 8px -4px rgba(24, 24, 27, 0.14);
}
.card { padding: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; font: inherit; font-weight: 700; font-size: 13px; color: var(--ink); background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 999px; padding: 0 16px; cursor: pointer; text-decoration: none; box-shadow: inset 0 1px 0 #fff, 0 4px 12px -6px rgba(24, 24, 27, 0.35); transition: transform 0.15s, background 0.15s, box-shadow 0.15s; }
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { color: #fff; background: linear-gradient(135deg, #3f3f46, var(--navy)); border-color: rgba(255, 255, 255, 0.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 18px -8px rgba(24, 24, 27, 0.8); }
.btn.danger { color: #fff; background: linear-gradient(135deg, #b4232f, #8f1a24); border-color: rgba(255, 255, 255, 0.35); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(24, 24, 27, 0.14); border-radius: 14px; padding: 8px 14px; min-height: 38px; }
:focus-visible { outline: 3px solid rgba(24, 24, 27, 0.6); outline-offset: 2px; }

.welcome { max-width: 900px; margin: 6vh auto; padding: 0 16px; display: grid; gap: 18px; }
.welcome > header { display: grid; justify-items: center; gap: 6px; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.step { padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; }
.step.locked > :not(.step-no, h2, .lock-note) { opacity: 0.4; }
.step ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.qr { align-self: center; padding: 10px; background: #fff; border-radius: 16px; line-height: 0; }
.qr img { width: 148px; height: 148px; }
.welcome .btn.big { min-height: 48px; font-size: 14px; }
.step label { font-size: 12px; font-weight: 700; color: var(--muted); }

.bar { position: sticky; top: 12px; z-index: 900; margin: 12px 20px 0; padding: 10px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand span { font-weight: 800; font-size: 14px; border-left: 2px solid var(--line); padding-left: 12px; color: var(--ink); }
nav { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 999px; background: rgba(24, 24, 27, 0.07); }
nav a { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 15px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 13px; color: var(--muted); }
nav a i { font-size: 18px; }
nav a.on { color: var(--navy); background: #fff; box-shadow: 0 6px 16px -8px rgba(24, 24, 27, 0.5); }
.count { font-size: 11px; color: #fff; background: var(--full); border-radius: 999px; padding: 0 7px; }
.count.soft { background: var(--navy); }
.count:empty { display: none; }
.bar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); border: 1px solid #fff; }
.chip.warn { color: #3f3f46; background: rgba(255, 255, 255, 0.75); }
.chip.ai { color: #fff; border: 0; background: linear-gradient(110deg, #3f3f46, #27272a 55%, #18181b); }

.timeline { margin: 14px 20px 0; padding: 12px 18px; display: flex; align-items: center; gap: 16px; }
.timeline-label { display: grid; min-width: 132px; }
.timeline-label strong { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.timeline-label span { font-size: 11px; color: var(--muted); }
.hours { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(24, minmax(30px, 1fr)); gap: 4px; overflow-x: auto; padding: 3px; }
.hour { font: inherit; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 11px; padding: 4px 0; background: rgba(255, 255, 255, 0.5); display: grid; justify-items: center; color: var(--ink); }
.hour small { font-size: 10px; color: var(--muted); font-weight: 600; }
.hour b { font-size: 12px; }
.hour i { width: 60%; height: 3px; border-radius: 2px; background: var(--full); }
.hour:hover { background: #fff; }
.hour.current { border: 2px solid var(--navy); }
.hour.on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 18px -8px rgba(24, 24, 27, 0.9); }
.hour.on small { color: #d4d4d8; }

main { padding: 16px 20px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1720px; margin: 0 auto; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.g-hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.g-map { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); }
.g-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-split { grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); align-items: start; }

/* CAIMEx surfaces carry a moving iridescent edge. */
.aiglass::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; background: linear-gradient(135deg, rgba(24, 24, 27, 0.55), rgba(255, 255, 255, 0.9) 35%, rgba(113, 113, 122, 0.3) 65%, rgba(24, 24, 27, 0.4)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes sheen { to { background-position: 300% 0; } }
.ai-title { display: flex; align-items: center; gap: 10px; }
.orb { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 19px; background: linear-gradient(145deg, #3f3f46, #18181b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px -8px rgba(24, 24, 27, 0.7); }
.thinking .orb { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 19px; background: linear-gradient(145deg, #3f3f46, #18181b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px -8px rgba(24, 24, 27, 0.7); }
@keyframes spin { to { transform: rotate(360deg); } }
.summary { font-size: 16px; font-weight: 600; line-height: 1.55; margin: 4px 0 14px; letter-spacing: -0.01em; }
.actions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: step; }
.actions li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.62); border: 1px solid rgba(255, 255, 255, 0.9); }
.actions li::before { content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--navy); }
.source { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #52525b; }
.shimmer { height: 14px; margin: 9px 0; border-radius: 8px; background: linear-gradient(90deg, rgba(82, 82, 91, 0.1), rgba(82, 82, 91, 0.28), rgba(82, 82, 91, 0.1)); background-size: 200% 100%; animation: sheen 1.4s linear infinite; }
.ask { display: flex; gap: 8px; margin-top: 14px; }
.ask input { flex: 1; min-width: 0; border-radius: 999px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.thread { display: grid; gap: 8px; margin-top: 12px; max-height: 340px; overflow: auto; }
.thread:empty { display: none; }
.msg { padding: 10px 14px; border-radius: 16px; max-width: 88%; }
.msg.me { justify-self: end; color: #fff; background: var(--navy); border-bottom-right-radius: 5px; }
.msg.ai { justify-self: start; background: rgba(255, 255, 255, 0.85); border-bottom-left-radius: 5px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; padding: 14px 16px 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform 0.15s; }
button.tile:hover { transform: translateY(-2px); }
.tile .label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tile .label i { font-size: 17px; }
.tile strong { display: block; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.25; }
.tile small { color: var(--muted); font-size: 11px; }
.tile svg { display: block; width: 100%; height: 30px; margin-top: auto; padding-top: 4px; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; flex: none; }
.s-down { --c: var(--down); } .s-full { --c: var(--full); } .s-near { --c: var(--near); } .s-busy { --c: var(--busy); } .s-healthy { --c: var(--healthy); }
.v-critical { --c: var(--critical); } .v-major { --c: var(--major); } .v-warning { --c: var(--warning); }
.dot[class*='s-'] { background: var(--c); }
.tag { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 800; line-height: 1.4; padding: 3px 10px; border-radius: 999px; color: color-mix(in srgb, var(--c, var(--navy)) 82%, #000); background: color-mix(in srgb, var(--c, var(--navy)) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c, var(--navy)) 30%, #fff); white-space: nowrap; }
.tag.severity { text-transform: capitalize; }
.filter { cursor: pointer; font-family: inherit; min-height: 30px; }
.filter.off { opacity: 0.45; text-decoration: line-through; }

#map { height: 640px; border-radius: 18px; z-index: 0; background: #e4e4e7; }
.leaflet-container { font: inherit; }
.leaflet-tile-pane { filter: grayscale(1) brightness(1.04) contrast(0.95); }
.leaflet-tooltip { border: 1px solid #fff; border-radius: 12px; box-shadow: 0 12px 28px -12px rgba(24, 24, 27, 0.5); color: var(--ink); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }

.queue { display: grid; gap: 8px; max-height: 690px; overflow: auto; padding-right: 4px; }
.item { display: grid; gap: 5px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.62); border: 1px solid rgba(255, 255, 255, 0.95); border-left: 4px solid var(--c); }
.item-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item-head .link { font-weight: 800; }
.item .next { font-size: 12.5px; display: flex; gap: 6px; }
.item .next i { color: #52525b; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.link { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; color: var(--navy); text-align: left; }
.link:hover { text-decoration: underline; }

.wall { display: grid; gap: 14px; }
.wall-city { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: start; }
.wall-city > div:first-child b { display: block; font-size: 13px; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.cell { height: 28px; padding: 0; border: 0; border-radius: 8px; cursor: pointer; font: 700 10px 'Plus Jakarta Sans', sans-serif; color: #fff; background: var(--c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45); transition: transform 0.12s; }
.cell.s-near { color: #231500; }
.cell.s-healthy { color: #3f3f46; background: color-mix(in srgb, var(--healthy) 34%, #fff); }
.cell.s-busy { color: #fff; }
.cell:hover { transform: scale(1.18); position: relative; z-index: 2; }
.cell.dim { opacity: 0.13; }

.chart { width: 100%; height: 340px; }
.chart.tall { height: 440px; }
.chart.short { height: 240px; }
.scroll-x { overflow-x: auto; }

table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
.plain th, .plain td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plain th { font-size: 11px; color: var(--muted); font-weight: 700; }
.plain .num { text-align: right; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabulator { background: transparent; border: 0; font-size: 13px; font-family: inherit; }
.tabulator .tabulator-header, .tabulator .tabulator-header .tabulator-col { background: rgba(255, 255, 255, 0.8); color: var(--muted); border-color: var(--line); }
.tabulator .tabulator-tableholder .tabulator-table { background: transparent; color: var(--ink); }
.tabulator .tabulator-row { background: rgba(255, 255, 255, 0.4); border-bottom: 1px solid var(--line); cursor: pointer; }
.tabulator .tabulator-row.tabulator-row-even { background: rgba(255, 255, 255, 0.62); }
.tabulator .tabulator-row.tabulator-selectable:hover { background: #fff; }
.tabulator .tabulator-row .tabulator-cell { border: 0; padding: 9px 8px; }
.tabulator .tabulator-row .tabulator-cell.tabulator-frozen { background: inherit; }
.meter { display: inline-block; width: 70px; height: 7px; margin-right: 8px; border-radius: 4px; background: rgba(24, 24, 27, 0.1); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--c); }

.alarm-row { width: 100%; display: grid; grid-template-columns: 100px minmax(0, 1fr) 92px 110px; gap: 12px; align-items: center; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 11px 14px; border: 1px solid rgba(255, 255, 255, 0.95); border-left: 4px solid var(--c); border-radius: 15px; background: rgba(255, 255, 255, 0.55); }
.alarm-row:hover, .alarm-row.on { background: #fff; }
.alarm-row.on { box-shadow: 0 10px 24px -14px rgba(24, 24, 27, 0.65); }
.alarm-list { display: grid; align-content: start; gap: 7px; max-height: 860px; overflow: auto; padding-right: 4px; }
.sticky { position: sticky; top: 90px; }
.history { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.history li { padding-left: 14px; border-left: 2px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.sheet .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.fact { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.66); border: 1px solid rgba(255, 255, 255, 0.95); }
.fact span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.fact b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }

.phone { margin: 12px auto; max-width: 340px; padding: 16px; border-radius: 32px; background: #18181b; }
.phone .from { color: #a1a1aa; font-size: 11px; text-align: center; margin-bottom: 8px; }
.phone .sms { background: #f4f4f5; border-radius: 18px 18px 18px 5px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 60px; }
textarea { width: 100%; min-height: 92px; resize: vertical; }

.tiles.wide { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.tile.still { cursor: default; padding-bottom: 14px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.banner > i { font-size: 22px; color: var(--down); }
.banner > span:not(.orb) { flex: 1; min-width: 220px; }
.scroll-y { max-height: 420px; overflow: auto; }
.scroll-y.tall { max-height: 560px; }
.scroll-y th { position: sticky; top: 0; background: rgba(247, 247, 248, 0.96); }
.meter.wide { width: 150px; }
.meter.full { display: block; width: 100%; height: 10px; }
.kill form { display: grid; gap: 10px; margin-bottom: 18px; }
.kill label { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 700; font-size: 13px; }
.kill label input { min-height: 0; }
.kill h3 { margin-bottom: 8px; }
.cell.paused { outline: 3px dashed var(--down); outline-offset: -1px; }
.sheet { position: fixed; inset: 0; z-index: 1200; background: rgba(24, 24, 27, 0.34); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; justify-content: flex-end; }
.glass.sheet-body { width: min(980px, calc(100% - 24px)); margin: 12px; padding: 22px; overflow: auto; background: rgba(240, 240, 242, 0.92); display: flex; flex-direction: column; gap: 14px; }
.sheet-body > * { flex: none; }
.sectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1400; padding: 12px 20px; font-weight: 700; border-radius: 999px; background: var(--glass-strong); }
.glass.toast { position: fixed; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 1280px) { .bar { border-radius: var(--radius); } }
@media (max-width: 1180px) { .g-hero, .g-map, .g-split { grid-template-columns: minmax(0, 1fr); } .sticky { position: static; } nav { order: 3; margin: 0; } .bar { position: static; } }
@media (max-width: 760px) {
  .g-two, .sectors, .steps { grid-template-columns: minmax(0, 1fr); }
  .scroll-y { overflow-x: auto; }
  main { padding: 12px; } .bar, .timeline { margin: 10px 12px 0; }
  .timeline { flex-wrap: wrap; } .hours { flex-basis: 100%; order: 3; }
  nav { width: 100%; justify-content: space-between; } nav a { padding: 0 10px; } nav a > span { display: none; }
  .wall-city { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .alarm-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sheet .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #map { height: 420px; }
  .ask { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: rgba(255, 255, 255, 0.94); } }
