:root {
  color-scheme: dark;
  --navy: #eaf7ff;
  --blue: #00e5ff;
  --sky: rgba(0, 229, 255, 0.1);
  --line: rgba(91, 211, 255, 0.2);
  --muted: #8ea6bd;
  --bg: #050b13;
  --card: rgba(12, 27, 45, 0.86);
  --ok: #22c55e;
  --warn: #f7c948;
  --bad: #ff4d6d;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  --surface: rgba(9, 20, 34, 0.88);
  --table-alt: rgba(18, 42, 66, 0.72);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 229, 255, 0.13), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(105, 255, 183, 0.09), transparent 22%),
    linear-gradient(120deg, rgba(0, 229, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #06111f 0%, var(--bg) 46%, #03070d 100%);
  background-size: auto, auto, 34px 34px, auto;
  color: var(--navy);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body.light-mode {
  color-scheme: light;
  --navy: #10203a;
  --blue: #006d9f;
  --sky: rgba(0, 109, 159, 0.1);
  --line: rgba(29, 78, 116, 0.18);
  --muted: #52667b;
  --bg: #eef5fb;
  --card: rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 44px rgba(18, 44, 74, 0.14);
  --surface: rgba(255, 255, 255, 0.92);
  --table-alt: rgba(224, 237, 248, 0.78);
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 145, 200, 0.12), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(58, 147, 118, 0.09), transparent 22%),
    linear-gradient(120deg, rgba(0, 109, 159, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #f8fbfe 0%, var(--bg) 52%, #e4edf6 100%);
}

body.locked {
  overflow: hidden;
}

body.locked .topbar,
body.locked main {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
  overflow: hidden;
  background: #03070d;
}

.login-screen[hidden] {
  display: none;
}

.login-backdrop,
.login-shade {
  position: absolute;
  inset: 0;
}

.login-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.84;
  transform: scale(1.02);
}

.login-shade {
  background:
    radial-gradient(circle at 68% 32%, rgba(0, 229, 255, 0.08), transparent 34%),
    linear-gradient(90deg, rgba(3, 7, 13, 0.94), rgba(3, 7, 13, 0.62) 48%, rgba(3, 7, 13, 0.34)),
    linear-gradient(0deg, rgba(3, 7, 13, 0.88), transparent 46%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 40px));
  margin-right: min(52vw, 720px);
  padding: 28px;
  border: 1px solid rgba(96, 219, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 53, 80, 0.82), rgba(5, 17, 30, 0.95)),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 38px rgba(0, 229, 255, 0.08),
    0 28px 70px rgba(0, 0, 0, 0.42),
    0 0 38px rgba(0, 229, 255, 0.14);
  backdrop-filter: blur(18px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--navy);
  font-weight: 900;
}

.login-brand img {
  width: 94px;
  height: 44px;
  object-fit: contain;
  padding: 4px;
  border-radius: 6px;
  background: #fff;
}

.login-card h1 {
  margin-bottom: 12px;
  font-size: 42px;
}

.login-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.login-card label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card input {
  margin-top: 7px;
}

.login-card .primary {
  width: 100%;
  margin-top: 18px;
}

.login-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

