:root {
  color-scheme: dark;
  --bg: #020711;
  --surface: rgba(8, 17, 30, 0.86);
  --surface-2: rgba(15, 28, 45, 0.82);
  --surface-3: rgba(7, 20, 33, 0.9);
  --ink: #eff7ff;
  --muted: #8fa1b4;
  --line: rgba(156, 184, 205, 0.16);
  --teal: #14f195;
  --teal-soft: #0c3329;
  --blue: #38bdf8;
  --blue-soft: #0b2740;
  --amber: #f59e0b;
  --amber-soft: #33240c;
  --red: #fb7185;
  --red-soft: #38141c;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.34);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(245, 174, 55, 0.18) 0%, rgba(20, 241, 149, 0.13) 34%, rgba(6, 15, 29, 0.96) 62%),
    linear-gradient(180deg, #06121d 0%, var(--bg) 48%, #010409 100%);
  color: var(--ink);
}

.sidebar {
  position: fixed;
  inset: 18px auto 18px 16px;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 236px;
  padding: 16px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(12, 24, 40, 0.82), rgba(4, 12, 24, 0.72)),
    rgba(7, 16, 29, 0.68);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  transition: width 180ms ease, padding 180ms ease, border-radius 180ms ease;
}

.side-brand {
  display: grid;
  place-items: center;
  min-height: 78px;
  padding: 4px 8px 18px;
}

.side-brand img {
  width: 148px;
  max-height: 64px;
  object-fit: contain;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 14px 28px rgba(56, 189, 248, 0.18)) brightness(1.42);
  transition: width 180ms ease, max-height 180ms ease;
}

.sidebar nav,
.side-bottom {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 6px 0 0;
}

.side-bottom {
  align-content: end;
  padding: 14px 0 0;
  border-top: 1px solid rgba(210, 232, 245, 0.12);
}

.side-icon {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(15, 28, 45, 0.28);
  color: #aebdd0;
  cursor: pointer;
  overflow: hidden;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.side-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(20, 241, 149, 0.06));
  transition: opacity 180ms ease;
}

.side-icon span {
  position: relative;
  z-index: 1;
  display: block;
  width: 32px;
  height: 32px;
  color: currentColor;
  justify-self: center;
}

.side-icon b {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 0.88rem;
  font-weight: 850;
  opacity: 1;
  pointer-events: none;
  text-align: left;
  transform: none;
  white-space: nowrap;
  transition: opacity 140ms ease;
}

.side-icon:hover,
.side-icon:focus-visible {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 48, 72, 0.52);
  color: #eff7ff;
  outline: 0;
  transform: translateX(2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.side-icon:hover::before,
.side-icon:focus-visible::before {
  opacity: 1;
}

.side-icon.active {
  border-color: rgba(56, 189, 248, 0.86);
  background: rgba(8, 25, 45, 0.72);
  color: #eff7ff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2), 0 0 28px rgba(56, 189, 248, 0.24), inset 0 0 24px rgba(56, 189, 248, 0.08);
}

.side-icon.active::before {
  opacity: 1;
}

.side-icon.active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.95);
  transform: translateY(-50%);
}

.collapse-toggle {
  margin-top: 4px;
}

.nav-collapse::before,
.nav-collapse::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 17px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.nav-collapse::before {
  top: 10px;
  transform: rotate(35deg);
}

.nav-collapse::after {
  bottom: 10px;
  transform: rotate(-35deg);
}

body.sidebar-collapsed .sidebar {
  width: 88px;
  padding-inline: 10px;
}

body.sidebar-collapsed .side-brand img {
  width: 58px;
  max-height: 42px;
}

body.sidebar-collapsed .side-icon {
  grid-template-columns: 1fr;
  justify-items: center;
  padding-inline: 8px;
  border-radius: 18px;
}

body.sidebar-collapsed .side-icon b {
  position: absolute;
  left: 76px;
  top: 50%;
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(6, 15, 29, 0.96);
  opacity: 0;
  pointer-events: none;
  transform: translate(-8px, -50%);
}

