:root {
  --rose-50: #fff5f7;
  --rose-100: #ffe4ec;
  --rose-400: #f472b6;
  --rose-500: #ec4899;
  --blush: #fdf2f8;
  --cream: #fffbfa;
  --text: #4a3f47;
  --text-dark: #2d2430;
  --sidebar: #2d2430;
  --white: #fff;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --radius: 16px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 8px 32px rgba(236,72,153,0.08);
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--rose-100), transparent),
    var(--cream);
}

.login-card {
  width: min(400px, 100%);
  padding: 2.5rem;
  border-radius: 24px;
}

.login-brand { text-align: center; margin-bottom: 2rem; }
.admin-logo {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  border: 1px solid rgba(201, 168, 124, 0.45);
}
.login-brand h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-dark);
  margin: 0.5rem 0;
}
.login-brand p { font-size: 0.9rem; color: var(--text); }

.back-link {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--rose-500);
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--rose-100);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.form-error { color: #dc2626; font-size: 0.85rem; min-height: 1.2em; margin-bottom: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
  color: var(--white);
}
.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--rose-100);
  color: var(--text-dark);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-success { background: #d1fae5; color: #047857; }

/* Admin layout */
.admin-app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
}
.sidebar-brand span { color: var(--rose-400); }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover,
.nav-item.active {
  background: rgba(236,72,153,0.2);
  color: var(--white);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
}
.btn-logout {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: var(--white);
  cursor: pointer;
  font-family: inherit;
}

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-x: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.admin-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-dark);
}

.panel { display: none; }
.panel.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}
.stat-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--rose-100);
}
.stat-card .value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--rose-500);
  line-height: 1;
}
.stat-card .label {
  font-size: 0.8rem;
  color: var(--text);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--rose-100);
  overflow-x: auto;
}

.booking-table-tools {
  min-width: 1080px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--rose-100);
}

.booking-table-tools strong {
  display: block;
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.booking-table-tools span {
  color: var(--text);
  font-size: 0.85rem;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.data-table th {
  text-align: left;
  padding: 1rem;
  background: var(--rose-50);
  color: var(--rose-500);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data-table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--rose-50);
  vertical-align: middle;
}
table.data-table tr:hover td { background: var(--blush); }

.bookings-table {
  min-width: 1080px;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.table-sort.active {
  color: var(--text-dark);
}

.table-filter-row th {
  padding: 0.45rem 0.6rem !important;
  background: #fffafb !important;
  vertical-align: top;
}

.table-filter-row input,
.table-filter-row select {
  width: 100%;
  min-width: 92px;
  margin: 0.15rem 0;
  padding: 0.45rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-dark);
  background: var(--white);
  border: 1px solid var(--rose-100);
  border-radius: 8px;
}

.table-filter-row input:focus,
.table-filter-row select:focus {
  outline: none;
  border-color: var(--rose-400);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
}

.table-pagination {
  min-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-top: 1px solid var(--rose-100);
}

.table-pagination span {
  color: var(--text);
  font-size: 0.9rem;
}

.table-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #d1fae5; color: #047857; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }

.actions-cell { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.actions-cell select {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--rose-100);
  font-size: 0.75rem;
}

.panel-actions { margin-bottom: 1.25rem; }
.form-row-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.form-row-inline select {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--rose-100);
  min-width: 220px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45,36,48,0.4);
}
.modal-content {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  border-radius: 20px;
}
#bookingModal .modal-content {
  width: min(760px, 100%);
}
.modal-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
}
.modal-divider { border: none; border-top: 1px solid var(--rose-100); margin: 1rem 0; }
.modal-sub { font-size: 0.8rem; color: var(--rose-500); margin-bottom: 0.75rem; font-weight: 600; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

.bill-preview { width: min(480px, 100%); }
.bill-preview h3 { margin-bottom: 1rem; }
.bill-line { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.9rem; }
.bill-line.total { font-weight: 600; color: var(--rose-500); border-top: 2px solid var(--rose-100); margin-top: 0.5rem; padding-top: 0.75rem; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }

.booking-service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  max-height: 260px;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--rose-100);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.65);
}

.booking-service-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid var(--rose-100);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}

.booking-service-option input {
  width: auto;
  margin-top: 0.25rem;
}

.booking-service-option strong,
.booking-service-option small {
  display: block;
}

.booking-service-option small {
  color: var(--rose-500);
  font-weight: 600;
}

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text);
}

@media (max-width: 768px) {
  .admin-app { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-nav { display: flex; flex-wrap: wrap; padding: 0.5rem; }
  .nav-item { width: auto; padding: 0.5rem 1rem; font-size: 0.8rem; }
  .booking-service-list { grid-template-columns: 1fr; }
}
