:root {
  --bg: #050b12;
  --bg-soft: #07111b;
  --surface: #0a1621;
  --surface-2: #0d1b27;
  --surface-3: #112231;
  --border: rgba(157, 185, 207, 0.12);
  --border-strong: rgba(157, 185, 207, 0.2);
  --text: #f2f7fb;
  --text-soft: #a9b9c6;
  --muted: #718695;
  --blue: #0877bd;
  --blue-light: #1d9bd1;
  --cyan: #02bed4;
  --cyan-soft: rgba(2, 190, 212, 0.12);
  --green: #30d19b;
  --green-soft: rgba(48, 209, 155, 0.12);
  --amber: #f4b95f;
  --amber-soft: rgba(244, 185, 95, 0.13);
  --red: #ff6d75;
  --red-soft: rgba(255, 109, 117, 0.12);
  --violet: #9a8cff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --sidebar-width: 248px;
  --topbar-height: 86px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 119, 184, 0.08), transparent 30%),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(4px);
}

.ambient-one {
  width: 420px;
  height: 420px;
  top: -260px;
  left: -180px;
  background: rgba(0, 120, 190, 0.1);
}

.ambient-two {
  width: 360px;
  height: 360px;
  right: -220px;
  bottom: -220px;
  background: rgba(0, 190, 212, 0.06);
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  background: #050b12;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 48px clamp(48px, 6vw, 96px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(120deg, rgba(5, 13, 22, 0.96), rgba(5, 20, 31, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(114, 187, 222, 0.035) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(114, 187, 222, 0.035) 80px);
  border-right: 1px solid rgba(127, 173, 199, 0.08);
}

.login-visual::before {
  content: "";
  position: absolute;
  width: 680px;
  height: 680px;
  left: -150px;
  top: 18%;
  background: radial-gradient(circle, rgba(0, 126, 185, 0.16), rgba(0, 190, 212, 0.02) 45%, transparent 68%);
  border-radius: 50%;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 16% 24%, rgba(2, 190, 212, 0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 34%, rgba(8, 119, 189, 0.4) 0 1px, transparent 1.5px),
    radial-gradient(circle at 32% 78%, rgba(2, 190, 212, 0.35) 0 1px, transparent 1.5px);
  background-size: 180px 180px, 220px 220px, 260px 260px;
  opacity: 0.6;
}

.login-brand,
.login-message,
.login-insight-card,
.login-footer {
  position: relative;
  z-index: 1;
}

.login-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(330px, 68%);
  height: 92px;
  left: -24px;
  top: 50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2, 190, 212, 0.16), rgba(8, 119, 189, 0.07) 48%, transparent 72%);
  filter: blur(8px);
  transform: translateY(-50%);
  pointer-events: none;
}

.login-brand img {
  width: min(275px, 55%);
  height: auto;
  display: block;
  filter: brightness(1.42) saturate(1.22) contrast(1.06) drop-shadow(0 0 10px rgba(2, 190, 212, 0.2));
}

