:root {
  --apollo-blue: #0057a7;
  --apollo-deep: #073b72;
  --apollo-sky: #1ba7e1;
  --apollo-aqua: #27b7c9;
  --apollo-gold: #d8a92f;
  --apollo-green: #1b9c85;
  --apollo-coral: #e36f59;
  --apollo-violet: #7c6ee6;
  --ink: #12213a;
  --muted: #617089;
  --line: #dce6f2;
  --soft: #f4f8fc;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(7, 59, 114, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 87, 167, 0.06), rgba(39, 183, 201, 0.06) 38%, rgba(255, 255, 255, 0) 70%),
    #f7fafd;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.auth-required {
  overflow: hidden;
}

body.auth-required .app-shell {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  overflow: auto;
  padding: clamp(16px, 2vw, 28px);
  background:
    radial-gradient(circle at 12% 88%, rgba(27, 156, 133, 0.22), transparent 22%),
    radial-gradient(circle at 80% 0%, rgba(0, 87, 167, 0.34), transparent 38%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(213, 232, 250, 0.9) 34%, rgba(0, 87, 167, 0.62)),
    #f7fafd;
}

body.auth-required .login-screen {
  display: block;
}

.login-network {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.52;
  background:
    linear-gradient(30deg, transparent 0 44%, rgba(255, 255, 255, 0.42) 44.2% 44.6%, transparent 45%),
    linear-gradient(150deg, transparent 0 54%, rgba(255, 255, 255, 0.3) 54.2% 54.5%, transparent 55%),
    radial-gradient(circle at 55% 10%, rgba(255, 255, 255, 0.9) 0 3px, transparent 4px),
    radial-gradient(circle at 68% 17%, rgba(255, 255, 255, 0.75) 0 2px, transparent 3px),
    radial-gradient(circle at 83% 4%, rgba(255, 255, 255, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 12%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px);
}

.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(380px, 480px);
  gap: clamp(24px, 3vw, 44px);
  align-items: center;
  width: min(1440px, 100%);
  min-height: calc(100vh - clamp(32px, 4vw, 56px));
  margin: 0 auto;
}

.login-panel {
  justify-self: end;
  width: min(480px, 100%);
  padding: clamp(22px, 2.2vw, 28px) clamp(28px, 3vw, 36px) clamp(20px, 2vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(7, 59, 114, 0.22);
  backdrop-filter: blur(12px);
}

.login-hero {
  min-width: 0;
}

.login-title-row {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 20px);
  margin-bottom: clamp(18px, 2.2vw, 26px);
}

.login-title-row h1 {
  margin: 0;
  color: #08336f;
  font-size: clamp(1.78rem, 2.7vw, 2.18rem);
  line-height: 1.05;
  font-weight: 900;
}

.login-title-row p {
  margin: 8px 0 0;
  color: #0b2f66;
  font-size: clamp(1rem, 1.55vw, 1.2rem);
  font-weight: 600;
}

.login-shield {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(62px, 6.2vw, 76px);
  height: clamp(70px, 7vw, 86px);
  background: linear-gradient(135deg, #0d63c7, #62b8ee);
  clip-path: polygon(50% 0, 93% 15%, 88% 64%, 50% 100%, 12% 64%, 7% 15%);
  box-shadow: 0 16px 32px rgba(0, 87, 167, 0.24);
}

.login-shield::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: rgba(255, 255, 255, 0.9);
  clip-path: polygon(50% 0, 90% 16%, 84% 61%, 50% 92%, 16% 61%, 10% 16%);
}

.login-shield.compact {
  width: clamp(52px, 5.2vw, 60px);
  height: clamp(58px, 6vw, 68px);
  margin: 0 auto;
}

.shield-cross {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
}

.shield-cross::before,
.shield-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 2px;
  background: #1168c9;
  transform: translate(-50%, -50%);
}

.shield-cross::before {
  width: 27px;
  height: 8px;
}

.shield-cross::after {
  width: 8px;
  height: 27px;
}

.shield-bars {
  position: absolute;
  z-index: 1;
  right: 17px;
  bottom: 20px;
  width: 6px;
  height: 17px;
  border-radius: 2px;
  background: #073b72;
  box-shadow: 10px 6px 0 #0d63c7, 20px -4px 0 #64b7e8;
}

