/* ─── TOKENS ─── */
:root {
  --bg:          #f8f9fa;
  --white:       #ffffff;
  --dark:        #111827;
  --text:        #6b7280;
  --border:      #e5e7eb;
  --blue:        #0066ff;
  --green:       #10b981;
  --orange:      #f59e0b;
  --danger:      #ef4444;
  --purple-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --font:        'Inter', Arial, sans-serif;
  --sidebar-w:   200px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--dark); -webkit-font-smoothing: antialiased; }

@keyframes dbFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── SHELL ─── */
.shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  animation: dbFadeIn .3s ease both;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-logo .logo-g {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; font-style: italic;
  flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: 14px; font-weight: 700; color: var(--dark); line-height: 1.1; }
.sidebar-logo .logo-text small { display: block; font-size: 10px; font-weight: 400; color: var(--text); }

.sidebar-nav { padding: 12px 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section-label {
  font-size: 10px; font-weight: 700; color: var(--text); opacity: .6;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: default; transition: all .15s; text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--dark); }
.nav-item.active { background: var(--blue); color: #fff; }
.nav-item.active svg { opacity: 1; }
.nav-item svg { opacity: 1; flex-shrink: 0; color: var(--blue); }
.nav-item.active svg path,
.nav-item.active svg rect,
.nav-item.active svg circle,
.nav-item.active svg line,
.nav-item.active svg polyline { stroke: #fff; }
.nav-item.danger { color: var(--danger); }
.nav-item.danger svg { opacity: .7; }
.nav-item.danger:hover { background: #fff5f5; }

/* ─── MAIN ─── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Topbar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-hamburger {
  display: flex; flex-direction: column; gap: 4px; cursor: default; padding: 4px;
}
.topbar-hamburger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; display: block; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.topbar-name { font-size: 13px; font-weight: 600; color: var(--dark); display: flex; align-items: center; gap: 4px; }
.topbar-name svg { opacity: .4; }

/* Content */
.content { padding: 24px 28px; display: flex; flex-direction: column; gap: 24px; }

/* Header row */
.content-header { display: flex; align-items: flex-start; justify-content: space-between; }
.content-header-left h2 { font-size: 20px; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 6px; }
.content-header-left p { font-size: 13px; color: var(--text); margin-top: 2px; }
.btn-agenda-publica {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--white); font-size: 13px; font-weight: 600; color: var(--blue);
  cursor: default; transition: all .2s;
}
.btn-agenda-publica:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.btn-agenda-publica svg { opacity: .7; }

/* ─── STAT CARDS ─── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat-card {
  border-radius: 16px; padding: 20px 22px;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 90px; position: relative; overflow: hidden;
  animation: dbFadeUp .5s ease both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: .1s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: .2s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: .3s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: .4s; }
.stat-card.blue   { background: linear-gradient(135deg, #0066ff, #004cc7); }
.stat-card.green  { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.purple { background: var(--purple-grad); }
.stat-card-info { display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.stat-card-val { font-size: 28px; font-weight: 800; color: #fff; line-height: 1; }
.stat-card-label { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); }
.stat-card-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.18);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; z-index: 1;
}
.stat-card.purple .plan-label { font-size: 11px; color: rgba(255,255,255,.7); font-weight: 500; }
.stat-card.purple .plan-name { font-size: 22px; font-weight: 800; color: #fff; }
.stat-card.purple .plan-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  border-radius: 100px; padding: 4px 12px; font-size: 11px; font-weight: 600; color: #fff;
  cursor: default;
}
.star-icon { font-size: 28px; opacity: .9; }

/* ─── CARD SECTION ─── */
.card-section {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  animation: dbFadeUp .5s .5s ease both;
}
.card-section-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-section-head .head-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--dark);
}
.card-section-head .head-title svg { color: var(--blue); }
.ver-todos { font-size: 13px; font-weight: 600; color: var(--blue); cursor: default; display: flex; align-items: center; gap: 3px; }
.card-section-body { padding: 20px; }

/* ─── APPOINTMENTS TABLE ─── */
.appt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.appt-table thead tr { border-bottom: 1px solid var(--border); }
.appt-table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text); letter-spacing: .05em; text-transform: uppercase; }
.appt-table tbody tr { border-bottom: 1px solid var(--border); }
.appt-table tbody tr:last-child { border-bottom: none; }
.appt-table td { padding: 14px 16px; vertical-align: middle; color: var(--dark); }
.appt-date { font-weight: 700; font-size: 13px; }
.appt-time { font-size: 12px; color: var(--text); margin-top: 2px; }
.appt-client { display: flex; align-items: center; gap: 10px; }
.appt-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.appt-name { font-weight: 600; font-size: 13px; }
.appt-phone { font-size: 11px; color: var(--text); margin-top: 2px; }
.appt-svc { font-weight: 600; }
.appt-dur { font-size: 11px; color: var(--text); margin-top: 2px; }
.appt-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.appt-badge.confirmed { background: #eff6ff; color: #2563eb; }
.appt-actions { display: flex; gap: 6px; align-items: center; }
.appt-btn { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: default; border: 1px solid var(--border); background: var(--white); color: var(--dark); }
.appt-btn.blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.appt-btn.red { background: #ef4444; color: #fff; border-color: #ef4444; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; text-align: center;
}
.empty-icon {
  width: 52px; height: 52px;
  background: var(--bg); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.empty-state h4 { font-size: 15px; font-weight: 700; color: var(--dark); }
.empty-state p { font-size: 13px; color: var(--text); }

/* ─── AÇÕES RÁPIDAS ─── */
.quick-actions-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px;
  max-width: 440px;
  animation: dbFadeUp .5s .65s ease both;
}
.quick-actions-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--dark);
  margin-bottom: 14px;
}
.quick-actions-head svg { color: var(--blue); }
.qa-list { display: flex; flex-direction: column; gap: 8px; }
.qa-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: default; transition: all .2s; width: 100%;
}
.qa-btn.primary { background: var(--blue); color: #fff; border: none; }
.qa-btn.primary:hover { background: #1648c0; }
.qa-btn.outline { background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); }
.qa-btn.outline:hover { background: rgba(26,86,219,.05); }
.qa-btn.green-btn { background: var(--green); color: #fff; }
.qa-btn.green-btn:hover { background: #048f52; }
.qa-btn svg { flex-shrink: 0; }
