:root {
  --bg: #f4efe4;
  --ink: #101820;
  --muted: #64707d;
  --panel: #fffaf0;
  --panel-strong: #ffffff;
  --line: #dfd3bd;
  --navy: #0b2f4f;
  --navy-soft: #153f62;
  --blue: #006bd6;
  --green: #0f9f6e;
  --gold: #f5b942;
  --red: #c94d42;
  --shadow: 0 24px 70px rgba(16, 24, 32, 0.12);
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(245, 185, 66, 0.22), transparent 28rem),
    radial-gradient(circle at 86% 12%, rgba(0, 107, 214, 0.16), transparent 30rem),
    linear-gradient(135deg, #f9f4e9 0%, var(--bg) 54%, #e8f1f4 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(20rem, 26rem);
  gap: 4rem;
  align-items: center;
  min-height: 100vh;
  padding: 7vw;
}

.brand-mark {
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border-radius: 1.35rem;
  background: linear-gradient(145deg, var(--navy), #091522);
  color: var(--gold);
  font-weight: 900;
  letter-spacing: -0.08em;
  box-shadow: var(--shadow);
}

.brand-mark.small {
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

h1 {
  max-width: 58rem;
  font-size: clamp(3rem, 8vw, 7rem);
}

h2 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
}

.lead {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.7;
}

.login-card,
.controls-card,
.kpi-card,
.chart-card,
.table-card,
.call-card,
.identity-card,
.admin-overview {
  border: 1px solid rgba(11, 47, 79, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card {
  display: grid;
  gap: 1.15rem;
  padding: 2rem;
  border-radius: 2rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 250, 240, 0.96);
  color: var(--ink);
  padding: 0.9rem 1rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 107, 214, 0.12);
}

.primary-action,
.secondary-action,
.ghost-button,
.identity-card button,
.inline-control button {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  font-weight: 900;
}

.primary-action {
  background: linear-gradient(135deg, var(--gold), #ffe779);
  color: #321700;
}

.primary-action.compact {
  padding-inline: 1.4rem;
}

.secondary-action,
.ghost-button,
.identity-card button,
.inline-control button {
  background: rgba(11, 47, 79, 0.08);
  color: var(--navy);
}

.form-note,
.muted {
  color: var(--muted);
}

.form-note {
  min-height: 1.3rem;
  margin: 0;
  line-height: 1.45;
}

.dashboard {
  display: grid;
  grid-template-columns: 18rem 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.35rem;
  background: #0a1d30;
  color: #f9f4e9;
}

.brand-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 3rem;
}

.brand-row span:not(.brand-mark),
.identity-card span {
  display: block;
  color: rgba(249, 244, 233, 0.65);
  font-size: 0.85rem;
}

.nav-stack {
  display: grid;
  gap: 0.45rem;
}

.nav-stack a {
  border-radius: 1rem;
  color: rgba(249, 244, 233, 0.78);
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.nav-stack a.active,
.nav-stack a:hover {
  background: rgba(245, 185, 66, 0.16);
  color: #ffffff;
}

.identity-card {
  display: grid;
  gap: 0.7rem;
  margin-top: auto;
  padding: 1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
}

.workspace {
  display: grid;
  gap: 1.4rem;
  align-content: start;
  padding: clamp(1rem, 3vw, 2.4rem);
}

.workspace-header,
.section-heading,
.header-actions,
.inline-control {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.controls-card {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 1.2fr) minmax(18rem, 1.4fr) minmax(12rem, 0.8fr);
  gap: 1rem;
  padding: 1rem;
  border-radius: 1.4rem;
}

.inline-control input {
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  border-radius: 1rem;
  background: rgba(11, 47, 79, 0.08);
  padding: 0.35rem;
}

.segmented button {
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--navy);
  padding: 0.65rem 0.75rem;
  font-weight: 800;
}

.segmented button.active {
  background: var(--panel-strong);
  box-shadow: 0 8px 20px rgba(16, 24, 32, 0.12);
}

.admin-overview,
.chart-card,
.table-card,
.call-card {
  padding: 1.25rem;
  border-radius: 1.6rem;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.operator-tile {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--panel);
  padding: 1rem;
  text-align: left;
}

.operator-tile strong,
.operator-tile span {
  display: block;
}

.operator-tile span {
  color: var(--muted);
  font-size: 0.85rem;
}

.operator-tile:hover {
  border-color: var(--blue);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(10rem, 1fr));
  gap: 1rem;
}

.kpi-card {
  display: grid;
  min-height: 9rem;
  gap: 0.6rem;
  align-content: start;
  padding: 1.15rem;
  border-radius: 1.4rem;
}

.kpi-card.featured {
  grid-column: span 2;
  background: linear-gradient(145deg, #09243c, var(--navy-soft));
  color: white;
}

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

.kpi-card.featured span,
.kpi-card.featured small {
  color: rgba(255, 255, 255, 0.75);
}

.kpi-card strong {
  font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.kpi-card small {
  color: var(--muted);
  line-height: 1.4;
}

.chart-card canvas {
  width: 100%;
  height: min(32vh, 26rem);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 0.75fr);
  gap: 1rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 58rem;
}

th,
td {
  border-bottom: 1px solid rgba(11, 47, 79, 0.1);
  padding: 0.8rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.numeric {
  text-align: right;
}

.event-pill {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(0, 107, 214, 0.1);
  color: var(--blue);
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 900;
}

.call-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.status-strip {
  border-left: 4px solid var(--green);
  border-radius: 1rem;
  background: rgba(15, 159, 110, 0.1);
  color: #07563d;
  padding: 0.9rem 1rem;
}

.status-strip.error {
  border-color: var(--red);
  background: rgba(201, 77, 66, 0.12);
  color: #8c271f;
}

@media (max-width: 1180px) {
  .dashboard,
  .split-section,
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

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

  .kpi-card.featured {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .workspace-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls-card,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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