:root {
  --bg: #f4f1eb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-ink: #19323b;
  --muted: #55707a;
  --line: rgba(25, 50, 59, 0.1);
  --primary: #ec7c35;
  --primary-deep: #b45316;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --danger: #c44536;
  --shadow: 0 24px 60px rgba(24, 47, 56, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--surface-ink);
  background:
    radial-gradient(circle at top left, rgba(236, 124, 53, 0.24), transparent 32%),
    radial-gradient(circle at right 20%, rgba(15, 118, 110, 0.18), transparent 26%),
    linear-gradient(180deg, #f8f6f2 0%, #eef3f2 100%);
  font-family: "Segoe UI Variable Text", "Aptos", "Trebuchet MS", sans-serif;
  position: relative;
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.background-glow {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}

.glow-left {
  top: -6rem;
  left: -5rem;
  background: rgba(234, 135, 56, 0.36);
}

.glow-right {
  right: -7rem;
  bottom: -3rem;
  background: rgba(42, 130, 108, 0.24);
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 24px auto 40px;
  position: relative;
  z-index: 1;
}

.auth-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 20px;
  position: relative;
  z-index: 1;
}

.hero,
.tab-bar,
.card,
.panel {
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: stretch;
  padding: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 247, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.eyebrow,
.section-label {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin: 0 0 10px;
}

.hero h1,
.panel-head h2,
.card-head h3 {
  font-family: "Aptos Display", "Segoe UI Variable Display", "Bahnschrift", sans-serif;
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  max-width: 14ch;
  letter-spacing: -0.04em;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.hero-panel,
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
}

.hero-panel {
  border-radius: var(--radius-xl);
  padding: 20px;
  display: grid;
  gap: 16px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 248, 0.84));
}

.auth-hero,
.auth-card {
  min-height: 100%;
}

.auth-hero {
  display: grid;
  align-content: center;
  gap: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 248, 0.86));
}

.auth-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 42ch;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

.auth-tab-bar {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 251, 245, 0.88);
  border: 1px solid var(--line);
}

.auth-tab-bar.login-only {
  padding: 0;
  background: transparent;
  border: 0;
}