.login-message {
  margin: auto 0;
  max-width: 670px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 32px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.login-message h1 {
  margin: 0;
  font-size: clamp(44px, 4.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 680;
}

.login-message h1 em {
  color: transparent;
  background: linear-gradient(90deg, #159bd0, #08d1d8);
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

.login-message > p {
  max-width: 580px;
  margin: 26px 0 0;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.72;
}

.login-insight-card {
  width: min(630px, 100%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(59, 158, 199, 0.17);
  border-radius: 15px;
  background: linear-gradient(110deg, rgba(13, 35, 51, 0.8), rgba(9, 25, 38, 0.65));
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.pulse-orbit {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(2, 190, 212, 0.35);
  border-radius: 50%;
  background: rgba(2, 190, 212, 0.08);
}

.pulse-orbit::before,
.pulse-orbit span {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(2, 190, 212, 0.8);
}

.pulse-orbit::before {
  position: absolute;
  animation: login-pulse 2.3s infinite;
}

@keyframes login-pulse {
  0% { box-shadow: 0 0 0 0 rgba(2, 190, 212, 0.35); }
  70% { box-shadow: 0 0 0 15px rgba(2, 190, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(2, 190, 212, 0); }
}

.login-insight-card small,
.login-insight-card strong,
.login-insight-card p {
  display: block;
}

.login-insight-card small {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-insight-card strong {
  margin: 2px 0;
  font-size: 14px;
}

.login-insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.live-badge i,
.ai-dot,
.system-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.login-footer {
  margin-top: 32px;
  color: #4f6575;
  font-size: 12px;
  letter-spacing: 0.025em;
}

.login-footer span {
  margin: 0 7px;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px clamp(36px, 5vw, 84px);
  background: linear-gradient(135deg, #07111a, #071019 75%);
}

.login-panel-inner {
  width: min(440px, 100%);
}

.login-mobile-brand {
  display: none;
  position: relative;
  isolation: isolate;
}

.login-mobile-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 270px;
  height: 84px;
  left: -20px;
  top: 50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2, 190, 212, 0.15), rgba(8, 119, 189, 0.06) 50%, transparent 74%);
  filter: blur(7px);
  transform: translateY(-50%);
  pointer-events: none;
}

.login-mobile-brand img {
  filter: brightness(1.48) saturate(1.24) contrast(1.07) drop-shadow(0 0 9px rgba(2, 190, 212, 0.2));
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 7px 11px;
  color: #77c8dc;
  border: 1px solid rgba(2, 190, 212, 0.14);
  border-radius: 999px;
  background: rgba(2, 190, 212, 0.05);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.secure-label svg {
  width: 14px;
  height: 14px;
}

.login-panel h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.035em;
}

.login-subtitle {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.quick-access-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.quick-access-label span {
  color: #c5d2dc;
  font-size: 12px;
  font-weight: 600;
}

.quick-access-label small {
  color: #526b7b;
  font-size: 12px;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.quick-user {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.014);
  cursor: pointer;
  text-align: left;
  transition: 150ms ease;
}

.quick-user:hover,
.quick-user.selected {
  color: var(--text);
  border-color: rgba(2, 190, 212, 0.36);
  background: rgba(2, 190, 212, 0.065);
  transform: translateY(-1px);
}

.quick-user > span:nth-child(2) {
  min-width: 0;
}

.quick-user strong,
.quick-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-user strong {
  font-size: 12px;
  font-weight: 650;
}

.quick-user small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.quick-user > svg {
  display: block;
  width: 12px;
  height: 12px;
  color: var(--cyan);
}

.quick-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #dffaff;
  border: 1px solid rgba(2, 190, 212, 0.24);
  border-radius: 7px;
  background: linear-gradient(135deg, #075483, #087a91);
}

.quick-avatar svg {
  width: 14px;
  height: 14px;
}

.login-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
  color: #526979;
  font-size: 11px;
}

.login-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  position: relative;
  padding: 0 10px;
  background: #07111a;
}

.field-label,
.password-label-row {
  color: #c5d2dc;
  font-size: 13px;
  font-weight: 600;
}

.password-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.text-button,
.login-support button {
  padding: 0;
  color: var(--cyan);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.input-wrap > svg {
  position: absolute;
  left: 15px;
  width: 17px;
  height: 17px;
  color: #5c7384;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 49px;
  padding: 0 48px 0 44px;
  color: var(--text);
  border: 1px solid rgba(140, 173, 196, 0.16);
  border-radius: 10px;
  background: rgba(13, 28, 41, 0.7);
  outline: none;
  transition: 160ms ease;
}

.input-wrap input::placeholder {
  color: #526878;
}

.input-wrap input:focus {
  border-color: rgba(2, 190, 212, 0.62);
  box-shadow: 0 0 0 3px rgba(2, 190, 212, 0.08);
}

.input-wrap:focus-within > svg {
  color: var(--cyan);
}

.input-wrap.has-error input {
  border-color: rgba(255, 109, 117, 0.7);
}

.password-toggle {
  position: absolute;
  right: 9px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #647a8a;
  background: transparent;
  cursor: pointer;
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.field-error {
  min-height: 15px;
  margin-top: 4px;
  color: var(--red);
  font-size: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 5px 0 23px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.check-row input {
  position: absolute;
  opacity: 0;
}

.checkmark {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-2);
}

.checkmark svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.check-row input:checked + .checkmark {
  color: #031016;
  border-color: var(--cyan);
  background: var(--cyan);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  transition: 150ms ease;
}

.primary-button {
  color: #031018;
  border: 1px solid var(--cyan);
  background: linear-gradient(135deg, #11c1d3, #12a9d5);
  box-shadow: 0 8px 24px rgba(2, 190, 212, 0.14);
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.secondary-button {
  color: #bfe9f1;
  border: 1px solid rgba(2, 190, 212, 0.22);
  background: rgba(2, 190, 212, 0.08);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: rgba(2, 190, 212, 0.4);
  color: var(--text);
  background: rgba(2, 190, 212, 0.1);
}

.ghost-button {
  color: var(--text-soft);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.danger-button {
  color: #ffd9dc;
  border: 1px solid rgba(255, 109, 117, 0.22);
  background: var(--red-soft);
}

.primary-button svg,
.secondary-button svg,
.ghost-button svg,
.danger-button svg {
  width: 16px;
  height: 16px;
}

.login-button {
  width: 100%;
  height: 50px;
  justify-content: space-between;
  padding: 0 19px;
  border-radius: 10px;
  font-size: 14px;
}

.login-button.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.login-button.is-loading svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-support {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 31px;
  padding-top: 24px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.login-support svg {
  width: 18px;
  height: 18px;
  color: #597384;
}

.login-support span,
.login-support button {
  display: block;
}

.login-support span {
  font-size: 12px;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #07131e, #071019);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.12);
}

.sidebar-brand {
  position: relative;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
  overflow: hidden;
}

.sidebar-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 222px;
  height: 66px;
  left: 4px;
  top: 50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2, 190, 212, 0.14), rgba(8, 119, 189, 0.06) 52%, transparent 74%);
  filter: blur(7px);
  transform: translateY(-50%);
  pointer-events: none;
}

.sidebar-brand img {
  position: relative;
  width: 188px;
  height: auto;
  filter: brightness(1.5) saturate(1.25) contrast(1.08) drop-shadow(0 0 8px rgba(2, 190, 212, 0.22));
}

.sidebar-close {
  display: none !important;
  margin-left: auto;
}

.workspace-selector {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 16px 13px 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.workspace-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #dffaff;
  border: 1px solid rgba(2, 190, 212, 0.25);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(8, 119, 189, 0.4), rgba(2, 190, 212, 0.23));
  font-size: 13px;
  font-weight: 700;
}

.workspace-selector small,
.workspace-selector strong {
  display: block;
}

.workspace-selector small {
  color: var(--muted);
  font-size: 12px;
}

.workspace-selector strong {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
}

.workspace-selector > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.main-nav {
  flex: 1;
  padding: 4px 11px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-section-label {
  display: block;
  margin: 18px 11px 7px;
  color: #526778;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  width: 100%;
  height: 39px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 0 11px;
  color: #8195a5;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: 140ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: -11px;
  width: 2px;
  height: 20px;
  border-radius: 0 2px 2px 0;
  background: transparent;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.nav-item span {
  flex: 1;
}

.nav-item:hover {
  color: #c1d2dc;
  background: rgba(255, 255, 255, 0.025);
}

.nav-item.active {
  color: #dffbff;
  background: linear-gradient(90deg, rgba(2, 190, 212, 0.12), rgba(2, 190, 212, 0.045));
}

.nav-item.active::before {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.nav-item.active svg {
  color: var(--cyan);
}

.nav-count {
  min-width: 20px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #ffc5c9;
  border-radius: 6px;
  background: rgba(255, 109, 117, 0.16);
  font-size: 12px;
}

.ai-dot {
  color: var(--cyan);
}

.sidebar-bottom {
  position: relative;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.system-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(48, 209, 155, 0.1);
  border-radius: 9px;
  background: rgba(48, 209, 155, 0.035);
}

.status-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--green);
  border-radius: 6px;
  background: var(--green-soft);
}

.system-status small,
.system-status strong {
  display: block;
}

.system-status small {
  color: #577080;
  font-size: 11px;
}

.system-status strong {
  color: #a5c6bd;
  font-size: 12px;
  font-weight: 600;
}

.status-time {
  color: #536b77;
  font-size: 11px;
}

.user-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.user-summary:hover {
  background: rgba(255, 255, 255, 0.025);
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #d7f7fc;
  border: 1px solid rgba(2, 190, 212, 0.22);
  border-radius: 9px;
  background: linear-gradient(135deg, #075483, #087a91);
  font-size: 12px;
  font-weight: 700;
}

.user-text strong,
.user-text small {
  display: block;
}

.user-text strong {
  font-size: 12px;
  font-weight: 600;
}

.user-text small {
  color: var(--muted);
  font-size: 11px;
}

.user-summary > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 11, 18, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 14px;
}

.breadcrumb {
  margin-bottom: 3px;
  color: #526979;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.breadcrumb span {
  margin: 0 4px;
}

.breadcrumb b {
  color: #7890a1;
  font-weight: 500;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #7d93a4;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  line-height: 0;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.mobile-menu {
  display: none;
}

.search-button,
.period-button {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #728898;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  font-size: 12px;
}

.search-button {
  width: 220px;
}

.search-button:hover,
.period-button:hover {
  color: var(--text-soft);
  border-color: var(--border-strong);
}

.search-button svg,
.period-button svg {
  width: 15px;
  height: 15px;
}

.search-button span {
  flex: 1;
  text-align: left;
}

kbd {
  padding: 2px 5px;
  color: #546a7a;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font: inherit;
  font-size: 11px;
}

.period-button > svg:last-child {
  width: 12px;
  height: 12px;
  margin-left: 3px;
}

.notification-button {
  position: relative;
}

.notification-button i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--bg);
  border-radius: 50%;
  background: var(--red);
}

.page-content {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 24px 30px 48px;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 21px;
}

.page-intro h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.kpi-card,
.panel,
.insight-banner,
.territory-stat,
.report-card,
.integration-card,
.quality-metric,
.alert-card,
.unit-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(13, 27, 39, 0.94), rgba(8, 19, 29, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.kpi-card {
  position: relative;
  min-height: 126px;
  padding: 17px;
  border-radius: 13px;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  top: -36px;
  right: -28px;
  border-radius: 50%;
  background: var(--kpi-color, rgba(2, 190, 212, 0.06));
  filter: blur(2px);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-label {
  color: #879aa9;
  font-size: 12px;
  font-weight: 560;
}

.kpi-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--kpi-bg, var(--cyan-soft));
  color: var(--kpi-accent, var(--cyan));
}

.kpi-icon svg {
  width: 15px;
  height: 15px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 12px;
}

.kpi-value {
  font-size: 25px;
  line-height: 1;
  font-weight: 660;
  letter-spacing: -0.045em;
}

.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}

.kpi-change.negative {
  color: var(--red);
}

.kpi-change.neutral {
  color: var(--amber);
}

.kpi-change svg {
  width: 11px;
  height: 11px;
}

.kpi-foot {
  margin-top: 9px;
  color: #536a79;
  font-size: 12px;
}

.dashboard-main-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.8fr);
  align-items: stretch;
  margin-bottom: 14px;
}

.trend-panel {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
}

.dashboard-main-grid > .panel:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.panel {
  border-radius: 14px;
  overflow: hidden;
}

.panel-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title h3,
.panel-title p {
  margin: 0;
}

.panel-title h3 {
  font-size: 13px;
  font-weight: 620;
}

.panel-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-tab,
.filter-chip {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
}

.mini-tab.active,
.filter-chip.active {
  color: #bcebf2;
  border-color: rgba(2, 190, 212, 0.2);
  background: rgba(2, 190, 212, 0.08);
}

.panel-body {
  padding: 16px;
}

.trend-chart-wrap {
  height: 220px;
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: 1fr 22px;
  padding: 12px 18px 0 16px;
}

.trend-panel .trend-chart-wrap {
  height: auto;
  min-height: 220px;
}

.chart-axis-y {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 8px;
  color: #4b6474;
  font-size: 11px;
}

.chart-axis-x {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  color: #4b6474;
  font-size: 11px;
}

.chart-svg-wrap {
  position: relative;
  min-width: 0;
  overflow: visible;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(137, 169, 191, 0.08);
  stroke-width: 1;
}

.chart-line-main {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 6px rgba(2, 190, 212, 0.3));
}

.chart-line-secondary {
  fill: none;
  stroke: #3a72b7;
  stroke-width: 1.7;
  stroke-dasharray: 4 5;
  opacity: 0.65;
}

.chart-area {
  fill: url(#areaGradient);
  stroke: none;
}

.chart-point {
  fill: #08131d;
  stroke: var(--cyan);
  stroke-width: 1.7;
}

.chart-tooltip-label {
  color: var(--muted);
  font-size: 11px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 16px 14px 48px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 16px;
  height: 2px;
  background: var(--cyan);
}

.chart-legend .secondary {
  background: repeating-linear-gradient(90deg, #3a72b7 0 4px, transparent 4px 7px);
}

.alert-highlight {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
}

.alert-visual {
  position: relative;
  min-height: 106px;
  display: grid;
  place-items: center;
  margin: 2px 0 14px;
}

.alert-rings,
.alert-rings::before,
.alert-rings::after {
  position: absolute;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(255, 109, 117, 0.14);
  border-radius: 50%;
}

.alert-rings::before,
.alert-rings::after {
  content: "";
  inset: -14px;
  width: auto;
  height: auto;
}

.alert-rings::after {
  inset: -30px;
  border-color: rgba(255, 109, 117, 0.07);
}

.alert-visual svg {
  z-index: 1;
  width: 27px;
  height: 27px;
  color: var(--red);
  filter: drop-shadow(0 0 8px rgba(255, 109, 117, 0.45));
}

.alert-severity {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #ffc0c5;
  border-radius: 6px;
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-severity i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
}

.alert-highlight h4 {
  margin: 10px 0 6px;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.alert-highlight > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.alert-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.alert-meta {
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.012);
}

.alert-meta small,
.alert-meta strong {
  display: block;
}

.alert-meta small {
  color: var(--muted);
  font-size: 11px;
}

.alert-meta strong {
  margin-top: 2px;
  font-size: 12px;
}

.alert-highlight .primary-button {
  width: 100%;
  margin-top: auto;
}

.dashboard-bottom-grid {
  grid-template-columns: 1fr;
}

.mini-map-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.municipality-map-mini {
  position: relative;
  height: 296px;
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(2, 190, 212, 0.08), transparent 45%),
    linear-gradient(rgba(105, 147, 174, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 147, 174, 0.035) 1px, transparent 1px),
    #07131d;
  background-size: auto, 28px 28px, 28px 28px, auto;
}

.municipality-map-mini svg,
.territory-map-canvas > svg {
  width: 100%;
  height: 100%;
}

/* The municipal boundary is naturally tall; a subtle scale keeps it legible inside the wide card. */
.territory-map-canvas.view-municipality > svg {
  transform: scale(1.14);
  transform-origin: center;
}

.map-boundary {
  fill: rgba(11, 110, 158, 0.035);
  stroke: #1689b8;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(2, 190, 212, 0.1));
  pointer-events: none;
}

.census-sector {
  fill-rule: evenodd;
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 160ms ease, stroke 160ms ease, filter 160ms ease;
}

.census-sector.risk-high {
  fill: rgba(255, 109, 117, 0.34);
  stroke: rgba(255, 145, 151, 0.5);
}

.census-sector.risk-medium {
  fill: rgba(244, 185, 95, 0.25);
  stroke: rgba(247, 207, 142, 0.46);
}

.census-sector.risk-low {
  fill: rgba(48, 209, 155, 0.18);
  stroke: rgba(105, 224, 181, 0.4);
}

.census-sector:hover,
.census-sector:focus-visible {
  stroke: #ddfbff;
  stroke-width: 1.45;
  filter: brightness(1.22);
  outline: none;
}

.census-sector.selected {
  stroke: #f2feff;
  stroke-width: 2.3;
  filter: drop-shadow(0 0 4px rgba(2, 190, 212, 0.85)) brightness(1.15);
}

.official-neighborhood {
  fill: rgba(244, 185, 95, 0.12);
  fill-rule: evenodd;
  stroke: #f4b95f;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(244, 185, 95, 0.24));
  pointer-events: none;
}

.official-neighborhood-label {
  fill: #ffe1aa;
  stroke: #07131d;
  stroke-width: 2.8px;
  paint-order: stroke;
  text-anchor: middle;
  dominant-baseline: middle;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 0;
  pointer-events: none;
}

.view-legal .official-neighborhood-label {
  opacity: 1;
}

.map-source {
  position: absolute;
  left: 9px;
  bottom: 7px;
  padding: 3px 6px;
  color: #5d7585;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(5, 12, 18, 0.78);
  font-size: 11px;
}

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

.territory-rank-row {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.012);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.territory-rank-row:hover {
  border-color: color-mix(in srgb, var(--territory-risk-color) 42%, var(--border));
  background: color-mix(in srgb, var(--territory-risk-color) 4%, transparent);
  transform: translateY(-1px);
}

.territory-rank-head,
.territory-risk-label,
.territory-rank-foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.territory-rank-head > span:first-child {
  min-width: 0;
}

.territory-rank-head strong,
.territory-rank-head small {
  display: block;
}

.territory-rank-head strong {
  font-size: 12px;
}

.territory-rank-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.territory-risk-label {
  align-items: flex-end;
  color: var(--muted);
}

.territory-risk-label small {
  font-size: 11px;
}

.territory-risk-label strong {
  color: var(--territory-risk-color);
  font-size: 12px;
}

.territory-risk-track {
  width: 100%;
  height: 7px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(123, 153, 174, 0.1);
}

.territory-risk-track > span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--territory-risk-color) 62%, #173448), var(--territory-risk-color));
  box-shadow: 0 0 10px color-mix(in srgb, var(--territory-risk-color) 35%, transparent);
}

.territory-risk-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -5px;
  color: #526b7b;
  font-size: 10px;
  line-height: 1;
}

