:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #eef2f6;
  --panel: #ffffff;
  --navy: #1a3f66;
  --navy-2: #24527f;
  --teal: #0e7490;
  --teal-2: #155e75;
  --accent: #1d4ed8;
  --green: #15803d;
  --amber: #c2410c;
  --bad: #dc2626;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--ink);
  background: var(--paper);
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d5dee8;
  border-radius: 8px;
  padding: 7px 10px;
  height: 36px;
}
textarea { height: auto; }
input[type="checkbox"], input[type="radio"] { height: auto; width: auto; }
button, .btn {
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
  cursor: pointer;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, .btn:hover { background: var(--teal-2); }
button.quiet, a.quiet {
  background: #fff;
  color: var(--ink);
  border-color: #d5dee8;
}
button.ghost {
  background: transparent;
  color: #e7eef8;
  border-color: rgba(255, 255, 255, 0.22);
  height: 34px;
}
.top {
  height: 64px;
  display: grid;
  grid-template-columns: 220px minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 12px;
  background: linear-gradient(100deg, #07111e 0%, #0c2340 52%, #10284a 100%);
  color: #e7eef8;
  position: sticky;
  top: 0;
  z-index: 30;
}
.icon-btn, .nav-collapse {
  width: auto;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #d6e2f0;
  border: 0;
  padding: 0 8px;
  font-weight: 600;
}
.icon-btn { width: 40px; justify-content: center; }
.icon-btn svg, .nav-collapse svg, .nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.top-search { display: flex; justify-content: center; }
.top-search form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(680px, 100%);
  background: #fff;
  color: var(--muted);
  border-radius: 10px;
  padding: 0 12px;
  height: 42px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
.top-search svg { width: 18px; height: 18px; }
.top-search input { border: 0; height: 38px; padding: 0; width: 100%; background: transparent; }
.top-search kbd {
  font: 11px/1 ui-monospace, monospace;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 6px;
  background: #f8fafc;
}
.who { display: flex; align-items: center; gap: 0; }
.who-group { display: flex; align-items: center; }
.who-split { width: 2px; height: 32px; margin: 0 16px; background: rgba(255, 255, 255, 0.72); flex: 0 0 auto; border-radius: 1px; }
.who-id { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; min-width: 0; }
.who-id strong { font-size: 14px; font-weight: 750; color: #fff; }
.who-id small { margin-top: 2px; font-size: 11px; font-weight: 650; color: #b7c8db; }
.who-logout button {
  height: 32px; padding: 0 14px; border-radius: 8px;
  background: #fff; color: var(--navy); border: 1px solid #fff; font-weight: 750;
}
.who-logout button:hover { background: #e7eef8; color: var(--navy); }
.pill {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.frame { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.fiber { margin: 0 6px 12px; }
.fiber svg { width: 100%; height: 48px; display: block; }
.portals { display: flex; gap: 10px; }
.portal-hold, .call-hold {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px;
  border-radius: 999px; border: 1px dashed rgba(255,255,255,.35);
  color: #d6e4f2; font-size: 12px; font-weight: 700; background: transparent;
}
.portal-hold { justify-content: center; width: 118px; padding: 0; border-radius: 8px; border-color: rgba(255,255,255,.45); box-sizing: border-box; }
.call-hold { border-color: #cbd5e1; color: #64748b; height: 30px; margin-top: 8px; cursor: not-allowed; }
.mail-demo { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 11px; font-weight: 750; vertical-align: middle; }
.side {
  background: linear-gradient(180deg, #081422 0%, #0a1c34 58%, #0d2748 100%);
  color: #d6e2f0;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 12px;
  min-height: calc(100vh - 64px);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 750; font-size: 18px; margin: 0 8px 16px; }
.mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--teal); color: #fff; font-size: 13px; font-weight: 800;
}
nav.ops, .side-admin { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 10px; border-radius: 8px;
  color: #d6e2f0; font-weight: 600;
}
a.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
a.nav-item.on { background: var(--navy-2); color: #fff; }
.nav-item b {
  margin-left: auto; min-width: 22px; text-align: center;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border-radius: 999px; font-size: 11px; padding: 2px 6px;
}
.nav-item b.alert { background: #b91c1c; }
.nav-hold { opacity: 0.42; cursor: default; }
.side-label {
  margin: 18px 10px 6px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8ea0b8;
}
.nav-collapse { margin-top: auto; color: #8ea0b8; justify-content: flex-start; }
.workspace { min-width: 0; max-width: 100%; padding: 16px 18px 24px; overflow-x: hidden; overflow-y: auto; }
.flash { border-radius: 8px; padding: 8px 12px; background: #ecfeff; }
.flash.error { background: #fef2f2; color: #991b1b; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.pagehead h1, .full-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.pagehead .btn { height: 40px; padding: 0 18px; font-size: 14px; }
.command { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; }
.filter-line { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.filter-drawer { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.filter-drawer summary { cursor: pointer; font-weight: 750; padding: 10px 12px; color: var(--teal); }
.filter-drawer .filters { border: 0; margin: 0; }
.selection-bar { display: none; align-items: end; gap: 10px; background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
body:has([data-pick]:checked) .selection-bar { display: flex; }
.selection-bar form { display: flex; gap: 8px; align-items: end; }
.selection-bar label { display: grid; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); }
.counts { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; overflow: auto; }
.counter {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 108px; height: 72px; padding: 8px 12px 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  border-top: 4px solid #94a3b8; color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.counter strong { font-size: 24px; line-height: 1; font-weight: 750; }
.counter span { margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 650; }
.counter.on { box-shadow: inset 0 0 0 1px var(--teal); background: #f8fafc; }
.tone-blue { border-top-color: #2563eb; } .tone-blue strong { color: #2563eb; }
.tone-slate { border-top-color: #475569; } .tone-slate strong { color: #334155; }
.tone-green { border-top-color: #15803d; } .tone-green strong { color: #15803d; }
.tone-red { border-top-color: #dc2626; } .tone-red strong { color: #dc2626; }
.tone-amber { border-top-color: #ea580c; } .tone-amber strong { color: #c2410c; }
.viewbar {
  width: 280px; flex: 0 0 280px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; display: grid; gap: 6px; align-content: center;
}
.viewbar label { display: grid; gap: 4px; font-size: 11px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.viewbar form { display: flex; gap: 6px; }
.viewbar input, .viewbar select { height: 32px; }
.viewbar button { height: 32px; padding: 0 10px; }
.filters {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.filters label { display: grid; gap: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.filters input, .filters select { height: 34px; background: #f8fafc; }
.filter-actions { display: flex; align-items: end; gap: 8px; grid-column: span 2; }
.filter-actions button { height: 34px; }
.reset { align-self: center; font-weight: 700; color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips a { background: #e0f2fe; color: #0c4a6e; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 100%; min-width: 0; }
.tablebar, .pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 360px); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eef2f6; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: #f8fafc; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: #475569; z-index: 1; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #f8fafc; }
tr.is-open td { background: #dbeafe; }
tr.is-open td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
tbody tr:has([data-pick]:checked) td { background: #e0f2fe; }
tbody tr:has([data-pick]:checked) td:first-child { box-shadow: inset 3px 0 0 #0e7490; }
.kls { color: #1d4ed8; font-weight: 750; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 750; }
.b-green { background: #dcfce7; color: #166534; }
.b-red { background: #fee2e2; color: #991b1b; }
.b-amber { background: #ffedd5; color: #9a3412; }
.b-blue { background: #dbeafe; color: #1d4ed8; }
.b-slate { background: #e2e8f0; color: #334155; }
.stage { display: flex; align-items: flex-start; width: 100%; max-width: 100%; min-width: 0; }
.list-pane { flex: 1 1 auto; min-width: 0; max-width: 100%; overflow: hidden; }
.detail-backdrop { display: none; }
.detail {
  width: 640px; flex: 0 0 640px; margin-left: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  max-height: none; overflow: visible; position: static;
  padding: 16px 16px 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.detail-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; }
.detail-top h2 { margin: 0; font-size: 26px; color: #1d4ed8; letter-spacing: -0.03em; }
.detail-top .badge { justify-self: end; }
.detail-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eyebrow { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
.meta { color: var(--muted); margin: 4px 0 0; }
.close {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 8px; color: var(--muted); font-size: 22px; background: #f8fafc;
}
.block, .sheet { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.detail .block { background: #f8fafc; }
.block h3, .sheet h2, .edit legend { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.person { margin: 0 0 4px; font-size: 18px; font-weight: 750; }
.address-card { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: start; }
.map { height: 148px; border-radius: 10px; overflow: hidden; background: #e8eef5; }
.map-empty { height: 148px; display: grid; place-items: center; text-align: center; color: var(--muted); background: #e8eef5; border-radius: 10px; padding: 8px; font-size: 12px; }
.map-link { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 750; color: var(--teal); }
.split, .sheets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dl { margin: 0; display: grid; gap: 8px; }
dl div { display: grid; gap: 1px; }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 0; font-weight: 700; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.activity li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.more { display: inline-block; margin-top: 8px; font-weight: 750; color: var(--teal); }
.edit { display: grid; gap: 12px; }
.edit fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #fff; }
.edit .wide, .edit fieldset legend { grid-column: 1 / -1; }
.edit label, .inline-form label, .block label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; }
.inline-form { display: grid; gap: 8px; }
.refs { margin: 8px 0 0; padding-left: 18px; }
.full-order { width: 100%; max-width: none; }
.full-navline { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.neighbors { display: flex; gap: 14px; }
.neighbors a { font-weight: 750; color: var(--teal); }
.neighbors span { color: #94a3b8; }
.work-grid:has(.assign-now) {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(320px, 1fr);
  gap: 16px 28px;
  align-items: start;
}
.work-grid:has(.assign-now) .assign-now { grid-column: 1; grid-row: 1 / span 4; }
.work-grid:has(.assign-now) form { grid-column: 2; max-width: 560px; }
.work-grid:has(.assign-now) .assign-now dl { grid-template-columns: 1fr 1fr; }
.desk { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.span-all { grid-column: 1 / -1; }
.address-card .map { height: 180px; }
.back { display: inline-flex; margin-bottom: 8px; font-weight: 750; color: var(--teal); }
.full-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.section-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 16px; }
.section-nav a { color: var(--muted); padding: 10px 12px; border-bottom: 2px solid transparent; font-weight: 700; }
.section-nav a.on { color: var(--teal); border-bottom-color: var(--teal); }
table.plain { background: #fff; }
body.nav-collapsed .frame { grid-template-columns: 76px minmax(0, 1fr); }
body.nav-collapsed .top { grid-template-columns: 76px minmax(240px, 1fr) auto; }
body.nav-collapsed .top-scene { width: 76px; left: 0; }
body.nav-collapsed .fiber { margin: 0 2px 8px; }
body.nav-collapsed .side-scene { height: 34%; }
body.nav-collapsed .side .label, body.nav-collapsed .side-label, body.nav-collapsed .nav-item b { display: none; }
body.nav-collapsed .brand { justify-content: center; margin-left: 0; margin-right: 0; }
body.nav-collapsed .nav-item { justify-content: center; padding: 0; }
body.gate { display: block; background: var(--paper); }
.narrow { max-width: 420px; margin: 12vh auto; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.stack { display: grid; gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; }
@media (max-width: 1540px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .command { flex-direction: column; }
  .viewbar { width: auto; flex-basis: auto; }
  .detail-backdrop { display: block; position: fixed; inset: 64px 0 0 0; background: rgba(11, 28, 48, 0.38); z-index: 20; }
  .detail {
    position: fixed; top: 64px; right: 0; bottom: 0;
    width: min(640px, 100%); max-height: none; overflow: auto; margin: 0; border-radius: 0;
    z-index: 21; box-shadow: -16px 0 40px rgba(11, 28, 48, 0.2);
  }
}
.top { overflow: hidden; border-bottom: 1px solid rgba(125, 211, 252, 0.18); }
.side { position: relative; }
.fiber { height: 30px; margin: 0 10px 8px; }
.fiber-scene { position: absolute; pointer-events: none; z-index: 0; overflow: hidden; }
.top-scene { left: 46px; top: 0; width: 188px; height: 64px; }
.side-scene { left: 0; right: 0; bottom: 0; height: 42%; }
.fiber-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-scene img {
  object-position: left center;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 38%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 38%, transparent 100%);
}
.side-scene img {
  object-position: center bottom;
  -webkit-mask-image: linear-gradient(to top, #000 42%, transparent 100%);
  mask-image: linear-gradient(to top, #000 42%, transparent 100%);
}
.side-scene::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 54px;
  background: linear-gradient(to top, rgba(6, 16, 28, 0.78), transparent);
}
.fiber-scene::before {
  content: "";
  position: absolute; inset: auto 8% 12% auto; width: 46%; height: 38%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 68%);
  animation: fiber-glow 9s ease-in-out infinite;
}
.top-scene::before { left: 8%; right: auto; bottom: 8%; width: 42%; height: 70%; }
.fiber-pulses { position: absolute; inset: 0; width: 100%; height: 100%; }
.top > :not(.fiber-scene),
.side > :not(.fiber-scene) { position: relative; z-index: 1; }
@keyframes fiber-glow {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .fiber-scene::before { animation: none; }
  .fiber-pulses { display: none; }
}
@media (max-width: 1100px) {
  .top { grid-template-columns: auto minmax(0, 1fr); }
  .who { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .split, .sheets, .edit fieldset, .activity li, .address-card, .desk { grid-template-columns: 1fr; }
  .span-all { grid-column: auto; }
}
