/* ============================================================
   Admin Panel — CSS
   ============================================================ */

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

:root {
  --primary:      #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light:#ede9fe;
  --success:      #059669;
  --warning:      #d97706;
  --danger:       #dc2626;
  --info:         #0284c7;

  --bg:           #f8f7ff;
  --surface:      #ffffff;
  --border:       #e5e7eb;
  --text:         #111827;
  --text-2:       #6b7280;
  --text-3:       #9ca3af;

  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius:       10px;
  --radius-sm:    6px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
}

body { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

/* ---- AUTH ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 2rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-card--wide { max-width: 680px; }
.auth-logo { font-weight: 700; font-size: 1.25rem; color: var(--primary); margin-bottom: 1.5rem; }
.auth-card h2 { font-size: 1.25rem; margin-bottom: .25rem; }
.auth-subtitle { color: var(--text-2); margin-bottom: 1.5rem; }
.auth-link { text-align: center; margin-top: 1.25rem; color: var(--text-2); font-size: 13px; }
.auth-link a { color: var(--primary); text-decoration: none; }

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

.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100; transition: transform .25s ease;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--text);
}
.sidebar-logo img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.sidebar-logo-text {
  width: 32px; height: 32px; border-radius: 6px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.sidebar-salon-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: .6rem 1rem;
  color: var(--text-2); text-decoration: none; font-size: 13.5px; border-radius: 0;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.btn-site-link {
  display: block; text-align: center; padding: .5rem; background: var(--primary-light);
  color: var(--primary); border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; font-weight: 500;
}
.logout-link { text-align: center; color: var(--text-2); text-decoration: none; font-size: 13px; }
.logout-link:hover { color: var(--danger); }

.main-wrapper { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; }
.sidebar-toggle svg { width: 22px; height: 22px; fill: var(--text-2); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-user { font-size: 13px; color: var(--text); display: flex; flex-direction: column; align-items: flex-end; }
.topbar-user small { color: var(--text-2); font-size: 11px; text-transform: capitalize; }

.main-content { flex: 1; padding: 1.75rem; }

/* ---- PAGE HEADER ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.25rem; font-weight: 600; }

/* ---- STATS GRID ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; display: flex; flex-direction: column; gap: .25rem;
}
.stat-card--info { border-color: var(--primary-light); background: var(--primary-light); }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-value--sm { font-size: 1.1rem; }
.stat-link { font-size: 12px; color: var(--primary); text-decoration: none; margin-top: auto; }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; }

/* ---- CARD ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 14px; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* ---- TABLE ---- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: .5rem .75rem; color: var(--text-2); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); }
.table td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: .15s;
}
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--outline:hover { background: var(--primary-light); }
.btn--sm { padding: .3rem .75rem; font-size: 12px; }
.btn--lg { padding: .75rem 1.5rem; font-size: 15px; }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- FORMS ---- */
.auth-form, .form-section { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

/* ---- ALERTS / FLASH ---- */
.alert, .flash {
  padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: 13.5px;
  margin-bottom: 1rem;
}
.alert--error, .flash--error     { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert--success, .flash--success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert--info, .flash--info       { background: #f0f9ff; color: var(--info);    border: 1px solid #bae6fd; }
.alert--warning, .flash--warning { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }

/* ---- BADGES ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge--pending      { background: #fef3c7; color: #92400e; }
.badge--confirmed    { background: #d1fae5; color: #065f46; }
.badge--in_progress  { background: #dbeafe; color: #1e40af; }
.badge--completed    { background: #f3f4f6; color: #374151; }
.badge--cancelled    { background: #fee2e2; color: #991b1b; }
.badge--no_show      { background: #fce7f3; color: #9d174d; }

/* ---- PLAN CARDS (register) ---- */
.plan-selector { margin: .5rem 0; }
.plan-selector-label { font-size: 13px; font-weight: 500; margin-bottom: .75rem; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.plan-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  cursor: pointer; position: relative; display: flex; flex-direction: column; gap: .35rem;
  transition: border-color .15s;
}
.plan-card input { position: absolute; opacity: 0; }
.plan-card:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.plan-card--featured { border-color: var(--primary); }
.plan-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 11px; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.plan-price { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.plan-price small { font-size: .7em; font-weight: 400; color: var(--text-2); }
.plan-features { padding-left: 1rem; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: .2rem; }

/* ---- TRIAL BANNER ---- */
.trial-banner {
  margin-top: 1.5rem; padding: .85rem 1.25rem; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: var(--radius-sm); color: var(--warning); font-size: 13.5px;
}
.trial-banner a { color: var(--primary); margin-left: .5rem; }

/* ---- MISC ---- */
.empty-state { color: var(--text-2); font-size: 13px; text-align: center; padding: 1.5rem 0; }
.text-danger { color: var(--danger); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
