/* ============================================================
   ClubMasSalud - style.css
   Estilos principais: portal, admin, componentes
   ============================================================ */

/* ── Variáveis CSS ─────────────────────────────────────────── */
:root {
  --primary:       #0ea5e9;
  --primary-dark:  #0284c7;
  --primary-light: #e0f2fe;
  --secondary:     #10b981;
  --secondary-dark:#059669;
  --accent:        #f59e0b;
  --danger:        #ef4444;
  --danger-dark:   #dc2626;
  --warning:       #f97316;
  --purple:        #8b5cf6;
  --dark:          #0f172a;
  --dark2:         #1e293b;
  --dark3:         #334155;
  --gray:          #64748b;
  --gray-light:    #94a3b8;
  --border:        #e2e8f0;
  --bg:            #f1f5f9;
  --bg2:           #f8fafc;
  --white:         #ffffff;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --transition:    .2s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ── Tipografia ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--dark); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: .875rem; }
p { color: var(--gray); margin-bottom: .5rem; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-light); }

/* ================================================================
   LAYOUT DO PORTAL / ADMIN
   ================================================================ */
.portal-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark2);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; }
.sidebar-logo-text { font-size: 1rem; font-weight: 700; color: #fff; }
.sidebar-logo-sub { font-size: .7rem; color: rgba(255,255,255,.5); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.sidebar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-name { font-size: .85rem; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.5); }

.sidebar-nav { flex: 1; padding: 0 8px 16px; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 12px 8px 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  transition: all var(--transition);
  position: relative;
}
.sidebar-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}
.sidebar-link i { width: 18px; text-align: center; font-size: .9rem; }
.sidebar-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 700;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer .sidebar-link { color: rgba(255,255,255,.5); }
.sidebar-footer .sidebar-link:hover { color: var(--danger); }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
}
.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--gray);
  padding: 4px 8px;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--dark); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--primary); }
.topbar-btn .notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--white);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.topbar-user:hover { background: var(--bg); }
.topbar-user-name { font-size: .85rem; font-weight: 600; }
.topbar-user-role { font-size: .7rem; color: var(--gray); }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  overflow: hidden;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  padding: 24px;
  background: var(--bg);
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-title span { color: var(--gray); font-size: 1rem; font-weight: 400; }
.page-subtitle { font-size: .875rem; color: var(--gray); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ================================================================
   COMPONENTES - CARDS
   ================================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: var(--primary); }