.login-dashboard-preview {
  display: grid;
  grid-template-columns: minmax(160px, 190px) minmax(0, 1fr);
  width: min(880px, 100%);
  height: clamp(390px, 63vh, 500px);
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 70px rgba(7, 59, 114, 0.2);
  transform: perspective(1100px) rotateY(3deg) rotateX(1deg);
}

.preview-sidebar {
  padding: clamp(18px, 2vw, 24px) clamp(14px, 1.7vw, 20px);
  color: var(--white);
  background: linear-gradient(180deg, #042a58, #0057a7);
}

.preview-brand {
  display: grid;
  gap: 8px;
  margin-bottom: clamp(18px, 2.2vw, 28px);
  font-weight: 900;
}

.preview-brand img {
  width: clamp(104px, 12vw, 124px);
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
}

.preview-nav {
  display: block;
  margin: 8px -8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.74rem, 1vw, 0.84rem);
  font-weight: 700;
}

.preview-nav.active {
  background: #0d63c7;
}

.preview-main {
  padding: clamp(18px, 2.2vw, 24px);
  background: #f8fbff;
}

.preview-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.preview-top strong {
  color: #101c36;
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
}

.preview-top span,
.preview-kpis small,
.preview-kpis em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
}

.preview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.preview-kpis div,
.preview-chart,
.preview-donut,
.preview-bars,
.preview-mini-donut {
  border: 1px solid rgba(0, 87, 167, 0.09);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(7, 59, 114, 0.08);
}

.preview-kpis div {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 12px;
}

.preview-kpis b {
  color: #084aa2;
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
}

.preview-kpis em {
  color: #0b9b70;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 12px;
}

.preview-chart.large {
  display: flex;
  align-items: end;
  gap: 14px;
  height: 165px;
  padding: 20px;
}

.preview-chart span {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #1ba7e1, #0057a7);
}

.preview-chart span:nth-child(1) { height: 40%; }
.preview-chart span:nth-child(2) { height: 58%; }
.preview-chart span:nth-child(3) { height: 48%; }
.preview-chart span:nth-child(4) { height: 72%; }
.preview-chart span:nth-child(5) { height: 86%; }

