﻿/* ── BOOKING PAGE ── */
.book-hero {
  background: var(--cream);
  background-image:
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(201,79,20,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 5% 5%, rgba(201,79,20,0.04) 0%, transparent 55%);
  padding: 70px 10% 50px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.book-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(201,79,20,0.09) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none; opacity: 0.4;
}
.book-body { padding: 60px 10%; max-width: 1100px; }

/* Branch selector */
.branch-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}
.branch-btn {
  border: 2px solid var(--border);
  background: white;
  border-radius: 12px;
  padding: 24px 28px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: var(--sans);
}
.branch-btn:hover { border-color: var(--orange); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.branch-btn.selected { border-color: var(--orange); background: var(--orange-light); box-shadow: 0 0 0 3px rgba(201,79,20,0.12); }
.branch-btn-name { font-size: 17px; font-weight: 500; color: var(--charcoal); margin-bottom: 4px; font-family: var(--serif); }
.branch-btn-detail { font-size: 12px; color: var(--mid); letter-spacing: 0.04em; }
.branch-btn-hours { font-size: 11px; color: var(--orange); margin-top: 8px; font-weight: 500; letter-spacing: 0.05em; }

/* Step labels */
.book-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.book-step-num {
  width: 30px; height: 30px;
  background: var(--orange);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.book-step-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--orange); font-weight: 500;
}

/* Calendar */
.cal-wrap { background: white; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 48px; box-shadow: var(--shadow-soft); max-width: 480px; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: var(--charcoal);
  color: white;
}
.cal-month { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.cal-nav { background: none; border: 1px solid rgba(255,255,255,0.2); color: white; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 16px; transition: background 0.15s; display:flex;align-items:center;justify-content:center; }
.cal-nav:hover { background: rgba(255,255,255,0.12); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-dow { text-align: center; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--light); padding: 14px 0 10px; font-weight: 500; }
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; border-radius: 8px;
  margin: 2px; transition: all 0.15s; color: var(--charcoal);
  position: relative;
}
.cal-day:hover:not(.cal-empty):not(.cal-past):not(.cal-full) { background: var(--orange-light); color: var(--orange); }
.cal-day.cal-today { font-weight: 600; color: var(--orange); }
.cal-day.cal-today::after { content:''; position:absolute; bottom:4px; left:50%; transform:translateX(-50%); width:4px;height:4px;border-radius:50%;background:var(--orange); }
.cal-day.cal-selected { background: var(--orange) !important; color: white !important; font-weight: 600; box-shadow: 0 4px 12px rgba(201,79,20,0.35); }
.cal-day.cal-past { color: #ccc; cursor: default; }
.cal-day.cal-empty { cursor: default; }
.cal-day.cal-full { color: #ccc; cursor: default; text-decoration: line-through; }
.cal-day.cal-has-slots::before { content:''; position:absolute; top:4px; right:4px; width:5px;height:5px;border-radius:50%;background:var(--orange);opacity:0.5; }

/* Time slots */
.slots-wrap { margin-bottom: 48px; }
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 16px; }
.slot-btn {
  border: 1.5px solid var(--border); background: white; border-radius: 10px;
  padding: 12px 8px; text-align: center; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--charcoal);
  transition: all 0.15s;
}
.slot-btn:hover:not(.slot-booked) { border-color: var(--orange); color: var(--orange); background: var(--orange-light); transform: translateY(-1px); }
.slot-btn.slot-selected { border-color: var(--orange); background: var(--orange); color: white; font-weight: 500; box-shadow: 0 4px 12px rgba(201,79,20,0.3); }
.slot-btn.slot-booked { background: #f5f5f5; color: #bbb; cursor: not-allowed; border-color: #eee; text-decoration: line-through; }
.slot-doctor { font-size: 10px; margin-top: 3px; opacity: 0.7; }

/* Doctor badge on selected day */
.doctor-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 1px solid var(--border);
  border-radius: 100px; padding: 8px 16px 8px 10px;
  font-size: 13px; color: var(--charcoal);
  margin-bottom: 20px; box-shadow: var(--shadow-soft);
}
.doctor-badge-icon { width: 28px; height: 28px; background: var(--orange); border-radius: 50%; display:flex;align-items:center;justify-content:center; }

