:root {
  --bg: #111317;
  --surface: #181b21;
  --surface-soft: #1f232b;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f6f8;
  --muted: #a7adb8;
  --yellow: #f4c430;
  --yellow-soft: #ffde69;
  --black: #090a0d;
  --white: #ffffff;
  --success: #16c47f;
  --danger: #ff6b6b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 24%),
    radial-gradient(circle at top, rgba(244, 196, 48, 0.12), transparent 28%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  display: block;
  max-width: 100%;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app--dashboard {
  display: block;
  padding: 1.25rem;
}

.dashboard-shell {
  width: min(100%, 1600px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.dashboard-sidebar,
.dashboard-content {
  min-width: 0;
}

.dashboard-sidebar {
  position: sticky;
  top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.dashboard-brand,
.sidebar-panel,
.dashboard-stat,
.booking-card--list-page {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.88), rgba(15, 23, 42, 0.82));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.36);
}

.dashboard-brand,
.sidebar-panel {
  padding: 1.1rem;
  border-radius: 22px;
}

.brand--sidebar {
  margin-bottom: 0;
}

.brand--sidebar h1 {
  font-size: 1.15rem;
}

.sidebar-panel__label,
.dashboard-subtitle {
  color: var(--muted);
}

.sidebar-panel__label {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 0.65rem;
}

.sidebar-nav__item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.sidebar-nav__item:hover {
  transform: translateY(-1px);
}

.sidebar-nav__item--active {
  color: var(--black);
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
}

.sidebar-nav__item--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.sidebar-mini-card {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-mini-card + .sidebar-mini-card {
  margin-top: 0.75rem;
}

.sidebar-mini-card span,
.dashboard-stat span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.sidebar-mini-card strong,
.dashboard-stat strong {
  font-size: 1.2rem;
  color: var(--white);
}

.stack {
  width: min(100%, 920px);
  display: grid;
  gap: 1rem;
}

.stack--single {
  width: min(100%, 640px);
}

.stack--wide {
  width: min(100%, 1280px);
}

.booking-card {
  width: 100%;
  padding: 1.25rem;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(24, 27, 33, 0.96), rgba(18, 20, 25, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.brand__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
}

.brand__icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--black);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
}

.intro,
.modal__text,
.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.intro {
  margin-bottom: 1rem;
}

.edit-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.edit-notice[hidden] {
  display: none;
}

.edit-notice span {
  color: var(--yellow-soft);
  font-weight: 700;
}

.price-box,
.summary-box,
.result-box,
.list-summary,
.student-item,
.empty-state,
.field input,
.field select {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.price-box,
.summary-box {
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.price-box span,
.summary-row span,
.result-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.price-box strong {
  font-size: 1.5rem;
  color: var(--yellow-soft);
}

.booking-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field--search {
  margin-bottom: 1rem;
}

.field--search-dashboard {
  flex: 1 1 420px;
  margin-bottom: 0;
}

.field span {
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 54px;
  padding: 0.95rem 1rem;
  color: var(--white);
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field select:focus {
  border-color: rgba(244, 196, 48, 0.45);
  box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.1);
}

.search-shell {
  position: relative;
}

.search-shell__icon {
  position: absolute;
  top: 50%;
  left: 0.95rem;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-shell__icon svg {
  width: 18px;
  height: 18px;
}

.search-shell input {
  padding-left: 2.8rem;
}

.summary-box {
  display: grid;
  gap: 0.75rem;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-row strong {
  font-size: 1rem;
}

.button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  color: var(--black);
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
  transition: transform var(--transition), opacity var(--transition);
}

.button,
.button:visited {
  text-decoration: none;
}

.button--small {
  min-height: 46px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.75;
  cursor: wait;
}

.button--secondary,
.button--ghost {
  color: var(--white);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dashboard-subtitle {
  margin: 0.5rem 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.dashboard-stat {
  padding: 1rem 1.05rem;
  border-radius: 18px;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.list-summary {
  border-radius: var(--radius-md);
  padding: 1rem;
  min-width: 220px;
}

.list-summary span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.list-summary strong {
  font-size: 1.4rem;
  color: var(--yellow-soft);
}

.student-list {
  display: grid;
  gap: 0;
}

.list-table {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.78), rgba(15, 23, 42, 0.68));
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}

.list-table__viewport {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
}

.list-table__header,
.student-row {
  display: grid;
  grid-template-columns: 0.45fr 1.6fr 1.35fr 1.1fr 0.95fr 0.95fr 1fr 1fr 1.4fr 1.5fr;
  gap: 0.9rem;
  align-items: center;
}

.list-table__header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.95rem 1rem;
  background: rgba(17, 24, 39, 0.94);
  color: #cbd5e1;
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.student-row {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition), transform var(--transition);
}

.student-row:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.student-row__cell {
  min-width: 0;
}

.student-row__index,
.student-row__money,
.student-row__price {
  font-weight: 700;
}

.student-row__student strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.98rem;
}

.student-row__phone,
.student-row__date {
  color: var(--muted);
  line-height: 1.5;
}

.student-row__student span,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ticket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.14));
  color: #c4e7ff;
  font-weight: 700;
  border: 1px solid rgba(96, 165, 250, 0.22);
}

.payment-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.payment-pill--paid {
  color: #86f2b9;
  background: rgba(22, 196, 127, 0.14);
}

.payment-pill--remaining {
  color: #ffd98a;
  background: rgba(244, 196, 48, 0.14);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge--full {
  color: #86f2b9;
  background: rgba(22, 196, 127, 0.14);
}

.status-badge--partial {
  color: #ffd98a;
  background: rgba(244, 196, 48, 0.14);
}

.student-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.student-actions .button {
  flex: 1 1 132px;
  min-height: 42px;
  padding-inline: 0.85rem;
}

.action-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-icon svg {
  width: 16px;
  height: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.pagination[hidden] {
  display: none;
}

.page-indicator {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.button--danger {
  color: var(--white);
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.empty-state {
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.button__spinner {
  width: 16px;
  height: 16px;
  display: none;
  border-radius: 50%;
  border: 2px solid rgba(9, 10, 13, 0.2);
  border-top-color: var(--black);
  animation: spin 0.8s linear infinite;
}

.button.is-loading .button__spinner {
  display: inline-block;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 40;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 11, 0.72);
}

.modal__dialog {
  position: relative;
  width: min(92vw, 500px);
  padding: 1.25rem;
  border-radius: 24px;
  background: #171a20;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.result-grid,
.modal__actions {
  display: grid;
  gap: 0.75rem;
}

.result-grid {
  grid-template-columns: 1fr;
  margin: 1rem 0;
}

.result-box {
  padding: 0.95rem;
  border-radius: var(--radius-md);
}

.result-box strong {
  font-size: 1.2rem;
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.7rem;
}

.toast {
  min-width: min(92vw, 320px);
  padding: 0.95rem 1rem;
  border-radius: 16px;
  color: var(--white);
  background: #181b21;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toast--success {
  border-color: rgba(22, 196, 127, 0.35);
}

.toast--error {
  border-color: rgba(255, 107, 107, 0.35);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 640px) {
  .booking-card,
  .modal__dialog {
    padding: 1.5rem;
  }

  .result-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal__actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .stack {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .stack--single {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .dashboard-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .list-table__header {
    display: none;
  }

  .list-table__viewport {
    max-height: none;
    overflow: visible;
  }

  .student-row {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    min-width: 100%;
    padding: 1rem;
  }

  .student-row__cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.25rem;
  }

  .student-row__cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .student-row__student {
    display: block;
  }

  .student-row__student::before {
    display: block;
    margin-bottom: 0.55rem;
  }

  .student-actions {
    justify-content: stretch;
  }

  .student-actions .button {
    flex: 1 1 0;
  }
}

@media (max-width: 640px) {
  .app--dashboard {
    padding: 0.8rem;
  }

  .dashboard-sidebar {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .list-toolbar,
  .stats-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .pagination {
    flex-direction: column;
  }

  .pagination .button {
    width: 100%;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .list-table__header,
  .student-row {
    min-width: 1260px;
  }
}