.logout-button {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(91, 211, 255, 0.16);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.theme-toggle {
  min-height: 30px;
  padding: 0 4px;
  border: 1px solid rgba(91, 211, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
}

.theme-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(0, 141, 194, 0.12));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 17, 31, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

body.light-mode .topbar {
  background: rgba(247, 251, 255, 0.94);
  box-shadow: 0 14px 34px rgba(18, 44, 74, 0.12);
}

.brand-lockup, .client-logos, .account, .hero-actions, .filters, .tabs, .tab-list, .nav-actions, .flow, .actions {
  display: flex;
  align-items: center;
}

.avi-logo,
.client-logos img {
  width: 116px;
  height: 52px;
  display: block;
  object-fit: contain;
}

.avi-logo {
  background: white;
  border-radius: 6px;
  padding: 4px;
}

.divider { width: 1px; height: 34px; background: var(--line); margin: 0 18px; }

.client-logos { gap: 14px; }

.account {
  gap: 8px;
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(20, 128, 74, 0.14);
}

main {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: block;
  padding: 34px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 44px;
  line-height: 1.05;
}

h2 {
  color: var(--navy);
  font-size: 26px;
  margin-bottom: 0;
}

h3 {
  color: var(--navy);
  font-size: 17px;
  margin-bottom: 12px;
}

.lead {
  max-width: 820px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  margin-bottom: 0;
}

.hero-actions { gap: 12px; }

button, .secondary, .primary, .small-link, .small-button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.primary, .secondary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.primary { background: linear-gradient(135deg, #00e5ff, #008dc2); color: #03111f; box-shadow: 0 0 22px rgba(0, 229, 255, 0.18); }
.secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.small-link { color: var(--blue); font-weight: 800; text-decoration: none; background: transparent; }
.small-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(0, 229, 255, 0.22);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.actions {
  display: grid;
  grid-template-columns: 76px 58px 70px;
  gap: 10px;
  justify-content: end;
  align-items: center;
  white-space: nowrap;
  min-width: 234px;
}

.actions-head {
  text-align: right;
  padding-right: 28px;
}

.actions .small-button,
.actions .small-link {
  width: 100%;
  text-align: center;
}

.actions .connect-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.actions .folder-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(91, 211, 255, 0.18);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.overview-tile {
  width: 100%;
  justify-self: center;
}

.card, .wide-card, .table-card, .report-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.command-tile {
  --load: 0;
  position: relative;
  min-height: 450px;
  padding: 16px 18px 164px;
  overflow: hidden;
  border: 1px solid rgba(96, 219, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(27, 58, 88, 0.78), rgba(6, 18, 32, 0.95)),
    radial-gradient(circle at 50% 40%, rgba(0, 229, 255, 0.12), transparent 30%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 42px rgba(0, 229, 255, 0.06),
    0 18px 44px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(0, 229, 255, 0.08);
  backdrop-filter: blur(14px);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.command-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(105, 215, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 215, 255, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.84), transparent 78%);
}

.command-tile::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 155px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(123, 224, 255, 0.32), transparent);
}

.command-tile:hover {
  border-color: rgba(143, 246, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 38px rgba(0, 229, 255, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.28),
    0 0 32px rgba(0, 229, 255, 0.16);
  transform: translateY(-1px);
}

.command-tile > * {
  position: relative;
  z-index: 1;
}

.command-tile header {
  min-height: 40px;
}

.command-tile h3 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 18px;
}

.command-tile p {
  margin: 0;
  color: #7fe8ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-radar-layout {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 118px);
  gap: 14px 16px;
  align-items: stretch;
  margin-top: 12px;
}

.tile-quadrant {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 118px;
  padding: 16px 18px;
  border: 1px solid rgba(123, 224, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 17, 30, 0.34);
}

.quadrant-total { grid-column: 1; grid-row: 1; padding-right: 72px; }
.quadrant-remote { grid-column: 2; grid-row: 1; padding-left: 72px; }
.quadrant-tickets { grid-column: 1; grid-row: 2; padding-right: 72px; }
.quadrant-approvals { grid-column: 2; grid-row: 2; padding-left: 72px; }

.tile-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -45%);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 136px;
  min-height: 136px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(6, 18, 32, 0.96) 0 52%, rgba(6, 18, 32, 0.56) 53% 68%, transparent 69%);
  pointer-events: none;
}