.territory-risk-scale i {
  font-style: normal;
}

.territory-rank-foot {
  justify-content: flex-start;
  margin-top: auto;
  color: #607989;
  font-size: 11px;
}

.territory-rank-foot svg {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: var(--territory-risk-color);
}

.risk-pill,
.status-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.risk-pill.high,
.status-pill.critical {
  color: #ffc2c6;
  background: var(--red-soft);
}

.risk-pill.medium,
.status-pill.warning {
  color: #f7d598;
  background: var(--amber-soft);
}

.risk-pill.low,
.status-pill.ok,
.source-pill {
  color: #92e3c3;
  background: var(--green-soft);
}

.risk-pill.info,
.status-pill.info {
  color: #91dce9;
  background: var(--cyan-soft);
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 112px 1fr 28px;
  align-items: center;
  gap: 10px;
}

.distribution-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #a6bac7;
  font-size: 12px;
}

.distribution-label i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--bar-color);
}

.bar-track,
.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(123, 153, 174, 0.09);
}

.bar-fill,
.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--cyan));
  box-shadow: 0 0 8px color-mix(in srgb, var(--bar-color, var(--cyan)) 35%, transparent);
  transition: width 500ms ease;
}

.distribution-value {
  color: #8da2b1;
  font-size: 12px;
  text-align: right;
}

