/* ════════════════════════════════════════
   MEDICARE ADMIN — admin.css
════════════════════════════════════════ */

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

:root {
  --teal:        #0a9396;
  --teal-dark:   #007f82;
  --teal-light:  #94d2bd;
  --accent:      #e9d8a6;
  --bg:          #070d14;
  --bg2:         #0d1520;
  --bg3:         #111e2d;
  --card-bg:     rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --text:        #e8edf2;
  --muted:       rgba(255,255,255,0.42);
  --error:       #e05252;
  --success:     #2dbd88;
  --sidebar-w:   260px;
  --topbar-h:    68px;
  --font-display:'Cormorant Garamond', Georgia, serif;
  --font-body:   'DM Sans', sans-serif;
}

html, body { height: 100%; font-family: var(--font-body); color: var(--text); }

/* ── Background ── */
.admin-body { display: flex; min-height: 100vh; position: relative; background: var(--bg); overflow-x: hidden; }

.admin-bg {
  position: fixed; inset: 0; z-index: 0;
  background: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=1800&q=80') center/cover no-repeat;
  opacity: 0.04;
}
.admin-bg-overlay {
  position: fixed; inset: 0; z-index: 1;
  background: linear-gradient(135deg, #040810 0%, #0a1628 50%, #060d1a 100%);
  opacity: 0.97;
}
.admin-grid-lines {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background-image:
    linear-gradient(rgba(10,147,150,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,147,150,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ══ SIDEBAR ═══════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: rgba(8,16,28,0.96);
  border-right: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  z-index: 200;
  display: flex; flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.22,0.61,0.36,1);
}

/* Brand */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 6px 18px rgba(10,147,150,0.4);
  flex-shrink: 0;
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600; color: #fff; display: block;
}
.sidebar-brand-sub {
  font-size: 10.5px; font-weight: 600;
  color: var(--teal-light); text-transform: uppercase;
  letter-spacing: 1px; display: block;
}

/* Nav */
.sidebar-nav {
  flex: 1; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 8px 10px 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 11px;
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.55);
  transition: background 0.22s, color 0.22s, transform 0.22s;
  cursor: pointer; border: none; background: none;
  position: relative; overflow: hidden;
}
.sidebar-link::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px;
  background: var(--teal-light); opacity: 0;
  transition: opacity 0.22s;
}
.sidebar-link i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff; transform: translateX(3px);
}
.sidebar-link.active {
  background: rgba(10,147,150,0.14);
  color: var(--teal-light);
  border: 1px solid rgba(10,147,150,0.2);
}
.sidebar-link.active::before { opacity: 1; }
.sidebar-link.logout-link { color: rgba(224,82,82,0.7); margin-top: 4px; }
.sidebar-link.logout-link:hover { background: rgba(224,82,82,0.1); color: #ff9a9a; }

/* Admin info */
.sidebar-admin-info {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.sidebar-admin-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(10,147,150,0.15);
  border: 1px solid rgba(10,147,150,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-light); font-size: 16px; flex-shrink: 0;
}
.sidebar-admin-name { font-size: 13.5px; font-weight: 600; color: #fff; }
.sidebar-admin-email { font-size: 11px; color: var(--muted); }

/* ══ MAIN ══════════════════════════════ */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  flex: 1;
  transition: margin-left 0.35s cubic-bezier(0.22,0.61,0.36,1);
}

/* ── Topbar ── */
.admin-topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: rgba(8,16,28,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }
.topbar-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; color: #fff;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-date { font-size: 13px; color: var(--muted); }
.topbar-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  background: rgba(10,147,150,0.12);
  border: 1px solid rgba(10,147,150,0.25);
  border-radius: 50px; font-size: 12.5px; font-weight: 600;
  color: var(--teal-light); letter-spacing: 0.3px;
}

/* ── Sections ── */
.admin-section { display: none; padding: 32px; flex-direction: column; gap: 28px; animation: fadeInUp 0.4s ease both; }
.admin-section.active { display: flex; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header { margin-bottom: 4px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px); font-weight: 300; color: #fff;
  letter-spacing: -0.3px; margin-bottom: 6px;
}
.section-header h2 em { font-style: italic; color: var(--teal-light); }
.section-header p { font-size: 14px; color: var(--muted); }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat-card {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  position: relative; overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.5s ease both;
  animation-delay: var(--i, 0s);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.stat-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.14); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.stat-card:hover::before { opacity: 1; }
.stat-card-icon {
  width: 50px; height: 50px; border-radius: 14px;
  background: rgba(var(--accent, 10,147,150), 0.12);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--accent, var(--teal-light));
  flex-shrink: 0;
  background: rgba(10,147,150,0.12);
}
.stat-card-info { flex: 1; }
.stat-card-num {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 600; color: #fff; line-height: 1; display: block;
}
.stat-card-label { font-size: 11.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; }
.stat-card-trend { color: var(--teal-light); font-size: 16px; opacity: 0.6; }

/* ── Admin Cards ── */
.admin-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  transition: border-color 0.3s;
  animation: fadeInUp 0.5s ease both;
}
.admin-card:hover { border-color: rgba(255,255,255,0.12); }

.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-card-header h3 {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600; color: #fff;
}
.admin-card-header h3 i { color: var(--teal-light); font-size: 14px; }
.card-badge {
  padding: 4px 12px; border-radius: 50px;
  background: rgba(10,147,150,0.12);
  border: 1px solid rgba(10,147,150,0.2);
  font-size: 12px; font-weight: 600; color: var(--teal-light);
  font-family: var(--font-body);
}