body.sidebar-collapsed .side-icon:hover b,
body.sidebar-collapsed .side-icon:focus-visible b {
  opacity: 1;
  transform: translate(0, -50%);
}

body.sidebar-collapsed .collapse-toggle .nav-collapse {
  transform: rotate(180deg);
}

body.sidebar-collapsed .topbar,
body.sidebar-collapsed .shell {
  margin-left: 124px;
}

.nav-gauge {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.nav-gauge::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  width: 18px;
  height: 2px;
  background: currentColor;
  transform: rotate(38deg);
  transform-origin: right center;
}

.nav-gauge::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: #1d2130;
}

.nav-bars::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 4px;
  width: 6px;
  height: 12px;
  border: 2px solid currentColor;
  box-shadow:
    10px -13px 0 -2px #1d2130,
    10px -13px 0 0 currentColor,
    20px -6px 0 -2px #1d2130,
    20px -6px 0 0 currentColor;
}

.nav-bars::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 0;
  width: 30px;
  height: 2px;
  background: currentColor;
}

.nav-pin::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 18px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 18px 18px 18px 2px;
  transform: rotate(45deg);
}

.nav-pin::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.nav-client::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.nav-client::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 3px;
  width: 24px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 18px 18px 8px 8px;
}


.nav-map::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 20px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50% 50% 48% 48%;
  transform: rotate(-12deg);
}

.nav-map::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 11px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow: 6px 12px 0 -3px currentColor;
}

.nav-ticket::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 26px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-ticket::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 10px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.nav-pdf::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 18px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-pdf::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 11px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.nav-cut::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 24px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-cut::after {
  content: "$";
  position: absolute;
  left: 12px;
  top: 8px;
  font-size: 17px;
  font-weight: 850;
}

.nav-info {
  border: 2px solid currentColor;
  border-radius: 999px;
}

.nav-info::before {
  content: "i";
  position: absolute;
  left: 14px;
  top: 5px;
  font-size: 22px;
  font-weight: 700;
}

.nav-gear::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow:
    0 -5px 0 -2px #1d2130,
    0 -5px 0 0 currentColor,
    0 5px 0 -2px #1d2130,
    0 5px 0 0 currentColor,
    5px 0 0 -2px #1d2130,
    5px 0 0 0 currentColor,
    -5px 0 0 -2px #1d2130,
    -5px 0 0 0 currentColor;
}

.nav-gear::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 16px 16px 0 276px;
  padding: 8px clamp(16px, 3vw, 28px);
  border: 1px solid rgba(210, 232, 245, 0.14);
  border-radius: 8px;
  background: rgba(6, 15, 29, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.topbar h1,
.section-head h2,
.point h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  font-weight: 500;
}

.topbar h1 span {
  font-style: italic;
  font-weight: 850;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 82px;
  height: 42px;
  border: 0;
  background: transparent;
  object-fit: contain;
  padding: 0;
  filter: drop-shadow(0 8px 18px rgba(56, 189, 248, 0.18)) brightness(1.55);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.top-site {
  min-width: 210px;
  color: #8b90a1;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.top-site select {
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c8ccda;
}

.current-user {
  min-width: 150px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(8, 18, 32, 0.74);
  box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.75);
}

.current-user span,
.current-user small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.current-user strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.1;
}

.current-user small {
  margin-top: 3px;
  color: #8ff8c4;
}

.shell {
  width: min(1320px, calc(100% - 292px));
  margin: 0 16px 0 276px;
  padding: 18px 0 48px;
}

.dashboard {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid rgba(210, 232, 245, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239, 247, 255, 0.08), rgba(20, 241, 149, 0.08)),
    rgba(6, 15, 29, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  min-height: 270px;
  margin-bottom: 18px;
}

.dashboard h2 {
  margin: 0;
  max-width: 720px;
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: 22px 10px 22px 14px;
}

.hero-copy > p {
  max-width: 620px;
  margin: 12px 0 0;
  color: #b3c2d3;
  font-size: 0.98rem;
  font-weight: 750;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 210px));
  gap: 12px;
  margin-top: 28px;
}

