/* ============================================
   BRIGHTSMILE DENTAL CLINIC - Main Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary:      #1a6fa8;
  --primary-dark: #134f7a;
  --primary-light:#e8f4fd;
  --accent:       #28b4a0;
  --accent-light: #e6f7f5;
  --danger:       #e74c3c;
  --warning:      #f39c12;
  --success:      #27ae60;
  --info:         #2980b9;
  --dark:         #1a2332;
  --gray:         #6b7280;
  --gray-light:   #f1f5f9;
  --white:        #ffffff;
  --border:       #e2e8f0;
  --shadow:       0 4px 24px rgba(26,111,168,0.10);
  --shadow-lg:    0 8px 40px rgba(26,111,168,0.16);
  --radius:       14px;
  --radius-sm:    8px;
  --font-display: 'Playfair Display', serif;
  --font-body:    'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--gray-light);
  color: var(--dark);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   LOGO SVG
   ============================================ */
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 44px; height: 44px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text .brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--primary); letter-spacing: -0.5px; }
.logo-text .tagline { font-size: 0.68rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f3460 0%, #1a6fa8 45%, #28b4a0 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative; overflow: hidden;
}
.auth-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  width: 100%; max-width: 440px;
  padding: 48px 44px;
  position: relative; z-index: 1;
  animation: slideUp 0.5s ease;
}
.auth-card.wide { max-width: 520px; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-wrap { justify-content: center; }
.auth-title { font-family: var(--font-display); font-size: 1.6rem; color: var(--dark); margin: 16px 0 4px; text-align: center; }
.auth-sub   { color: var(--gray); font-size: 0.9rem; text-align: center; margin-bottom: 28px; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray); width: 18px; height: 18px;
}
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%; padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.9rem; color: var(--dark);
  background: var(--white); transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,111,168,0.1);
}
.input-wrap textarea { padding-top: 12px; resize: vertical; min-height: 80px; }
.input-wrap.no-icon input,
.input-wrap.no-icon select,
.input-wrap.no-icon textarea { padding-left: 14px; }

select { appearance: none; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); border: none;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,111,168,0.35); text-decoration: none; color: white; }
.btn-accent  { background: var(--accent); color: white; }
.btn-accent:hover { background: #22998a; transform: translateY(-1px); text-decoration: none; color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; text-decoration: none; color: white; }
.btn-ghost   { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); background: var(--primary-light); text-decoration: none; }
.btn-sm      { padding: 7px 16px; font-size: 0.82rem; }
.btn-block   { width: 100%; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; text-decoration: none; color: white; }

/* ============================================
   ALERTS / FLASH
   ============================================ */
.alert {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--info); }

/* ============================================
   LAYOUT - SIDEBAR + MAIN
   ============================================ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
}
.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header .logo-text .brand { color: white; }
.sidebar-header .logo-text .tagline { color: var(--accent); }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: rgba(255,255,255,0.35);
  padding: 8px 8px 6px; margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65); font-size: 0.9rem; font-weight: 500;
  transition: all 0.18s; margin-bottom: 2px; cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; text-decoration: none; }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 2px 12px rgba(26,111,168,0.4); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.user-details .name  { color: white; font-size: 0.88rem; font-weight: 600; }
.user-details .role  { color: rgba(255,255,255,0.45); font-size: 0.75rem; text-transform: capitalize; }

.main-content { margin-left: 260px; flex: 1; display: flex; flex-direction: column; }

.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--dark); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 32px; flex: 1; }

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: white; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 26px; height: 26px; }
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: #d4edda; color: var(--success); }
.stat-icon.yellow { background: #fff3cd; color: var(--warning); }
.stat-icon.teal   { background: var(--accent-light); color: var(--accent); }
.stat-icon.red    { background: #f8d7da; color: var(--danger); }
.stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--dark); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--gray); font-weight: 500; margin-top: 2px; }

/* ============================================
   CARDS & TABLES
   ============================================ */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: var(--font-display); font-size: 1.1rem; color: var(--dark); }
.card-body { padding: 24px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-light); padding: 12px 16px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--gray); text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-light); }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; text-transform: capitalize;
}
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-confirmed { background: var(--primary-light); color: var(--primary); }
.badge-completed { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: white; border-radius: var(--radius); width: 100%; max-width: 520px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3); animation: slideUp 0.3s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--dark); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray); padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--gray-light); color: var(--dark); }
.modal-body   { padding: 24px 28px; }
.modal-footer { padding: 16px 28px 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* ============================================
   APPOINTMENT CARDS (Patient view)
   ============================================ */
.appt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.appt-card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border-left: 4px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.appt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.appt-card.pending   { border-color: var(--warning); }
.appt-card.confirmed { border-color: var(--primary); }
.appt-card.completed { border-color: var(--success); }
.appt-card.cancelled { border-color: var(--danger); opacity: 0.7; }
.appt-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.appt-service { font-weight: 700; font-size: 0.95rem; color: var(--dark); }
.appt-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.appt-meta-item { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--gray); }
.appt-meta-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.appt-price { font-size: 1rem; font-weight: 700; color: var(--primary); }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 7px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  background: white; font-size: 0.82rem; font-weight: 600; color: var(--gray);
  cursor: pointer; transition: all 0.18s; text-decoration: none;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--primary); background: var(--primary); color: white;
  text-decoration: none;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center; padding: 60px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state svg { width: 56px; height: 56px; color: var(--border); }
.empty-state h3 { font-family: var(--font-display); color: var(--dark); }
.empty-state p  { color: var(--gray); font-size: 0.9rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
  .auth-card { padding: 32px 24px; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 12px; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.85rem; }
.text-gray { color: var(--gray); }
.text-primary { color: var(--primary); }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