.admin-card-body { padding: 24px 26px; }

/* ── Forms ── */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
.af-group { display: flex; flex-direction: column; gap: 7px; }
.af-group.full-width { grid-column: 1 / -1; }
.af-group label {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.af-input-wrap { position: relative; display: flex; align-items: center; }
.af-icon {
  position: absolute; left: 14px;
  color: var(--teal-light); font-size: 13px; pointer-events: none; opacity: 0.7;
}
.af-input-wrap input,
.af-input-wrap select {
  width: 100%; padding: 12px 14px 12px 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-family: var(--font-body); font-size: 13.5px; color: #fff;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.af-input-wrap select option { background: #0d1520; }
.af-input-wrap input::placeholder { color: rgba(255,255,255,0.25); }
.af-input-wrap input:focus,
.af-input-wrap select:focus {
  border-color: var(--teal-light);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(148,210,189,0.12);
}

/* ── Buttons ── */
.admin-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: transform 0.22s, box-shadow 0.22s, background 0.22s;
  letter-spacing: 0.2px;
}
.admin-btn:hover { transform: translateY(-2px); }
.admin-btn:active { transform: translateY(0); }
.admin-btn.primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; box-shadow: 0 4px 16px rgba(10,147,150,0.35);
}
.admin-btn.primary:hover { box-shadow: 0 8px 24px rgba(10,147,150,0.5); }
.admin-btn.ghost {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13); color: rgba(255,255,255,0.75);
}
.admin-btn.ghost:hover { background: rgba(255,255,255,0.13); color: #fff; }
.admin-btn.danger {
  background: rgba(224,82,82,0.12);
  border: 1px solid rgba(224,82,82,0.3); color: #ff9a9a;
}
.admin-btn.danger:hover { background: rgba(224,82,82,0.22); color: #fff; }
.admin-btn.danger-sm {
  background: rgba(224,82,82,0.1);
  border: 1px solid rgba(224,82,82,0.25);
  color: #ff9a9a; padding: 8px 16px; font-size: 12.5px;
}
.admin-btn.edit-sm {
  background: rgba(10,147,150,0.1);
  border: 1px solid rgba(10,147,150,0.25);
  color: var(--teal-light); padding: 7px 14px; font-size: 12px;
}

/* ── Doctor Row ── */
.doctor-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
  animation: fadeInUp 0.4s ease both;
  animation-delay: var(--delay, 0s);
}
.doctor-row:last-child { border-bottom: none; }
.doctor-row:hover { background: rgba(255,255,255,0.02); border-radius: 10px; padding-left: 10px; }
.doctor-avatar-sm {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(10,147,150,0.12);
  border: 1px solid rgba(10,147,150,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-light); font-size: 18px; flex-shrink: 0;
}
.doctor-row-info { flex: 1; }
.doctor-row-name { font-size: 14.5px; font-weight: 600; color: #fff; }
.doctor-row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.doctor-row-spec {
  padding: 3px 10px; border-radius: 50px;
  background: rgba(148,210,189,0.1);
  border: 1px solid rgba(148,210,189,0.18);
  font-size: 11px; font-weight: 600; color: var(--teal-light);
  white-space: nowrap;
}
.doctor-row-actions { display: flex; gap: 8px; }

/* ── Booking Row ── */
.booking-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: fadeInUp 0.4s ease both;
  animation-delay: var(--delay, 0s);
}
.booking-row:last-child { border-bottom: none; }
.booking-num {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--muted);
  flex-shrink: 0;
}
.booking-row-info { flex: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.booking-field { display: flex; flex-direction: column; gap: 2px; }
.booking-field-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.7px; }
.booking-field-value { font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.8); }
.booking-field-value.spec { color: var(--teal-light); }

/* ── Empty & Danger ── */
.empty-msg { font-size: 14px; color: var(--muted); text-align: center; padding: 24px 0; }
.danger-card { border-color: rgba(224,82,82,0.15); }
.danger-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 20px;
}
.danger-row:last-child { border-bottom: none; }
.danger-row strong { font-size: 14px; color: #fff; display: block; margin-bottom: 4px; }
.danger-row p { font-size: 12.5px; color: var(--muted); }

/* ── Settings ── */
.settings-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.settings-info-item {
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.settings-info-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 6px; }
.settings-info-value { font-size: 14.5px; font-weight: 500; color: #fff; }

/* ── Modal ── */
.admin-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,5,12,0.8);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.admin-modal-overlay.show { opacity: 1; pointer-events: all; }
.admin-modal {
  background: rgba(10,18,30,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px; width: 580px; max-width: 95vw;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
.admin-modal-overlay.show .admin-modal { transform: translateY(0) scale(1); }
.admin-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.admin-modal-header h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600; color: #fff;
}
.admin-modal-header h3 i { color: var(--teal-light); }
.modal-close {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.13); color: #fff; }
.admin-modal-body { padding: 24px 28px; }
.admin-modal-footer {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 18px 28px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── Toast ── */
.admin-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(45,189,136,0.95);
  color: #fff; padding: 13px 26px; border-radius: 13px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  z-index: 999; opacity: 0; pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  white-space: nowrap;
}
.admin-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.admin-toast.error-toast { background: rgba(224,82,82,0.95); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-section { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .booking-row-info { grid-template-columns: 1fr 1fr; }
  .admin-topbar { padding: 0 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .doctor-row-spec { display: none; }
}
