:root {
  --navy-950: #0b0b0d;
  --navy-900: #151310;
  --navy-800: #2a2418;
  --blue-100: #eadfca;
  --blue-50: #fff8ea;
  --gold-600: #ad761d;
  --gold-500: #efbd45;
  --teal-600: #2f6f5e;
  --teal-100: #e6f4ec;
  --ink: #1d1912;
  --muted: #736955;
  --line: #e2d2ad;
  --surface: #fffdf7;
  --soft: #fff8ec;
  --danger: #c24135;
  --shadow: 0 24px 70px rgba(11, 11, 13, 0.18);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(239, 189, 69, 0.22), transparent 30rem),
    linear-gradient(135deg, #111113 0%, #1d1810 34%, #f6efe0 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 31rem) minmax(22rem, 1fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: center;
  min-height: 100vh;
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
}

.login-panel,
.glass-card,
.panel-card {
  border: 1px solid rgba(226, 210, 173, 0.92);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.login-panel {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.brand-row,
.sidebar-brand,
.list-row,
.receipt-row,
.payment-summary,
.table-actions {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 1rem;
  margin-bottom: 2rem;
}

.school-logo {
  width: 5.25rem;
  height: 5.25rem;
  flex: 0 0 auto;
  object-fit: contain;
  padding: 0.28rem;
  background: var(--navy-950);
  border-radius: 8px;
  border: 1px solid rgba(239, 189, 69, 0.55);
}

.eyebrow,
.panel-label {
  margin: 0 0 0.35rem;
  color: var(--gold-600);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy-900);
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 24rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

h3 {
  font-size: 1.05rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

label {
  color: var(--navy-900);
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  padding: 0.78rem 0.9rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 4px rgba(239, 189, 69, 0.2);
}

.form-error {
  min-height: 1.25rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
}

.notice-text,
.success-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 750;
}

.notice-text {
  color: #6d4a0f;
  background: #fff7e8;
  border: 1px solid #efd59f;
}

.success-banner {
  color: var(--teal-600);
  background: var(--teal-100);
  border: 1px solid rgba(21, 123, 115, 0.18);
}

.primary-button,
.ghost-button,
.secondary-button,
.nav-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  color: var(--navy-950);
  background: linear-gradient(135deg, #f7d772, var(--gold-500) 58%, #b87d20);
  box-shadow: 0 14px 28px rgba(173, 118, 29, 0.28);
  padding: 0.78rem 1rem;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ffe18a, #efbd45 58%, #9f6918);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.secondary-button {
  color: #fff;
  background: var(--navy-900);
  padding: 0.72rem 0.95rem;
}

.ghost-button,
.nav-button {
  color: var(--navy-900);
  background: var(--surface);
  border-color: var(--line);
  padding: 0.7rem 0.9rem;
}

.ghost-button:hover,
.nav-button:hover,
.secondary-button:hover {
  border-color: rgba(239, 189, 69, 0.62);
  box-shadow: 0 10px 24px rgba(11, 11, 13, 0.12);
}

.full-width {
  width: 100%;
}

.demo-strip {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.status-panel {
  display: grid;
  place-items: center;
}

.glass-card {
  width: min(100%, 32rem);
  min-height: 23rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  color: #fff;
  border: 1px solid rgba(239, 189, 69, 0.24);
  background:
    radial-gradient(circle at 82% 20%, rgba(239, 189, 69, 0.26), transparent 14rem),
    linear-gradient(135deg, #0b0b0d 0%, #17130d 52%, #33240e 100%);
  overflow: hidden;
  position: relative;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 1.1rem;
  background: url("assets/lion-logo.png") right 0 top 0.15rem / 14.5rem auto no-repeat;
  opacity: 0.32;
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 100%;
  height: 0.45rem;
  background: linear-gradient(90deg, transparent, rgba(239, 189, 69, 0.9));
}

.glass-card .panel-label,
.glass-card strong,
.glass-card span {
  position: relative;
  z-index: 1;
}

.glass-card .panel-label {
  color: var(--gold-500);
}

.glass-card > strong {
  display: block;
  max-width: 16rem;
  margin-top: 0.5rem;
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
  line-height: 1.05;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 8rem;
  position: relative;
  z-index: 1;
}

.metric-grid div {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(239, 189, 69, 0.24);
  background: rgba(255, 253, 247, 0.09);
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}

.metric-grid span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
}

.metric-grid strong {
  display: block;
  margin-top: 0.35rem;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 1.1rem;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(239, 189, 69, 0.16), transparent 14rem),
    var(--navy-950);
}

.sidebar-brand {
  gap: 0.8rem;
  padding: 0.7rem;
  margin-bottom: 1.3rem;
}

.sidebar-logo {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
  padding: 0.25rem;
  background: #0f1115;
  border: 1px solid rgba(239, 189, 69, 0.62);
  border-radius: 8px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
}

.section-nav {
  display: grid;
  gap: 0.45rem;
}

.nav-button {
  justify-content: flex-start;
  width: 100%;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border-color: transparent;
}

.nav-button.is-active,
.nav-button:hover {
  color: var(--gold-500);
  background: rgba(239, 189, 69, 0.1);
  border-color: rgba(239, 189, 69, 0.2);
  box-shadow: none;
}

.workspace {
  min-width: 0;
  padding: clamp(1rem, 3vw, 2rem);
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.workspace-header h2 {
  color: #fff;
}

.muted-text {
  color: var(--muted);
  margin: 0.45rem 0 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card,
.panel-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.stat-card {
  min-height: 8rem;
  padding: 1rem;
  box-shadow: 0 14px 36px rgba(11, 11, 13, 0.08);
}

.stat-card span,
.list-meta,
.table-caption,
.empty-state,
.receipt-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.65rem;
  color: var(--navy-900);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.stat-card small {
  display: block;
  margin-top: 0.7rem;
  color: var(--teal-600);
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: 1rem;
  align-items: start;
}

.span-all {
  grid-column: 1 / -1;
}

.panel-card {
  padding: 1rem;
  box-shadow: 0 12px 34px rgba(11, 11, 13, 0.07);
}

.panel-card > header,
.subtle-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stack {
  display: grid;
  gap: 0.8rem;
}

.list-row {
  gap: 1rem;
  justify-content: space-between;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.list-main {
  min-width: 0;
}

.list-main strong,
.list-main span {
  display: block;
}

.list-main strong {
  color: var(--navy-900);
}

.list-meta {
  margin-top: 0.35rem;
}

.amount-text {
  color: var(--navy-900);
  font-size: 1.1rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.25rem 0.55rem;
  color: var(--teal-600);
  background: var(--teal-100);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

.badge.gold {
  color: #6f4b12;
  background: #f9eacb;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
}

.inline-pay-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}

.inline-pay-form input {
  width: auto;
  min-width: 13rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.analysis-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.analysis-card.compact {
  gap: 0.7rem;
}

.analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.analysis-head > strong {
  color: var(--navy-900);
  font-size: 1.4rem;
}

.progress-track {
  width: 100%;
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-100);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-500));
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.metric-row span {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-row strong {
  color: var(--navy-900);
  font-size: 0.95rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 42rem;
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  color: var(--navy-900);
  background: var(--blue-50);
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--blue-50);
}

.receipt-row {
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.receipt-row strong,
.receipt-row span {
  display: block;
}

.receipt-row strong {
  color: var(--navy-900);
  text-align: right;
}

@media (max-width: 980px) {
  .login-layout,
  .dashboard-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .status-panel {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
  }

  .section-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-content: center;
    overflow-x: auto;
  }

  .nav-button {
    white-space: nowrap;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-grid,
  .metric-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-layout {
    width: min(100% - 1rem, 31rem);
    padding: 0.5rem 0;
  }

  .brand-row,
  .workspace-header,
  .panel-card > header,
  .list-row,
  .receipt-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .school-logo {
    width: 4rem;
    height: 4rem;
  }

  .overview-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    justify-content: flex-start;
    width: 100%;
  }

  .action-row > *,
  .inline-pay-form,
  .inline-pay-form input,
  .workspace-header .ghost-button,
  .secondary-button {
    width: 100%;
  }

  .receipt-row strong {
    text-align: left;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }
}
