/* Identidade visual — vermelho/marsala */
:root {
  --ea-primary: #7B2D3B;
  --ea-primary-600: #6a2532;
  --ea-secondary: #A84B5C;
  --ea-soft: #F6EDEE;
  --ea-soft-2: #fbf7f7;
  --ea-text: #2B2B2B;
  --ea-muted: #6c6466;
  --ea-border: #e9dfe1;
  --bs-primary: #7B2D3B;
  --bs-primary-rgb: 123, 45, 59;
  --bs-link-color: #7B2D3B;
  --bs-link-color-rgb: 123, 45, 59;
  --bs-link-hover-color: #5a1f2a;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: #2B2B2B;
  --bs-border-color: #e9dfe1;
}
body { background: var(--ea-soft-2); color: var(--ea-text); }
.btn-primary { --bs-btn-bg: var(--ea-primary); --bs-btn-border-color: var(--ea-primary); --bs-btn-hover-bg: var(--ea-primary-600); --bs-btn-hover-border-color: var(--ea-primary-600); --bs-btn-active-bg: #57202a; --bs-btn-disabled-bg: var(--ea-secondary); --bs-btn-disabled-border-color: var(--ea-secondary); }
.btn-outline-primary { --bs-btn-color: var(--ea-primary); --bs-btn-border-color: var(--ea-primary); --bs-btn-hover-bg: var(--ea-primary); --bs-btn-hover-border-color: var(--ea-primary); --bs-btn-active-bg: var(--ea-primary); }
.text-primary { color: var(--ea-primary) !important; }
.bg-soft { background: var(--ea-soft) !important; }
.form-control:focus, .form-select:focus { border-color: var(--ea-secondary); box-shadow: 0 0 0 .2rem rgba(123,45,59,.15); }
.form-check-input:checked { background-color: var(--ea-primary); border-color: var(--ea-primary); }
.page-link { color: var(--ea-primary); }

/* Layout */
.ea-shell { display: flex; min-height: 100vh; }
@media (min-width: 992px) { .ea-shell { background: linear-gradient(to right, var(--ea-primary) 248px, transparent 248px); } }
.ea-sidebar { width: 248px; background: var(--ea-primary); color: #fff; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ea-sidebar .brand { padding: 1.25rem 1.25rem 1rem; font-weight: 600; letter-spacing: .02em; border-bottom: 1px solid rgba(255,255,255,.12); }
.ea-sidebar .brand small { display: block; font-weight: 400; opacity: .75; font-size: .75rem; }
.ea-sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: 1rem 1.25rem .35rem; }
.ea-sidebar a.nav-link { color: rgba(255,255,255,.88); padding: .5rem 1.25rem; display: flex; gap: .6rem; align-items: center; border-left: 3px solid transparent; }
.ea-sidebar a.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.ea-sidebar a.nav-link.active { background: rgba(255,255,255,.14); color: #fff; border-left-color: #f3c6cf; }
.ea-main { flex: 1; min-width: 0; }
.ea-topbar { background: #fff; border-bottom: 1px solid var(--ea-border); padding: .6rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.ea-content { padding: 1.5rem 1.25rem 3rem; max-width: 1280px; }
.ea-mobile-toggle { display: none; }
@media (max-width: 991.98px) {
  .ea-sidebar { position: fixed; left: -260px; z-index: 1040; transition: left .2s ease; }
  .ea-sidebar.open { left: 0; }
  .ea-mobile-toggle { display: inline-flex; }
  .ea-backdrop.open { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1030; }
  .ea-content { padding: 1rem .75rem 4rem; }
}

/* Componentes */
.card { border: 1px solid var(--ea-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(60,20,30,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--ea-border); font-weight: 600; }
.kpi .label { color: var(--ea-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.6rem; font-weight: 600; color: var(--ea-primary); }
.table > :not(caption) > * > * { padding: .55rem .6rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ea-muted); font-weight: 600; background: var(--ea-soft-2); }
.table-hover tbody tr:hover { --bs-table-hover-bg: var(--ea-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-title { font-size: 1.4rem; font-weight: 600; margin: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.badge-soft { background: var(--ea-soft); color: var(--ea-primary); font-weight: 500; }
.chart-box { position: relative; height: 340px; }
.chart-box.tall { height: 520px; }
.guest-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: linear-gradient(160deg, var(--ea-soft) 0%, #fff 60%); }
.guest-card { width: 100%; max-width: 420px; }
.guest-brand { text-align: center; color: var(--ea-primary); margin-bottom: 1.25rem; }
.guest-brand .logo { width: 56px; height: 56px; border-radius: 50%; background: var(--ea-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 600; }
.qr-box { display: inline-block; padding: .75rem; background: #fff; border: 1px solid var(--ea-border); border-radius: .5rem; }
.qr-box svg, .qr-box img { width: 200px; height: 200px; display: block; }
.codigos { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; columns: 2; }
.ficha-row .form-control, .ficha-row .form-select { min-width: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.text-pre { white-space: pre-line; }
.w-qtd { max-width: 140px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--ea-soft-2); box-shadow: 0 -6px 12px rgba(251,247,247,1); padding: .75rem 0; border-top: 1px solid var(--ea-border); z-index: 5; }
.hidden { display: none !important; }
@media (max-width: 575.98px) {
  .btn, .form-control, .form-select { min-height: 44px; }
  .chart-box { height: 280px; }
}

/* Fase 2 */
.foto-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--ea-soft); }
.ficha-sn { border-bottom: 1px dashed var(--ea-border); padding-bottom: .6rem; }
.ficha-secao { margin-bottom: 1rem; }
.ficha-secao-titulo { background: var(--ea-primary); color: #fff; font-weight: 600; padding: .35rem .75rem; border-radius: .4rem; margin-bottom: .5rem; }
.assinatura-pad .pad-canvas { width: 100%; height: auto; aspect-ratio: 900 / 260; border: 1px dashed var(--ea-secondary); border-radius: .5rem; background: #fff; touch-action: none; cursor: crosshair; }
.mapa-canvas { width: 100%; max-width: 900px; height: auto; display: block; border: 1px solid var(--ea-border); border-radius: .5rem; touch-action: none; cursor: crosshair; background: #fff; }
.assinatura-img { max-width: 320px; width: 100%; height: auto; display: block; }
.assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; }
.assinaturas .linha { border-top: 1px solid #555; margin-top: .25rem; padding-top: .25rem; text-align: center; font-size: .8rem; }
.assinatura-vazia { height: 80px; }
.documento-texto { line-height: 1.55; }
[data-busca-lista] { z-index: 20; left: 0; right: 0; }
.print-body { background: #fff; }
.print-toolbar { padding: .75rem 1rem; border-bottom: 1px solid var(--ea-border); background: var(--ea-soft-2); }
.print-page { max-width: 820px; margin: 0 auto; padding: 1.5rem; color: #3b1a20; }
.print-head { text-align: center; margin-bottom: 1rem; }
.print-logo { font-size: 1.8rem; color: var(--ea-primary); font-weight: 500; letter-spacing: .02em; }
.print-sub { font-size: .8rem; color: var(--ea-secondary); font-weight: 600; }
.print-head h1 { font-size: 1rem; letter-spacing: .25em; color: var(--ea-primary); margin-top: .75rem; font-weight: 400; }
.print-rodape { font-size: .7rem; color: #777; margin-top: 1.5rem; border-top: 1px solid #ddd; padding-top: .4rem; }
@media print {
  .no-print, .ea-sidebar, .ea-topbar { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .ficha-secao { break-inside: avoid; }
  .ficha-secao-titulo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 11pt; }
}
@media (max-width: 575.98px) { .assinaturas { grid-template-columns: 1fr; } }

/* Fase 3: agenda */
.agenda-scroll { overflow-x: auto; }
.agenda-grid { display: grid; }
.agenda-grid.d7 { grid-template-columns: 52px repeat(7, minmax(100px, 1fr)); min-width: 760px; }
.agenda-grid.d1 { grid-template-columns: 52px 1fr; }
.agenda-cab { height: 34px; display: flex; align-items: center; justify-content: center; font-size: .8rem; border-bottom: 1px solid var(--ea-border); }
.agenda-cab a { text-decoration: none; color: inherit; }
.agenda-dia.hoje .agenda-cab { background: var(--ea-soft); color: var(--ea-primary); }
.agenda-corpo { position: relative; }
.agenda-dia .agenda-corpo { border-left: 1px solid var(--ea-border); cursor: copy; }
.agenda-hora { height: 48px; font-size: .7rem; color: var(--ea-muted); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.agenda-slot { height: 48px; border-bottom: 1px dashed #eee; }
.agenda-ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 2px 6px; font-size: .72rem; line-height: 1.2; overflow: hidden; text-decoration: none; color: #2b2b2b;
  background: #f3e3e6; border-left: 4px solid var(--ea-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: pointer; display: flex; flex-direction: column; }
.agenda-ev .ag-hora { font-weight: 600; } .agenda-ev .ag-nome { font-weight: 600; } .agenda-ev .ag-det { color: #5c5456; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-confirmado { background: #e3ecfb; } .ag-realizado { background: #e3f4e8; } .ag-cancelado, .ag-faltou { background: #eee; color: #888 !important; text-decoration: line-through; opacity: .75; }
.ag-reserva { background: repeating-linear-gradient(45deg, #f6edee, #f6edee 6px, #fff 6px, #fff 12px); }
.ag-sala { background: repeating-linear-gradient(45deg, #e9e9e9, #e9e9e9 6px, #f6f6f6 6px, #f6f6f6 12px); border-left-color: #999; color: #666; cursor: default; left: 55%; right: 2px; }
.legenda { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; border: 1px solid #ccc; }
