/* ============================================
   Hemo Gestão — CSS standalone v2
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #0f6e56;
  --primary-light: #1d9e75;
  --primary-dark:  #085041;
  --primary-5:     rgba(15,110,86,.05);
  --primary-10:    rgba(15,110,86,.10);
  --primary-20:    rgba(15,110,86,.20);
  --surface:       #f8faf9;
  --white:         #ffffff;
  --gray-50:#f9fafb; --gray-100:#f3f4f6; --gray-200:#e5e7eb;
  --gray-300:#d1d5db; --gray-400:#9ca3af; --gray-500:#6b7280;
  --gray-600:#4b5563; --gray-700:#374151; --gray-800:#1f2937; --gray-900:#111827;
  --red-50:#fef2f2; --red-200:#fecaca; --red-600:#dc2626; --red-700:#b91c1c;
  --green-50:#f0fdf4; --green-100:#dcfce7; --green-200:#bbf7d0;
  --green-600:#16a34a; --green-700:#15803d; --green-800:#166534;
  --orange-50:#fff7ed; --orange-100:#ffedd5; --orange-200:#fed7aa;
  --orange-600:#ea580c; --orange-700:#c2410c;
  --yellow-100:#fef9c3; --yellow-800:#854d0e;
  --blue-100:#dbeafe; --blue-800:#1e40af;
  --indigo-100:#e0e7ff; --indigo-800:#3730a3;
  --purple-100:#f3e8ff; --purple-800:#6b21a8;
  --radius:10px; --radius-lg:14px; --radius-full:9999px;
  --shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.05);
  --transition:140ms ease;
}

/* ── Reset base ── */
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; font-size:14px; color:var(--gray-800); background:var(--surface); min-height:100vh; line-height:1.5; }
a { color:inherit; text-decoration:none; }
/* SVG sem tamanho definido colapsa para 0 — tamanho SEMPRE pela classe pai */
svg { display:block; width:100%; height:100%; fill:none; stroke:currentColor; overflow:visible; }

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

/* ── Sidebar ── */
.sidebar { display:none; flex-direction:column; width:224px; background:var(--white); border-right:1px solid var(--gray-200); position:fixed; inset:0 auto 0 0; z-index:30; overflow:hidden; }
@media(min-width:1024px){ .sidebar { display:flex; } }

.sidebar-logo { display:flex; align-items:center; gap:10px; padding:16px; border-bottom:1px solid var(--gray-100); flex-shrink:0; }
.logo-icon { width:34px; height:34px; min-width:34px; border-radius:10px; background:var(--primary); display:flex; align-items:center; justify-content:center; }
.logo-icon svg { width:18px; height:18px; min-width:18px; stroke:white; }
.logo-text { font-weight:700; font-size:14px; color:var(--gray-900); letter-spacing:-.01em; }

.sidebar-nav { flex:1; padding:10px; display:flex; flex-direction:column; gap:1px; overflow-y:auto; }
.nav-section { font-size:10px; font-weight:700; color:var(--gray-400); text-transform:uppercase; letter-spacing:.08em; padding:12px 10px 4px; }
.nav-link { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:var(--radius); font-size:13px; font-weight:500; color:var(--gray-600); transition:background var(--transition),color var(--transition); }
.nav-link:hover { background:var(--primary-5); color:var(--primary); }
.nav-link.active { background:var(--primary); color:white; font-weight:600; }
.nav-link .icon { width:17px; height:17px; min-width:17px; flex-shrink:0; }
.nav-link .icon svg { width:17px; height:17px; stroke:currentColor; }