.tile-center p {
  color: #b4cbe0;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.tile-value span,
.tile-breakdown span {
  display: block;
  color: #b4cbe0;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tile-value strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
}

.tile-ring {
  --load-angle: 0deg;
  --remaining-load: 100%;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background:
    conic-gradient(
      from 180deg,
      #7fe8ff 0 20%,
      #69ffb7 34%,
      #f7c948 58%,
      #ff9f43 76%,
      #ff4d6d 100%
    );
  border: 1px solid rgba(142, 236, 255, 0.22);
  box-shadow:
    inset 0 0 10px rgba(0, 229, 255, 0.12),
    0 0 18px rgba(0, 229, 255, 0.12);
}

.tile-ring::after {
  content: "";
  grid-area: 1 / 1;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: conic-gradient(from calc(180deg + var(--load-angle)), #07121f 0 var(--remaining-load), transparent 0 100%);
}

.tile-ring::before {
  content: "";
  grid-area: 1 / 1;
  z-index: 1;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(180deg, #10243a, #07121f);
  border: 1px solid rgba(127, 232, 255, 0.18);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.34);
}

.tile-ring span,
.tile-ring small {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  color: #ffffff;
  text-align: center;
}

.tile-ring span {
  margin-top: -10px;
  font-size: 21px;
  font-weight: 1000;
}

.tile-ring small {
  margin-top: 20px;
  color: #d6fbff;
  font-size: 9px;
  font-weight: 900;
}

.tile-breakdown {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
}

.tile-breakdown div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 20px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(92, 211, 255, 0.16), rgba(6, 18, 32, 0.76));
}

.tile-breakdown strong {
  color: #ffffff;
  font-size: 12px;
}

.tile-trend {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 14px;
  height: 132px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(127, 232, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(12, 31, 51, 0.86), rgba(3, 9, 16, 0.58));
  background-size: 56px 100%, auto;
  border: 1px solid rgba(127, 232, 255, 0.08);
}

.ticket-chart-head {
  position: absolute;
  inset: 8px 12px auto 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #d6fbff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-chart-head strong {
  margin-right: auto;
  color: #ffffff;
  font-size: 11px;
}

.ticket-chart-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(214, 251, 255, 0.78);
}

.ticket-chart-head i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #7fe8ff;
}

.ticket-chart-head i.historical {
  background: #b491ff;
  opacity: 0.76;
}

.tile-trend svg {
  position: absolute;
  inset: 18px 0 0;
  width: 100%;
  height: calc(100% - 18px);
}

.ticket-chart-grid {
  stroke: rgba(127, 232, 255, 0.12);
  stroke-width: 1;
}

.ticket-chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticket-chart-line.current {
  stroke: #7fe8ff;
  filter: drop-shadow(0 0 5px rgba(127, 232, 255, 0.55));
}

.ticket-chart-line.historical {
  stroke: #b491ff;
  stroke-width: 3;
  stroke-dasharray: 8 7;
  opacity: 0.75;
}

.ticket-chart-point {
  stroke: #07121f;
  stroke-width: 2;
}

.ticket-chart-point.current {
  fill: #7fe8ff;
}

.ticket-chart-point.historical {
  fill: #b491ff;
  opacity: 0.78;
}

