:root {
  --bg: #eff3fb;
  --panel: #ffffff;
  --panel-soft: #f7f9ff;
  --line: #e6ebf6;
  --text: #1b2340;
  --muted: #7080a6;
  --primary: #5f79ff;
  --primary-soft: rgba(95, 121, 255, 0.12);
  --pink: #ff7dae;
  --cyan: #48c6e8;
  --gold: #ffb347;
  --shadow: 0 18px 40px rgba(58, 77, 145, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "SF Pro Display", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(114, 140, 255, 0.12), transparent 25%),
    radial-gradient(circle at top right, rgba(255, 140, 190, 0.1), transparent 22%),
    var(--bg);
  color: var(--text);
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 22, 48, 0.48);
  backdrop-filter: blur(14px);
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(34, 49, 105, 0.18);
}

.auth-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  margin-top: 24px;
}

.auth-error {
  min-height: 22px;
  color: #dd4d74;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

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

.admin-shell {
  display: grid;
  grid-template-columns: 284px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 20px;
  background: linear-gradient(180deg, #18203c 0%, #212b50 100%);
  color: #ffffff;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #d7ddff 100%);
  color: #566ee9;
  font-size: 24px;
  font-weight: 800;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.66);
}

.nav-list {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.nav-item {
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  text-align: left;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: 28px;
  padding: 20px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
}

.footer-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 800;
}

.footer-meta {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.68);
}

.main-content {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.page-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 8px 0 0;
  font-size: 34px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-chip {
  height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.search-box input {
  width: 220px;
  border: 0;
  outline: none;
  background: transparent;
}

.primary-button,
.ghost-button,
.tiny-button,
.filter-chip,
.text-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #6c84ff 0%, #5b72f0 100%);
  box-shadow: 0 14px 28px rgba(95, 121, 255, 0.26);
}

.ghost-button {
  height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  color: var(--primary);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.text-button {
  background: transparent;
  color: var(--primary);
}

.view {
  display: none;
  margin-top: 24px;
}

.view.active {
  display: block;
}

.dashboard-hero {
  margin-bottom: 24px;
}

.dashboard-periods {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.quick-action-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfcff 0%, #f3f6ff 100%);
  text-align: left;
  box-shadow: var(--shadow);
}

.quick-action-card strong,
.quick-action-card span {
  display: block;
}

.quick-action-card strong {
  font-size: 16px;
  color: var(--text);
}

.quick-action-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 22px 20px;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.accent-blue {
  background: linear-gradient(135deg, rgba(95, 121, 255, 0.14), rgba(95, 121, 255, 0.03)), var(--panel);
}

.accent-pink {
  background: linear-gradient(135deg, rgba(255, 125, 174, 0.14), rgba(255, 125, 174, 0.03)), var(--panel);
}

.accent-cyan {
  background: linear-gradient(135deg, rgba(72, 198, 232, 0.14), rgba(72, 198, 232, 0.03)), var(--panel);
}

.accent-gold {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.16), rgba(255, 179, 71, 0.04)), var(--panel);
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
}

.stat-value {
  margin-top: 12px;
  font-size: 36px;
  font-weight: 800;
}

.stat-meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.panel-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.panel {
  padding: 22px;
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 22px;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge.success {
  color: #1b8e68;
  background: rgba(46, 199, 137, 0.14);
}

.insight-list,
.todo-list,
.schedule-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.warning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.warning-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-soft);
}

.warning-card strong {
  display: block;
  font-size: 16px;
}

.warning-card p {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.warning-card.danger {
  background: rgba(255, 110, 138, 0.08);
}

.warning-card.warning {
  background: rgba(255, 179, 71, 0.12);
}

.warning-card.info {
  background: rgba(72, 198, 232, 0.1);
}

.insight-item,
.todo-item,
.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--panel-soft);
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.insight-time {
  min-width: 52px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.insight-content,
.todo-item p,
.schedule-item p {
  color: var(--muted);
  line-height: 1.6;
}

.todo-item strong,
.schedule-item strong {
  display: block;
  margin-bottom: 6px;
}

.todo-item.urgent {
  box-shadow: inset 0 0 0 1px rgba(255, 125, 174, 0.26);
}

.tiny-button,
.filter-chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
}