.stat-icon.green  { background: #f0fdf4; color: var(--secondary); }
.stat-icon.orange { background: #fff7ed; color: var(--warning); }
.stat-icon.red    { background: #fef2f2; color: var(--danger); }
.stat-icon.purple { background: #f5f3ff; color: var(--purple); }
.stat-icon.yellow { background: #fffbeb; color: var(--accent); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--gray); margin-top: 2px; }
.stat-change { font-size: .72rem; margin-top: 4px; display: flex; align-items: center; gap: 3px; }
.stat-change.up   { color: var(--secondary); }
.stat-change.down { color: var(--danger); }

/* ── Grid de conteúdo ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.col-span-2 { grid-column: span 2; }

/* ================================================================
   COMPONENTES - BOTÕES
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 7px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.btn-secondary:hover { background: var(--secondary-dark); color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-dark); color: #fff; }

.btn-warning {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--gray);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--dark); }

.btn-dark {
  background: var(--dark2);
  color: #fff;
  border-color: var(--dark2);
}
.btn-dark:hover { background: var(--dark3); color: #fff; }

.btn-success {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.btn-success:hover { background: var(--secondary-dark); color: #fff; }

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
}
.btn-whatsapp:hover { background: #1da851; color: #fff; }

.btn-block { display: flex; width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ================================================================
   COMPONENTES - FORMULÁRIOS
   ================================================================ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--dark3);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.form-control::placeholder { color: var(--gray-light); }
.form-control:disabled { background: var(--bg); cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.col-3 { grid-template-columns: repeat(3, 1fr); }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text {
  padding: 9px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--gray);
  font-size: .875rem;
}
.input-icon { position: relative; }
.input-icon .form-control { padding-left: 36px; }
.input-icon i {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-light);
}

.form-help { font-size: .75rem; color: var(--gray); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--danger); margin-top: 4px; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid { border-color: var(--secondary); }

/* Checkbox / Radio */
.check-group { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-group input[type="checkbox"],
.check-group input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.check-group label { font-size: .875rem; cursor: pointer; color: var(--dark); }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 24px;
  transition: var(--transition);
  cursor: pointer;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ================================================================
   COMPONENTES - TABELAS
   ================================================================ */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg2);
  color: var(--gray);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--bg2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 4px; align-items: center; }

/* ── Filtros de tabela ─────────────────────────────────────── */
.table-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.table-search { position: relative; flex: 1; min-width: 200px; }
.table-search input { padding-left: 36px; }
.table-search i {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-light);
}
.table-filter select { width: auto; min-width: 140px; }

/* ── Paginação ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-info { font-size: .8rem; color: var(--gray); }
.pagination-links { display: flex; gap: 4px; }
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: .8rem;
  color: var(--gray);
  transition: all var(--transition);
  text-decoration: none;
}
.page-link:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ================================================================
   COMPONENTES - BADGES / TAGS / STATUS
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-danger    { background: #fee2e2; color: var(--danger-dark); }
.badge-warning   { background: #fff7ed; color: #c2410c; }
.badge-info      { background: #eff6ff; color: #1d4ed8; }
.badge-gray      { background: #f1f5f9; color: var(--gray); }
.badge-purple    { background: #f5f3ff; color: #6d28d9; }
.badge-orange    { background: #fff7ed; color: var(--warning); }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green  { background: var(--secondary); }
.status-dot.red    { background: var(--danger); }
.status-dot.yellow { background: var(--accent); }
.status-dot.gray   { background: var(--gray-light); }
.status-dot.blue   { background: var(--primary); }

/* ================================================================
   COMPONENTES - MODAIS
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 740px; }
.modal-xl { max-width: 960px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: none;
  background: var(--bg);
  color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ================================================================
   COMPONENTES - TABS
   ================================================================ */
.tabs { border-bottom: 2px solid var(--border); display: flex; gap: 0; margin-bottom: 20px; }
.tab-link {
  padding: 10px 20px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ================================================================
   COMPONENTES - ALERTAS / FLASH
   ================================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .875rem;
}
.alert i { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger   { background: #fee2e2; color: var(--danger-dark); border: 1px solid #fecaca; }
.alert-warning  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.alert-info     { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  padding: 0;
}

/* ================================================================
   COMPONENTES - AVATAR / USUÁRIO
   ================================================================ */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.user-cell-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-cell-name { font-weight: 600; font-size: .875rem; }
.user-cell-email { font-size: .75rem; color: var(--gray); }

/* ================================================================
   COMPONENTES - DIGITAL CARD
   ================================================================ */
.digital-card {
  background: linear-gradient(135deg, #0f172a 0%, #0ea5e9 100%);
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(14,165,233,.3);
}
.digital-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.digital-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.card-chip {
  width: 40px; height: 30px;
  background: linear-gradient(135deg, #ffd700, #ffb700);
  border-radius: 6px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.card-logo { position: absolute; top: 20px; right: 20px; z-index: 1; }
.card-logo img { height: 28px; filter: brightness(0) invert(1); }
.card-number { font-size: 1.1rem; letter-spacing: .15em; margin-bottom: 16px; font-family: monospace; }
.card-holder-label { font-size: .65rem; text-transform: uppercase; opacity: .6; margin-bottom: 2px; }
.card-holder-name { font-size: .95rem; font-weight: 700; }
.card-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; }
.card-expiry label { font-size: .65rem; text-transform: uppercase; opacity: .6; margin-bottom: 2px; }
.card-expiry span { font-size: .875rem; font-weight: 600; }
.card-qr { width: 64px; height: 64px; background: #fff; border-radius: 8px; padding: 4px; }
.card-qr img { width: 100%; height: 100%; }
.card-plan-badge {
  position: absolute;
  top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
}

/* ================================================================
   COMPONENTES - BREADCRUMB
   ================================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--gray);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb span { color: var(--dark3); font-weight: 600; }

/* ================================================================
   COMPONENTES - EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state i {
  font-size: 3rem;
  color: var(--border);
  margin-bottom: 16px;
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; }
.empty-state p { color: var(--gray); max-width: 360px; margin: 0 auto 20px; }

/* ================================================================
   COMPONENTES - STEP WIZARD
   ================================================================ */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
}
.wizard-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--gray);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition);
}
.wizard-step-label { font-size: .8rem; font-weight: 600; color: var(--gray); }
.wizard-step.active .wizard-step-num { background: var(--primary); color: #fff; }
.wizard-step.active .wizard-step-label { color: var(--primary); }
.wizard-step.done .wizard-step-num { background: var(--secondary); color: #fff; }
.wizard-step.done .wizard-step-label { color: var(--secondary); }
.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 60px;
}
.wizard-connector.done { background: var(--secondary); }

/* ================================================================
   COMPONENTES - TELEMEDICINA / FILA
   ================================================================ */
.queue-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.queue-number { font-size: 4rem; font-weight: 900; line-height: 1; }
.queue-label { font-size: .875rem; opacity: .8; margin-top: 4px; }
.queue-position { font-size: 1.1rem; font-weight: 700; margin-top: 12px; }
.pulse-ring {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid #22c55e;
  border-radius: 50%;
  animation: pulseRing 1.5s infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(.8); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ================================================================
   COMPONENTES - FINANCEIRO / PIX
   ================================================================ */
.pix-qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}
.pix-qr {
  width: 200px; height: 200px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex; align-items: center; justify-content: center;
}
.pix-qr img { width: 100%; height: 100%; }
.pix-code-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: monospace;
  font-size: .75rem;
  word-break: break-all;
  position: relative;
  width: 100%;
}
.pix-steps { counter-reset: step; }
.pix-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .875rem;
}
.pix-step::before {
  counter-increment: step;
  content: counter(step);
  min-width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Credit card visual */
.cc-preview {
  background: linear-gradient(135deg, #1e3a5f, #0ea5e9);
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  margin-bottom: 20px;
  min-height: 160px;
  position: relative;
  overflow: hidden;
}
.cc-number { font-family: monospace; font-size: 1.2rem; letter-spacing: .15em; margin: 16px 0; }
.cc-info { display: flex; justify-content: space-between; font-size: .75rem; }
.cc-info label { opacity: .6; font-size: .6rem; display: block; margin-bottom: 2px; }

/* ================================================================
   RANKING / LEADERBOARD
   ================================================================ */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-pos {
  width: 32px;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
  flex-shrink: 0;
}
.ranking-pos.gold   { color: #f59e0b; }
.ranking-pos.silver { color: #94a3b8; }
.ranking-pos.bronze { color: #92400e; }
.ranking-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ranking-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width .6s ease;
}

/* ================================================================
   COMPONENTES - CHART WRAPPER
   ================================================================ */
.chart-wrapper { position: relative; }
.chart-wrapper canvas { max-height: 280px; }
.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: .75rem;
}
.chart-legend-item { display: flex; align-items: center; gap: 6px; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ================================================================
   COMPONENTES - PROGRESS
   ================================================================ */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
  background: var(--primary);
}
.progress-bar.green { background: var(--secondary); }
.progress-bar.orange { background: var(--warning); }
.progress-bar.red { background: var(--danger); }
.progress-bar.gradient {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* ================================================================
   COMPONENTES - APPOINTMENT CARDS
   ================================================================ */
.appointment-card {
  display: flex;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  transition: box-shadow var(--transition);
}
.appointment-card:hover { box-shadow: var(--shadow-md); }
.appointment-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  padding: 8px 4px;
}
.appointment-date .day { font-size: 1.4rem; font-weight: 900; line-height: 1; }
.appointment-date .month { font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.appointment-info { flex: 1; }
.appointment-title { font-weight: 700; font-size: .9rem; }
.appointment-sub { font-size: .75rem; color: var(--gray); margin-top: 2px; }
.appointment-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  color: var(--gray);
  margin-top: 4px;
}

/* ================================================================
   COMPONENTES - BENEFIT CARD
   ================================================================ */
.benefit-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}
.benefit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.benefit-icon {
  width: 60px; height: 60px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px;
  transition: all var(--transition);
}
.benefit-card:hover .benefit-icon { background: var(--primary); color: #fff; }
.benefit-title { font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.benefit-desc { font-size: .75rem; color: var(--gray); }
.benefit-discount {
  display: inline-block;
  margin-top: 8px;
  background: var(--secondary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .topbar-toggle { display: flex; }
  .main-content { margin-left: 0; padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .table-filters { flex-direction: column; align-items: stretch; }
  .table-search { min-width: unset; }
  .tabs { overflow-x: auto; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
  }
  .sidebar-overlay.active { display: block; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 14px; }
  .wizard-steps { flex-direction: column; gap: 4px; }
  .wizard-connector { width: 2px; height: 20px; max-width: unset; }
  .digital-card { padding: 20px; }
  .card-number { font-size: .9rem; }
}

/* ================================================================
   UTILITÁRIOS
   ================================================================ */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--accent) !important; }
.text-success { color: var(--secondary) !important; }
.text-gray { color: var(--gray) !important; }
.text-muted { color: var(--gray-light) !important; }
.text-dark { color: var(--dark) !important; }
.text-white { color: #fff !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-sm { font-size: .8rem !important; }
.text-xs { font-size: .7rem !important; }
.text-lg { font-size: 1.1rem !important; }
.fw-bold { font-weight: 700 !important; }
.fw-600 { font-weight: 600 !important; }
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.gap-4 { gap: 4px !important; }
.gap-8 { gap: 8px !important; }
.gap-12 { gap: 12px !important; }
.gap-16 { gap: 16px !important; }
.flex-1 { flex: 1 !important; }
.mb-0  { margin-bottom: 0 !important; }
.mb-4  { margin-bottom: 4px !important; }
.mb-8  { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mt-4  { margin-top: 4px !important; }
.mt-8  { margin-top: 8px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-24 { margin-top: 24px !important; }
.p-0   { padding: 0 !important; }
.w-100 { width: 100% !important; }
.rounded { border-radius: var(--radius-sm) !important; }
.rounded-full { border-radius: 50% !important; }
.border { border: 1px solid var(--border) !important; }
.bg-white { background: var(--white) !important; }
.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--secondary) !important; }
.bg-danger { background: var(--danger) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.overflow-hidden { overflow: hidden !important; }
.position-relative { position: relative !important; }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider-text span { font-size: .75rem; color: var(--gray); white-space: nowrap; }

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .7rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-sm { width: 16px; height: 16px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Copy button feedback ────────────────────────────────────── */
.copy-feedback {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: .7rem;
  color: var(--secondary);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.copy-feedback.show { opacity: 1; }

/* ── Info boxes ──────────────────────────────────────────────── */
.info-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: .875rem;
  color: var(--dark3);
}
.info-box.green {
  background: #dcfce7;
  border-color: var(--secondary);
}
.info-box.orange {
  background: #fff7ed;
  border-color: var(--warning);
}
.info-box.red {
  background: #fee2e2;
  border-color: var(--danger);
}
