@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f8;
  --text: #0f172a;
  --muted: #5b6478;
  --border: #e4e8f0;
  --primary: #3b63f7;
  --primary-dark: #2d4fe1;
  --success: #1f9d6a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-welcome {
  display: grid;
  gap: 6px;
}

.admin-grid {
  display: grid;
  gap: 20px;
}

.admin-section {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-section-title {
  font-size: 18px;
  font-weight: 700;
}

.admin-section-desc {
  font-size: 14px;
  color: var(--muted);
}

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

.admin-section-actions button,
.admin-table td button {
  padding: 8px 12px;
  font-size: 13px;
  min-width: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

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

.admin-table td button {
  margin-right: 6px;
}

.admin-table-actions {
  text-align: right;
  white-space: nowrap;
}

.admin-table td.admin-table-actions {
  text-align: right !important;
}

.admin-table-actions .admin-action-group {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
}

.admin-table-actions button:last-child {
  margin-right: 0;
}

.admin-btn-edit {
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 8px 18px rgba(59, 99, 247, 0.2);
}

.admin-btn-add {
  background: #22c55e !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.2);
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

.status-pill.active {
  background: rgba(34, 197, 94, 0.16);
  color: #16a34a;
}

.status-pill.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.import-modal {
  width: min(900px, 100%);
}

.user-picker-modal {
  width: min(720px, 100%);
}

.edit-user-modal {
  width: min(760px, 100%);
}

.report-modal {
  width: min(640px, 100%);
}

.user-search {
  margin: 12px 0 6px;
}

.user-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: var(--surface-alt);
}

.user-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-row-title {
  font-weight: 600;
}

.user-row-meta {
  font-size: 12px;
  color: var(--muted);
}

.modal-step {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.import-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.import-options {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.import-preview-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.import-preview-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.import-preview-header {
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-alt);
}
.import-preview-row.preview-new {
  background: rgba(34, 197, 94, 0.08);
}

.import-preview-row.preview-updated {
  background: rgba(245, 158, 11, 0.1);
}

.import-preview-row.preview-removed {
  background: rgba(239, 68, 68, 0.08);
}

.import-preview-row.preview-unchanged {
  background: rgba(91, 100, 120, 0.04);
}

.import-preview-row:last-child {
  border-bottom: none;
}

.import-effect {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.import-effect-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 99, 247, 0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

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

.form-field {
  display: grid;
  gap: 6px;
}

.form-row-inline {
  grid-template-columns: 220px 1fr;
  align-items: start;
}

.form-label-inline {
  justify-content: flex-start;
}

.form-input-inline {
  display: grid;
  gap: 8px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.form-help {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.form-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-alt);
}

.form-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.form-subfield {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.max-bookings-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}

.input-sm {
  max-width: 120px;
}

.radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.radio-item {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text);
}

.input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
}

.permissions-stack {
  display: grid;
  gap: 12px;
}

.multi-select {
  display: grid;
  gap: 10px;
}

.selector-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
}

.selected-empty {
  font-size: 13px;
  color: var(--muted);
}

.admin-btn-select {
  padding: 8px 12px;
  font-size: 13px;
}

.selector-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding-right: 6px;
}

.selector-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.header {
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  font-size: 20px;
}

.header-back {
  font-size: 16px;
  font-weight: 600;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  border: none;
  box-shadow: 0 8px 18px rgba(59, 99, 247, 0.25);
  border-radius: 12px;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f7cff, #7e88ff);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 15px;
}

.meta-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.ghost-button,
.primary-button,
.secondary-button {
  border-radius: 12px;
  padding: 12px 18px;
  border: 1px solid transparent;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: 0.15s ease;
  min-width: 120px;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 12px 22px rgba(59, 99, 247, 0.25);
}


.secondary-button {
  background: var(--surface);
  border: 1px solid var(--border);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--border);
}

.step-indicator {
  display: flex;
  gap: 16px;
  padding: 18px 24px;
  align-items: center;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.step.active {
  background: rgba(59, 99, 247, 0.14);
  color: var(--primary);
}

.step.complete {
  background: rgba(31, 157, 106, 0.16);
  color: var(--success);
}

.step-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
}