.danger-button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #d24979;
  background: rgba(255, 125, 174, 0.14);
  cursor: pointer;
}

.tiny-button.is-offline {
  color: #8b96ba;
  background: rgba(139, 150, 186, 0.16);
}

.filter-chip.active {
  color: #ffffff;
  background: var(--primary);
}

.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.order-search {
  width: 220px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fbff;
  outline: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
}

.data-table th,
.data-table td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(95, 121, 255, 0.04);
}

.status {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.success {
  color: #149164;
  background: rgba(46, 199, 137, 0.14);
}

.status.warning {
  color: #cc7d10;
  background: rgba(255, 179, 71, 0.18);
}

.status.danger {
  color: #d24979;
  background: rgba(255, 125, 174, 0.18);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.pricing-card {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 100%);
  box-shadow: inset 0 0 0 1px rgba(95, 121, 255, 0.08);
}

.pricing-badge {
  display: inline-flex;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  align-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.pricing-cat {
  display: inline-flex;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  align-items: center;
  background: #fef3c7;
  color: #d97706;
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
}

.pricing-card h3 {
  margin: 16px 0 8px;
  font-size: 24px;
}

.pricing-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--muted);
}

.pricing-row strong {
  font-size: 26px;
  color: var(--text);
}

.pricing-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 46, 0.46);
  backdrop-filter: blur(6px);
}

.modal-shell {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 60px rgba(24, 35, 74, 0.24);
}

.modal-wide {
  width: min(920px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.modal-head h3 {
  margin: 0;
  font-size: 26px;
}

.modal-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.icon-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 24px;
}

.modal-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.modal-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.modal-form input,
.modal-form textarea,
.modal-form select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #f9fbff;
  color: var(--text);
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel-soft);
  color: var(--muted);
}

.detail-row strong {
  text-align: right;
  color: var(--text);
}

.customer-profile {
  margin-top: 24px;
}

.customer-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(95, 121, 255, 0.12), rgba(95, 121, 255, 0.03));
}

.customer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6c84ff 0%, #5b72f0 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.customer-name {
  font-size: 24px;
  font-weight: 800;
}

.customer-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.customer-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.customer-section {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-soft);
}

.customer-section h4 {
  margin: 0 0 14px;
  font-size: 16px;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

.customer-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.checkin-stats-table {
  margin-top: 12px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-date {
  font-size: 15px;
  color: #333;
}
.stat-count {
  font-size: 15px;
  color: #5f79ff;
  font-weight: 600;
}
.today-row .stat-date,
.today-row .stat-count {
  font-weight: 700;
  color: #5f79ff;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-stack label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.form-stack input {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbff;
}

.full-width {
  width: 100%;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

.storefront-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.storefront-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--panel-soft);
}
.storefront-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.storefront-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
}
.storefront-delete:hover {
  background: rgba(220, 38, 38, 0.85);
}
.storefront-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 32px 0;
  text-align: center;
}

/* Weekly schedule */
.week-schedule {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.day-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.day-row:last-child {
  border-bottom: none;
}
.day-label {
  flex-shrink: 0;
  width: 72px;
  text-align: center;
  padding-top: 4px;
}
.day-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.day-count {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.day-courses {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.day-course-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel-soft);
  border-radius: 10px;
}
.day-course-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.course-time {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  white-space: nowrap;
}
.course-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.course-meta {
  font-size: 12px;
  color: var(--muted);
}
.day-course-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.day-course-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}
.add-course-btn {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px dashed var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.add-course-btn:hover {
  background: var(--primary-soft);
}

@media (max-width: 760px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input {
    width: 100%;
  }

  .order-search {
    width: 100%;
  }

  .nav-list,
  .stats-grid,
  .card-grid,
  .two-columns,
  .stats-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-periods,
  .quick-action-grid,
  .warning-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-periods {
    display: grid;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .customer-grid,
  .customer-sections {
    grid-template-columns: 1fr;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }
}
