﻿/* Agenda PSI 2.0 — camada oficial de legibilidade */
html { font-size: 17px; }
body { font-size: 17px; line-height: 1.58; }

/* Navegação */
.nav button { font-size: 15px !important; }
.nav-label { font-size: 13px !important; letter-spacing: .02em !important; }
.profile-name, .profile strong { font-size: 15px !important; }
.profile-meta, .profile small { font-size: 13px !important; }

/* Cabeçalhos e textos de apoio */
.aps-kicker { font-size: 14px !important; }
.page-copy, .page-head p { font-size: 17px !important; line-height: 1.55; }
.panel-subtitle, .block-copy, .section-head p { font-size: 15px !important; line-height: 1.5; }
.block-title, .section-title { font-size: 19px !important; }

/* Formulários, filtros e ações */
.aps-btn { font-size: 15px !important; }
.field label, .olabel, .care-label, .forecast-label { font-size: 14px !important; }
.field input, .field select, .field textarea, .global-search input,
.patient-search input, .search input { font-size: 15px !important; }
.tabs button, .filter-tabs button { font-size: 14px !important; }

/* Metadados e conteúdo operacional */
.summary-label, .summary-foot, .patient-meta, .patient-next,
.last-session, .tx-meta, .tx-status, .attention-meta,
.hero-meta, .detail-status, .session-meta, .pmeta,
.entry-date, .entry-text, .option p, .integration span,
.quality p, .block-copy { font-size: 14px !important; }
.patient-name, .tx-name, .attention-name, .pname,
.entry-title, .option strong, .integration strong { font-size: 16px !important; }
.care-value, .ovalue, .forecast-value, .tx-value { font-size: 16px !important; }
.clinical-note, .side-card p, .goal div, .privacy { font-size: 14px !important; }
.privacy-note, .section-link { font-size: 13px !important; }

/* Página pública — compacta, mas nítida */
.public-meta, .public-tags span, .date, .time { font-size: 13px !important; }
.intro, .public-service strong, .public-service div { font-size: 14px !important; }
.quality-head, .hero-link, .link-box, .slug-prefix { font-size: 15px !important; }

/* Piso tipográfico comum a todos os módulos */
small { font-size: 13px !important; line-height: 1.45 !important; }
button, input, select, textarea { font-size: 14px !important; }
th, td, label { font-size: 14px !important; }
.card p, .aps-card p, .card span, .aps-card span { line-height: 1.5; }
.topbar, .topbar button { font-size: 15px !important; }

/* Meus Horários — mesma régua dos demais módulos */
.page-head h1 { font-size: 36px !important; line-height: 1.12 !important; }
.page-head p { font-size: 16px !important; }
.panel-title { font-size: 20px !important; }
.panel-copy { font-size: 14px !important; }
.day-row { min-height: 72px !important; padding: 12px 14px !important; }
.day-name { font-size: 15px !important; }
.time-editor { min-width: 78px !important; min-height: 40px !important; font-size: 14px !important; font-weight: 750 !important; }
.add-range { font-size: 13px !important; }
.sync-card h3 { font-size: 20px !important; }
.sync-card p { font-size: 14px !important; }
.sync-item { font-size: 13px !important; }
.exception strong { font-size: 14px !important; }
.exception span { font-size: 13px !important; }
.exception-badge { font-size:14px !important; }
.rule { font-size: 14px !important; }
.summary-card strong { font-size: 27px !important; }
.summary-card > span { font-size: 14px !important; }
.day-actions-menu button { font-size: 14px !important; }

@media (max-width: 780px) {
  body { font-size: 16px; }
  .page-copy, .page-head p { font-size: 14px !important; }
}

/* Agenda PSI 2.0 — sistema cromático global
   O roxo permanece como identidade; cores de apoio comunicam significado. */
:root {
  --aps-neutral-bg: #f6f7fb;
  --aps-neutral-panel: #fbfcfe;
  --aps-neutral-border: #e6e8f0;
  --aps-blue: #2563a9;
  --aps-blue-soft: #eaf3fb;
  --aps-green: #08775a;
  --aps-green-soft: #e7f7f0;
  --aps-amber: #9a5a0a;
  --aps-amber-soft: #fff4dc;
  --aps-coral: #ad4b5e;
  --aps-coral-soft: #fcecef;
  --aps-indigo: #4f46a5;
  --aps-indigo-soft: #eeecfb;
  --aps-slate: #52647a;
  --aps-slate-soft: #edf2f6;
  --module-accent: var(--aps-cta);
  --module-accent-soft: var(--aps-surface-lilac);
  --module-accent-border: #dcd7f8;
}