.hero-stats article,
.live-card,
.metric,
.chart-card,
.insight-card {
  border: 1px solid rgba(210, 232, 245, 0.14);
  border-radius: 8px;
  background: rgba(6, 15, 29, 0.66);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.hero-stats article {
  min-height: 86px;
  padding: 16px 18px;
}

.hero-stats span,
.mini-card-title span,
.insight-card p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.live-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 18px;
  background: rgba(9, 22, 36, 0.72);
}

.mini-card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.mini-card-title strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.stock-chart {
  display: grid;
  align-items: end;
  gap: 10px;
}

.money-card {
  align-content: start;
}

.money-card .mini-card-title strong {
  color: #9fffd2;
  font-size: 1.55rem;
}

.money-breakdown {
  display: grid;
  gap: 12px;
}

.money-breakdown article {
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(210, 232, 245, 0.12);
  border-radius: 8px;
  background: rgba(15, 28, 45, 0.78);
}

.money-breakdown span,
.money-breakdown small {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.money-breakdown span {
  font-size: 0.76rem;
  text-transform: uppercase;
}

.money-breakdown strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.money-breakdown small {
  margin-top: 5px;
  font-size: 0.72rem;
}

.stock-chart span {
  min-height: 12px;
  height: var(--h);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(124, 162, 224, 0.92), rgba(33, 69, 103, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.health-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #a7adbf;
  font-weight: 750;
}

.health-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.dot.good {
  background: #39d11f;
}

.dot.fair {
  background: #ffad28;
}

.dot.poor {
  background: #ff3434;
}

.network-map {
  display: grid;
  grid-template-columns: 1fr minmax(40px, 0.55fr) 1fr minmax(40px, 0.55fr) 1fr minmax(40px, 0.55fr) 1fr minmax(40px, 0.55fr) 1fr minmax(40px, 0.55fr) 1fr;
  align-items: center;
  min-height: 250px;
  padding: 18px 30px 10px;
}

.network-node {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #8f94a7;
  text-align: center;
}

.network-node strong {
  color: #9da3b7;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  line-height: 1;
}

.network-node p {
  min-height: 40px;
  margin: 0;
  color: #7c8294;
  font-weight: 850;
}

.network-link {
  height: 2px;
  background: #343a4e;
}

.network-link.active {
  background: linear-gradient(90deg, #343a4e, #0078ff, #343a4e);
}

.node-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid #4a5065;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 40%, #4f566f, #202537 70%);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.08);
}

.node-icon::before {
  color: #0078ff;
  font-weight: 950;
}

.node-icon.globe::before {
  content: "◎";
}

.node-icon.shield::before {
  content: "U";
}

.node-icon.stack {
  border-radius: 8px;
}

.node-icon.stack::before {
  content: "▤";
}

.node-icon.ring {
  width: 68px;
  height: 68px;
}

.node-icon.ring::before {
  content: "○";
  font-size: 1.6rem;
}

.node-icon.screen {
  border-radius: 8px;
}

.node-icon.screen::before {
  content: "▭";
}

.node-icon.badge {
  border-radius: 8px;
}

.node-icon.badge::before {
  content: "▣";
}

.traffic-band {
  display: grid;
  gap: 10px;
  padding: 0 44px 26px;
  color: #8f94a7;
}

.traffic-band div:first-child {
  display: flex;
  gap: 12px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 2px;
  border-top: 1px solid #30364a;
  border-bottom: 1px solid #30364a;
  padding: 12px 0;
}

.channel-grid span {
  height: 15px;
  background: #393e50;
}

.totals {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 108px;
  padding: 14px;
}

.metric span,
.next-code span,
.stats dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1;
}

.metric-teal {
  border-top: 3px solid var(--teal);
}

.metric-amber {
  border-top: 3px solid var(--amber);
}

.metric-ink {
  border-top: 3px solid #64748b;
}

.metric-green {
  border-top: 3px solid #22c55e;
}

.metric-warn {
  border-top: 3px solid #facc15;
}

.metric-blue {
  border-top: 3px solid var(--blue);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, 0.75fr);
  gap: 18px;
}

