:root {
  --primary: #1c1c1e;
  --accent: #d4a853;
  --accent-hover: #b8922f;
  --success: #34c759;
  --danger: #ff3b30;
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #6c6c70;
  --border: #e5e5ea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.25rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

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

.admin-header h1 { font-size: 1.1rem; font-weight: 700; }

.signout-btn {
  background: transparent;
  border: 1.5px solid rgba(255,59,48,0.5);
  color: rgba(255,59,48,0.9);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.signout-btn:hover { background: rgba(255,59,48,0.1); }

.admin-header-right { display: flex; align-items: center; gap: 0.7rem; }

.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  opacity: 0.55;
  flex-shrink: 0;
}
.notif-bell:hover { background: rgba(255,255,255,0.1); opacity: 1; }
.notif-bell.has-notif { opacity: 1; }
.notif-bell.ringing { animation: bellRing 0.5s ease; }

.notif-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

@keyframes bellRing {
  0%,100% { transform: rotate(0); }
  15%      { transform: rotate(18deg); }
  35%      { transform: rotate(-16deg); }
  55%      { transform: rotate(12deg); }
  75%      { transform: rotate(-8deg); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.header-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text { text-align: left; }
.header h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.3px; }
.header .subtitle { font-size: 0.78rem; opacity: 0.65; margin-top: 2px; }

/* ---- Layout ---- */
.container { max-width: 480px; margin: 0 auto; padding: 1rem; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

/* ---- Day grid (landing page) ---- */
.day-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.day-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem 0.9rem;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: var(--text);
  display: block;
  border: 2px solid transparent;
}

.day-card:hover:not(.day-card--closed):not(.day-card--full) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.day-card__name { font-size: 0.82rem; color: var(--text-secondary); text-transform: capitalize; }
.day-card__date { font-size: 1.6rem; font-weight: 700; margin: 0.2rem 0; }
.day-card__month { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.65rem; }

.day-card__status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  display: inline-block;
}

.day-card--available .day-card__status { background: rgba(52,199,89,.12); color: var(--success); }
.day-card--full .day-card__status { background: rgba(255,59,48,.1); color: var(--danger); }
.day-card--closed { opacity: 0.45; cursor: not-allowed; }
.day-card--closed .day-card__status { background: rgba(108,108,112,.1); color: var(--text-secondary); }

.day-card--today .day-card__name { color: var(--accent); font-weight: 700; }

/* ---- Slot grid ---- */
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }

.slot-btn {
  padding: 0.7rem 0.4rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.slot-btn:hover { border-color: var(--accent); color: var(--accent); }
.slot-btn.selected { background: var(--accent); border-color: var(--accent); color: white; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: white;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus { outline: none; border-color: var(--accent); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover { background: #333; }
.btn-accent { background: var(--accent); color: white; width: 100%; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); width: 100%; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-warning {
  background: transparent;
  color: #ff9500;
  border: 1.5px solid #ff9500;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-warning:hover { background: #ff9500; color: white; }

.appointment-item.no-show .appointment-time { color: #ff9500; }
.appointment-item.no-show .appointment-name { color: var(--text-secondary); }

.btn-success-sm {
  background: transparent;
  color: var(--success);
  border: 1.5px solid var(--success);
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-success-sm:hover { background: var(--success); color: white; }

/* ---- Admin Nav ---- */
.admin-nav {
  background: var(--primary);
  display: flex;
}

.admin-nav a {
  flex: 1;
  text-align: center;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 0.85rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-bottom: 2.5px solid transparent;
  transition: all 0.15s;
}
.admin-nav a:hover,
.admin-nav a.active { color: white; border-bottom-color: var(--accent); }

/* ---- Appointment list ---- */
.appointment-item {
  display: flex;
  align-items: flex-start;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.appointment-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.appointment-item:last-child { border-bottom: none; }

.appointment-time { font-weight: 700; font-size: 0.95rem; min-width: 45px; color: var(--accent); }
.appointment-info { flex: 1; min-width: 0; }
.appointment-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appointment-phone { font-size: 0.78rem; color: var(--text-secondary); margin-top: 1px; }
.appointment-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.appointment-item.cancelled .appointment-name { text-decoration: line-through; color: var(--text-secondary); }
.appointment-item.completed .appointment-time { color: var(--success); }

/* ---- Schedule form ---- */
.schedule-row {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 44px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.schedule-row:last-child { border-bottom: none; }
.schedule-row.inactive { opacity: 0.45; }

.day-label { font-weight: 600; font-size: 0.85rem; }

.time-input {
  padding: 0.45rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  width: 100%;
  font-family: inherit;
}
.time-input:focus { outline: none; border-color: var(--accent); }
.time-input:disabled { opacity: 0.4; }

/* ---- Toggle ---- */
.toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.25s;
}
.toggle-slider::before {
  position: absolute;
  content: '';
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
}
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---- Reschedule ---- */
.reschedule-panel {
  background: rgba(212,168,83,.05);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
  animation: slideDown 0.2s ease;
}

.reschedule-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.btn-reschedule {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-reschedule:hover { background: var(--accent); color: white; }

/* ---- Booking form panel ---- */
.booking-form-panel {
  background: rgba(212,168,83,0.06);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  border: 2px solid var(--accent);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.booking-form-panel h3 { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.75rem; }

/* ---- Selected slot info ---- */
.selected-slot-info {
  background: rgba(212,168,83,.1);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---- Section header ---- */
.section-header { padding: 0.75rem 0 0.5rem; }
.section-header h2 { font-size: 1rem; font-weight: 700; }
.section-header p { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ---- Alerts ---- */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 1rem; }
.alert-success { background: rgba(52,199,89,.1); color: #1a7a34; border: 1px solid rgba(52,199,89,.3); }
.alert-error { background: rgba(255,59,48,.1); color: #b02020; border: 1px solid rgba(255,59,48,.3); }

/* ---- Confirmation ---- */
.confirmation-icon { font-size: 3.5rem; text-align: center; margin: 1rem 0; }

.confirmation-detail {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.confirmation-detail:last-child { border-bottom: none; }
.confirmation-detail .lbl { color: var(--text-secondary); min-width: 80px; font-size: 0.8rem; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-secondary); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.88rem; }

/* ---- Back link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.4px; }

/* ---- Loading ---- */
.loading { text-align: center; padding: 2rem; color: var(--text-secondary); font-size: 0.88rem; }
.loading::after { content: ''; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin-left: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Login page ---- */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--primary); padding: 1rem; }
.login-card { background: white; border-radius: var(--radius); padding: 2rem 1.75rem; width: 100%; max-width: 360px; box-shadow: var(--shadow-md); }
.login-card h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.login-card .subtitle { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.5rem; }
.login-logo { text-align: center; font-size: 2.5rem; margin-bottom: 1.25rem; }

/* ---- Service cards (customer) ---- */
.section-block { margin-bottom: 1.25rem; }

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.service-card {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.service-card:hover { border-color: var(--accent); }

.service-card.selected {
  border-color: var(--accent);
  background: rgba(212,168,83,0.05);
}

.service-card__body { flex: 1; }
.service-card__name { font-weight: 600; font-size: 0.95rem; }
.service-card__meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.service-card__arrow { font-size: 1.3rem; color: var(--text-secondary); margin-left: 0.5rem; }

/* ---- Service badge on booking page ---- */
.service-badge {
  background: rgba(212,168,83,.12);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.4rem;
}
