@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --primary: #6C3FEB;
  --primary-dark: #5530C9;
  --primary-light: #EDE9FF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --dark: #0F172A;
  --gray-900: #1E293B;
  --gray-700: #334155;
  --gray-500: #64748B;
  --gray-300: #CBD5E1;
  --gray-100: #F1F5F9;
  --white: #FFFFFF;
  --sidebar-w: 240px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── AUTH PAGES ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.auth-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .icon { font-size: 40px; margin-bottom: 8px; }
.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--dark); }
.auth-logo p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-300);
  border-radius: 8px; font-size: 14px; font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s; outline: none; background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,63,235,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--primary); color: white; width: 100%; padding: 12px; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-purple-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-purple-outline:hover { background: var(--primary); color: white; }

.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--gray-500); }
.auth-footer a { color: var(--primary); font-weight: 500; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: none; }
.alert-error { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }

/* ─── APP LAYOUT ─── */
.app-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); background: var(--dark); color: white;
  display: flex; flex-direction: column; position: fixed; height: 100vh;
  left: 0; top: 0; z-index: 100; transition: transform 0.3s;
}
.sidebar-header {
  padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo { font-size: 22px; }
.sidebar-title { font-size: 15px; font-weight: 700; color: white; }
.sidebar-subtitle { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: rgba(255,255,255,0.6); font-size: 13px;
  font-weight: 500; text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08);
}
.salon-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.salon-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 14px; color: white; flex-shrink: 0;
}
.salon-name { font-size: 13px; font-weight: 600; color: white; }
.salon-plan { font-size: 11px; color: rgba(255,255,255,0.4); }
.btn-logout {
  width: 100%; padding: 8px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.6);
  border-radius: 7px; cursor: pointer; font-size: 12px; font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #FCA5A5; }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--header-h); background: white; border-bottom: 1px solid var(--gray-300);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-left h2 { font-size: 18px; font-weight: 700; color: var(--dark); }
.topbar-left p { font-size: 12px; color: var(--gray-500); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.today-badge {
  background: var(--primary-light); color: var(--primary);
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.page-content { padding: 28px; flex: 1; }

/* ─── STAT CARDS ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-300);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.stat-icon.purple { background: var(--primary-light); }
.stat-icon.green { background: #ECFDF5; }
.stat-icon.yellow { background: #FFFBEB; }
.stat-icon.blue { background: #EFF6FF; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ─── CARDS ─── */
.card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-300);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--dark); }
.card-body { padding: 20px; }

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-100); padding: 10px 16px;
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); font-size: 13px; color: var(--gray-700); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-100); }

/* ─── STATUS BADGES ─── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-pending { background: #FFFBEB; color: #D97706; }
.badge-confirmed { background: #EFF6FF; color: #2563EB; }
.badge-completed { background: #ECFDF5; color: #059669; }
.badge-cancelled { background: #FEF2F2; color: #DC2626; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: 16px; padding: 28px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--dark); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-500); padding: 4px; line-height: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-500); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ─── GRID LAYOUT ─── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ─── SEARCH BAR ─── */
.search-bar { position: relative; }
.search-bar input { padding-left: 36px; }
.search-bar .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray-500); font-size: 15px; pointer-events: none; }

/* ─── TIME SLOTS ─── */
.time-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-slot {
  padding: 8px; border: 1.5px solid var(--gray-300); border-radius: 7px;
  text-align: center; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; color: var(--gray-700);
}
.time-slot:hover { border-color: var(--primary); color: var(--primary); }
.time-slot.selected { background: var(--primary); border-color: var(--primary); color: white; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
}