.ticket-chart-axis,
.ticket-chart-months text {
  fill: rgba(214, 251, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.tile-trend em {
  display: none;
}

.quadrant-approvals .tile-breakdown div,
.command-tile[data-tile="approvals"] {
  border-color: rgba(247, 201, 72, 0.34);
}

.quadrant-approvals .tile-breakdown div,
.command-tile[data-tile="approvals"] .tile-breakdown div {
  background: linear-gradient(90deg, rgba(247, 201, 72, 0.18), rgba(6, 18, 32, 0.76));
}

.tabs {
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  background: rgba(6, 17, 31, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  justify-content: space-between;
  overflow-x: auto;
}

.tab-list {
  gap: 6px;
}

.nav-actions {
  gap: 10px;
  margin-left: auto;
  padding-left: 16px;
  flex: 0 0 auto;
}

.sticky-tabs {
  position: sticky;
  top: 88px;
  z-index: 9;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.tabs button {
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.tabs button.active {
  background: var(--sky);
  color: var(--navy);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.18), 0 0 22px rgba(0, 229, 255, 0.08);
}

.panel { display: none; }
.panel.active { display: block; }

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

.section-head.compact { margin: 0 0 8px; }

.dashboard-layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.health-banner {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 15px 18px;
  border: 1px solid rgba(105, 255, 183, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(105, 255, 183, 0.14), rgba(6, 18, 32, 0.72)),
    var(--card);
  box-shadow: var(--shadow);
}

.health-banner span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.health-banner strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-size: 20px;
}

.health-banner p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.health-body {
  display: grid;
  gap: 9px;
}

.health-bar {
  position: relative;
  height: 16px;
  overflow: visible;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4d6d 0%, #ff9f43 38%, #f7c948 62%, #69ffb7 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 14px rgba(255, 77, 109, 0.12);
}

.health-marker {
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #081522;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.24);
  transform: translate(-50%, -50%);
}

.health-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.health-scale span:nth-child(2) {
  text-align: center;
}

.health-scale span:nth-child(3) {
  text-align: right;
}

.health-banner.warning {
  border-color: rgba(247, 201, 72, 0.36);
  background:
    linear-gradient(90deg, rgba(247, 201, 72, 0.16), rgba(6, 18, 32, 0.72)),
    var(--card);
}

.health-banner.critical {
  border-color: rgba(255, 77, 109, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 77, 109, 0.18), rgba(6, 18, 32, 0.74)),
    var(--card);
}

.wide-card, .card, .table-card, .report-grid article {
  padding: 18px;
}

.flow {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.flow span {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--sky);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.card strong {
  display: block;
  color: var(--navy);
  font-size: 38px;
  margin-bottom: 8px;
}

.card p, .wide-card p, .report-grid p, .note {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.filters { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  color: var(--navy);
  background: rgba(5, 11, 19, 0.62);
}

.filters input { width: 290px; }
.filters select { width: 140px; }
.filters #systemFilter { width: 190px; }

.table-wrap {
  max-height: 590px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1b2d;
}

table {
  width: max(100%, 1320px);
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

th:nth-child(1), td:nth-child(1) { width: 74px; }
th:nth-child(2), td:nth-child(2) { width: 82px; }
th:nth-child(3), td:nth-child(3) { width: 360px; }
th:nth-child(4), td:nth-child(4) { width: 108px; }
th:nth-child(5), td:nth-child(5) { width: 178px; }
th:nth-child(6), td:nth-child(6) { width: 210px; }
th:nth-child(7), td:nth-child(7) { width: 150px; }
th:nth-child(8), td:nth-child(8) { width: 226px; }

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(0, 229, 255, 0.12);
  color: var(--navy);
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th:last-child,
td:last-child {
  padding-right: 34px;
}

tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--table-alt); }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.low, .pill.active, .pill.ready { background: rgba(34, 197, 94, 0.15); color: var(--ok); }
.pill.medium, .pill.pending { background: rgba(247, 201, 72, 0.15); color: var(--warn); }
.pill.high, .pill.special { background: rgba(255, 77, 109, 0.15); color: var(--bad); }
.pill.neutral { background: var(--sky); color: var(--navy); }

.remote-cell .pill {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.risk-cell {
  min-width: 0;
}

.actions {
  display: grid;
  grid-template-columns: 76px 58px 72px;
  align-items: center;
  gap: 10px;
}

.actions .small-button,
.actions .small-link {
  justify-content: center;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  padding: 11px 0 11px 28px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.checklist li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--blue);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

textarea {
  min-height: 116px;
  resize: vertical;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.status-card {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-card strong {
  display: block;
  color: var(--navy);
  font-size: 28px;
}

.status-card span { color: var(--muted); font-weight: 800; }

.validation-card {
  margin-bottom: 14px;
}

.validation-count {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.validation-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px;
  gap: 10px;
  margin-bottom: 12px;
}

.validation-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.validation-item {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 160px 230px 120px minmax(180px, 1fr) 72px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #0c1b2d;
  border: 1px solid rgba(91, 211, 255, 0.18);
  border-radius: 8px;
}

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

.validation-site span,
.validation-site small {
  color: var(--muted);
  font-size: 12px;
}

.validation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.validation-item label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.validation-item input,
.validation-item select {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.validation-item .small-button {
  min-height: 34px;
}

.remote-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.remote-actions a, .remote-actions button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--sky);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.google-calendar-panel {
  display: grid;
  gap: 14px;
}

.calendar-badge,
.calendar-open-link[aria-disabled="true"] {
  opacity: 0.68;
  pointer-events: none;
}

.calendar-frame-card {
  min-height: 650px;
}

.calendar-frame-card header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.calendar-frame-card header p {
  max-width: 720px;
}

.calendar-embed-shell {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(91, 211, 255, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.1), transparent 38%),
    linear-gradient(120deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    #07111e;
  background-size: 36px 36px, auto;
  box-shadow:
    inset 0 0 38px rgba(0, 229, 255, 0.06),
    0 18px 44px rgba(0, 0, 0, 0.28);
}

.calendar-embed-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 9, 16, 0.16), transparent 18%),
    linear-gradient(90deg, rgba(0, 229, 255, 0.08), transparent 14%, transparent 86%, rgba(0, 229, 255, 0.08));
  mix-blend-mode: screen;
}

.calendar-embed-shell iframe {
  width: 100%;
  height: 560px;
  border: 0;
  background: #07111e;
  filter: invert(0.92) hue-rotate(178deg) saturate(0.82) brightness(0.82) contrast(1.08);
}

.calendar-embed-shell iframe[hidden] {
  display: none;
}

.calendar-config-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.calendar-config-message[hidden] {
  display: none;
}

.calendar-config-message strong {
  color: var(--navy);
  font-size: 22px;
}

.calendar-config-message span {
  color: var(--muted);
}

.portal-calendar {
  min-height: 560px;
  padding: 16px;
  border: 1px solid rgba(91, 211, 255, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.1), transparent 38%),
    linear-gradient(120deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    #07111e;
  background-size: auto, 36px 36px;
  box-shadow:
    inset 0 0 38px rgba(0, 229, 255, 0.06),
    0 18px 44px rgba(0, 0, 0, 0.28);
}

.portal-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: var(--navy);
}

.portal-calendar-head strong {
  font-size: 24px;
}

.portal-calendar-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  gap: 6px;
  margin-bottom: 6px;
}

.calendar-weekdays span {
  padding: 8px 10px;
  border: 1px solid rgba(91, 211, 255, 0.12);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-month-grid {
  gap: 6px;
}

.calendar-day {
  min-height: 104px;
  padding: 8px;
  border: 1px solid rgba(91, 211, 255, 0.14);
  border-radius: 6px;
  background: rgba(10, 24, 42, 0.66);
  overflow: hidden;
}

.calendar-day.outside {
  opacity: 0.46;
}

.calendar-day.today {
  border-color: rgba(123, 224, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(123, 224, 255, 0.18);
}

.calendar-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--navy);
  font-weight: 900;
}

.calendar-day.today .calendar-date {
  background: var(--blue);
  color: #06111f;
}

.calendar-events {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.calendar-event {
  display: grid;
  gap: 2px;
  padding: 6px 7px;
  border-left: 3px solid var(--blue);
  border-radius: 5px;
  background: rgba(91, 211, 255, 0.1);
}

.calendar-event strong,
.calendar-event span,
.calendar-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event strong {
  color: var(--navy);
  font-size: 11px;
}

.calendar-event span,
.calendar-event small,
.calendar-more,
.calendar-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.calendar-more {
  padding: 2px 7px;
}

.calendar-empty {
  margin: 14px 0 0;
  font-size: 13px;
}

body.light-mode .primary {
  background: linear-gradient(135deg, #5fc7ed, #0f78ad);
  color: #06111f;
}

body.light-mode .secondary,
body.light-mode .logout-button,
body.light-mode .theme-toggle {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(29, 78, 116, 0.18);
  color: var(--navy);
}

body.light-mode .tabs,
body.light-mode .table-wrap,
body.light-mode .validation-item,
body.light-mode .detail-group,
body.light-mode .mini-table-wrap,
body.light-mode .calendar-embed-shell,
body.light-mode .portal-calendar {
  background: rgba(255, 255, 255, 0.72);
}

body.light-mode .command-tile,
body.light-mode .card,
body.light-mode .wide-card,
body.light-mode .table-card,
body.light-mode .report-grid article,
body.light-mode .status-card,
body.light-mode .calendar-card,
body.light-mode dialog,
body.light-mode .info-group {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 245, 251, 0.96)),
    var(--surface);
  border-color: rgba(29, 78, 116, 0.2);
  box-shadow: 0 16px 36px rgba(18, 44, 74, 0.12);
}

body.light-mode .command-tile h3,
body.light-mode .tile-value strong,
body.light-mode .tile-breakdown strong,
body.light-mode .card strong,
body.light-mode .summary-grid strong,
body.light-mode .info-row strong,
body.light-mode .detail-group h3,
body.light-mode h1,
body.light-mode h2,
body.light-mode h3 {
  color: var(--navy);
}

body.light-mode .command-tile p,
body.light-mode .eyebrow,
body.light-mode .detail-group h3,
body.light-mode .validation-count {
  color: #007eac;
}

body.light-mode .tile-quadrant {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(29, 78, 116, 0.13);
}

body.light-mode .tile-center {
  border-color: rgba(29, 78, 116, 0.16);
}

body.light-mode .tile-ring {
  background:
    radial-gradient(circle at center, #f4fbff 0 39%, transparent 40%),
    conic-gradient(#137faa calc(var(--load) * 1%), rgba(158, 184, 205, 0.42) 0);
  border-color: rgba(19, 127, 170, 0.24);
}

body.light-mode .tile-ring span,
body.light-mode .tile-ring small {
  color: #0e2035;
}

body.light-mode .tile-breakdown div,
body.light-mode .flow span,
body.light-mode .summary-grid div {
  background: linear-gradient(90deg, rgba(0, 109, 159, 0.12), rgba(255, 255, 255, 0.7));
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
}

body.light-mode th,
body.light-mode .mini-table th {
  background: rgba(0, 109, 159, 0.12);
  color: var(--navy);
}

body.light-mode tbody tr:nth-child(even),
body.light-mode .mini-table tbody tr:nth-child(even) {
  background: rgba(224, 237, 248, 0.78);
}

body.light-mode .calendar-embed-shell::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 18%);
  mix-blend-mode: normal;
}

body.light-mode .calendar-embed-shell iframe {
  filter: none;
}

body.light-mode .health-banner strong {
  color: #0e2035;
}

body.light-mode .health-banner p,
body.light-mode .health-banner span {
  color: #40546b;
}

body.light-mode .health-marker {
  background: #ffffff;
  border-color: #0e2035;
  box-shadow: 0 0 12px rgba(14, 32, 53, 0.18);
}

body.light-mode .health-banner.critical {
  background:
    linear-gradient(90deg, rgba(255, 77, 109, 0.16), rgba(255, 255, 255, 0.84)),
    var(--surface);
}

body.light-mode .health-banner.warning {
  background:
    linear-gradient(90deg, rgba(247, 201, 72, 0.18), rgba(255, 255, 255, 0.84)),
    var(--surface);
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy);
}