.screen-subtitle {
  color: var(--muted);
  font-size: 16px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.bookings-section {
  display: grid;
  gap: 16px;
}

.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.booking-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 12px;
  min-height: 110px;
}

.booking-card.clickable {
  cursor: pointer;
}

.booking-card-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.booking-card.available {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.booking-card.booked {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.booking-card.mine {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.16);
}

.booking-card-date {
  display: grid;
  gap: 6px;
  text-align: center;
}

.booking-date-day {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.booking-card-time {
  text-align: center;
}

.booking-card-time strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.booking-cancel-summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-alt);
  text-align: center;
}


.qr-section {
  display: grid;
  gap: 12px;
  align-items: start;
}

.qr-card {
  padding: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.qr-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.qr-display {
  padding: 16px;
  display: grid;
  gap: 12px;
  align-items: center;
  grid-template-columns: 84px 1fr;
}

.qr-box {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
}

.qr-box-large {
  width: 220px;
  height: 220px;
  border-radius: 20px;
  font-size: 18px;
  justify-self: center;
}

.service-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: 0.2s ease;
  min-height: 210px;
}



.service-title {
  font-weight: 700;
  font-size: 18px;
}

.service-meta {
  color: var(--muted);
  font-size: 14px;
}

.service-pill {
  align-self: flex-start;
  background: rgba(59, 99, 247, 0.1);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
}

.calendar {
  padding: 24px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-title {
  font-weight: 700;
  font-size: 20px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-weekday {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.weekday-sunday {
  color: #dc2626;
}

.day-card {
  border-radius: 14px;
  padding: 12px;
  min-height: 88px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: center;
}

.day-card strong {
  font-size: 18px;
  font-weight: 700;
}

.day-weekday {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: none;
}


.day-card.disabled {
  background: #f4f5f9;
  color: #9aa3b2;
  cursor: not-allowed;
}

.day-card.booked {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.day-card.mine {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.16);
}


.day-card.available {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.status-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dot-available {
  background: #22c55e;
}

.dot-booked {
  background: #ef4444;
}

.dot-mine {
  background: #fbbf24;
}

.dot-disabled {
  background: #9aa3b2;
}

.timeslot-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 12px;
}

.timeslot-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeslot-header {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.timeslot-button {
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: 0.15s ease;
  min-height: 68px;
}

.timeslot-button strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.timeslot-button span {
  font-size: 12px;
  color: var(--muted);
}


.timeslot-button.booked {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  cursor: not-allowed;
}

.timeslot-button.mine {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.22);
}

.timeslot-button.available {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.18);
}

.timeslot-button.disabled {
  background: #f4f5f9;
  color: #9aa3b2;
  cursor: not-allowed;
}


.booking-summary {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
}

.summary-label {
  color: var(--muted);
}

.footer-nav {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-left,
.footer-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.state-panel {
  background: var(--surface-alt);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
}

.week-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal {
  width: min(720px, 100%);
  padding: 28px;
  display: grid;
  gap: 20px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.empty-state,
.error-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: #f9f9fc;
}

.skeleton {
  background: linear-gradient(90deg, #f0f2f8 25%, #e4e8f0 37%, #f0f2f8 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 12px;
}

.skeleton-card {
  height: 180px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.skeleton-row {
  height: 14px;
  width: 100%;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 1100px) {
  .calendar-grid,
  .timeslot-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .calendar-weekdays {
    display: none;
  }

  .day-weekday {
    display: inline-block;
  }

  .timeslot-column {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
  }

  .timeslot-header {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 24px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-grid,
  .calendar-grid,
  .calendar-weekdays,
  .timeslot-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .admin-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

}

@media (max-width: 600px) {
  .app-shell {
    padding: 20px 16px 24px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .service-grid,
  .calendar-grid,
  .timeslot-grid {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays {
    display: none;
  }

  .day-weekday {
    display: inline-block;
  }

  .timeslot-column {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
  }

  .timeslot-header {
    text-align: left;
  }

  .footer-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: space-between;
  }


  .qr-display {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .qr-card {
    grid-template-columns: 1fr;
  }
}