.insight-banner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  margin-top: 14px;
  padding: 14px 16px;
  border-color: rgba(2, 190, 212, 0.14);
  border-radius: 13px;
  overflow: hidden;
}

.insight-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 190, 212, 0.055), transparent 55%);
  pointer-events: none;
}

.insight-icon {
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(2, 190, 212, 0.18);
  border-radius: 10px;
  background: var(--cyan-soft);
}

.insight-icon svg {
  width: 18px;
  height: 18px;
}

.insight-banner > div,
.insight-banner > button {
  z-index: 1;
}

.insight-banner h4,
.insight-banner p {
  margin: 0;
}

.insight-banner h4 {
  font-size: 12px;
}

.insight-banner p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--cyan);
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.link-button svg {
  width: 12px;
  height: 12px;
}

/* Territory */
.territory-kpis {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}

.territory-stat {
  padding: 15px;
  border-radius: 12px;
}

.territory-stat small,
.territory-stat strong,
.territory-stat span {
  display: block;
}

.territory-stat small {
  color: var(--muted);
  font-size: 12px;
}

.territory-stat strong {
  margin: 5px 0 3px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.territory-stat span {
  color: #5c7585;
  font-size: 11px;
}

.territory-layout {
  grid-template-columns: minmax(480px, 1.4fr) minmax(300px, 0.78fr);
}

.territory-layout > .panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.territory-map-canvas {
  position: relative;
  flex: 1 1 auto;
  height: min(510px, calc(100vh - 280px));
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 35%, rgba(2, 190, 212, 0.07), transparent 42%),
    linear-gradient(rgba(105, 147, 174, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 147, 174, 0.035) 1px, transparent 1px),
    #07131d;
  background-size: auto, 36px 36px, 36px 36px, auto;
}