.sidebar-footer { padding:10px; border-top:1px solid var(--gray-100); flex-shrink:0; }
.sidebar-user { display:flex; align-items:center; gap:9px; padding:6px 8px; }
.avatar { width:30px; height:30px; min-width:30px; border-radius:var(--radius-full); background:var(--primary-10); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--primary); }
.sidebar-user-name { font-size:12px; font-weight:600; color:var(--gray-800); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-role { font-size:11px; color:var(--gray-400); text-transform:capitalize; }
.logout-btn { display:flex; align-items:center; justify-content:center; width:28px; height:28px; min-width:28px; border-radius:var(--radius); color:var(--gray-400); transition:background var(--transition),color var(--transition); }
.logout-btn:hover { background:var(--red-50); color:var(--red-600); }
.logout-btn svg { width:16px; height:16px; stroke:currentColor; }

/* ── Main ── */
.main-content { flex:1; padding-bottom:72px; min-width:0; }
@media(min-width:1024px){ .main-content { margin-left:224px; padding-bottom:0; } }

/* ── Topbar mobile ── */
.topbar { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; background:var(--white); border-bottom:1px solid var(--gray-200); position:sticky; top:0; z-index:20; }
@media(min-width:1024px){ .topbar { display:none; } }
.topbar-brand { display:flex; align-items:center; gap:8px; }
.topbar-icon { width:30px; height:30px; min-width:30px; border-radius:9px; background:var(--primary); display:flex; align-items:center; justify-content:center; }
.topbar-icon svg { width:16px; height:16px; stroke:white; }
.topbar-title { font-weight:700; font-size:14px; color:var(--gray-900); }

/* ── Bottom nav mobile ── */
.bottom-nav { display:flex; position:fixed; bottom:0; left:0; right:0; background:var(--white); border-top:1px solid var(--gray-200); z-index:30; }
@media(min-width:1024px){ .bottom-nav { display:none; } }
.bottom-nav a { flex:1; display:flex; flex-direction:column; align-items:center; padding:8px 4px 10px; gap:3px; color:var(--gray-500); font-size:10px; font-weight:500; transition:color var(--transition); }
.bottom-nav a.active, .bottom-nav a:hover { color:var(--primary); }
.bottom-nav .icon { width:22px; height:22px; }
.bottom-nav .icon svg { width:22px; height:22px; stroke:currentColor; }

.page-body { padding:16px; }
@media(min-width:1024px){ .page-body { padding:24px; } }

/* ── Cards ── */
.card { background:var(--white); border-radius:var(--radius-lg); border:1px solid var(--gray-200); padding:16px; }
.card-p0 { background:var(--white); border-radius:var(--radius-lg); border:1px solid var(--gray-200); overflow:hidden; }

/* ── Botões — visual consistente com o menu ── */
.btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 16px; border-radius:var(--radius);
  font-size:13px; font-weight:600; cursor:pointer;
  border:none; text-decoration:none;
  transition:background var(--transition), box-shadow var(--transition), color var(--transition);
  white-space:nowrap; font-family:inherit; line-height:1.4;
}
.btn .icon { width:15px; height:15px; }
.btn .icon svg { width:15px; height:15px; stroke:currentColor; }
.btn-primary { background:var(--primary); color:white; box-shadow:0 1px 2px rgba(15,110,86,.25); }
.btn-primary:hover { background:var(--primary-dark); box-shadow:0 2px 6px rgba(15,110,86,.30); }
.btn-secondary { background:var(--white); color:var(--gray-700); border:1px solid var(--gray-300); }
.btn-secondary:hover { background:var(--gray-50); border-color:var(--gray-400); }
.btn-danger { background:var(--red-600); color:white; }
.btn-danger:hover { background:var(--red-700); }
.btn-ghost { background:transparent; color:var(--primary); border:1px solid var(--primary-20); }
.btn-ghost:hover { background:var(--primary-5); }
.btn-sm { padding:5px 10px; font-size:12px; border-radius:8px; }
.btn-full { width:100%; justify-content:center; }

