/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --blue:        #1a56db;
  --blue-dark:   #1e40af;
  --blue-light:  #eff6ff;
  --green:       #059669;
  --green-light: #f0fdf4;
  --red:         #dc2626;
  --red-light:   #fef2f2;
  --yellow:      #d97706;
  --yellow-light:#fffbeb;
  --purple:      #7c3aed;
  --purple-light:#f5f3ff;
  --gray:        #6b7280;
  --gray-light:  #f9fafb;
  --border:      #e5e7eb;
  --text:        #111827;
  --text-muted:  #6b7280;
  --radius:      8px;
  --shadow:      0 1px 3px rgb(0 0 0 / 0.08);
  --shadow-md:   0 4px 12px rgb(0 0 0 / 0.10);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
       color: var(--text); line-height: 1.5; font-size: 15px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: 15px; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid transparent; font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary  { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-ghost    { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--gray-light); }
.btn-danger   { background: var(--red-light); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm       { padding: 5px 12px; font-size: 13px; }
.btn-full     { width: 100%; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error   { background: var(--red-light); color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-warning { background: var(--yellow-light); color: var(--yellow); border: 1px solid #fde68a; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px;
         font-size: 12px; font-weight: 600; }
.badge-blue   { background: var(--blue-light); color: var(--blue); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-gray   { background: #f3f4f6; color: var(--gray); }

/* ─── Auth page ──────────────────────────────────────────────── */
.auth-page { background: var(--gray-light); min-height: 100vh; display: flex;
             align-items: center; justify-content: center; }
.auth-container { width: 100%; max-width: 400px; padding: 16px; }
.auth-card { background: #fff; border-radius: 12px; padding: 40px;
             box-shadow: var(--shadow-md); }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 28px; }

/* ─── Forms ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; font-size: 14px; color: var(--text); }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text); transition: border-color 0.15s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(26 86 219 / 0.12);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 580px) { .field-row { grid-template-columns: 1fr; } }

.radio-group { display: flex; gap: 16px; padding: 9px 0; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer;
               font-weight: 400; }

/* ─── Admin layout ───────────────────────────────────────────── */
.admin-page { background: var(--gray-light); min-height: 100vh; }
.admin-header { background: #fff; border-bottom: 1px solid var(--border);
                position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px;
                height: 56px; display: flex; align-items: center; justify-content: space-between; }
.header-title { font-weight: 700; font-size: 17px; }
.header-nav   { display: flex; align-items: center; gap: 12px; }
.header-user  { font-size: 14px; color: var(--text-muted); }

.admin-main  { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between;
               margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; }

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrapper { background: #fff; border-radius: 10px; border: 1px solid var(--border);
                 overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600;
             text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
             border-bottom: 1px solid var(--border); background: var(--gray-light); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--gray-light); }
.customer-name { font-weight: 500; }
.customer-email { font-size: 13px; color: var(--text-muted); }
.booked-time { font-size: 13px; color: var(--green); font-weight: 500; }

/* ─── Form card ──────────────────────────────────────────────── */
.form-card { background: #fff; border-radius: 10px; border: 1px solid var(--border);
             box-shadow: var(--shadow); }
.form-section { padding: 28px 32px; border-bottom: 1px solid var(--border);
                display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.form-actions  { padding: 20px 32px; display: flex; justify-content: flex-end;
                 gap: 12px; background: var(--gray-light);
                 border-radius: 0 0 10px 10px; }
@media (max-width: 480px) {
  .form-section { padding: 20px 16px; }
  .form-actions { padding: 16px; flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 16px; color: var(--text-muted); }
.empty-state p { margin-bottom: 16px; }

/* ─── Booking page ───────────────────────────────────────────── */
.booking-page { background: var(--gray-light); min-height: 100vh; }
.booking-wrapper { max-width: 680px; margin: 0 auto; padding: 32px 16px 80px; }
.booking-header { margin-bottom: 32px; }
.booking-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.booking-meta { display: flex; flex-wrap: wrap; gap: 4px; color: var(--text-muted);
                font-size: 14px; margin-bottom: 8px; }
.meta-item { }
.meta-sep { color: var(--border); }
.booking-location { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.booking-notes { font-size: 14px; color: var(--text); background: #fff;
                 border: 1px solid var(--border); border-radius: var(--radius);
                 padding: 12px 16px; margin-top: 12px; }

.slots-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.day-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
             margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); }
.day-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between;
              padding: 16px 20px; background: #fff; border: none; font-weight: 500;
              font-size: 15px; transition: background 0.1s; }
.day-toggle:hover { background: var(--gray-light); }
.day-count { font-size: 13px; color: var(--text-muted); margin-left: auto; margin-right: 12px; }
.chevron { font-size: 12px; color: var(--text-muted); }

.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
             gap: 8px; padding: 12px 16px 16px; }
.time-btn { padding: 10px 8px; border: 1px solid var(--border); border-radius: var(--radius);
            background: #fff; color: var(--text); font-weight: 500; font-size: 14px;
            transition: background 0.1s, border-color 0.1s; }
.time-btn:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.time-btn.selected { background: var(--blue); border-color: var(--blue); color: #fff; }

.confirm-bar { position: fixed; bottom: 0; left: 0; right: 0;
               background: #fff; border-top: 1px solid var(--border);
               padding: 16px 24px; display: flex; align-items: center;
               justify-content: space-between; gap: 16px; box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08); }
.confirm-info { display: flex; flex-direction: column; }
.confirm-info strong { font-weight: 600; font-size: 15px; }
.confirm-info span   { font-size: 14px; color: var(--text-muted); }
@media (max-width: 480px) {
  .confirm-bar { flex-direction: column; align-items: stretch; }
  .confirm-bar .btn { width: 100%; justify-content: center; }
}

.no-slots { text-align: center; padding: 48px 16px; color: var(--text-muted); background: #fff;
            border-radius: var(--radius); border: 1px solid var(--border); }
.no-slots p { margin-bottom: 8px; }

/* ─── Confirmed / error card ─────────────────────────────────── */
.confirmed-card { background: #fff; border-radius: 12px; border: 1px solid var(--border);
                  padding: 48px 40px; text-align: center; box-shadow: var(--shadow-md); margin-top: 32px; }
.confirmed-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--green-light);
                  color: var(--green); font-size: 26px; font-weight: 700;
                  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.error-icon { background: var(--red-light); color: var(--red); }
.confirmed-card h1 { font-size: 22px; margin-bottom: 8px; }
.confirmed-sub { color: var(--text-muted); margin-bottom: 28px; }
.confirmed-details { background: var(--gray-light); border-radius: var(--radius);
                     padding: 16px; margin-bottom: 24px; text-align: left; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0;
              border-bottom: 1px solid var(--border); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 500; text-align: right; }
.confirmed-footer { color: var(--text-muted); font-size: 14px; }
@media (max-width: 480px) {
  .confirmed-card { padding: 32px 20px; }
  .booking-header h1 { font-size: 22px; }
}