body {
  background: var(--aps-neutral-bg) !important;
}

/* Assinatura discreta de cada módulo. */
body:has(.metrics) {
  --module-accent: #5b4fc2;
  --module-accent-soft: #efedff;
  --module-accent-border: #dcd8fb;
}
body:has(.agenda-shell) {
  --module-accent: #6655c5;
  --module-accent-soft: #f0edff;
  --module-accent-border: #ddd7fb;
}
body:has(.patients-shell) {
  --module-accent: var(--aps-blue);
  --module-accent-soft: var(--aps-blue-soft);
  --module-accent-border: #cfe3f3;
}
body:has(.finance-grid) {
  --module-accent: var(--aps-green);
  --module-accent-soft: var(--aps-green-soft);
  --module-accent-border: #c9eadc;
}
body:has(.record-shell) {
  --module-accent: var(--aps-indigo);
  --module-accent-soft: var(--aps-indigo-soft);
  --module-accent-border: #d8d4f3;
}
body:has(.schedule-shell) {
  --module-accent: #356d9b;
  --module-accent-soft: #eaf3f8;
  --module-accent-border: #cfe1ed;
}
body:has(.cancel-layout) {
  --module-accent: var(--aps-amber);
  --module-accent-soft: var(--aps-amber-soft);
  --module-accent-border: #f2ddb1;
}
body:has(.settings-shell) {
  --module-accent: var(--aps-slate);
  --module-accent-soft: var(--aps-slate-soft);
  --module-accent-border: #d8e0e8;
}
body:has(.preview-side), body:has(.booking-pane) {
  --module-accent: #5b4fc2;
  --module-accent-soft: #efedff;
  --module-accent-border: #dcd8fb;
}

.aps-kicker { color: var(--module-accent) !important; }
.aps-card {
  border-color: var(--aps-neutral-border);
  background: linear-gradient(180deg,#fff 0%,#fefeff 100%);
  box-shadow: 0 5px 18px rgba(37,36,68,.045),0 1px 3px rgba(37,36,68,.025);
}
.aps-card:hover { border-color: #dcdee9; }

/* Cards informativos: cor somente como detalhe, nunca como superfície dominante. */
.metric,
.summary-card,
.metric-card,
.overview-item,
.forecast-item,
.care-item {
  --card-accent: var(--module-accent);
  --card-soft: var(--module-accent-soft);
  position: relative;
  overflow: hidden;
}
.metric::before,
.summary-card::before,
.metric-card::before,
.overview-item::before,
.forecast-item::before,
.care-item::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--card-accent);
}
.metrics > :nth-child(1),
.summary > :nth-child(1),
.metric-grid > :nth-child(1),
.overview > :nth-child(1),
.forecast-grid > :nth-child(1),
.care-grid > :nth-child(1) { --card-accent: var(--aps-green); --card-soft: var(--aps-green-soft); }
.metrics > :nth-child(2),
.summary > :nth-child(2),
.metric-grid > :nth-child(2),
.overview > :nth-child(2),
.forecast-grid > :nth-child(2),
.care-grid > :nth-child(2) { --card-accent: var(--aps-blue); --card-soft: var(--aps-blue-soft); }
.metrics > :nth-child(3),
.summary > :nth-child(3),
.metric-grid > :nth-child(3),
.overview > :nth-child(3),
.forecast-grid > :nth-child(3),
.care-grid > :nth-child(3) { --card-accent: var(--aps-amber); --card-soft: var(--aps-amber-soft); }
.metrics > :nth-child(4),
.summary > :nth-child(4),
.metric-grid > :nth-child(4),
.overview > :nth-child(4),
.forecast-grid > :nth-child(4),
.care-grid > :nth-child(4) { --card-accent: var(--aps-indigo); --card-soft: var(--aps-indigo-soft); }