/* ── Forms ── */
.form-group { display:flex; flex-direction:column; gap:5px; }
.form-label { font-size:12px; font-weight:600; color:var(--gray-600); }
.form-input {
  width:100%; border:1px solid var(--gray-300); border-radius:var(--radius);
  padding:9px 12px; font-size:13px; color:var(--gray-800);
  background:white; transition:border-color var(--transition),box-shadow var(--transition);
  font-family:inherit; line-height:1.4;
}
.form-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-10); }
.form-row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.form-row .form-group { flex:1; min-width:140px; }
.form-grid { display:grid; gap:12px; }
.form-grid-2 { grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
.form-grid-3 { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
.col-full { grid-column:1/-1; }

/* ── Tabelas ── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
thead { background:var(--gray-50); border-bottom:1px solid var(--gray-200); }
th { text-align:left; font-size:11px; font-weight:700; color:var(--gray-500); text-transform:uppercase; letter-spacing:.06em; padding:10px 14px; white-space:nowrap; }
td { padding:12px 14px; font-size:13px; color:var(--gray-700); border-bottom:1px solid var(--gray-100); }
tr:last-child td { border-bottom:none; }
tbody tr:hover td { background:var(--gray-50); }
.td-name { font-weight:600; color:var(--gray-900); }
.td-sub { font-size:11px; color:var(--gray-400); margin-top:2px; }
.hidden-sm { display:none; }
@media(min-width:768px){ .hidden-sm { display:table-cell; } }

/* ── Badges ── */
.badge { display:inline-flex; align-items:center; padding:3px 9px; border-radius:var(--radius-full); font-size:11px; font-weight:600; white-space:nowrap; letter-spacing:.01em; }
.badge-agendada     { background:var(--blue-100);   color:var(--blue-800); }
.badge-concluida    { background:var(--green-100);  color:var(--green-800); }
.badge-cancelada    { background:var(--red-200);    color:var(--red-700); }
.badge-em_andamento { background:var(--yellow-100); color:var(--yellow-800); }
.badge-pendente     { background:var(--orange-100); color:var(--orange-700); }
.badge-pago         { background:var(--green-100);  color:var(--green-800); }
.badge-ativo        { background:var(--green-100);  color:var(--green-800); }
.badge-inativo      { background:var(--red-200);    color:var(--red-700); }
.badge-gestor       { background:var(--purple-100); color:var(--purple-800); }
.badge-profissional { background:var(--blue-100);   color:var(--blue-800); }
.turno-badge { display:inline-flex; align-items:center; padding:3px 9px; border-radius:var(--radius-full); font-size:11px; font-weight:600; }
.turno-manha { background:var(--yellow-100); color:var(--yellow-800); }
.turno-tarde { background:var(--orange-100); color:var(--orange-700); }
.turno-noite { background:var(--indigo-100); color:var(--indigo-800); }

/* ── Alertas ── */
.alert { display:flex; align-items:center; gap:9px; padding:12px 14px; border-radius:var(--radius); font-size:13px; margin-bottom:16px; }
.alert-icon { width:16px; height:16px; min-width:16px; }
.alert-icon svg { width:16px; height:16px; stroke:currentColor; }
.alert-error  { background:var(--red-50);   border:1px solid var(--red-200);   color:var(--red-700); }
.alert-success{ background:var(--green-50); border:1px solid var(--green-200); color:var(--green-700); }

/* ── Stats ── */
.stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media(min-width:1024px){ .stat-grid { grid-template-columns:repeat(4,1fr); } }
.stat-card { background:var(--white); border:1px solid var(--gray-200); border-radius:var(--radius-lg); padding:16px; }
.stat-label { font-size:12px; font-weight:500; color:var(--gray-500); }
.stat-value { font-size:30px; font-weight:800; margin-top:6px; line-height:1; letter-spacing:-.02em; }
.c-primary { color:var(--primary); }
.c-orange  { color:var(--orange-600); }
.c-gray    { color:var(--gray-800); }

/* ── Empty state ── */
.empty-state { text-align:center; padding:48px 16px; }
.empty-state .empty-icon { width:44px; height:44px; margin:0 auto 12px; color:var(--gray-300); }
.empty-state .empty-icon svg { width:44px; height:44px; stroke:var(--gray-300); }
.empty-state p { color:var(--gray-500); font-weight:500; font-size:14px; }
.empty-state small { font-size:13px; color:var(--gray-400); margin-top:4px; display:block; }

/* ── Accordion / Details ── */
details summary { list-style:none; cursor:pointer; user-select:none; }
details summary::-webkit-details-marker { display:none; }
.accordion-trigger { display:flex; align-items:center; justify-content:space-between; font-size:13px; font-weight:600; color:var(--gray-700); }
.accordion-trigger .icon { width:16px; height:16px; }
.accordion-trigger .icon svg { width:16px; height:16px; stroke:var(--gray-400); }
.accordion-body { margin-top:16px; }
.inline-trigger { font-size:13px; font-weight:600; color:var(--primary); display:inline-flex; align-items:center; gap:4px; }
.inline-trigger .icon { width:14px; height:14px; }
.inline-trigger .icon svg { width:14px; height:14px; stroke:currentColor; }

/* ── Login ── */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:16px; background:linear-gradient(135deg,var(--primary-5) 0%,var(--primary-10) 100%); }
.login-wrap { width:100%; max-width:380px; }
.login-logo { text-align:center; margin-bottom:32px; }
.login-logo-icon { width:64px; height:64px; border-radius:20px; background:var(--primary); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; }
.login-logo-icon svg { width:36px; height:36px; stroke:white; }
.login-logo h1 { font-size:24px; font-weight:800; color:var(--gray-900); letter-spacing:-.02em; }
.login-logo p { font-size:13px; color:var(--gray-500); margin-top:4px; }
.login-box { background:var(--white); border-radius:20px; border:1px solid var(--gray-200); padding:28px; box-shadow:var(--shadow); }
.login-box h2 { font-size:16px; font-weight:700; color:var(--gray-800); margin-bottom:20px; }
.login-footer { text-align:center; font-size:12px; color:var(--gray-400); margin-top:20px; }

/* ── Sessão card ── */
.sessao-card { background:var(--white); border:1px solid var(--gray-200); border-radius:var(--radius-lg); padding:16px; }
.sessao-tags { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
.sessao-nome { font-size:16px; font-weight:700; color:var(--gray-900); }
.sessao-sub { font-size:13px; color:var(--gray-500); margin-top:3px; }
.horario-box { display:flex; align-items:center; gap:16px; background:var(--green-50); border-radius:var(--radius); padding:12px; margin-top:12px; }
.horario-item .hl { font-size:11px; color:var(--green-700); font-weight:600; }
.horario-item .hv { font-size:15px; font-weight:700; color:var(--green-800); }
.horario-arrow { width:16px; height:16px; min-width:16px; color:var(--green-600); }
.horario-arrow svg { width:16px; height:16px; stroke:currentColor; }
.horario-duracao { margin-left:auto; text-align:right; }
.prof-chip { display:inline-flex; align-items:center; gap:6px; background:var(--gray-50); border:1px solid var(--gray-200); border-radius:var(--radius); padding:4px 10px; font-size:12px; font-weight:500; color:var(--gray-700); }
.prof-chip .avatar { width:20px; height:20px; min-width:20px; font-size:10px; }

/* ── Repasse cards ── */
.repasse-card { display:flex; align-items:center; gap:12px; background:var(--white); border:1px solid var(--gray-200); border-radius:var(--radius-lg); padding:14px 16px; }
.repasse-info { flex:1; min-width:0; }
.repasse-data { font-size:13px; font-weight:700; color:var(--gray-800); }
.repasse-sub { font-size:12px; color:var(--gray-500); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.repasse-right { text-align:right; flex-shrink:0; }
.repasse-valor { font-size:16px; font-weight:800; color:var(--gray-900); }

/* ── Totais ── */
.total-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.total-card { border-radius:var(--radius-lg); padding:16px; }
.total-pendente { background:var(--orange-50); border:1px solid var(--orange-200); }
.total-pago     { background:var(--green-50);  border:1px solid var(--green-200); }
.total-principal{ background:var(--primary-5); border:1px solid var(--primary-20); }
.total-label { font-size:12px; font-weight:600; }
.lbl-pendente  { color:var(--orange-700); }
.lbl-pago      { color:var(--green-700); }
.lbl-principal { color:var(--primary); }
.total-value { font-size:22px; font-weight:800; line-height:1.2; margin-top:4px; letter-spacing:-.02em; }
.val-pendente  { color:var(--orange-700); }
.val-pago      { color:var(--green-700); }
.val-principal { color:var(--primary); }

/* ── Quick links ── */
.quick-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media(min-width:1024px){ .quick-grid { grid-template-columns:repeat(4,1fr); } }
.quick-card {
  background:var(--white); border:1px solid var(--gray-200);
  border-radius:var(--radius-lg); padding:20px 12px; text-align:center;
  transition:border-color var(--transition),background var(--transition),box-shadow var(--transition);
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.quick-card:hover { border-color:var(--primary-20); background:var(--primary-5); box-shadow:0 2px 8px rgba(15,110,86,.08); }
.quick-card .qc-icon { width:36px; height:36px; border-radius:10px; background:var(--primary-10); display:flex; align-items:center; justify-content:center; }
.quick-card .qc-icon svg { width:20px; height:20px; stroke:var(--primary); }
.quick-card span { font-size:12px; font-weight:600; color:var(--gray-700); }

/* ── Utilitários ── */
.flex{display:flex;} .flex-col{flex-direction:column;} .flex-wrap{flex-wrap:wrap;}
.items-center{align-items:center;} .items-start{align-items:flex-start;}
.justify-between{justify-content:space-between;} .justify-center{justify-content:center;}
.gap-1{gap:4px;} .gap-2{gap:8px;} .gap-3{gap:12px;} .gap-4{gap:16px;}
.flex-1{flex:1;} .min-w-0{min-width:0;} .ml-auto{margin-left:auto;} .flex-shrink-0{flex-shrink:0;}
.w-full{width:100%;} .text-center{text-align:center;} .text-right{text-align:right;}
.font-bold{font-weight:700;} .font-semibold{font-weight:600;} .font-medium{font-weight:500;}
.text-xs{font-size:11px;} .text-sm{font-size:13px;} .text-lg{font-size:16px;} .text-xl{font-size:20px;}
.mt-1{margin-top:4px;} .mt-2{margin-top:8px;} .mt-3{margin-top:12px;} .mt-4{margin-top:16px;}
.mb-2{margin-bottom:8px;} .mb-3{margin-bottom:12px;} .mb-4{margin-bottom:16px;}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.page-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:16px;}
.page-title{font-size:20px;font-weight:800;color:var(--gray-900);letter-spacing:-.02em;}
.page-subtitle{font-size:13px;color:var(--gray-500);margin-top:2px;}
.section-title{font-size:13px;font-weight:700;color:var(--gray-700);margin-bottom:12px;}
.stack{display:flex;flex-direction:column;gap:12px;}
.stack-4{display:flex;flex-direction:column;gap:16px;}
.link{color:var(--primary);font-size:13px;font-weight:500;}
.link:hover{text-decoration:underline;}
.divider{border:none;border-top:1px solid var(--gray-100);margin:12px 0;}