.map-controls {
  position: absolute;
  z-index: 3;
  top: 13px;
  left: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-data-badge {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: #88d8e3;
  border: 1px solid rgba(2, 190, 212, 0.17);
  border-radius: 8px;
  background: rgba(5, 12, 18, 0.84);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.map-data-badge svg {
  width: 14px;
  height: 14px;
}

.map-legend {
  position: absolute;
  z-index: 2;
  left: 13px;
  bottom: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 12, 18, 0.85);
  backdrop-filter: blur(10px);
  font-size: 11px;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.map-legend .legend-risk.high {
  background: var(--red);
}

.map-legend .legend-risk.medium {
  background: var(--amber);
}

.map-legend .legend-risk.low {
  background: var(--green);
}

.map-legend .legend-neighborhood {
  width: 13px;
  height: 7px;
  border: 1.5px solid #f4b95f;
  border-radius: 2px;
  background: rgba(244, 185, 95, 0.12);
}

.territory-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.territory-detail {
  padding: 18px;
}

.territory-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.territory-detail-header small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.territory-detail-header h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-metric {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.014);
}

.detail-metric small,
.detail-metric strong,
.detail-metric span {
  display: block;
}

.detail-metric small {
  color: var(--muted);
  font-size: 11px;
}

.detail-metric strong {
  margin: 3px 0;
  font-size: 15px;
}

.detail-metric span {
  color: #617989;
  font-size: 11px;
}

.factor-list {
  margin-top: 17px;
}

.factor-list > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
}

.factor-row {
  display: grid;
  grid-template-columns: 1fr 90px auto;
  align-items: center;
  gap: 9px;
  margin: 9px 0;
  color: #9fb2bf;
  font-size: 11px;
}

.factor-row .bar-track {
  height: 4px;
}

.territory-list {
  max-height: 275px;
  overflow-y: auto;
}

.territory-list-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  color: inherit;
  border: 0;
  border-bottom: 1px solid rgba(157, 185, 207, 0.07);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.territory-list-row:last-child {
  border-bottom: 0;
}

.territory-list-row:hover strong,
.territory-list-row.active strong {
  color: var(--cyan);
}

.territory-color {
  width: 7px;
  height: 28px;
  border-radius: 3px;
  background: var(--territory-color);
}

.territory-list-row strong,
.territory-list-row small {
  display: block;
}

.territory-list-row strong {
  font-size: 12px;
}

.territory-list-row small {
  color: var(--muted);
  font-size: 11px;
}

/* Surveillance */
.surveillance-summary {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.surveillance-main {
  grid-template-columns: 1.5fr 0.72fr;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.alert-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border-radius: 11px;
  cursor: pointer;
  transition: 140ms ease;
}

.alert-card:hover {
  transform: translateY(-1px);
  border-color: rgba(2, 190, 212, 0.22);
}

.alert-card-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--alert-color);
  border-radius: 9px;
  background: color-mix(in srgb, var(--alert-color) 11%, transparent);
}

.alert-card-icon svg {
  width: 17px;
  height: 17px;
}

.alert-card h4,
.alert-card p {
  margin: 0;
}

.alert-card h4 {
  font-size: 12px;
}

.alert-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.alert-card-meta {
  min-width: 105px;
  text-align: right;
}

.alert-card-meta time {
  display: block;
  margin-top: 5px;
  color: #5f7686;
  font-size: 11px;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 7px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 15px 1fr;
  gap: 10px;
}

.timeline-dot {
  z-index: 1;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--timeline-color, var(--cyan));
}

.timeline-item strong,
.timeline-item p,
.timeline-item time {
  display: block;
  margin: 0;
}

.timeline-item strong {
  font-size: 12px;
}

.timeline-item p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.timeline-item time {
  margin-top: 4px;
  color: #506879;
  font-size: 11px;
}

/* Connected operational flows */
.flow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  margin-bottom: 14px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(11, 25, 36, 0.72);
}

.flow-toolbar.compact {
  min-height: 60px;
}

.flow-toolbar > div > small,
.flow-context {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}

.flow-toolbar > div > small {
  margin-bottom: 7px;
}

.flow-toolbar-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-context {
  margin-left: auto;
  text-align: right;
}

.finance-layout {
  grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.28fr);
  align-items: stretch;
}

.finance-scenario .panel-body {
  display: flex;
  flex-direction: column;
  height: calc(100% - 66px);
}

.scenario-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 25px;
}

.scenario-values > div {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
}

.scenario-values small,
.scenario-values strong {
  display: block;
}

.scenario-values small {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.scenario-values strong {
  font-size: 18px;
}

.scenario-range {
  width: 100%;
  accent-color: var(--cyan);
  cursor: pointer;
}

.scenario-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.ingestion-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.65fr);
  align-items: stretch;
}

.ingestion-main-panel {
  height: 700px;
  min-height: 700px;
  display: flex;
  flex-direction: column;
}

.ingestion-main-panel > .panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.ingestion-aside {
  gap: 14px;
}

.ingestion-steps {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: #647c8c;
  font-size: 11px;
  font-weight: 650;
}

.ingestion-steps span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ingestion-steps i {
  width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: #7690a0;
  font-style: normal;
}

.ingestion-steps i svg {
  width: 12px;
  height: 12px;
}

.ingestion-steps b {
  height: 1px;
  background: var(--border);
}

.ingestion-steps span.active {
  color: var(--text);
}

.ingestion-steps span.active i {
  color: var(--cyan);
  border-color: rgba(2, 190, 212, 0.5);
  background: var(--cyan-soft);
}

.ingestion-steps span.done i {
  color: var(--green);
  border-color: rgba(48, 209, 155, 0.45);
  background: var(--green-soft);
}

.upload-dropzone {
  height: 280px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  border: 1px dashed #315061;
  border-radius: 11px;
  background: rgba(2, 190, 212, 0.018);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.ingestion-main-panel > .panel-body > .upload-dropzone {
  flex: 1 1 auto;
  height: auto;
}

.upload-dropzone:hover {
  border-color: var(--cyan);
  background: rgba(2, 190, 212, 0.04);
}

.upload-dropzone > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 12px;
  color: var(--cyan);
  background: var(--cyan-soft);
}

.upload-dropzone > span svg {
  width: 21px;
  height: 21px;
}

.upload-dropzone strong {
  font-size: 14px;
}

.upload-dropzone p {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.upload-dropzone > small {
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: #b4c8d3;
  font-size: 11px;
}

.ingestion-source-picker {
  padding: 8px !important;
}

.ingestion-source-picker button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ingestion-source-picker button:hover,
.ingestion-source-picker button.active {
  border-color: var(--border-strong);
  background: rgba(2, 190, 212, 0.05);
}

.ingestion-source-picker button > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--cyan);
  background: var(--cyan-soft);
}

.ingestion-source-picker button > span svg,
.ingestion-source-picker button > svg {
  width: 15px;
  height: 15px;
}