.preview-donut {
  display: grid;
  place-items: center;
  min-height: 165px;
  background:
    radial-gradient(circle, #ffffff 0 34%, transparent 35%),
    conic-gradient(#0057a7 0 63%, #27b7c9 63% 86%, #d8a92f 86% 100%);
}

.preview-donut span {
  color: #073b72;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.preview-bars {
  display: grid;
  gap: 10px;
  min-height: 96px;
  padding: 18px;
}

.preview-bars span {
  display: block;
  width: var(--w);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0057a7, #8ec7ee);
}

.preview-mini-donut {
  min-height: 96px;
  background:
    radial-gradient(circle, #ffffff 0 36%, transparent 37%),
    conic-gradient(#27b7c9 0 45%, #0057a7 45% 76%, #e6eff8 76% 100%);
}

.login-insight-mark {
  display: flex;
  align-items: end;
  gap: 14px;
  margin-top: 18px;
  margin-left: 54px;
  color: #0b3c81;
}

.trend-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-left: 6px solid #4a8ed7;
  border-bottom: 6px solid #4a8ed7;
}

.trend-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  bottom: 16px;
  width: 42px;
  height: 28px;
  border-top: 6px solid #4a8ed7;
  border-right: 6px solid #4a8ed7;
  transform: skew(-18deg);
}

.login-insight-mark strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.login-card-mark {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.login-logo {
  width: clamp(126px, 12vw, 142px);
  height: 50px;
  object-fit: contain;
}

.login-copy {
  margin-bottom: 16px;
  text-align: center;
}

.login-copy h2 {
  margin: 0;
  color: #0751bd;
  font-size: clamp(1.58rem, 2.1vw, 1.82rem);
  line-height: 1.1;
  font-weight: 900;
}

.login-copy p {
  margin: 8px 0 0;
  color: #12213a;
  font-size: 1rem;
  font-weight: 600;
}

.reset-copy {
  text-align: center;
}

.reset-copy h3 {
  margin: 0;
  color: var(--apollo-deep);
  font-size: 1.2rem;
}

.reset-copy p {
  margin: 7px 0 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.auth-form {
  display: none;
  gap: 10px;
}

.auth-form.active {
  display: grid;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field > span {
  color: #44536b;
  font-size: 0.82rem;
  font-weight: 800;
}

.input-shell {
  position: relative;
}

.input-shell::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2d84dc;
  transform: translateY(-50%);
  opacity: 0.95;
}

.input-shell.user-icon::after {
  content: "";
  position: absolute;
  left: 15px;
  top: calc(50% + 7px);
  width: 26px;
  height: 12px;
  border-radius: 12px 12px 4px 4px;
  background: #2d84dc;
  transform: translateY(-50%);
}

.input-shell.lock-icon::before {
  width: 18px;
  height: 16px;
  border-radius: 4px;
  background: #0b58c9;
}

.input-shell.lock-icon::after {
  content: "";
  position: absolute;
  left: 20px;
  top: calc(50% - 12px);
  width: 12px;
  height: 12px;
  border: 3px solid #0b58c9;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 44px 10px 54px;
  border: 1px solid #c8d4e4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: none;
  font-size: 1rem;
  font-weight: 650;
}

.auth-form input::placeholder {
  color: #78849a;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
  border-color: #0b67d3;
  box-shadow: 0 0 0 4px rgba(13, 99, 199, 0.12);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #25314a;
  font-size: 0.9rem;
  font-weight: 700;
}

.remember-row input {
  width: 20px;
  height: 20px;
  accent-color: #0b58c9;
}

.forgot-button {
  border: 0;
  color: #0751bd;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 800;
}

.login-button,
.link-button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
}

.login-button {
  border: 0;
  color: var(--white);
  background: linear-gradient(135deg, #0751bd, #006bdc);
  box-shadow: 0 16px 28px rgba(0, 87, 167, 0.22);
  font-size: 1rem;
}

.link-button {
  border: 1px solid transparent;
  color: var(--apollo-blue);
  background: transparent;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  color: #56627a;
  font-weight: 800;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: #dce5f1;
}

.sso-button {
  min-height: 48px;
  border: 1px solid #b7cae5;
  border-radius: 8px;
  color: #0751bd;
  background: var(--white);
  font-weight: 900;
}

.login-support {
  margin: 0;
  color: #56627a;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 650;
}

.support-button {
  border: 0;
  color: #0751bd;
  background: transparent;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.support-message {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(0, 87, 167, 0.15);
  border-radius: 8px;
  color: #073b72;
  background: #f4f9ff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.auth-message {
  min-height: 18px;
  margin: 0;
  color: var(--apollo-deep);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.auth-message.error {
  color: #b42318;
}

.auth-chip {
  max-width: 190px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--apollo-deep);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  background: linear-gradient(180deg, var(--white), #eef9f8 58%, #eef7ff);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-logo {
  width: 104px;
  height: 50px;
  object-fit: contain;
  border: 1px solid rgba(0, 87, 167, 0.16);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(0, 87, 167, 0.14);
}

.brand h1,
.topbar h2 {
  margin: 0;
  color: var(--apollo-deep);
  line-height: 1.1;
}

.brand h1 {
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--apollo-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-tabs {
  display: grid;
  gap: 7px;
  margin-bottom: 20px;
}

.nav-tab {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--apollo-deep);
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 8px 18px rgba(7, 59, 114, 0.08);
}

.filter-panel {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--apollo-deep);
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--apollo-blue);
  background: var(--white);
  font-weight: 900;
}

.filter-grid {
  display: grid;
  gap: 12px;
}

.filter-control {
  display: grid;
  gap: 6px;
}

.filter-control label,
.compact-select span,
.role-select span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-control select,
.filter-control input,
.multi-summary,
.compact-select select,
.role-select select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  outline: none;
}

.filter-control input[type="number"] {
  min-width: 0;
}

.range-row,
.date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.sidebar .range-row,
.sidebar .date-row {
  grid-template-columns: 1fr;
}

.multi-select {
  position: relative;
}

.multi-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.multi-summary::-webkit-details-marker {
  display: none;
}

.multi-summary::after {
  content: "v";
  color: var(--apollo-blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.multi-options {
  display: grid;
  gap: 7px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 24px rgba(7, 59, 114, 0.1);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.25;
}

.check-row input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--apollo-blue);
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(0, 87, 167, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(239, 248, 255, 0.97)),
    var(--white);
  box-shadow: var(--shadow);
}

.topbar h2 {
  max-width: 780px;
  font-size: clamp(1.35rem, 2.6vw, 2.35rem);
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--apollo-deep);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.success {
  color: #0f765f;
  border-color: rgba(27, 156, 133, 0.26);
  background: rgba(27, 156, 133, 0.08);
}

.pill.warn {
  color: #9d6b06;
  border-color: rgba(216, 169, 47, 0.35);
  background: rgba(216, 169, 47, 0.1);
}

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

.role-select,
.compact-select {
  display: grid;
  min-width: 144px;
  gap: 4px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--apollo-blue);
}

.action-button {
  min-width: 76px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--apollo-blue);
  border-radius: var(--radius);
  color: var(--white);
  background: linear-gradient(135deg, var(--apollo-blue), var(--apollo-sky));
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(0, 87, 167, 0.18);
}

.action-button.secondary {
  color: var(--apollo-blue);
  background: var(--white);
  box-shadow: none;
}

.action-button.ghost {
  min-width: 72px;
  color: var(--apollo-blue);
  background: var(--white);
  border-color: var(--line);
  box-shadow: none;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--apollo-blue);
  background: var(--white);
  font-weight: 900;
  text-decoration: none;
}

