/* Shared identity for existing and future internal screens. Load after module CSS. */
body.auth-page,
body.dashboard-body {
  --lia-roxo: #59106b;
  --lia-roxo-escuro: #400851;
  --lia-lilas: #d9b9e7;
  --lia-rosa: #f052b4;
  --lia-rosa-claro: #fcebf3;
  --lia-lilas-claro: #f3e8f7;
  --lia-branco: #ffffff;
  --lia-texto: #36253e;
  --lia-cinza: #66566b;
  --internal-border: #e4d5e8;
  --dashboard-bg: #fffaf8;
  --dashboard-card: #ffffff;
  --dashboard-border: var(--internal-border);
  --dashboard-text: var(--lia-texto);
  --dashboard-muted: var(--lia-cinza);
  --dashboard-purple: var(--lia-roxo);
  --dashboard-purple-dark: var(--lia-roxo-escuro);
  --dashboard-purple-light: var(--lia-lilas-claro);
  --dashboard-pink-light: var(--lia-rosa-claro);
  color: var(--lia-texto);
  font-family: system-ui, -apple-system, sans-serif;
  accent-color: var(--lia-roxo);
}

.internal-logo, .sidebar-brand img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.auth-brand { justify-content: center; }
.auth-logo { display: inline-block; }
.auth-page {
  background: radial-gradient(ellipse at top left, var(--lia-lilas-claro), transparent 65%),
    linear-gradient(135deg, #fffaf8, var(--lia-rosa-claro));
}
.auth-card { border-color: var(--internal-border); }
.auth-page .btn-lia:hover, .auth-page .btn-lia:focus-visible {
  background-color: var(--lia-roxo-escuro);
  color: #fff;
}
body.auth-page :focus-visible, body.dashboard-body :focus-visible {
  outline: 3px solid var(--lia-roxo);
  outline-offset: 3px;
}
.auth-page .check-card { position: relative; }
.auth-page .check-card input {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.auth-page .check-card input:focus-visible + span {
  outline: 3px solid var(--lia-roxo);
  outline-offset: 3px;
}
.dashboard-body .sidebar-link { color: var(--lia-cinza); }
.dashboard-body .sidebar-link:hover, .dashboard-body .sidebar-link.active {
  color: var(--lia-roxo);
  background: var(--lia-lilas-claro);
}
.dashboard-body .user-avatar {
  background: linear-gradient(145deg, var(--lia-roxo), #8c347d);
}
.dashboard-body .stat-card span,
.dashboard-body .lia-status-indicator { color: var(--lia-cinza); }
.dashboard-body .secondary-button,
.dashboard-body .logout-button:hover { border-color: var(--internal-border); }
.dashboard-body .empty-state {
  border-color: var(--internal-border);
  background: linear-gradient(145deg, #fffaf8, var(--lia-lilas-claro));
}
.dashboard-body .lia-status-card {
  background: linear-gradient(160deg, #fff 55%, var(--lia-rosa-claro));
}
.dashboard-body .dashboard-topbar a { color: var(--lia-roxo); }
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .dashboard-body * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.dashboard-body .sidebar-link [data-client-label] {
  display: inline;
  width: auto;
  min-width: 0;
  font-size: inherit;
}

/* ========================================
   LIA. 1.0 — IDENTIDADE PREMIUM GLOBAL
   Mantém o DOM e a lógica de cada módulo; este arquivo é carregado por último.
======================================== */
body.auth-page,
body.dashboard-body {
  --lia-roxo: #1f3a32;
  --lia-roxo-escuro: #162d27;
  --lia-lilas: #8a9a8e;
  --lia-rosa: #e5c5bb;
  --lia-rosa-claro: #f5e9e4;
  --lia-lilas-claro: #f0e7dd;
  --lia-branco: #fffefd;
  --lia-texto: #24322d;
  --lia-cinza: #5f6d67;
  --lia-salvia: #8a9a8e;
  --lia-areia: #f0e7dd;
  --lia-off-white: #faf9f6;
  --internal-border: #dedfd9;
  --dashboard-bg: #faf9f6;
  --dashboard-card: #fffefd;
  --dashboard-border: #e4e3dd;
  --dashboard-text: #24322d;
  --dashboard-muted: #5f6d67;
  --dashboard-purple: #1f3a32;
  --dashboard-purple-dark: #162d27;
  --dashboard-purple-light: #f0e7dd;
  --dashboard-pink-light: #f5e9e4;
  color: var(--dashboard-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  accent-color: #1f3a32;
}

body.dashboard-body:not(.dashboard-home) {
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% 0, rgba(229, 197, 187, .18), transparent 28rem),
    #faf9f6;
}

body.dashboard-body:not(.dashboard-home) .dashboard-sidebar {
  display: flex;
  flex-direction: column;
  width: 274px;
  padding: 30px 22px 24px;
  overflow-y: auto;
  color: #fff;
  background: #1f3a32;
  border-right: 0;
  box-shadow: 18px 0 55px rgba(22, 45, 39, .1);
}

body.dashboard-body:not(.dashboard-home) .sidebar-brand {
  min-height: 86px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 0 15px 6px;
}

body.dashboard-body:not(.dashboard-home) .sidebar-brand img {
  width: 132px;
  height: auto;
}

body.dashboard-body:not(.dashboard-home) .sidebar-menu { gap: 5px; }
body.dashboard-body:not(.dashboard-home) .sidebar-link {
  gap: 13px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: rgba(255, 255, 255, .84);
  font-size: 15.5px;
  font-weight: 560;
  line-height: 1.3;
}
body.dashboard-body:not(.dashboard-home) .sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}
body.dashboard-body:not(.dashboard-home) .sidebar-link.active {
  color: #1f3a32;
  background: #faf9f6;
  border-color: rgba(255, 255, 255, .34);
  box-shadow: 0 10px 24px rgba(10, 27, 22, .14);
}
body.dashboard-body:not(.dashboard-home) .sidebar-link.active [data-client-label],
body.dashboard-body:not(.dashboard-home) .sidebar-link:hover [data-client-label] { color: inherit; }
body.dashboard-body:not(.dashboard-home) .sidebar-divider { background: rgba(255, 255, 255, .14); }

body.dashboard-body:not(.dashboard-home) .dashboard-main {
  width: calc(100% - 274px);
  min-width: 0;
  margin-left: 274px;
}
body.dashboard-body:not(.dashboard-home) .dashboard-topbar {
  height: 82px;
  padding: 0 42px;
  background: rgba(250, 249, 246, .94);
  border-bottom-color: rgba(31, 58, 50, .09);
  backdrop-filter: blur(18px);
}
body.dashboard-body:not(.dashboard-home) .dashboard-topbar > strong,
body.dashboard-body:not(.dashboard-home) .topbar-title strong {
  color: #1f3a32;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
}
body.dashboard-body:not(.dashboard-home) .dashboard-topbar a {
  color: #365b4e;
  font-size: 15px;
  font-weight: 700;
}
body.dashboard-body:not(.dashboard-home) .mobile-menu-button { color: #1f3a32; }
body.dashboard-body:not(.dashboard-home) .dashboard-content {
  width: 100%;
  max-width: 1540px;
  margin-inline: auto;
  padding: 42px clamp(24px, 3vw, 42px) 64px;
}

body.dashboard-body:not(.dashboard-home) .dashboard-welcome h1,
body.dashboard-body:not(.dashboard-home) .dashboard-card h1,
body.dashboard-body:not(.dashboard-home) .dashboard-card h2,
body.dashboard-body:not(.dashboard-home) .dashboard-card h3,
body.dashboard-body:not(.dashboard-home) .conversation-column h1,
body.dashboard-body:not(.dashboard-home) .chat-header h2 {
  color: #1f3a32;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.015em;
}
body.dashboard-body:not(.dashboard-home) .dashboard-welcome h1,
body.dashboard-body:not(.dashboard-home) .dashboard-card h1 { font-size: clamp(28px, 3vw, 34px); }
body.dashboard-body:not(.dashboard-home) .dashboard-card h2 { font-size: clamp(19px, 2vw, 22px); }
body.dashboard-body:not(.dashboard-home) .dashboard-kicker,
body.dashboard-body:not(.dashboard-home) .card-kicker,
body.dashboard-body:not(.dashboard-home) .availability-kicker {
  color: #667b6d;
  font-size: 13px;
  letter-spacing: .13em;
}

body.dashboard-body:not(.dashboard-home) .dashboard-card,
body.dashboard-body:not(.dashboard-home) .consultation-box,
body.dashboard-body:not(.dashboard-home) .inbox-shell {
  max-width: 100%;
  border-color: #e4e3dd;
  background: #fffefd;
  box-shadow: 0 14px 38px rgba(31, 58, 50, .065);
}
body.dashboard-body:not(.dashboard-home) .dashboard-card {
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: 20px;
}
body.dashboard-body:not(.dashboard-home) .consultation-box,
body.dashboard-body:not(.dashboard-home) .inbox-shell { border-radius: 16px; }
body.dashboard-body:not(.dashboard-home) :is(p, small, .field-hint, .clinical-help, .profile-help, .financial-help) {
  line-height: 1.55;
}

body.dashboard-body:not(.dashboard-home) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 46px;
  border-color: #cfd4ce;
  border-radius: 11px;
  background: #fffefd;
  color: #24322d;
  font-size: 15px;
}
body.dashboard-body:not(.dashboard-home) textarea { min-height: 96px; }
body.dashboard-body:not(.dashboard-home) :is(input, select, textarea):focus {
  border-color: #6f8c79;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(138, 154, 142, .22);
}
body.dashboard-body:not(.dashboard-home) label {
  color: #32443d;
  font-size: 15px;
}

body.dashboard-body:not(.dashboard-home) :is(.dashboard-primary-button, button[type="submit"]:not(.link-button)) {
  min-height: 44px;
  border-color: #1f3a32;
  color: #fff;
  background: #1f3a32;
  font-size: 15px;
}
body.dashboard-body:not(.dashboard-home) :is(.dashboard-primary-button, button[type="submit"]:not(.link-button)):hover {
  border-color: #162d27;
  color: #fff;
  background: #162d27;
}
body.dashboard-body:not(.dashboard-home) :is(.secondary-button, .logout-button) {
  min-height: 44px;
  border-color: #bfc9c2;
  color: #1f3a32;
  background: #fffefd;
  font-size: 15px;
}
body.dashboard-body:not(.dashboard-home) :is(.secondary-button, .logout-button):hover {
  border-color: #8a9a8e;
  color: #162d27;
  background: #eef1ed;
}
body.dashboard-body:not(.dashboard-home) :is(.link-button, .card-link-button) { color: #315b4c; }
body.dashboard-body:not(.dashboard-home) button:focus-visible,
body.dashboard-body:not(.dashboard-home) a:focus-visible { outline-color: #e5c5bb; }

body.dashboard-body:not(.dashboard-home) table {
  width: 100%;
  color: #24322d;
  border-color: #e4e3dd;
}
body.dashboard-body:not(.dashboard-home) :is(th, td) { padding: 12px 14px; }
body.dashboard-body:not(.dashboard-home) th {
  color: #40564d;
  background: #f4f1ea;
  font-size: 14px;
  letter-spacing: .02em;
}
body.dashboard-body:not(.dashboard-home) :is(.status-badge, .inventory-badge, .knowledge-badge, .lia-badge, .state-pill) {
  border: 1px solid rgba(31, 58, 50, .09);
  color: #315446;
  background: #e8eee8;
}
body.dashboard-body:not(.dashboard-home) :is(.knowledge-tabs, .lia-tabs) button[aria-selected="true"] {
  border-color: #1f3a32;
  color: #1f3a32;
}
body.dashboard-body:not(.dashboard-home) :is(.external-note, .clinical-entry.is-addendum, .clinical-entry.is-resolution) {
  border-left-color: #8a9a8e;
}

/* Agenda, disponibilidade e listas densas. */
body.dashboard-body:not(.dashboard-home) .agenda-day { border-color: #dfe2dc; background: #fffefd; }
body.dashboard-body:not(.dashboard-home) .agenda-day.is-today { border-color: #8a9a8e; box-shadow: inset 0 0 0 1px #8a9a8e; }
body.dashboard-body:not(.dashboard-home) .agenda-day.outside,
body.dashboard-body:not(.dashboard-home) .work-day-closed { background: #f5f3ee; }
body.dashboard-body:not(.dashboard-home) .agenda-event {
  border-left-color: #8a9a8e;
  color: #24322d;
  background: #edf1ec;
}
body.dashboard-body:not(.dashboard-home) .agenda-event:hover { outline-color: #8a9a8e; }
body.dashboard-body:not(.dashboard-home) .upcoming-list li,
body.dashboard-body:not(.dashboard-home) :is(.financial-list, .inventory-list, .knowledge-list) > li {
  border-bottom-color: #e4e3dd;
}

/* Atendimento mantém a densidade e melhora contraste sem tocar na lógica. */
body.dashboard-body.inbox-page .inbox-content { height: calc(100vh - 82px); }
body.dashboard-body.inbox-page :is(.conversation-column header button, .chat-actions button, .reply-form button, .consultation-actions button) {
  min-height: 42px;
  color: #fff;
  background: #1f3a32;
}
body.dashboard-body.inbox-page .chat-actions .resolve {
  color: #1f3a32;
  background: #fffefd;
  border-color: #8a9a8e;
}
body.dashboard-body.inbox-page .conversation-item { color: #24322d; background: #fffefd; }
body.dashboard-body.inbox-page .conversation-item:hover,
body.dashboard-body.inbox-page .conversation-item.active { background: #f0e7dd; }
body.dashboard-body.inbox-page .message-region { background: #f7f4ee; }
body.dashboard-body.inbox-page .message-bubble { border-color: #dfe2dc; background: #fffefd; }
body.dashboard-body.inbox-page .message-bubble.saida { border-color: #c4d0c7; background: #e8eee8; }
body.dashboard-body.inbox-page .unread-badge { background: #c9887b; }

/* Feedbacks, vazios e diálogos. */
body.dashboard-body:not(.dashboard-home) :is(dialog, .modal-content, .clinical-preview) {
  border-color: #dfe2dc;
  border-radius: 18px;
  color: #24322d;
  background: #fffefd;
  box-shadow: 0 26px 70px rgba(22, 45, 39, .2);
}
body.dashboard-body:not(.dashboard-home) :is(.empty-state, .clinical-empty, .empty-conversation) {
  color: #5f6d67;
  background: linear-gradient(145deg, #fffefd, #f4efe8);
}
body.dashboard-body:not(.dashboard-home) :is(.error, [role="alert"].error) { color: #8c2938; }

/* Autenticação usa a mesma identidade em uma composição mais leve. */
body.auth-page {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(138, 154, 142, .24), transparent 30rem),
    radial-gradient(circle at 92% 88%, rgba(229, 197, 187, .3), transparent 28rem),
    #faf9f6;
}
body.auth-page .auth-card {
  border: 1px solid rgba(31, 58, 50, .1);
  background: rgba(255, 254, 253, .96);
  box-shadow: 0 28px 72px rgba(31, 58, 50, .13);
}
body.auth-page .auth-brand { justify-content: center; }
body.auth-page .auth-brand .internal-logo { width: 142px; }
body.auth-page .auth-header { text-align: center; }
body.auth-page .auth-header h1 {
  color: #1f3a32;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -.025em;
}
body.auth-page .auth-kicker { color: #62796b; }
body.auth-page .auth-header > p:not(.auth-kicker),
body.auth-page .auth-footer p { color: #5f6d67; font-size: 15px; }
body.auth-page :is(.form-control, .form-select) {
  min-height: 48px;
  border-color: #cfd4ce;
  color: #24322d;
  background: #fffefd;
  font-size: 16px;
}
body.auth-page :is(.form-control, .form-select):focus {
  border-color: #6f8c79;
  box-shadow: 0 0 0 3px rgba(138, 154, 142, .22);
}
body.auth-page :is(.btn-lia, .auth-button) {
  min-height: 48px;
  color: #fff;
  background: #1f3a32;
  border-color: #1f3a32;
  font-size: 16px;
}
body.auth-page :is(.btn-lia, .auth-button):hover { background: #162d27; }
body.auth-page :is(.area-card, .tom-card, .check-card, .rotina-card) {
  border-color: #dfe2dc;
  background: #fffefd;
}
body.auth-page :is(.area-card, .tom-card, .check-card, .rotina-card):hover,
body.auth-page :is(.area-card, .tom-card, .check-card, .rotina-card).selected {
  border-color: #8a9a8e;
  background: #f0f2ee;
  box-shadow: 0 10px 26px rgba(31, 58, 50, .09);
}
body.auth-page .progress-step.active span { background: #1f3a32; }
body.auth-page .progress-line { background: #dfe2dc; }
body.auth-page a { color: #315b4c; }

@media (max-width: 1024px) {
  body.dashboard-body:not(.dashboard-home) .dashboard-content { padding-inline: 28px; }
}

@media (max-width: 920px) {
  body.dashboard-body:not(.dashboard-home) .dashboard-sidebar { transform: translateX(-102%); }
  body.dashboard-body:not(.dashboard-home) .dashboard-sidebar.open { transform: translateX(0); }
  body.dashboard-body:not(.dashboard-home) .dashboard-main { width: 100%; margin-left: 0; }
  body.dashboard-body:not(.dashboard-home) .mobile-menu-button { display: block; }
}

@media (max-width: 650px) {
  body.dashboard-body:not(.dashboard-home) .dashboard-topbar { height: 70px; padding: 0 16px; gap: 12px; }
  body.dashboard-body:not(.dashboard-home) .dashboard-topbar > strong { font-size: 17px; }
  body.dashboard-body:not(.dashboard-home) .dashboard-topbar a { font-size: 14px; text-align: right; }
  body.dashboard-body:not(.dashboard-home) .dashboard-content { padding: 28px 16px 52px; }
  body.dashboard-body:not(.dashboard-home) .dashboard-card { padding: 19px; border-radius: 17px; }
  body.dashboard-body:not(.dashboard-home) :is(th, td) { padding: 10px 11px; }
  body.dashboard-body.inbox-page { height: auto; overflow: auto; }
  body.dashboard-body.inbox-page .inbox-content { height: auto; padding: 10px; }
  body.auth-page { padding: 18px 10px; }
  body.auth-page .auth-card { padding: 28px 20px; border-radius: 22px; }
}

/* ========================================
   LIA 1.0 — LEGIBILIDADE OPERACIONAL GLOBAL
======================================== */
body.dashboard-body,
body.auth-page {
  color: #24322d;
  font-size: 16px;
  line-height: 1.55;
}

body.dashboard-body .sidebar-link {
  gap: 0;
  min-height: 48px;
  font-size: 16px;
  font-weight: 600;
}

body.dashboard-body .dashboard-content :is(p, li, label, input, select, textarea, button, a),
body.dashboard-body.inbox-page :is(p, label, textarea, button),
body.auth-page :is(p, label, input, select, textarea, button, a) {
  font-size: max(1em, 16px);
}

body.dashboard-body :is(small, .field-hint, .clinical-help, .profile-help, .financial-help, .conversation-state, .message-state) {
  font-size: 14px;
  line-height: 1.5;
}

body.dashboard-body :is(th, td) {
  font-size: 15px;
  line-height: 1.45;
}

body.dashboard-body .dashboard-kicker,
body.dashboard-body .card-kicker,
body.dashboard-body .availability-kicker {
  font-size: 14px;
  line-height: 1.4;
}

body.dashboard-body :is(.status-badge, .inventory-badge, .knowledge-badge, .lia-badge, .state-pill) {
  font-size: 14px;
  line-height: 1.35;
}

body.dashboard-body:not(.dashboard-home) .dashboard-content {
  line-height: 1.55;
}

body.dashboard-body.clinical-page .clinical-header :is(p, span),
body.dashboard-body.clinical-page .clinical-entry :is(p, li, dd),
body.dashboard-body.clinical-page .clinical-field,
body.dashboard-body.clinical-page .clinical-history-statement p {
  font-size: 16px;
  line-height: 1.6;
}

body.dashboard-body.clinical-page .clinical-entry h3 {
  font-size: 18px;
  line-height: 1.4;
}

body.dashboard-body.clinical-page :is(.clinical-entry-status, .clinical-draft-updated, .clinical-finalized-at, .clinical-entry-meta, .clinical-attachment-meta, .clinical-history-sources a, .clinical-map-badge, .clinical-map-credit) {
  font-size: 14px;
  line-height: 1.45;
}

body.dashboard-body.clinical-page .clinical-workflow-section > summary small,
body.dashboard-body.clinical-page .clinical-assistant::before,
body.dashboard-body.clinical-page .is-ai-suggested::after {
  font-size: 14px;
  line-height: 1.45;
}

body.dashboard-body.clinical-page .clinical-entry,
body.dashboard-body.clinical-page .clinical-history-statement,
body.dashboard-body.clinical-page .clinical-alerts {
  padding-block: 18px;
}

body.dashboard-body.inbox-page :is(.conversation-item, .message-bubble, .consultation-box) {
  font-size: 15px;
  line-height: 1.5;
}

body.auth-page .auth-header > p:not(.auth-kicker),
body.auth-page .auth-footer p,
body.auth-page small {
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 650px) {
  body.dashboard-body :is(th, td) {
    font-size: 14px;
  }
  body.dashboard-body.clinical-page .clinical-entry {
    padding: 16px;
  }
}