.ingestion-source-picker strong,
.ingestion-source-picker small {
  display: block;
}

.ingestion-source-picker strong {
  font-size: 12px;
}

.ingestion-source-picker small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.file-review-head,
.structured-review-head,
.ingestion-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.file-review-head {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.014);
}

.file-review-head > span:first-child {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--cyan);
  background: var(--cyan-soft);
}

.file-review-head > span:first-child svg {
  width: 17px;
  height: 17px;
}

.file-review-head > div,
.structured-review-head > div {
  min-width: 0;
  flex: 1;
}

.file-review-head strong,
.file-review-head small,
.structured-review-head strong,
.structured-review-head small {
  display: block;
}

.file-review-head strong,
.structured-review-head strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-review-head small,
.structured-review-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ingestion-preview {
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.ingestion-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.ingestion-actions.split {
  justify-content: space-between;
}

.ingestion-actions.split > small {
  color: var(--muted);
  font-size: 11px;
}

.ingestion-actions.split > div {
  display: flex;
  gap: 8px;
}

.structured-review {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.012);
}

.structured-review-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.review-fields > span {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
}

.review-fields small,
.review-fields strong {
  display: block;
}

.review-fields small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

.review-fields strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.ingestion-complete {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}

.ingestion-complete > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
}

.ingestion-complete > span svg {
  width: 24px;
  height: 24px;
}

.ingestion-complete h3 {
  font-size: 16px;
}

.ingestion-complete p {
  max-width: 480px;
  margin: 7px auto 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ingestion-complete > div {
  display: flex;
  gap: 8px;
}

.action-plan-panel {
  margin-top: 14px;
}

.plan-priority {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(2, 190, 212, 0.28);
  border-radius: 7px;
  color: var(--cyan);
  background: var(--cyan-soft);
  font-size: 11px;
  font-weight: 750;
}

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

.disease-card {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.012);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.disease-card:hover,
.disease-card.active {
  border-color: rgba(2, 190, 212, 0.45);
  background: rgba(2, 190, 212, 0.045);
}

.disease-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 7px;
}

.disease-card strong {
  font-size: 12px;
}

.disease-card b {
  font-size: 14px;
}

.sparkline {
  width: 100%;
  height: 34px;
}

/* Primary care */
.coverage-ring-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 25px;
}

.donut {
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  margin: 5px auto;
}

.donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut circle {
  fill: none;
  stroke-width: 11;
}

.donut .track {
  stroke: rgba(113, 145, 165, 0.1);
}

.donut .value {
  stroke: var(--cyan);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(2, 190, 212, 0.25));
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center strong,
.donut-center small {
  display: block;
}

.donut-center strong {
  font-size: 25px;
  letter-spacing: -0.045em;
}

.donut-center small {
  color: var(--muted);
  font-size: 11px;
}

.coverage-breakdown {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.coverage-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #9db0bd;
  font-size: 12px;
}

.coverage-row-head b {
  color: var(--text);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.toolbar-search {
  position: relative;
  width: 240px;
}

.toolbar-search svg {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.toolbar-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 31px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  outline: 0;
  font-size: 12px;
}

.data-table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(157, 185, 207, 0.07);
  text-align: left;
}

.data-table th {
  color: #5d7484;
  background: rgba(255, 255, 255, 0.01);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table td {
  color: #9eb1be;
  font-size: 12px;
}

.data-table tbody tr {
  cursor: pointer;
  transition: 120ms ease;
}

.data-table tbody tr:hover {
  background: rgba(2, 190, 212, 0.025);
}

.data-table td strong {
  display: block;
  color: #d1dce3;
  font-size: 12px;
}

.data-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.table-progress {
  display: grid;
  grid-template-columns: 55px 25px;
  align-items: center;
  gap: 7px;
}

.table-progress .progress-track {
  height: 4px;
}

/* Data quality */
.quality-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 22px;
}

.quality-score {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border: 7px solid rgba(48, 209, 155, 0.15);
  border-top-color: var(--green);
  border-right-color: var(--green);
  border-radius: 50%;
  transform: rotate(15deg);
}

.quality-score > div {
  transform: rotate(-15deg);
  text-align: center;
}

.quality-score strong,
.quality-score small {
  display: block;
}

.quality-score strong {
  font-size: 22px;
}

.quality-score small {
  color: var(--muted);
  font-size: 11px;
}

.quality-hero h2,
.quality-hero p {
  margin: 0;
}

.quality-hero h2 {
  font-size: 17px;
}

.quality-hero p {
  max-width: 600px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.quality-grid {
  grid-template-columns: repeat(4, 1fr);
  margin: 14px 0;
}

.quality-metric {
  padding: 15px;
  border-radius: 12px;
}

.quality-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quality-metric-head span {
  color: var(--muted);
  font-size: 12px;
}

.quality-metric-head strong {
  font-size: 15px;
}

.quality-metric small {
  display: block;
  margin-top: 7px;
  color: #5b7383;
  font-size: 11px;
}

.quality-layout {
  grid-template-columns: minmax(400px, 1.35fr) minmax(300px, 0.75fr);
}

.issue-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(157, 185, 207, 0.07);
}

.issue-row:last-child {
  border-bottom: 0;
}

.issue-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--issue-color, var(--amber));
  border-radius: 8px;
  background: color-mix(in srgb, var(--issue-color, var(--amber)) 11%, transparent);
}

.issue-icon svg {
  width: 14px;
  height: 14px;
}

.issue-row strong,
.issue-row p {
  margin: 0;
}

.issue-row strong {
  font-size: 12px;
}

.issue-row p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.source-health-row {
  margin-bottom: 16px;
}

.source-health-row:last-child {
  margin-bottom: 0;
}

.source-health-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.source-health-head span {
  color: #9cafbb;
}

.source-health-head strong {
  color: var(--green);
}

/* Intelligence */
.intelligence-layout {
  grid-template-columns: minmax(0, 1.32fr) minmax(290px, 0.68fr);
  gap: 18px;
  align-items: start;
  min-height: calc(100vh - 205px);
}

.intelligence-chat {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 205px);
}

.ai-workspace-header {
  min-height: 66px;
}

.ai-workspace-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-workspace-title > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--cyan);
  border: 1px solid rgba(2, 190, 212, 0.2);
  border-radius: 10px;
  background: var(--cyan-soft);
}

.ai-workspace-title > span svg {
  width: 17px;
  height: 17px;
}

