:root {
  --bg: #09111f;
  --panel: rgba(9, 17, 31, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.88);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #f97316;
  --accent-2: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 22rem),
    radial-gradient(circle at right center, rgba(249, 115, 22, 0.16), transparent 24rem),
    linear-gradient(180deg, #040812, #0b1325 45%, #08101d);
  color: var(--text);
  min-height: 100vh;
}

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

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
}

.orb-a {
  width: 16rem;
  height: 16rem;
  top: 5rem;
  right: 10%;
  background: var(--accent);
}

.orb-b {
  width: 20rem;
  height: 20rem;
  left: 0;
  bottom: 10%;
  background: var(--accent-2);
}

.layout {
  width: 100%;
  max-width: 1760px;
  margin: 0;
  padding: 2rem 1.2rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.topbar {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.8rem;
  align-items: stretch;
}

.session-box {
  display: grid;
  align-content: center;
  gap: 0.2rem;
  min-width: 10rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 0.9rem 1rem;
}

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

.session-box strong {
  font-size: 1rem;
}

.logout-form,
.logout-form button {
  height: 100%;
}

.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f59e0b;
  font-size: 0.76rem;
  margin-bottom: 0.3rem;
}

.brand-lockup {
  display: grid;
  gap: 1rem;
  margin-top: 0.9rem;
}

.brand-mark {
  width: 25rem;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.28));
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  margin-top: 0.7rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.back-link:hover {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

h1, h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 48rem;
  color: var(--muted);
  font-size: 1rem;
}

.brand-banner {
  margin-top: 1rem;
  max-width: 48rem;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.18);
}

.brand-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  padding: 1rem;
  backdrop-filter: blur(20px);
}

.filters label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
button {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  padding: 0.9rem 1rem;
  font: inherit;
}

button {
  align-self: end;
  background: linear-gradient(135deg, var(--accent), #fb923c);
  color: #140b02;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button {
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
}

.cards,
.charts,
.tables {
  display: grid;
  gap: 1rem;
}

.cards {
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

.secondary-cards {
  grid-auto-columns: minmax(280px, 1fr);
}

.secondary-cards.single-special-card {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  overflow-x: visible;
}

.charts {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 1rem;
}

.charts.secondary {
  margin-top: 0;
}

.tables {
  grid-template-columns: 1fr 2fr;
  margin-bottom: 1rem;
}

.single-column {
  grid-template-columns: 1fr;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  padding: 1rem;
  overflow: hidden;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.28);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), transparent 30%);
  pointer-events: none;
}

.kpi-card {
  min-height: 8.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-label,
.panel-title span,
.kpi-note {
  color: var(--muted);
}

.kpi-value {
  font-size: 1.7rem;
  line-height: 1;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-panel {
  min-height: 22rem;
}

.chart-panel canvas {
  width: 100% !important;
  height: 18rem !important;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

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

th {
  color: #cbd5e1;
  font-weight: 500;
}

td {
  color: #e2e8f0;
}

tbody tr:hover {
  background: rgba(148, 163, 184, 0.07);
}

.wide {
  min-width: 0;
}

.full-span {
  width: 100%;
}

.compact-panel {
  max-width: 34rem;
}

.login-body {
  display: grid;
  place-items: center;
}

.login-shell {
  width: 100%;
  max-width: 34rem;
  padding: 2rem 1rem;
}

.login-card {
  padding: 2rem;
}

.login-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin-bottom: 0.8rem;
}

.login-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 1.4rem;
}

.login-logo {
  width: 25rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.24));
}

.login-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.login-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.login-error {
  min-height: 1.2rem;
  color: #fda4af;
  margin-top: 0.8rem;
}

@media (max-width: 1180px) {
  .tables,
  .charts,
  .hero {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .layout {
    padding: 1rem 0.8rem 3rem;
  }

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

  .brand-lockup {
    gap: 0.8rem;
  }

  .brand-mark {
    width: min(25rem, 100%);
  }

  .chart-panel {
    min-height: 18rem;
  }

  .chart-panel canvas {
    height: 14rem !important;
  }
}
