/* B' Beauty Bellezaria — Premium Dark Theme */
:root {
  --bg: #0A0908;
  --surface: #141210;
  --surface2: #1c1a17;
  --border: rgba(212,175,55,0.15);
  --gold: #D4AF37;
  --gold-light: #E5C158;
  --gold-dim: rgba(212,175,55,0.7);
  --text: #F5F1E8;
  --text-muted: #8B8070;
  --text-dim: #6B6055;
  --danger: #c0392b;
  --success: #27ae60;
  --sidebar-w: 200px;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Typography */
.serif { font-family: 'Cormorant Garamond', serif; }
.gold-text {
  background: linear-gradient(135deg, #D4AF37 0%, #F0D060 50%, #D4AF37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Layout */
.page { display: none; }
.page.active { display: flex; }

.center-page {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center top, rgba(212,175,55,0.06) 0%, transparent 60%), var(--bg);
}

/* Login */
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.logo-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--text);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}

.logo-circle.sm { width: 40px; height: 40px; flex-shrink: 0; }

.logo-b {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 600;
  color: var(--bg);
  line-height: 1;
}

.logo-circle.sm .logo-b { font-size: 16px; }

.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 500;
  letter-spacing: 6px;
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}

.logo-sub {
  font-family: 'Inter', sans-serif;
  font-size: 9px; letter-spacing: 4px;
  color: var(--gold-dim); display: block; margin-top: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 13px;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
select option { background: var(--surface2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Buttons */
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:hover { background: var(--gold-light); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { border-color: var(--gold-dim); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(192,57,43,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { background: rgba(192,57,43,0.1); }

.btn-icon {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex; align-items: center;
  transition: color 0.2s, background 0.2s;
}
.btn-icon:hover { color: var(--text); background: var(--surface2); }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-whatsapp:hover { opacity: 0.9; }
.btn-whatsapp.sent { background: #128C4D; }

.w-full { width: 100%; }

/* Utilities */
.hidden { display: none !important; }
.error-msg { background: rgba(192,57,43,0.15); border: 1px solid rgba(192,57,43,0.3); color: #e74c3c; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-confirmed { background: rgba(39,174,96,0.15); color: #27ae60; }
.badge-completed { background: rgba(212,175,55,0.15); color: var(--gold); }
.badge-cancelled { background: rgba(192,57,43,0.15); color: #e74c3c; }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; letter-spacing: 3px;
  color: var(--text); line-height: 1;
}
.sidebar-sub { font-size: 8px; letter-spacing: 3px; color: var(--gold-dim); margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px; font-weight: 400;
  transition: all 0.15s;
}
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--gold); background: rgba(212,175,55,0.08); }
.nav-item.active svg { stroke: var(--gold); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mobile header */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99;
}

.mobile-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; letter-spacing: 4px;
}

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 32px;
}

/* Page header */
.page-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--gold-dim); margin-bottom: 6px; }
.page-title { font-family: 'Cormorant Garamond', serif; font-size: 42px; font-weight: 500; line-height: 1; margin-bottom: 4px; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.card-value { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 500; color: var(--text); line-height: 1; }
.card-value.gold { color: var(--gold); }

/* Table */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 12px 16px; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 500; }
tbody td { padding: 14px 16px; border-bottom: 1px solid rgba(212,175,55,0.06); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(212,175,55,0.03); }

/* Search bar */
.search-bar { position: relative; }
.search-bar input { padding-left: 36px; }
.search-bar svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* Timeline */
.timeline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.timeline-slot { display: grid; grid-template-columns: 64px 1fr; border-bottom: 1px solid rgba(212,175,55,0.06); min-height: 52px; cursor: pointer; transition: background 0.15s; }
.timeline-slot:last-child { border-bottom: none; }
.timeline-slot:hover .slot-empty { color: var(--gold-dim); }
.slot-time { padding: 16px 16px; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; border-right: 1px solid rgba(212,175,55,0.06); font-weight: 500; }
.slot-content { padding: 8px 16px; display: flex; align-items: center; }
.slot-empty { color: var(--text-dim); font-size: 12px; }
.slot-appt { display: flex; align-items: center; gap: 10px; width: 100%; }
.slot-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.slot-info { flex: 1; }
.slot-client { font-size: 13px; font-weight: 500; }
.slot-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.slot-actions { display: flex; gap: 6px; }

/* Calendar */
.calendar-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-month { font-family: 'Cormorant Garamond', serif; font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-label { text-align: center; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 4px; }
.cal-day {
  text-align: center; padding: 8px 4px;
  border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  transition: all 0.15s; user-select: none;
}
.cal-day:hover { background: var(--surface2); color: var(--text); }
.cal-day.today { background: rgba(212,175,55,0.12); color: var(--gold); font-weight: 600; }
.cal-day.selected { background: var(--gold); color: var(--bg); font-weight: 600; }
.cal-day.other-month { opacity: 0.3; }
.cal-day.has-appt::after { content: ''; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin: 2px auto 0; }

/* Agenda layout */
.agenda-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: 'Cormorant Garamond', serif; font-size: 22px; }
#modal-body { padding: 24px; }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  animation: slideIn 0.3s ease;
  min-width: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.success { border-color: rgba(39,174,96,0.4); }
.toast.error { border-color: rgba(192,57,43,0.4); }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.toast.success .toast-dot { background: var(--success); }
.toast.error .toast-dot { background: var(--danger); }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Finance chart */
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; overflow-x: auto; padding-bottom: 4px; }
.chart-bar-group { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; width: 24px; }
.chart-bar { width: 10px; border-radius: 2px 2px 0 0; transition: height 0.3s; }
.chart-bar.income { background: var(--gold); }
.chart-bar.expense { background: rgba(192,57,43,0.6); }
.chart-date { font-size: 8px; color: var(--text-dim); transform: rotate(-45deg); width: 20px; }

/* Link card */
.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.link-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(212,175,55,0.1); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--gold); }
.link-info { flex: 1; min-width: 200px; }
.link-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold-dim); margin-bottom: 4px; }
.link-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; margin-bottom: 2px; }
.link-url { font-size: 11px; color: var(--text-muted); word-break: break-all; }
.link-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Reminders */
.reminder-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.reminder-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.reminder-info { flex: 1; }
.reminder-name { font-weight: 500; margin-bottom: 2px; }
.reminder-detail { font-size: 12px; color: var(--text-muted); }
.reminder-list { display: flex; flex-direction: column; gap: 10px; }

/* Professionals color picker */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; }
.swatch.selected, .swatch:hover { border-color: var(--text); }

/* Empty state */
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state svg { margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* Select filter */
.filter-select { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text); font-size: 13px; cursor: pointer; outline: none; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.5);
  }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 16px; padding-top: 72px; }
  .agenda-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 32px; }
  table { font-size: 12px; }
  thead th, tbody td { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .login-box { padding: 32px 24px; }
  .link-card { flex-direction: column; align-items: flex-start; }
}