.chart-card {
  min-height: 330px;
  padding: 22px;
}

.stock-chart {
  grid-template-columns: repeat(6, 1fr);
  height: 220px;
  margin-top: 26px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(239, 247, 255, 0.14);
}

.stock-chart span:nth-child(1),
.stock-chart span:nth-child(2) {
  background: linear-gradient(180deg, rgba(20, 241, 149, 0.78), rgba(20, 241, 149, 0.24));
}

.stock-chart span:nth-child(3) {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.84), rgba(245, 158, 11, 0.24));
}

.stock-chart span:nth-child(6) {
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.84), rgba(251, 113, 133, 0.24));
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 10px 8px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
}

.insight-column {
  display: grid;
  gap: 12px;
}

.insight-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
}

.insight-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
}

.insight-card p {
  margin: 0 0 6px;
}

.insight-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.14);
  color: #bdefff;
  font-weight: 950;
}

.insight-card.highlight {
  display: grid;
  align-content: center;
  background: linear-gradient(135deg, rgba(20, 241, 149, 0.16), rgba(56, 189, 248, 0.12)), rgba(6, 15, 29, 0.72);
}

.insight-card.highlight span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.insight-card.highlight strong {
  font-size: 1.55rem;
}

.insight-card.highlight p {
  color: #aab9ca;
  font-size: 0.8rem;
  line-height: 1.45;
  text-transform: none;
}

.notice,
.alert {
  padding: 13px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  color: #ffd98a;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}

.section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-head.compact {
  margin-top: 32px;
}


.map-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.7fr);
  gap: 16px;
  min-height: 560px;
  margin-bottom: 18px;
}

.client-map,
.map-tools {
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(7, 18, 31, 0.84);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.client-map {
  min-height: 560px;
  overflow: hidden;
}

.map-tools {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.map-tools label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.map-tools select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  background: #06101c;
  color: var(--ink);
  padding: 0 12px;
}

.map-client-info {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 28, 45, 0.72);
  color: var(--muted);
}

.map-client-info strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.map-client-info code {
  color: #9cffcf;
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: normal;
  overflow-wrap: anywhere;
}

.map-status {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.map-empty,
.map-fallback {
  padding: 18px;
}

.map-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.map-embed-shell {
  min-height: 340px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}

.map-embed-shell iframe {
  display: block;
  width: 100%;
  min-height: 340px;
  border: 0;
}

.map-fallback {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  gap: 12px;
}

.map-fallback button {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(10, 26, 43, 0.78);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.map-fallback button.active,
.map-fallback button:hover,
.map-fallback button:focus-visible {
  border-color: rgba(56, 189, 248, 0.72);
  outline: 0;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.16);
}

.map-fallback span,
.map-fallback code {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.disabled-link {
  pointer-events: none;
  opacity: 0.5;
}

.gm-info {
  color: #07101c;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.35;
}

.gm-info a {
  color: #075985;
  font-weight: 800;
}

.button,
.icon-button {
  min-height: 40px;
  border: 0;
  background: var(--ink);
  color: #03100b;
  font-weight: 850;
  cursor: pointer;
}

.button {
  padding: 0 16px;
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.danger-action {
  border-color: #f0aaa4;
  color: var(--red);
}

.button.sell {
  background: var(--teal);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.icon-button.danger {
  background: var(--red-soft);
  color: var(--red);
}

.status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.status.ok {
  border-color: #14f195;
  background: var(--teal-soft);
  color: #9fffd2;
}

.status.error {
  border-color: #f0aaa4;
  background: var(--red-soft);
  color: var(--red);
}

.point-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(140px, 0.9fr) minmax(170px, 1fr) 82px 82px 88px 88px auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.site-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.site-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.batch-list,
.pdf-archive,
.cut-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 10px;
}

.batch-item {
  display: grid;
  gap: 10px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.batch-item header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.batch-item strong,
.batch-item span {
  display: block;
}

.batch-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.pdf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 94px;
  padding: 12px;
  border: 1px solid rgba(20, 241, 149, 0.42);
  background: rgba(7, 24, 28, 0.86);
}

.pdf-item strong,
.pdf-item span {
  display: block;
}

.pdf-item span {
  max-width: 100%;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.pdf-item .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  text-decoration: none;
}

.pdf-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.cut-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.cut-item header {
  display: flex;
  justify-content: space-between;
}

.cut-item header strong {
  display: block;
  color: #9fffd2;
  font-size: 1.35rem;
}

.cut-item header span,
.cut-items span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.cut-items {
  display: grid;
  gap: 8px;
}

.cut-items div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.site-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.site-item strong,
.site-item span {
  display: block;
}

.site-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #07101c;
  color: var(--ink);
}

.alerts {
  display: grid;
  gap: 8px;
}

.export-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.export-links a {
  display: grid;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(20, 241, 149, 0.42);
  background: rgba(12, 51, 41, 0.72);
  color: #9fffd2;
  font-weight: 850;
  text-decoration: none;
}

.alert {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
}

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 620px), 1fr));
  gap: 18px;
}