.metric-icon,
.summary-icon,
.tx-icon,
.integration-icon,
.service-icon,
.policy-icon,
.aps-state__icon {
  color: var(--card-accent,var(--module-accent)) !important;
  background: var(--card-soft,var(--module-accent-soft)) !important;
}
.summary-card .summary-value,
.metric .metric-value,
.metric-card strong,
.overview-item .ovalue,
.forecast-item .forecast-value {
  color: var(--card-accent,var(--module-accent)) !important;
}

/* Ritmo visual em painéis operacionais e colunas laterais. */
.side-stack > .aps-card:not(.sync-card),
.cancel-side > .aps-card,
.side-card,
.attention-card,
.attention,
.exceptions,
.rules {
  background: var(--aps-neutral-panel) !important;
  border-color: #e1e4ed !important;
}
.panel-title,
.section-title,
.section-head h2,
.block-title,
.panel-header .panel-title {
  color: var(--aps-primary);
}
.panel-title::before,
.section-title::before,
.section-head h2::before,
.block-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--module-accent);
  vertical-align: .12em;
}

/* Estados semânticos consistentes em todos os módulos. */
.aps-badge--success,
.appointment-state.success,
.tx-status.ok,
.status.ok,
.live-status,
.available .status {
  color: #087257 !important;
  border-color: #c8e8db !important;
  background: var(--aps-green-soft) !important;
}
.aps-badge--warning,
.appointment-state.warning,
.tx-status.pending,
.status.pending,
.exception-badge,
.status-pill.fee {
  color: #915408 !important;
  border-color: #f0d9a8 !important;
  background: var(--aps-amber-soft) !important;
}
.danger,
.late,
.day-row.has-error:not(.off) .row-message {
  color: #a33e53 !important;
}
.aps-state--error {
  border-color: #f1ccd4 !important;
  background: var(--aps-coral-soft) !important;
}
.aps-badge--neutral,
.status-pill.free,
.status-pill.refund {
  color: #365f85 !important;
  border-color: #cfe1ef !important;
  background: var(--aps-blue-soft) !important;
}

/* Campos: neutros em repouso, evidentes em interação. */
input,
select,
textarea,
.time-editor {
  border-color: #dfe2ec !important;
  background: #fff !important;
  transition: border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
input:hover,
select:hover,
textarea:hover,
.time-editor:hover {
  border-color: var(--module-accent-border) !important;
  background: #fdfdff !important;
}
input:focus,
select:focus,
textarea:focus,
.time-editor:focus {
  outline: 0;
  border-color: var(--module-accent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb,var(--module-accent) 14%,transparent) !important;
}
input:disabled,
select:disabled,
textarea:disabled,
.time-editor:disabled {
  color: #85899a !important;
  background: #f2f3f7 !important;
}

/* Acentos próprios dos módulos sem substituir as ações principais roxas. */
body:has(.patients-shell) .patient-card.selected {
  border-color: var(--module-accent-border) !important;
  background: linear-gradient(90deg,var(--module-accent-soft),#fff 45%) !important;
}
body:has(.patients-shell) .patient-avatar,
body:has(.patients-shell) .care-item::before { color: var(--aps-blue); }
body:has(.finance-grid) .bar-fill { background: linear-gradient(90deg,#36a47f,var(--aps-green)) !important; }
body:has(.finance-grid) .tx-icon { color: var(--aps-green) !important; background: var(--aps-green-soft) !important; }
body:has(.record-shell) .entry-card,
body:has(.record-shell) .record-hero { border-left-color: var(--aps-indigo) !important; }
body:has(.schedule-shell) .pause-note { color: #356582 !important; background: #eaf3f8 !important; }
body:has(.schedule-shell) .day-row:not(.off):hover { border-color: var(--module-accent-border) !important; background: #fbfdff !important; }
body:has(.cancel-layout) .policy-icon { color: var(--aps-amber) !important; background: var(--aps-amber-soft) !important; }
body:has(.settings-shell) .integration-icon { color: var(--aps-slate) !important; background: var(--aps-slate-soft) !important; }

/* O roxo continua reservado para marca, navegação e ações principais. */
.aps-btn--primary,
.nav button.active,
.toggle.on,
.switch.on {
  --module-accent: var(--aps-cta);
}

@media (prefers-contrast: more) {
  .metric::before,.summary-card::before,.metric-card::before,.overview-item::before,.forecast-item::before,.care-item::before { width: 6px; }
  .aps-card { border-color: #cfd2de; }
}