dialog {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  background: #091422;
  color: var(--navy);
}

dialog::backdrop { background: rgba(11, 37, 69, 0.38); }

.site-dialog {
  width: min(1040px, calc(100vw - 32px));
  height: min(86vh, 860px);
  max-height: min(86vh, 860px);
  overflow: hidden;
  border: 1px solid var(--line);
}

#siteInfoContent {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.site-modal-head {
  flex: 0 0 auto;
  padding-right: 44px;
  padding-bottom: 16px;
  margin: -2px 0 14px;
  background: #091422;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.22);
}

.site-modal-head h2 {
  margin-bottom: 8px;
}

.site-modal-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.folder-actions .folder-link {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.24);
}

.site-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-group {
  padding: 14px;
  background: rgba(12, 27, 45, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-group h3 {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 13px;
  text-transform: uppercase;
}

.info-row {
  display: grid;
  grid-template-columns: minmax(132px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(91, 211, 255, 0.12);
}

.info-row:first-of-type {
  border-top: 0;
}

.info-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-row strong {
  color: var(--navy);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.info-row.is-pending strong {
  color: var(--muted);
  font-style: italic;
}

.detail-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.detail-group {
  padding: 14px;
  background: #0c1b2d;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 13px;
  text-transform: uppercase;
}

.detail-group h3 span {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.summary-grid div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 16px;
}

.mini-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(91, 211, 255, 0.14);
  border-radius: 8px;
  background: #0c1b2d;
}

.mini-table {
  min-width: 920px;
  font-size: 12px;
}

.mini-table th {
  z-index: 2;
  background: #20374b;
  color: #f3fbff;
  box-shadow: 0 1px 0 rgba(91, 211, 255, 0.22);
}

.mini-table tbody tr:nth-child(even) {
  background: #12243a;
}

.mini-table th,
.mini-table td {
  padding: 8px 9px;
}

@media (max-width: 920px) {
  .topbar { height: auto; padding: 14px 18px; align-items: flex-start; }
  .brand-lockup { align-items: flex-start; flex-direction: column; gap: 10px; }
  .divider { display: none; }
  .login-card { margin-right: 0; }
  main { width: min(100vw - 28px, 760px); padding-top: 18px; }
  .hero, .section-head, .split { grid-template-columns: 1fr; display: grid; }
  .hero-actions, .filters { justify-content: stretch; }
  .tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .tab-list {
    width: 100%;
    overflow-x: auto;
  }
  .nav-actions {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }
  .nav-actions .primary,
  .nav-actions .secondary,
  .filters input,
  .filters select { width: 100%; }
  .sticky-tabs {
    top: 12px;
  }
  h1 { font-size: 34px; }
  .metric-grid, .overview-radar-layout, .dashboard-layout, .status-board, .remote-actions, .report-grid, .summary-grid { grid-template-columns: 1fr; }
  .command-tile {
    padding-bottom: 154px;
  }
  .overview-radar-layout { grid-template-rows: auto; }
  .quadrant-total, .quadrant-remote, .quadrant-tickets, .quadrant-approvals, .tile-center {
    grid-column: auto;
    grid-row: auto;
    padding-left: 15px;
    padding-right: 15px;
  }
  .tile-center {
    order: -1;
    width: 100%;
    min-height: 164px;
    border: 1px solid rgba(123, 224, 255, 0.16);
    border-radius: 8px;
  }
  .tile-ring {
    width: 104px;
    height: 104px;
  }
  .ticket-chart-head {
    gap: 8px;
    flex-wrap: wrap;
  }
  .validation-toolbar, .validation-item { grid-template-columns: 1fr; }
  .info-grid, .info-row { grid-template-columns: 1fr; }
  .portal-calendar-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .calendar-weekdays {
    display: none;
  }
  .calendar-month-grid {
    grid-template-columns: 1fr;
  }
  .calendar-day {
    min-height: 74px;
  }
  .calendar-day.outside:empty {
    display: none;
  }
}