.point {
  min-width: 0;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.point-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.point-title h3 {
  overflow-wrap: anywhere;
}

.point-title p {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--muted);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 12px;
}

.point-site-control {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, auto);
  gap: 8px;
  margin-bottom: 14px;
}

.point-defaults {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #081522;
}

.point-cut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(20, 241, 149, 0.34);
  background: rgba(9, 41, 33, 0.58);
}

.point-cut span {
  color: #9fffd2;
  font-weight: 850;
}

.plan {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface-3);
  padding: 12px;
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.plan-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--teal);
}

.pill {
  margin-left: auto;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.low {
  background: var(--red-soft);
  color: var(--red);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}

.stats div {
  min-width: 0;
  min-height: 56px;
  padding: 8px 6px;
  background: var(--surface-2);
}

.stats dt {
  font-size: clamp(0.68rem, 1.5vw, 0.78rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stats dd {
  margin: 3px 0 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 900;
}

.next-code {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

code {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
  white-space: nowrap;
}

.plan-actions {
  display: grid;
  grid-template-columns: minmax(86px, 0.8fr) minmax(116px, 1fr);
  gap: 8px;
}

.plan-actions [data-batch-name] {
  grid-column: 1 / -1;
}

.voucher-table {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.select-cell {
  width: 42px;
  text-align: center;
}

.select-cell input {
  width: 18px;
  height: 18px;
  padding: 0;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 7, 17, 0.92);
}

.login-card {
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 150px;
  max-height: 80px;
  object-fit: contain;
}

.login-card h2 {
  margin: 0;
}

.access-panel {
  display: grid;
  gap: 18px;
}

.access-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 17, 30, 0.72);
}

.access-head h3 {
  margin: 0;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.access-card,
.audit-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.access-card span,
.access-card small,
.audit-list span,
.audit-list small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.access-card small {
  color: #c7d6e6;
  line-height: 1.35;
}

.access-edit {
  display: grid;
  gap: 10px;
}

.access-edit label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.access-edit input,
.access-edit select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #06101d;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.access-edit .check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-edit .check-line input {
  width: auto;
}

.access-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.access-message {
  min-height: 18px;
  color: var(--muted);
}

.access-message[data-kind="working"] {
  color: #bae6fd;
}

.access-message[data-kind="ok"] {
  color: #8ff8c4;
}

.access-message[data-kind="error"] {
  color: #ff7a93;
}

.permission-box.compact {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.permission-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.permission-box legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.permission-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.permission-box input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.audit-list small {
  color: #c7d6e6;
  line-height: 1.35;
}

.audit-list {
  display: grid;
  gap: 8px;
}

@media (max-width: 1180px) {
  .totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-hero,
  .dashboard-grid,
  .map-panel {
    grid-template-columns: 1fr;
  }

  .network-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .network-link {
    display: none;
  }

  .health-legend {
    position: static;
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .points {
    grid-template-columns: 1fr;
  }

  .point-site-control,
  .point-defaults,
  .point-cut {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(6, 18, 29, 0.98), rgba(2, 7, 17, 0.98)),
      #020711;
  }

  .totals,
  .plan-grid,
  .point-form,
  .site-form,
  .point-site-control,
  .point-defaults,
  .point-cut {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: stretch;
  }

  .sidebar {
    inset: auto 10px 10px 10px;
    z-index: 50;
    display: flex;
    width: auto;
    height: calc(78px + env(safe-area-inset-bottom));
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 22px;
    background: rgba(6, 15, 29, 0.78);
    box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.34);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .side-brand {
    display: none;
  }

  .sidebar nav,
  .side-bottom {
    display: flex;
    align-items: center;
    justify-items: initial;
    align-content: initial;
    gap: 8px;
    padding: 0;
    border: 0;
  }

  .side-bottom {
    margin-left: 0;
  }

  .side-icon {
    flex: 0 0 78px;
    grid-template-columns: 1fr;
    grid-template-rows: 28px auto;
    width: 78px;
    min-height: 58px;
    height: 58px;
    padding: 7px 8px;
    border-radius: 16px;
    gap: 2px;
  }

  .side-icon span {
    width: 24px;
    height: 24px;
    transform: scale(0.82);
  }

  .side-icon b {
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 0.62rem;
    opacity: 1;
    text-align: center;
    transform: none;
  }

  .side-icon:hover b,
  .side-icon:focus-visible b {
    transform: none;
  }

  .side-icon.active::after {
    top: 7px;
    right: 8px;
    transform: none;
  }

  .collapse-toggle {
    display: none;
  }

  body.sidebar-collapsed .topbar,
  body.sidebar-collapsed .shell {
    margin-left: 10px;
  }

  .topbar {
    position: static;
    margin: 10px;
    padding: 10px;
    align-items: stretch;
  }

  .shell {
    width: auto;
    margin: 0 10px;
    padding: 10px 0 18px;
  }

  .network-map {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 0;
  }

  .client-map {
    min-height: 430px;
  }

  .traffic-band {
    padding-inline: 0;
  }

  .channel-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .topbar,
  .section-head,
  .section-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .brand-lockup {
    width: 100%;
    justify-content: space-between;
  }

  .brand-logo {
    width: 64px;
  }

  .top-site {
    width: 100%;
    min-width: 0;
  }

  .top-site select {
    width: 100%;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: #07101c;
  }

  .current-user,
  .status,
  .topbar-actions .button {
    width: 100%;
    justify-content: center;
  }

  .current-user {
    min-width: 0;
  }

  .dashboard {
    padding: 14px;
    margin-bottom: 18px;
  }

  .hero-copy {
    padding: 12px 0;
  }

  .hero-copy h2 {
    font-size: clamp(2.2rem, 16vw, 4.2rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
  }

  .hero-stats,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .totals {
    gap: 8px;
  }

  .metric {
    min-height: 88px;
  }

  .money-breakdown,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .point {
    padding: 12px;
  }

  .point-title {
    align-items: flex-start;
  }

  .point-title h3 {
    font-size: 1.35rem;
  }

  .point-title p {
    font-size: 0.95rem;
  }

  .point-cut {
    align-items: stretch;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .stats div {
    padding: 7px 5px;
  }

  .plan-actions {
    grid-template-columns: 1fr;
  }

  .plan-actions [data-batch-name] {
    grid-column: auto;
  }

  .pdf-item,
  .batch-item header,
  .site-item,
  .cut-items div {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-actions {
    justify-content: stretch;
  }

  .pdf-actions .button,
  .pdf-item .button {
    width: 100%;
  }

  .stock-chart {
    height: 170px;
  }

  .voucher-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 720px;
  }
}

@media (max-width: 460px) {
  .topbar h1 {
    font-size: 1.2rem;
  }

  .dashboard {
    padding: 10px;
  }

  .live-card,
  .chart-card,
  .insight-card,
  .point,
  .plan {
    border-radius: 6px;
  }

  .side-icon {
    flex-basis: 60px;
    width: 60px;
  }

  .side-icon b {
    font-size: 0.58rem;
  }

  .stats dt {
    font-size: 0.62rem;
  }

  .stats dd {
    font-size: 1.08rem;
  }

  .next-code {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* Premium SaaS UI refresh */
:root {
  --radius-lg: 20px;
  --radius-md: 16px;
  --glass: rgba(9, 18, 32, 0.72);
  --glass-strong: rgba(13, 24, 42, 0.92);
  --glow-blue: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 18px 45px rgba(56, 189, 248, 0.12);
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(56, 189, 248, 0.18), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(20, 241, 149, 0.12), transparent 28%),
    linear-gradient(180deg, #06111d 0%, #020711 58%, #010409 100%);
  transition: background 240ms ease, color 240ms ease;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4fa;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(245, 249, 253, 0.9);
  --surface-3: rgba(255, 255, 255, 0.94);
  --ink: #08111f;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.12);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.94);
  background:
    radial-gradient(circle at 15% -5%, rgba(56, 189, 248, 0.22), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(20, 184, 166, 0.18), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fa 100%);
}

.sidebar,
.topbar,
.dashboard,
.hero-stats article,
.live-card,
.metric,
.chart-card,
.insight-card,
.activity-card,
.dashboard-map-card,
.map-tools,
.client-map,
.point,
.site-form,
.point-form,
.batch-item,
.pdf-item,
.cut-item,
.site-item,
.voucher-table,
.access-panel,
.users-list,
.user-card {
  border-radius: var(--radius-lg);
}

.sidebar {
  width: 256px;
  padding: 18px 14px;
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(13, 24, 42, 0.82), rgba(4, 11, 22, 0.68));
}

.side-brand { min-height: 92px; }
.side-brand img { width: 168px; max-height: 78px; }
.side-icon { min-height: 58px; border-radius: 18px; background: transparent; }
.side-icon.active { border-color: rgba(56, 189, 248, 0.95); box-shadow: var(--glow-blue), inset 0 0 22px rgba(56, 189, 248, 0.1); }
.side-icon:hover { transform: translateX(3px); }

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(220px, 1fr) auto;
  margin-left: 292px;
  border-radius: var(--radius-lg);
  background: var(--glass);
}

.brand-lockup p { margin: 2px 0 0; color: var(--muted); font-size: 0.75rem; font-weight: 800; }
.top-search { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(15, 28, 45, 0.56); }
body[data-theme="light"] .top-search { background: rgba(255,255,255,0.72); }
.top-search span { color: var(--muted); font-size: 1.35rem; line-height: 1; }
.top-search input { height: 42px; border: 0; background: transparent; padding: 0; }

.theme-toggle,
.notification-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.theme-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 0 12px; font-weight: 850; }
.theme-toggle span { width: 24px; height: 24px; border-radius: 999px; background: linear-gradient(135deg, #38bdf8, #0f172a); box-shadow: inset -6px -4px 0 rgba(255,255,255,0.45); }
.theme-toggle.is-light span { background: linear-gradient(135deg, #facc15, #fb923c); box-shadow: 0 0 18px rgba(250, 204, 21, 0.35); }
.notification-button { position: relative; width: 44px; display: grid; place-items: center; }
.notification-button i { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 999px; background: #38bdf8; box-shadow: 0 0 14px #38bdf8; }
.nav-bell::before { content: ""; position: absolute; left: 9px; top: 6px; width: 14px; height: 17px; border: 2px solid currentColor; border-radius: 12px 12px 7px 7px; }
.nav-bell::after { content: ""; position: absolute; left: 13px; bottom: 5px; width: 7px; height: 2px; border-radius: 999px; background: currentColor; }
.theme-toggle:hover,
.notification-button:hover,
.button:hover,
.icon-button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(0,0,0,0.18); }

.shell { width: min(1480px, calc(100% - 316px)); margin-left: 292px; }
.dashboard { padding: 18px; border-radius: 24px; background: rgba(8, 18, 32, 0.54); }
body[data-theme="light"] .dashboard { background: rgba(255,255,255,0.72); }
.dashboard-hero { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.42fr); min-height: 220px; }
.dashboard h2 { font-size: clamp(2rem, 4.5vw, 4.1rem); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { min-height: 138px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(16, 31, 51, 0.86), rgba(7, 17, 31, 0.72)); box-shadow: var(--shadow); transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease; }
body[data-theme="light"] .kpi-card { background: rgba(255,255,255,0.84); }
.kpi-card:hover,
.metric:hover,
.chart-card:hover,
.activity-card:hover,
.dashboard-map-card:hover { transform: translateY(-2px); border-color: rgba(56,189,248,0.38); box-shadow: var(--glow-blue); }
.kpi-card span { color: var(--muted); font-size: 0.76rem; font-weight: 850; text-transform: uppercase; }
.kpi-card strong { display: block; margin-top: 16px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 0.95; }
.kpi-card small { display: block; margin-top: 10px; color: var(--muted); font-weight: 750; }

.premium-row { grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr) minmax(280px, 0.75fr); margin-bottom: 16px; }
.activity-card,
.dashboard-map-card { min-height: 330px; padding: 20px; border: 1px solid rgba(210,232,245,0.14); background: rgba(6,15,29,0.66); box-shadow: 0 18px 46px rgba(0,0,0,0.24); }
body[data-theme="light"] .activity-card,
body[data-theme="light"] .dashboard-map-card { background: rgba(255,255,255,0.84); }
.activity-list { display: grid; gap: 10px; margin-top: 18px; }
.activity-list article { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(15, 28, 45, 0.62); }
body[data-theme="light"] .activity-list article { background: rgba(241,245,249,0.86); }
.activity-list span,
.activity-list small { color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.activity-list strong { color: var(--ink); }
.dashboard-map-preview { position: relative; min-height: 210px; margin: 18px 0 14px; overflow: hidden; border: 1px solid rgba(56,189,248,0.2); border-radius: 18px; background: linear-gradient(135deg, rgba(56,189,248,0.13), rgba(20,241,149,0.07)), repeating-linear-gradient(90deg, transparent 0 34px, rgba(148,163,184,0.08) 35px 36px), repeating-linear-gradient(0deg, transparent 0 34px, rgba(148,163,184,0.08) 35px 36px); }
.dashboard-map-preview span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 850; }
.dashboard-map-preview button { position: absolute; left: var(--x); top: var(--y); width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.9); border-radius: 999px; background: #38bdf8; box-shadow: 0 0 0 8px rgba(56,189,248,0.13), 0 0 20px rgba(56,189,248,0.7); cursor: pointer; }
.inventory-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dashboard-insights { display: none; }

.map-panel { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr); }
.map-tools .button:first-of-type::before { content: "Planificar ruta"; font-size: 0; }
#routeCurrentLocation { font-size: 0; }
#routeCurrentLocation::after { content: "Planificar ruta"; font-size: 1rem; }
.map-client-info em { color: #9fffd2; font-style: normal; font-weight: 850; }

input, select, .button, .icon-button { border-radius: 14px; transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease; }
.button { min-height: 46px; }
.button.secondary { background: rgba(9, 18, 32, 0.72); }
body[data-theme="light"] .button.secondary,
body[data-theme="light"] input,
body[data-theme="light"] select { background: rgba(255,255,255,0.85); color: var(--ink); }

@media (max-width: 1260px) {
  .kpi-grid, .inventory-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .premium-row { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; }
  .top-search { width: 100%; }
  .dashboard-hero, .map-panel { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell, .topbar, body.sidebar-collapsed .shell, body.sidebar-collapsed .topbar { margin-left: 10px; width: auto; }
  .kpi-grid, .inventory-row { grid-template-columns: 1fr; }
  .topbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar-actions .current-user, .topbar-actions .status, .topbar-actions .top-site, .topbar-actions .button { grid-column: span 2; }
}


.point-location-control {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) repeat(3, minmax(145px, auto));
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}

.point-location-control .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

@media (max-width: 980px) {
  .point-location-control {
    grid-template-columns: 1fr;
  }
}


.point-location-control input[data-location-url] {
  grid-column: span 2;
}

@media (max-width: 1180px) {
  .point-location-control input[data-location-url] {
    grid-column: auto;
  }
}