.upload-strip {
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px dashed rgba(0, 87, 167, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.file-drop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(0, 87, 167, 0.32);
  border-radius: var(--radius);
  color: var(--apollo-blue);
  background: #f8fcff;
  font-weight: 900;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.kpi-card {
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 28px rgba(7, 59, 114, 0.08);
}

.kpi-card .label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-card .value {
  margin: 10px 0 6px;
  color: var(--apollo-deep);
  font-size: clamp(1.28rem, 2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.kpi-card .delta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.kpi-card.accent-blue {
  background: linear-gradient(135deg, #ffffff, #eef8ff);
}

.kpi-card.accent-green {
  background: linear-gradient(135deg, #ffffff, #ecfbf7);
}

.kpi-card.accent-gold {
  background: linear-gradient(135deg, #ffffff, #fff9e8);
}

.kpi-card.accent-coral {
  background: linear-gradient(135deg, #ffffff, #fff1ee);
}

.page {
  display: none;
  margin-top: 18px;
}

.page.active {
  display: block;
}

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

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(7, 59, 114, 0.07);
}

.panel.span-3 { grid-column: span 3; }
.panel.span-4 { grid-column: span 4; }
.panel.span-5 { grid-column: span 5; }
.panel.span-6 { grid-column: span 6; }
.panel.span-7 { grid-column: span 7; }
.panel.span-8 { grid-column: span 8; }
.panel.span-9 { grid-column: span 9; }
.panel.span-12 { grid-column: span 12; }

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

.panel h3 {
  margin: 0;
  color: var(--apollo-deep);
  font-size: 1rem;
  line-height: 1.25;
}

.panel small {
  color: var(--muted);
  font-weight: 700;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.doctor-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-metric {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--apollo-deep);
  font-size: 1.2rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.chart {
  width: 100%;
  min-height: 270px;
}

.matrix-chart {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart.compact {
  min-height: 205px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--white);
}

.loading-panel {
  min-height: 210px;
}

.loading-bar {
  width: min(520px, 100%);
  height: 8px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6f1fb;
}

.loading-bar span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--apollo-blue), var(--apollo-sky));
  animation: loadingSweep 1.1s ease-in-out infinite alternate;
}

@keyframes loadingSweep {
  from { transform: translateX(-12%); }
  to { transform: translateX(170%); }
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--apollo-deep);
  background: #f2f8fe;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f7fbff;
}

.drill-link {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--apollo-blue);
  background: var(--white);
  font-weight: 900;
}

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

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

.mapping-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 74px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  font-size: 0.82rem;
}

.mapping-row strong {
  color: var(--apollo-deep);
}

.confidence {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--white);
  background: var(--apollo-green);
  font-size: 0.72rem;
  font-weight: 900;
}

.confidence.low {
  background: var(--apollo-gold);
}

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

.db-status {
  margin-bottom: 12px;
}

.edit-table table {
  min-width: 1180px;
}

.edit-input {
  width: 100%;
  min-width: 120px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fbfdff;
}

.edit-input:focus {
  border-color: var(--apollo-blue);
  outline: 2px solid rgba(0, 87, 167, 0.12);
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(150px, 0.85fr) minmax(150px, 0.85fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.admin-user-meta {
  display: grid;
  gap: 4px;
}

.admin-user-meta strong {
  color: var(--apollo-deep);
}

.admin-user-meta span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-force-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.upload-log {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.log-entry {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--apollo-blue);
  border-radius: var(--radius);
  background: var(--white);
}

.log-entry strong {
  display: block;
  color: var(--apollo-deep);
}

.log-entry span {
  color: var(--muted);
  font-size: 0.83rem;
}

.heat-cell {
  outline: 1px solid rgba(255, 255, 255, 0.88);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--apollo-deep);
  background: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: grid;
  min-height: 200px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fbfdff;
  font-weight: 800;
}

@media (max-height: 760px) and (min-width: 861px) {
  .login-screen {
    padding: 16px 24px;
  }

  .login-layout {
    min-height: calc(100vh - 32px);
  }

  .login-title-row {
    margin-bottom: 16px;
  }

  .login-title-row h1 {
    font-size: 1.86rem;
  }

  .login-title-row p {
    margin-top: 5px;
    font-size: 1rem;
  }

  .login-dashboard-preview {
    height: min(430px, calc(100vh - 126px));
  }

  .login-insight-mark {
    display: none;
  }

  .login-panel {
    padding: 20px 34px;
  }

  .login-card-mark {
    margin-bottom: 8px;
  }

  .login-shield.compact {
    width: 52px;
    height: 58px;
  }

  .login-logo {
    width: 126px;
    height: 44px;
  }

  .login-copy {
    margin-bottom: 12px;
  }

  .login-copy h2 {
    font-size: 1.58rem;
  }

  .login-copy p,
  .login-support,
  .support-message {
    font-size: 0.84rem;
  }

  .auth-field > span,
  .remember-row,
  .forgot-button {
    font-size: 0.84rem;
  }

  .auth-form input[type="text"],
  .auth-form input[type="password"] {
    font-size: 0.94rem;
  }

  .auth-form {
    gap: 8px;
  }

  .auth-form input[type="text"],
  .auth-form input[type="password"],
  .login-button,
  .link-button,
  .sso-button {
    min-height: 44px;
  }

  .login-divider {
    gap: 12px;
  }
}

@media (max-width: 1180px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }

  .login-panel {
    justify-self: center;
  }

  .login-hero {
    display: grid;
    justify-items: center;
  }

  .login-dashboard-preview {
    width: min(820px, 100%);
    transform: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .login-screen {
    padding: 20px;
  }

  .login-layout {
    min-height: calc(100vh - 40px);
  }

  .login-title-row {
    justify-content: center;
    text-align: left;
  }

  .login-title-row h1 {
    font-size: 1.7rem;
  }

  .login-title-row p {
    font-size: 1rem;
  }

  .login-dashboard-preview {
    grid-template-columns: 150px 1fr;
    min-height: 420px;
  }

  .preview-sidebar {
    padding: 20px 14px;
  }

  .preview-brand img {
    width: 108px;
  }

  .preview-main {
    padding: 18px;
  }

  .preview-kpis {
    grid-template-columns: 1fr;
  }

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

  .preview-chart.large,
  .preview-donut,
  .preview-bars,
  .preview-mini-donut {
    min-height: 130px;
    height: 130px;
  }

  .login-insight-mark {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .upload-strip {
    display: grid;
    justify-content: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions > *,
  .upload-strip > * {
    min-width: 0;
  }

  .nav-tabs,
  .filter-grid,
  .data-columns,
  .metric-row,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .panel.span-3,
  .panel.span-4,
  .panel.span-5,
  .panel.span-6,
  .panel.span-7,
  .panel.span-8,
  .panel.span-9,
  .panel.span-12 {
    grid-column: span 12;
  }

  .chart {
    min-height: 220px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 560px) {
  body.auth-required {
    overflow: hidden;
  }

  .login-screen {
    padding: 14px;
  }

  .login-layout {
    display: block;
    min-height: calc(100vh - 28px);
  }

  .login-hero {
    display: none;
  }

  .login-panel {
    min-height: calc(100vh - 28px);
    padding: 28px 20px;
    border-radius: 18px;
  }

  .login-copy h2 {
    font-size: 1.6rem;
  }

  .auth-options {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .sidebar {
    padding: 16px 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 88px;
    height: 44px;
  }

  .topbar h2 {
    font-size: 1.18rem;
  }

  .topbar-actions,
  .upload-strip {
    gap: 10px;
  }

  .action-button,
  .file-drop,
  .compact-select,
  .role-select {
    width: 100%;
  }

  .panel {
    padding: 14px;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .sidebar,
  .upload-strip,
  .topbar-actions,
  .toast {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .main {
    padding: 0;
  }

  .topbar,
  .panel,
  .kpi-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
