:root {
  color-scheme: light;
  --bg: #eef4ff;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #64748b;
  --line: #dbe4f0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --orange: #f97316;
  --shadow: 0 20px 50px rgba(30, 64, 175, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem),
    linear-gradient(135deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  margin-bottom: 24px;
}

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

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  letter-spacing: -0.06em;
}

.hero p:last-child {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.card,
.status-card,
.report-card,
.summary-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
}

.controls > * {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
select,
button {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font: inherit;
}

input,
select {
  min-width: 0;
  background: #f8fafc;
  color: var(--ink);
  padding: 0 14px;
}

input[type="date"] {
  max-width: 100%;
  min-width: 0;
  height: 46px;
  line-height: 46px;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
  border: 0;
  color: white;
  font-weight: 800;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  padding: 0 20px;
}

.account-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-button {
  width: auto;
  min-width: 132px;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0 16px;
}

.account-button.active {
  color: white;
  background: linear-gradient(135deg, var(--green), #15803d);
  border-color: transparent;
}

.status-card {
  margin-top: 18px;
  padding: 16px 18px;
  color: #0f172a;
}

.status-card.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.date-banner {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: white;
  box-shadow: var(--shadow);
}

.date-banner span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.82;
}

.date-banner strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.date-banner em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-weight: 700;
  opacity: 0.9;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.summary-card {
  height: 100%;
  padding: 24px;
}

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

.summary-card span {
  color: var(--muted);
  font-weight: 700;
}

.summary-card .location-name {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

.summary-card .location-name.texas {
  background: linear-gradient(135deg, #f97316, #c2410c);
}

.summary-card .location-name.books {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.day-change {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.day-change.positive {
  background: #dcfce7;
  color: #15803d;
}

.day-change.negative {
  background: #fee2e2;
  color: #b91c1c;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(3rem, 6vw, 4.4rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.comparison-block {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.summary-card .comparison-label {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 900;
}

.comparison.positive {
  background: #dcfce7;
  color: #15803d;
}

.comparison.negative {
  background: #fee2e2;
  color: #b91c1c;
}

.summary-card .comparison-note {
  display: block;
  color: #475569;
  font-size: 0.88rem;
}

.summary-card .comparison-exclusion {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 900;
}

.report-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 22px;
  margin-top: 22px;
  align-items: stretch;
}

.report-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.report-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #1e293b;
}

.metric-cell {
  font-size: 1.08rem;
  font-weight: 800;
}

td strong,
td span {
  display: block;
}

td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breakdown {
  font-size: 0.82rem;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

.empty {
  padding: 22px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .controls {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 16px;
  }

  .controls > div,
  .controls .primary {
    width: 100%;
  }

  .controls input,
  .controls button {
    width: 100%;
    max-width: none;
  }

  .controls input[type="date"] {
    display: block;
    inline-size: 100%;
    height: 54px;
    line-height: 54px;
    text-align: center;
  }

  .summary-card strong {
    font-size: clamp(2.8rem, 13vw, 4rem);
  }
}