/* Booking form */
.book-form { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 36px; box-shadow: var(--shadow-soft); max-width: 520px; }
.book-form-title { font-family: var(--serif); font-size: 24px; font-weight: 400; margin-bottom: 24px; color: var(--charcoal); }
.book-confirm-card {
  background: var(--cream); border-radius: 10px; padding: 18px 20px;
  margin-bottom: 24px; border-left: 4px solid var(--orange);
  font-size: 13px; color: var(--mid); line-height: 1.8;
}
.book-confirm-card strong { color: var(--charcoal); display:block; font-size:15px; margin-bottom:4px; }

/* Success state */
.book-success {
  display: none; text-align: center; padding: 60px 40px;
  background: white; border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow-soft); max-width: 480px;
}
.book-success-icon { width: 64px; height: 64px; background: #e8f5e9; border-radius: 50%; display:flex;align-items:center;justify-content:center; margin: 0 auto 20px; font-size: 28px; }
.book-success h3 { font-family: var(--serif); font-size: 28px; font-weight: 400; margin-bottom: 12px; }
.book-success p { font-size: 14px; color: var(--mid); line-height: 1.8; }

/* ── ADMIN PAGE ── */
.admin-login {
  min-height: calc(100vh - 72px);
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  background-image: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(201,79,20,0.06) 0%, transparent 65%);
}
.admin-login-card {
  background: white; border-radius: 16px; padding: 48px 40px;
  box-shadow: var(--shadow-float); width: 100%; max-width: 400px;
  border: 1px solid var(--border);
}
.admin-login-icon { width: 56px; height: 56px; background: var(--charcoal); border-radius: 14px; display:flex;align-items:center;justify-content:center; margin: 0 auto 24px; }
.admin-login-title { font-family: var(--serif); font-size: 28px; font-weight: 400; text-align: center; margin-bottom: 8px; }
.admin-login-sub { font-size: 13px; color: var(--mid); text-align: center; margin-bottom: 32px; }
.admin-login-error { background: #fff0f0; border: 1px solid #ffcccc; color: #c00; font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; display:none; }

/* Admin dashboard */
.admin-dash { display: none; padding: 40px 5%; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 36px; flex-wrap: wrap; gap: 16px;
}
.admin-header h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.admin-tab {
  background: white; border: 1.5px solid var(--border); border-radius: 100px;
  padding: 9px 20px; font-family: var(--sans); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  transition: all 0.15s; color: var(--mid);
}
.admin-tab.active { background: var(--charcoal); color: white; border-color: var(--charcoal); }
.admin-tab:hover:not(.active) { border-color: var(--orange); color: var(--orange); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* Admin form card */
.admin-card {
  background: white; border: 1px solid var(--border); border-radius: 14px;
  padding: 32px; margin-bottom: 24px; box-shadow: var(--shadow-soft);
}
.admin-card-title { font-family: var(--serif); font-size: 22px; font-weight: 400; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form-group { display: flex; flex-direction: column; gap: 6px; }
.admin-form-group label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); font-weight: 500; }
.admin-form-group input, .admin-form-group select, .admin-form-group textarea {
  border: 1.5px solid var(--border); background: var(--cream); padding: 11px 14px;
  border-radius: 8px; font-family: var(--sans); font-size: 14px; color: var(--charcoal);
  outline: none; transition: all 0.2s;
}
.admin-form-group input:focus, .admin-form-group select:focus, .admin-form-group textarea:focus {
  border-color: var(--orange); background: white; box-shadow: 0 0 0 3px rgba(201,79,20,0.1);
}
.admin-form-full { grid-column: 1 / -1; }
.admin-btn {
  background: var(--charcoal); color: white; border: none;
  padding: 12px 28px; border-radius: 100px; font-family: var(--sans);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.admin-btn:hover { background: var(--orange); box-shadow: 0 4px 16px rgba(201,79,20,0.3); }
.admin-btn-danger { background: #c00; }
.admin-btn-danger:hover { background: #a00; box-shadow: none; }
.admin-btn-sm { padding: 7px 16px; font-size: 11px; }

/* Appointments table */
.appt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.appt-table th { text-align: left; padding: 10px 14px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mid); border-bottom: 2px solid var(--border); font-weight: 500; }
.appt-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); color: var(--charcoal); vertical-align: middle; }
.appt-table tr:last-child td { border-bottom: none; }
.appt-table tr:hover td { background: var(--cream); }
.appt-badge { display:inline-block; font-size:10px; letter-spacing:0.1em; text-transform:uppercase; padding:3px 10px; border-radius:100px; font-weight:500; }
.appt-badge-sheraton { background: #e8f0ff; color: #2255cc; }
.appt-badge-cave { background: var(--orange-light); color: var(--orange); }
.appt-empty { text-align: center; padding: 48px; color: var(--light); font-size: 14px; }

/* Doctor roster table */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.roster-card {
  background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px;
  display: flex; align-items: center; gap: 14px;
}
.roster-avatar { width: 44px; height: 44px; background: var(--charcoal); border-radius: 50%; display:flex;align-items:center;justify-content:center; color:white; font-family:var(--serif); font-size:16px; flex-shrink:0; }
.roster-name { font-size: 14px; font-weight: 500; color: var(--charcoal); }
.roster-date { font-size: 11px; color: var(--mid); margin-top: 2px; }
.roster-branch { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); margin-top: 4px; font-weight: 500; }

/* Admin logout */
.admin-logout { background: none; border: 1.5px solid rgba(20,20,20,0.2); color: var(--mid); padding: 8px 18px; border-radius: 100px; font-family: var(--sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.2s; }
.admin-logout:hover { border-color: #c00; color: #c00; }

/* ── ADMIN CALENDAR ── */
.cal-nav-btn {
  background: white; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 18px; font-family: var(--sans); font-size: 13px; cursor: pointer;
  transition: all 0.15s; color: var(--charcoal);
}
.cal-nav-btn:hover { border-color: var(--orange); color: var(--orange); }

.admin-cal-wrap {
  background: white; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-soft);
}
.admin-cal-dow-row {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--charcoal);
}
.admin-cal-dow-row > div {
  text-align: center; padding: 12px 0;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); font-weight: 500;
}
.admin-cal-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
}
.admin-cal-cell {
  min-height: 88px; border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light); padding: 8px;
  cursor: pointer; transition: background 0.12s; position: relative;
  vertical-align: top;
}
.admin-cal-cell:hover { background: #fdf6f1; }
.admin-cal-cell.today-cell { background: #fffbf5; }
.admin-cal-cell.selected-cell { background: #fff3ec !important; outline: 2px solid var(--orange); outline-offset: -2px; }
.admin-cal-cell.empty-cell { background: #fafafa; cursor: default; }
.admin-cal-cell.past-cell { opacity: 0.5; }

.admin-cal-daynum {
  font-size: 13px; font-weight: 500; color: var(--charcoal);
  margin-bottom: 5px; display: flex; align-items: center; gap: 5px;
}
.admin-cal-daynum.today-num { color: var(--orange); }
.today-dot { width: 6px; height: 6px; background: var(--orange); border-radius: 50%; display:inline-block; }

.appt-pip {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; padding: 2px 5px; border-radius: 4px;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; cursor: pointer;
}
.appt-pip-sheraton { background: #e8f0ff; color: #2255cc; }
.appt-pip-cave     { background: #faeee6; color: var(--orange); }
.appt-pip-more { font-size: 10px; color: var(--mid); margin-top: 2px; }

.doc-chip {
  position: absolute; bottom: 5px; right: 6px;
  font-size: 9px; background: var(--charcoal); color: rgba(255,255,255,0.8);
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em;
  max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Day detail list */
.day-appt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.day-appt-row:last-child { border-bottom: none; }
.day-appt-row:hover { background: var(--cream); }
.day-appt-time { font-weight: 600; font-size: 13px; min-width: 72px; color: var(--charcoal); }
.day-appt-name { flex: 1; font-size: 14px; color: var(--charcoal); }
.day-appt-reason { font-size: 12px; color: var(--mid); min-width: 140px; }

/* Status */
.status-sel {
  border: 1.5px solid var(--border); background: var(--cream); padding: 5px 8px;
  border-radius: 8px; font-family: var(--sans); font-size: 12px; outline: none; cursor: pointer;
}
.st-booked   { color: #2255cc; background: #e8f0ff; border-color: #c0d0f0; }
.st-arrived  { color: #b36a00; background: #fff8e1; border-color: #ffe082; }
.st-complete { color: #1a7a2e; background: #e8f5e9; border-color: #a5d6a7; }
.st-noshow   { color: #c00;    background: #fde8e8; border-color: #f5b0b0; }

/* Status badge (read-only) */
.status-badge { display:inline-block;font-size:10px;letter-spacing:0.1em;text-transform:uppercase;padding:3px 9px;border-radius:100px;font-weight:500; }
.sb-booked   { background:#e8f0ff;color:#2255cc; }
.sb-arrived  { background:#fff8e1;color:#b36a00; }
.sb-complete { background:#e8f5e9;color:#1a7a2e; }
.sb-noshow   { background:#fde8e8;color:#c00; }

/* Patient search results */
.pt-result-card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 12px; cursor: pointer; transition: all 0.15s;
}
.pt-result-card:hover { border-color: var(--orange); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.pt-result-name { font-size: 16px; font-weight: 500; color: var(--charcoal); }
.pt-result-sub  { font-size: 12px; color: var(--mid); margin-top: 3px; }
.pt-result-appts { margin-top: 10px; }
.pt-appt-row { display:flex;align-items:center;gap:10px;padding:7px 0;border-top:1px solid var(--border-light);font-size:13px; }

/* Patient cards */
.pt-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-soft);
}
.pt-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.pt-card-name  { font-size: 15px; font-weight: 500; color: var(--charcoal); margin-bottom: 3px; }
.pt-card-phone { font-size: 12px; color: var(--mid); margin-bottom: 8px; }
.pt-card-meta  { font-size: 11px; color: var(--mid); }
.pt-card-meta strong { color: var(--charcoal); }
.notes-dot { display:inline-block;width:6px;height:6px;background:var(--orange);border-radius:50%;margin-left:6px;vertical-align:middle; }

@media (max-width: 900px) {
  .admin-cal-cell { min-height: 60px; }
  .day-appt-reason { display: none; }
  #panel-add > div { grid-template-columns: 1fr !important; }
  #panel-add > div > div:last-child { position: static; }
}
@media (max-width: 640px) {
  .admin-cal-cell { min-height: 44px; padding: 4px; }
  .appt-pip { display: none; }
}

/* Responsive */
@media (max-width: 640px) {
  .branch-selector { grid-template-columns: 1fr; }
  .book-body { padding: 40px 5%; }
  .book-hero { padding: 52px 5% 40px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-dash { padding: 28px 5%; }
  .admin-card { padding: 22px 18px; }
  .book-form { padding: 24px 20px; }
  .cal-wrap { max-width: 100%; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .appt-table { font-size: 12px; }
  .appt-table th, .appt-table td { padding: 9px 8px; }
}
@media (max-width: 1024px) {
  .book-body { padding: 48px 6%; }
  .book-hero { padding: 60px 6% 44px; }
}