.ai-workspace-title h3,
.ai-workspace-title p {
  margin: 0;
}

.ai-workspace-title h3 {
  font-size: 13px;
}

.ai-workspace-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ai-context-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 190, 212, 0.018);
}

.ai-context-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  color: #7892a2;
  border: 1px solid rgba(117, 151, 171, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.012);
  font-size: 11px;
}

.ai-context-strip svg {
  width: 12px;
  height: 12px;
  color: var(--cyan);
}

.intelligence-sidebar {
  gap: 14px;
  position: sticky;
  top: 14px;
}

.intelligence-hero {
  padding: 23px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 15% 20%, rgba(2, 190, 212, 0.08), transparent 38%),
    rgba(2, 190, 212, 0.01);
}

.intelligence-hero-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(2, 190, 212, 0.2);
  border-radius: 11px;
  background: var(--cyan-soft);
  box-shadow: 0 0 25px rgba(2, 190, 212, 0.08);
}

.intelligence-hero h2,
.intelligence-hero p {
  margin: 0;
}

.intelligence-hero h2 {
  margin-top: 12px;
  font-size: 20px;
}

.intelligence-hero p {
  max-width: 650px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 17px;
}

.ai-prompt-list {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 0;
}

.ai-prompt-list .prompt-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px;
}

.ai-prompt-list .prompt-card svg:last-child {
  width: 13px;
  height: 13px;
  color: #557181;
}

.prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px;
  color: #a8bdca;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.012);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
}

.prompt-card:hover {
  color: #d3e5ec;
  border-color: rgba(2, 190, 212, 0.24);
  background: rgba(2, 190, 212, 0.035);
}

.prompt-card svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--cyan);
}

.page-ai-messages {
  flex: 1;
  min-height: 330px;
  max-height: calc(100vh - 430px);
  padding: 20px;
  overflow-y: auto;
}

.page-ai-form {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}

.page-ai-input {
  display: flex;
  gap: 8px;
  padding: 7px 7px 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.page-ai-input:focus-within {
  border-color: rgba(2, 190, 212, 0.45);
}

.page-ai-input textarea {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 110px;
  padding: 8px 0;
  color: var(--text);
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 12px;
}

.page-ai-input button {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  align-self: flex-end;
  color: #051017;
  border: 0;
  border-radius: 8px;
  background: var(--cyan);
  cursor: pointer;
}

.page-ai-input button svg {
  width: 16px;
  height: 16px;
}

.page-ai-form > small {
  display: block;
  margin-top: 7px;
  color: #506979;
  font-size: 11px;
  text-align: center;
}

.message {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
}

.message.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--cyan);
  border: 1px solid rgba(2, 190, 212, 0.15);
  border-radius: 8px;
  background: var(--cyan-soft);
}

.message-avatar svg {
  width: 13px;
  height: 13px;
}

.message-bubble {
  max-width: min(620px, 86%);
  padding: 10px 12px;
  color: #aebfca;
  border: 1px solid var(--border);
  border-radius: 4px 11px 11px 11px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 12px;
  line-height: 1.62;
}

.message.user .message-bubble {
  color: #d5edf1;
  border-color: rgba(2, 190, 212, 0.14);
  border-radius: 11px 4px 11px 11px;
  background: rgba(2, 190, 212, 0.075);
}

.message-bubble p {
  margin: 0 0 7px;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble ul,
.message-bubble ol {
  margin: 6px 0;
  padding-left: 18px;
}

.message-bubble strong {
  color: #d9e6ec;
}

.typing {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 50px;
  min-height: 34px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #688493;
  animation: typing 1.2s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-4px); opacity: 1; }
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.evidence-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.012);
}

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

.evidence-item span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-item strong {
  margin: 3px 0;
  font-size: 12px;
}

.evidence-item small {
  color: #60798a;
  font-size: 11px;
}

/* Reports and integrations */
.report-grid,
.integration-grid {
  grid-template-columns: repeat(3, 1fr);
}

.report-card,
.integration-card {
  padding: 17px;
  border-radius: 13px;
}

.report-icon,
.integration-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--card-color, var(--cyan));
  border-radius: 9px;
  background: color-mix(in srgb, var(--card-color, var(--cyan)) 11%, transparent);
}

.report-icon svg,
.integration-icon svg {
  width: 16px;
  height: 16px;
}

.report-card h3,
.integration-card h3 {
  margin: 13px 0 5px;
  font-size: 13px;
}

.report-card p,
.integration-card p {
  min-height: 34px;
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.report-card-footer,
.integration-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.report-card-footer small,
.integration-card-footer small {
  color: #5d7484;
  font-size: 11px;
}

.integration-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 11px;
}

.integration-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sync-progress {
  margin-top: 12px;
}

.sync-progress .progress-track {
  height: 4px;
}

.generated-list {
  margin-top: 14px;
}

.sidebar-scrim {
  position: fixed;
  z-index: 60;
  inset: 0;
  pointer-events: none;
  background: rgba(2, 7, 11, 0.62);
  opacity: 0;
  transition: opacity 200ms ease;
  backdrop-filter: blur(2px);
}

.sidebar-scrim.open {
  pointer-events: auto;
  opacity: 1;
}

/* Modal, dropdown and toast */
.modal-root {
  position: fixed;
  z-index: 100;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 7, 11, 0.74);
  backdrop-filter: blur(4px);
  animation: fade-in 140ms ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal {
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: #0a1722;
  box-shadow: var(--shadow);
  animation: modal-in 180ms ease;
}