.auth-tab {
  cursor: pointer;
  border: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.active {
  background: linear-gradient(135deg, #1a8f84, #0f766e);
  color: #fffaf5;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

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

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

.auth-helper {
  margin-bottom: 0;
}

.field,
.compact-field {
  display: grid;
  gap: 8px;
}

.field span,
.compact-field span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(95, 67, 49, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.84);
  padding: 13px 14px;
  color: var(--surface-ink);
  outline: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(196, 94, 34, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 94, 34, 0.12);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.save-status,
.auth-status,
.status-pill,
.mini-note,
.chip,
.summary-pill {
  border-radius: 999px;
}

.save-status,
.auth-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  width: fit-content;
}

.save-status::before,
.auth-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.save-status.error::before,
.auth-status.error::before {
  background: var(--danger);
}

.save-status.pending::before,
.auth-status.pending::before {
  background: var(--primary);
}

.tab-bar {
  margin-top: 18px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 251, 245, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.tab-button,
.ghost-button,
.primary-button,
.table-button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tab-button {
  padding: 12px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.active {
  background: linear-gradient(135deg, #1a8f84, #0f766e);
  color: #fffaf5;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

.tab-button:hover,
.ghost-button:hover,
.primary-button:hover,
.table-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none !important;
}

main {
  margin-top: 18px;
}

.panel {
  display: none;
  border-radius: 32px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
  animation: fade-in 0.28s ease;
}

.panel-head,
.card-head,
.spread-head,
.inline-actions,
.filters-row {
  display: flex;
  gap: 12px;
}

.panel-head,
.spread-head {
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.inline-actions,
.filters-row {
  align-items: center;
  flex-wrap: wrap;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(25, 50, 59, 0.08);
}

.session-copy {
  display: grid;
  gap: 4px;
}

.session-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.session-copy span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-button,
.primary-button,
.table-button {
  padding: 11px 16px;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.9);
  color: var(--surface-ink);
  border: 1px solid rgba(94, 67, 48, 0.12);
}

.primary-button {
  background: linear-gradient(135deg, #ec7c35, #d8611b);
  color: white;
  box-shadow: 0 12px 20px rgba(216, 97, 27, 0.22);
}

.table-button {
  background: rgba(31, 107, 88, 0.1);
  color: var(--accent);
  padding-inline: 13px;
}

.table-button.warn {
  background: rgba(196, 94, 34, 0.12);
  color: var(--primary-deep);
}

.table-button.danger {
  background: rgba(177, 68, 45, 0.12);
  color: var(--danger);
}

.stats-grid,
.split-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 247, 0.82));
  border: 1px solid rgba(25, 50, 59, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 10px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.card {
  border-radius: var(--radius-xl);
  padding: 20px;
}

.card-head {
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-head h3 {
  font-size: 1.28rem;
  line-height: 1.15;
}

.mini-note {
  display: inline-flex;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(91, 66, 50, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead th {
  position: sticky;
  top: 0;
  background: #eef4f3;
  z-index: 1;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(93, 64, 46, 0.1);
  font-size: 0.95rem;
}

tbody tr:hover {
  background: rgba(255, 251, 245, 0.78);
}

.helper-text {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.helper-text code {
  background: rgba(255, 255, 255, 0.82);
  padding: 2px 6px;
  border-radius: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--surface-ink);
  font-weight: 700;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.compact-field {
  min-width: 160px;
}

.chip,
.status-pill,
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}

.chip.rmt,
.summary-pill.rmt,
.status-pill.present {
  background: rgba(31, 107, 88, 0.12);
  color: var(--accent);
}

.chip.non-rmt,
.summary-pill.total {
  background: rgba(94, 67, 48, 0.1);
  color: var(--muted);
}

.status-pill.pending,
.summary-pill.pending {
  background: rgba(25, 50, 59, 0.1);
  color: var(--surface-ink);
}

.status-pill.absent,
.summary-pill.absent {
  background: rgba(177, 68, 45, 0.12);
  color: var(--danger);
}

.summary-pill.meal {
  background: rgba(196, 94, 34, 0.12);
  color: var(--primary-deep);
}

.toggle-group {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: rgba(95, 67, 49, 0.08);
}

.toggle-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.toggle-button.active {
  background: white;
  color: var(--surface-ink);
  box-shadow: 0 6px 14px rgba(54, 35, 23, 0.1);
}

.toggle-button.active.present {
  color: var(--accent);
}

.toggle-button.active.pending {
  color: var(--surface-ink);
}

.toggle-button.active.absent {
  color: var(--danger);
}

.meal-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meal-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.meal-cell {
  min-width: 168px;
  white-space: nowrap;
}

.report-month-field {
  min-width: 180px;
}

.empty-state {
  padding: 22px 18px;
  color: var(--muted);
  text-align: center;
}

.absent-list,
.report-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.absent-card {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(177, 68, 45, 0.08);
  color: var(--danger);
  min-width: 160px;
}

.absent-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.steps-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .auth-shell,
  .hero,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero {
    padding: 18px;
  }

  .page-shell,
  .auth-shell {
    width: min(100% - 20px, 1200px);
  }
}

@media (max-width: 720px) {
  .hero h1 {
    max-width: none;
    font-size: 2.2rem;
  }

  .auth-tab-bar {
    width: 100%;
    justify-content: space-between;
  }

  .auth-tab {
    flex: 1 1 calc(50% - 10px);
  }

  .tab-bar {
    width: 100%;
    justify-content: space-between;
  }

  .tab-button {
    flex: 1 1 calc(50% - 10px);
  }

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

  .compact-field {
    min-width: 100%;
  }

  .filters-row {
    width: 100%;
  }

  .session-bar {
    align-items: start;
  }
}