.modal.modal-wide {
  width: min(760px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header h2 {
  font-size: 16px;
}

.modal-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
}

.modal-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field.full {
  grid-column: 1 / -1;
}

.modal-field label {
  color: #9eb0bd;
  font-size: 11px;
  font-weight: 600;
}

.modal-field input,
.modal-field select,
.modal-field textarea,
.command-input {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  outline: 0;
  font-size: 12px;
}

.modal-field textarea {
  min-height: 85px;
  resize: vertical;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus,
.command-input:focus {
  border-color: rgba(2, 190, 212, 0.45);
}

.command-modal {
  align-self: start;
  margin-top: 11vh;
}

.command-search-wrap {
  position: relative;
}

.command-search-wrap > svg {
  position: absolute;
  top: 11px;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.command-input {
  height: 40px;
  padding-left: 37px;
}

.command-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.command-result {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--text-soft);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.command-result:hover {
  color: var(--text);
  background: rgba(2, 190, 212, 0.06);
}

.command-result svg {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

.command-result strong,
.command-result small {
  display: block;
}

.command-result strong {
  font-size: 12px;
}

.command-result small {
  color: var(--muted);
  font-size: 11px;
}

.command-result > span:last-child {
  color: #586e7e;
  font-size: 11px;
}

.dropdown-menu {
  position: fixed;
  z-index: 90;
  width: 210px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0b1823;
  box-shadow: var(--shadow);
  animation: modal-in 130ms ease;
}

.user-dropdown {
  position: fixed;
  z-index: 90;
  width: 238px;
  padding: 7px;
}

.user-dropdown::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #0b1823;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

.user-dropdown button {
  min-height: 36px;
}

.user-dropdown button[data-value="clear-data"] {
  color: #f4c77c;
}

.user-dropdown button[data-value="clear-data"]:hover {
  color: #ffe0a7;
  background: rgba(244, 185, 95, 0.08);
}

.dropdown-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: #9eb0bd;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.dropdown-menu button:hover,
.dropdown-menu button.active {
  color: var(--text);
  background: rgba(2, 190, 212, 0.06);
}

.dropdown-menu button svg {
  width: 14px;
  height: 14px;
}

.dropdown-menu .separator {
  height: 1px;
  margin: 5px;
  background: var(--border);
}

.toast-root {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(330px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0c1b27;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  animation: toast-in 180ms ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
}

.toast-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--toast-color, var(--green));
  border-radius: 8px;
  background: color-mix(in srgb, var(--toast-color, var(--green)) 11%, transparent);
}

.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast strong,
.toast span {
  display: block;
}

.toast .toast-icon {
  display: grid;
  place-items: center;
  align-self: center;
  line-height: 0;
}

.toast .toast-icon svg {
  display: block;
  margin: auto;
}

.toast strong {
  font-size: 12px;
}

.toast span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  padding: 35px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  color: #496473;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: #9cb0bc;
  font-size: 12px;
}

.empty-state span {
  margin-top: 3px;
  font-size: 11px;
}

.reports-empty .empty-state-mark {
  width: 34px;
  height: 26px;
  margin: 0 auto 11px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  opacity: .65;
}

.reports-empty .empty-state-mark span {
  width: 6px;
  margin: 0;
  border-radius: 3px 3px 1px 1px;
  background: var(--cyan);
}

.reports-empty .empty-state-mark span:nth-child(1) { height: 11px; opacity: .45; }
.reports-empty .empty-state-mark span:nth-child(2) { height: 20px; opacity: .75; }
.reports-empty .empty-state-mark span:nth-child(3) { height: 15px; opacity: .55; }

/* Responsive */
@media (max-width: 1180px) {
  .ingestion-main-panel {
    height: 700px;
    min-height: 700px;
  }

  .kpi-grid,
  .quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-main-grid,
  .dashboard-bottom-grid,
  .surveillance-main,
  .quality-layout,
  .finance-layout,
  .ingestion-layout {
    grid-template-columns: 1fr;
  }

  .territory-layout {
    grid-template-columns: minmax(420px, 1.2fr) minmax(280px, 0.8fr);
  }

  .report-grid,
  .integration-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar-width: 244px;
    --topbar-height: 72px;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    padding: 30px 24px;
  }

  .login-mobile-brand {
    display: block;
    margin-bottom: 48px;
  }

  .login-mobile-brand img {
    width: 230px;
  }

  .sidebar {
    transform: translateX(-103%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid !important;
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    padding: 0 20px;
  }

  .search-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .search-button span,
  .search-button kbd {
    display: none;
  }

  .page-content {
    padding: 22px 20px 45px;
  }

  .territory-layout,
  .intelligence-layout {
    grid-template-columns: 1fr;
  }

  .territory-map-canvas {
    height: 540px;
  }

  .intelligence-layout {
    min-height: auto;
  }

  .intelligence-chat {
    min-height: 600px;
  }

  .intelligence-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    position: static;
  }

  .sidebar-scrim {
    z-index: 40;
  }
}

@media (max-width: 680px) {
  .topbar-actions .period-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .period-button span,
  .period-button > svg:last-child,
  .breadcrumb {
    display: none;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .page-content {
    padding: 18px 14px 78px;
  }

  .page-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .flow-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-context {
    margin-left: 0;
    text-align: left;
  }

  .flow-toolbar > button {
    width: 100%;
  }

  .ingestion-steps {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .ingestion-steps b {
    display: none;
  }

  .upload-dropzone {
    min-height: 220px;
    padding: 22px 16px;
  }

  .review-fields,
  .scenario-values {
    grid-template-columns: 1fr;
  }

  .ingestion-actions.split {
    align-items: stretch;
    flex-direction: column;
  }

  .ingestion-actions.split > div,
  .ingestion-complete > div {
    width: 100%;
    flex-direction: column;
  }

  .intro-actions {
    width: 100%;
  }

  .intro-actions button {
    flex: 1;
  }

  .kpi-grid,
  .territory-kpis,
  .surveillance-summary,
  .quality-grid,
  .report-grid,
  .integration-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 110px;
  }

  .mini-map-layout,
  .coverage-ring-layout {
    grid-template-columns: 1fr;
  }

  .territory-ranking,
  .intelligence-sidebar {
    grid-template-columns: 1fr;
  }

  .municipality-map-mini {
    height: 260px;
  }

  .insight-banner {
    grid-template-columns: auto 1fr;
  }

  .insight-banner > button {
    grid-column: 2;
    justify-self: start;
  }

  .territory-map-canvas {
    min-height: 470px;
    height: 72vh;
  }

  .map-legend {
    max-width: calc(100% - 26px);
    flex-wrap: wrap;
  }

  .map-data-badge {
    top: 57px;
  }

  .alert-card {
    grid-template-columns: auto 1fr;
  }

  .alert-card-meta {
    grid-column: 2;
    text-align: left;
  }

  .quality-hero {
    grid-template-columns: 1fr;
  }

  .quality-score {
    width: 82px;
    height: 82px;
  }

  .quality-hero .primary-button {
    width: 100%;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-search {
    width: 100%;
  }

  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .quick-access-grid {
    grid-template-columns: 1fr;
  }

  .modal-field.full {
    grid-column: auto;
  }

  .toast-root {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 400px) {
  .login-panel h2 {
    font-size: 27px;
  }

  .login-mobile-brand {
    margin-bottom: 38px;
  }

  .login-mobile-brand img {
    width: 205px;
  }

  .topbar {
    padding: 0 12px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .search-button {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
