/* UNNI OS Staging v2.1.47 — tema neutro, cabeçalho e componentes integrais. */
/*
 * LOT 02 — fundação canônica do UI Kit congelado.
 * Os tokens --unni-* são a autoridade; --unni-theme-* permanece como adaptador
 * para a cascade histórica já consumida pelo Runtime.
 */
:root {
  color-scheme: dark;

  /* Tipografia e ritmo base */
  --unni-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --unni-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --unni-font-size-xs: 0.75rem;
  --unni-font-size-sm: 0.875rem;
  --unni-font-size-md: 1rem;
  --unni-font-size-lg: 1.125rem;
  --unni-font-size-xl: 1.25rem;
  --unni-font-size-2xl: 1.5rem;
  --unni-font-size-3xl: 1.875rem;
  --unni-line-height-tight: 1.2;
  --unni-line-height-body: 1.5;
  --unni-line-height-relaxed: 1.7;

  /* Escala de spacing aprovada: 4, 8, 12, 16, 20, 24 e 32px */
  --unni-space-2xs: 4px;
  --unni-space-xs: 8px;
  --unni-space-sm: 12px;
  --unni-space-md: 16px;
  --unni-space-lg: 20px;
  --unni-space-xl: 24px;
  --unni-space-2xl: 32px;

  /* Geometria compartilhada */
  --unni-radius-sm: 6px;
  --unni-radius-md: 10px;
  --unni-radius-card: 12px;
  --unni-radius-lg: 16px;
  --unni-radius-full: 9999px;
  --unni-touch-target: 44px;

  /* Marca e acento funcional preservam os dois papéis homologados */
  --unni-brand-primary: #7c3aed;
  --unni-brand-primary-hover: #6d28d9;
  --unni-brand-primary-soft: rgba(124, 58, 237, 0.12);
  --unni-accent-primary: #6366f1;
  --unni-accent-hover: #4f46e5;
  --unni-accent-light: rgba(99, 102, 241, 0.15);

  /* Dark é o fallback quando o atributo de tema ainda não foi aplicado */
  --unni-bg-primary: #0a0e17;
  --unni-bg-secondary: #111827;
  --unni-bg-tertiary: #1f2937;
  --unni-bg-elevated: #1e293b;
  --unni-bg-glass: rgba(17, 24, 39, 0.88);
  --unni-bg-canvas: var(--unni-bg-primary);
  --unni-surface-1: var(--unni-bg-secondary);
  --unni-surface-2: var(--unni-bg-elevated);
  --unni-surface-3: var(--unni-bg-tertiary);

  --unni-text-primary: #f9fafb;
  --unni-text-secondary: #cbd5e1;
  --unni-text-muted: #94a3b8;
  --unni-text-disabled: #6b7280;
  --unni-text-inverse: #0f172a;

  --unni-border-subtle: rgba(255, 255, 255, 0.08);
  --unni-border-default: rgba(255, 255, 255, 0.16);
  --unni-border-strong: rgba(255, 255, 255, 0.22);
  --unni-border-highlight: rgba(99, 102, 241, 0.4);
  --unni-border-focus: var(--unni-brand-primary);

  --unni-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --unni-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --unni-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --unni-status-info: #3b82f6;
  --unni-status-info-text: #93c5fd;
  --unni-status-info-bg: rgba(59, 130, 246, 0.15);
  --unni-status-info-border: rgba(59, 130, 246, 0.35);
  --unni-status-success: #10b981;
  --unni-status-success-text: #6ee7b7;
  --unni-status-success-bg: rgba(16, 185, 129, 0.15);
  --unni-status-success-border: rgba(16, 185, 129, 0.35);
  --unni-status-warning: #f59e0b;
  --unni-status-warning-text: #fcd34d;
  --unni-status-warning-bg: rgba(245, 158, 11, 0.15);
  --unni-status-warning-border: rgba(245, 158, 11, 0.35);
  --unni-status-danger: #ef4444;
  --unni-status-danger-text: #fca5a5;
  --unni-status-danger-bg: rgba(239, 68, 68, 0.15);
  --unni-status-danger-border: rgba(239, 68, 68, 0.35);
  --unni-status-throttled: #ec4899;
  --unni-status-throttled-bg: rgba(236, 72, 153, 0.18);

  /* Adaptador da nomenclatura histórica */
  --unni-theme-transition: 180ms ease;
  --unni-theme-bg: var(--unni-bg-primary);
  --unni-theme-bg-soft: var(--unni-bg-tertiary);
  --unni-theme-surface: var(--unni-bg-secondary);
  --unni-theme-surface-raised: var(--unni-bg-elevated);
  --unni-theme-surface-soft: var(--unni-bg-tertiary);
  --unni-theme-text: var(--unni-text-primary);
  --unni-theme-heading: var(--unni-text-primary);
  --unni-theme-on-accent: #ffffff;
  --unni-theme-muted: var(--unni-text-secondary);
  --unni-theme-text-muted: var(--unni-theme-muted);
  --unni-theme-soft: var(--unni-text-muted);
  --unni-theme-line: var(--unni-border-subtle);
  --unni-theme-line-strong: var(--unni-border-default);
  --unni-theme-input: var(--unni-bg-elevated);
  --unni-theme-hover: var(--unni-bg-tertiary);
  --unni-theme-overlay: var(--unni-bg-glass);
  --unni-theme-shadow: var(--unni-shadow-lg);
  --unni-theme-shadow-soft: var(--unni-shadow-md);
  --unni-theme-focus: var(--unni-border-focus);
  --unni-theme-primary: var(--unni-brand-primary);
  --unni-theme-primary-soft: var(--unni-brand-primary-soft);
  --unni-theme-success: var(--unni-status-success-text);
  --unni-theme-success-soft: var(--unni-status-success-bg);
  --unni-theme-warning: var(--unni-status-warning-text);
  --unni-theme-warning-soft: var(--unni-status-warning-bg);
  --unni-theme-danger: var(--unni-status-danger-text);
  --unni-theme-danger-soft: var(--unni-status-danger-bg);
}

:root[data-unni-theme="dark"] {
  color-scheme: dark;
}

:root[data-unni-theme="light"] {
  color-scheme: light;
  --unni-bg-primary: #f8fafc;
  --unni-bg-secondary: #ffffff;
  --unni-bg-tertiary: #f1f5f9;
  --unni-bg-elevated: #ffffff;
  --unni-bg-glass: rgba(255, 255, 255, 0.94);

  --unni-text-primary: #0f172a;
  --unni-text-secondary: #475569;
  --unni-text-muted: #64748b;
  --unni-text-disabled: #94a3b8;
  --unni-text-inverse: #f8fafc;

  --unni-border-subtle: rgba(0, 0, 0, 0.08);
  --unni-border-default: rgba(0, 0, 0, 0.14);
  --unni-border-strong: #94a3b8;
  --unni-border-highlight: rgba(99, 102, 241, 0.35);

  --unni-accent-light: rgba(99, 102, 241, 0.1);
  --unni-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --unni-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --unni-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

  --unni-status-info-text: #1d4ed8;
  --unni-status-info-bg: #eff6ff;
  --unni-status-info-border: #bfdbfe;
  --unni-status-success-text: #15803d;
  --unni-status-success-bg: #f0fdf4;
  --unni-status-success-border: #bbf7d0;
  --unni-status-warning-text: #a16207;
  --unni-status-warning-bg: #fefce8;
  --unni-status-warning-border: #fef08a;
  --unni-status-danger-text: #b91c1c;
  --unni-status-danger-bg: #fef2f2;
  --unni-status-danger-border: #fecaca;
}

/*
 * Correções críticas v2.1.46.
 * Este bloco fica deliberadamente no início do arquivo para evitar que uma
 * cópia parcial do asset preserve componentes claros dentro do tema escuro.
 */
html[data-unni-theme] body.unni-ui .unni-pwa-install,
html[data-unni-theme] body.unni-ui [data-pwa-install] {
  display: none !important;
}

html[data-unni-theme] body.unni-ui .unni-standard-brand {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-unni-theme] body.unni-ui .unni-standard-brand > img,
html[data-unni-theme] body.unni-ui .unni-standard-brand .unni-brand-logo {
  display: block;
  max-width: 100%;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain !important;
  object-position: left center !important;
}

html[data-unni-theme="light"] body.unni-ui .unni-brand-logo--dark-theme,
html[data-unni-theme="dark"] body.unni-ui .unni-brand-logo--light-theme {
  display: none !important;
}

html[data-unni-theme="light"] body.unni-ui .unni-brand-logo--light-theme,
html[data-unni-theme="dark"] body.unni-ui .unni-brand-logo--dark-theme {
  display: block !important;
}

html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-header,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-summary,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-summary > div,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-steps li,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-section,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-material,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-history,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-footer,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-next,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-empty,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-receipt,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-approved,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .os-timeline-event {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background-color: var(--unni-theme-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-section--attention,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-history {
  background-color: var(--unni-theme-surface-soft) !important;
}

html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey h2,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey h3,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey h4,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey strong {
  color: var(--unni-theme-heading) !important;
}

html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey p,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey small,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-summary span,
html[data-unni-theme="dark"] body.unni-client-dashboard .client-journey .journey-footer {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme] body.unni-ui,
:root[data-unni-theme] body.unni-theme-enabled {
  --bg: var(--unni-theme-bg);
  --panel: var(--unni-theme-surface);
  --panel2: var(--unni-theme-surface-soft);
  --surface: var(--unni-theme-surface);
  --soft-surface: var(--unni-theme-surface-soft);
  --line: var(--unni-theme-line);
  --border: var(--unni-theme-line);
  --strong: var(--unni-theme-line-strong);
  --text: var(--unni-theme-text);
  --muted: var(--unni-theme-muted);
  --soft: var(--unni-theme-soft);
  --mobile-bg: var(--unni-theme-bg);
  --mobile-surface: var(--unni-theme-surface);
  --mobile-surface-soft: var(--unni-theme-surface-soft);
  --mobile-line: var(--unni-theme-line);
  --mobile-muted: var(--unni-theme-muted);
  --mobile-white: var(--unni-theme-text);
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-bg) !important;
  font-family: var(--unni-font-sans);
  line-height: var(--unni-line-height-body);
  text-rendering: optimizeLegibility;
}

:root[data-unni-theme="dark"] body.unni-ui,
:root[data-unni-theme="dark"] body.unni-theme-enabled {
  background: var(--unni-bg-primary) !important;
  background-image: none !important;
}

:root[data-unni-theme] body.unni-ui ::selection,
:root[data-unni-theme] body.unni-theme-enabled ::selection {
  color: var(--unni-text-primary);
  background: var(--unni-brand-primary-soft);
}

:root[data-unni-theme] body :where(.surface, .card, .panel, .step, .form-panel, .intro, .hero, .section, .settings-card, .access-surface, .status, .metric, .check, .event, .material, .delivery, .timeline-section, details, .menu-popover) {
  color: var(--unni-theme-text);
  border-color: var(--unni-theme-line) !important;
  background-color: var(--unni-theme-surface) !important;
  box-shadow: var(--unni-theme-shadow-soft);
}

:root[data-unni-theme] body :where(.topbar, .top, header.surface, .access-topbar, .unni-standard-topbar) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-overlay) !important;
  box-shadow: var(--unni-theme-shadow) !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

:root[data-unni-theme] body :where(h1, h2, h3, h4, h5, h6, strong, b, legend, .unni-standard-title, .client-portal-title) {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme] body :where(p, small, .muted, .soft, .hint, .help, .intro, .caption, .description, .card-intro, .section-head p, .footer, .access-intro, .access-help, .access-support) {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme] body :where(label, .label, th, dt, .field > span, .field > small) {
  color: var(--unni-theme-muted);
}

:root[data-unni-theme] body :where(a) {
  color: var(--unni-theme-primary);
}

:root[data-unni-theme] body :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .input, .access-input) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line-strong) !important;
  background: var(--unni-theme-input) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body :where(input, select, textarea)::placeholder {
  color: var(--unni-theme-soft) !important;
  opacity: 1;
}

:root[data-unni-theme] body :where(input, select, textarea):focus {
  border-color: var(--unni-theme-focus) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--unni-theme-focus) 22%, transparent) !important;
}

:root[data-unni-theme] body :where(.button, .submit, .action, button, [role="button"], .integration-button, .access-button) {
  border-color: var(--unni-theme-line-strong) !important;
}

:root[data-unni-theme] body :where(.button:not(.primary):not(.button--primary):not(.danger), .action:not(.approve):not(.reject), button:not([class*="primary"]):not([class*="danger"]):not([class*="approve"]):not([class*="reject"]), .integration-button--ghost) {
  color: var(--unni-theme-heading) !important;
  background: var(--unni-theme-surface-raised) !important;
}

:root[data-unni-theme] body :where(.button:not(.primary):not(.button--primary):not(.danger), button:not([class*="primary"]):not([class*="danger"])):hover {
  background: var(--unni-theme-hover) !important;
}

:root[data-unni-theme] body :where(.button.primary, .button--primary, .submit, button.primary, .access-button, .action.approve) {
  color: var(--unni-theme-on-accent) !important;
  border-color: transparent !important;
  background: linear-gradient(110deg, #7c3aed 0%, #9333ea 50%, #db2777 100%) !important;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.25) !important;
}

:root[data-unni-theme] body :where(.button.danger, .action.reject, .danger) {
  color: var(--unni-theme-danger) !important;
  border-color: color-mix(in srgb, var(--unni-theme-danger) 38%, var(--unni-theme-line)) !important;
  background: var(--unni-theme-danger-soft) !important;
}

:root[data-unni-theme] body :where(.notice, .message, .privacy, .warning, .agency-maintenance-notice, .agency-maintenance) {
  border-color: var(--unni-theme-line-strong) !important;
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme] body :where(.chip, .badge, .status-badge, .pill, .tag),
:root[data-unni-theme] .unni-os-layout .chip,
:root[data-unni-theme] .chips > .chip {
  border-color: var(--unni-theme-line) !important;
  color: var(--unni-theme-muted) !important;
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme="dark"] body :where(.chip, .badge, .status-badge, .pill, .tag),
:root[data-unni-theme="dark"] .unni-os-layout .chip,
:root[data-unni-theme="dark"] .unni-os-layout span.chip,
:root[data-unni-theme="dark"] .chips > .chip,
:root[data-unni-theme="dark"] .chips > span.chip,
:root[data-unni-theme="dark"] body.unni-ui .chip,
:root[data-unni-theme="dark"] body.unni-ui span.chip {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f2ede4 !important;
  -webkit-text-fill-color: #f2ede4 !important;
  background: #282828 !important;
  background-color: #282828 !important;
}

:root[data-unni-theme="light"] body :where(.chip, .badge, .status-badge, .pill, .tag),
:root[data-unni-theme="light"] .unni-os-layout .chip,
:root[data-unni-theme="light"] .unni-os-layout span.chip,
:root[data-unni-theme="light"] .chips > .chip,
:root[data-unni-theme="light"] .chips > span.chip,
:root[data-unni-theme="light"] body.unni-ui .chip,
:root[data-unni-theme="light"] body.unni-ui span.chip {
  border: 1px solid #dfe4ee !important;
  border-color: #dfe4ee !important;
  color: #5e6680 !important;
  -webkit-text-fill-color: #5e6680 !important;
  background: #eef1f7 !important;
  background-color: #eef1f7 !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.profile-editor, .crop-dialog),
:root[data-unni-theme="dark"] body.unni-users .profile-editor,
:root[data-unni-theme="dark"] body.unni-users .crop-dialog {
  border-color: var(--unni-theme-line, rgba(255, 255, 255, 0.14)) !important;
  color: var(--unni-theme-text, #f8f4ff) !important;
  background: var(--unni-theme-surface-soft, rgba(255, 255, 255, 0.06)) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-editor h3,
:root[data-unni-theme="dark"] body.unni-users .profile-editor h3 {
  color: var(--unni-theme-heading, #ffffff) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-editor p,
:root[data-unni-theme="dark"] body.unni-users .profile-editor p {
  color: var(--unni-theme-text-muted, rgba(248, 244, 255, 0.70)) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .crop-dialog,
:root[data-unni-theme="dark"] body.unni-users .crop-dialog {
  background: #151326 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: var(--unni-theme-text, #f8f4ff) !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.profile-editor, .crop-dialog),
:root[data-unni-theme="light"] body.unni-users .profile-editor,
:root[data-unni-theme="light"] body.unni-users .crop-dialog {
  border-color: #dfe4ee !important;
  color: #0e1631 !important;
  background: #ffffff !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-editor h3,
:root[data-unni-theme="light"] body.unni-users .profile-editor h3 {
  color: #0e1631 !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-editor p,
:root[data-unni-theme="light"] body.unni-users .profile-editor p {
  color: #5e6680 !important;
}

:root[data-unni-theme] body :where(.notice.success, .message.ok, .success, .chip.good, .badge.good, .status-badge.is-ready, .badge--active, .status-active) {
  color: var(--unni-theme-success) !important;
  background: var(--unni-theme-success-soft) !important;
}

:root[data-unni-theme="dark"] body :where(.notice.success, .message.ok, .success, .chip.good, .badge.good, .status-badge.is-ready, .badge--active, .status-active) {
  border-color: rgba(110, 215, 163, 0.3) !important;
  color: #6ed7a3 !important;
  background: rgba(110, 215, 163, 0.12) !important;
}

:root[data-unni-theme] body :where(.notice.error, .message.error, .error, .chip.bad, .badge.bad, .badge--blocked, .danger-note) {
  color: var(--unni-theme-danger) !important;
  background: var(--unni-theme-danger-soft) !important;
}

:root[data-unni-theme="dark"] body :where(.notice.error, .message.error, .error, .chip.bad, .badge.bad, .badge--blocked, .danger-note) {
  border-color: rgba(255, 158, 174, 0.3) !important;
  color: #ff9eae !important;
  background: rgba(255, 158, 174, 0.12) !important;
}

:root[data-unni-theme] body :where(.warning, .chip.warn, .badge.warn, .badge--change, .status-badge.is-warning) {
  color: var(--unni-theme-warning) !important;
  background: var(--unni-theme-warning-soft) !important;
}

:root[data-unni-theme="dark"] body :where(.warning, .chip.warn, .badge.warn, .badge--change, .status-badge.is-warning) {
  border-color: rgba(240, 198, 108, 0.3) !important;
  color: #f0c66c !important;
  background: rgba(240, 198, 108, 0.12) !important;
}

:root[data-unni-theme] body :where(table, thead, tbody, tr, th, td) {
  color: var(--unni-theme-text);
  border-color: var(--unni-theme-line) !important;
}

:root[data-unni-theme] body :where(thead, th) {
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme] body :where(hr, .divider, .separator) {
  border-color: var(--unni-theme-line) !important;
}

:root[data-unni-theme="dark"] body :where(.unni-standard-brand, .brand:has(img), .access-topbar > a:first-child, .access-topbar > span:first-child) {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 40%);
}

:root[data-unni-theme="dark"] body :where(.projects-summary, .summary-grid, .hero-stats) {
  border-color: var(--unni-theme-line) !important;
  background: #1d1e22 !important;
}

:root[data-unni-theme="dark"] body :where(.projects-summary *, .summary-grid *, .hero-stats *) {
  border-color: var(--unni-theme-line) !important;
}

:root[data-unni-theme="dark"] body :where(.client-card, .attention-item, .timeline-item, .journey-card, .project-card, .type-option, .channel-card) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface-raised) !important;
}

/* Componentes históricos que possuíam cores claras fixas. */
:root[data-unni-theme="dark"] body.unni-dashboard :where(
  .search-panel,
  .summary-strip,
  .summary-card,
  .attention-panel,
  .attention-item,
  .projects-panel,
  .client-row,
  .tools-panel,
  .tool-link,
  .include-bar,
  .new-client-action
) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface) !important;
  background-image: none !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(.summary-strip, .summary-card) {
  background: #1d1e22 !important;
}

/* No tema claro, o resumo não pode herdar texto branco da faixa escura histórica. */
:root[data-unni-theme="light"] body.unni-dashboard :where(.summary-strip, .summary-card) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface) !important;
  background-image: none !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .summary-card strong {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .summary-card :where(span, small) {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(.attention-item, .client-row, .tool-link, .include-bar) {
  background: var(--unni-theme-surface-raised) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(
  .client-main h3,
  .attention-copy strong,
  .next-step strong,
  .dashboard-collapsible-title,
  .inactive-panel-title,
  .new-client-action__copy strong,
  .tool-copy strong,
  .summary-card strong
) {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(
  .client-main p,
  .client-type,
  .status-priority,
  .next-step span,
  .project-count,
  .dashboard-collapsible-description,
  .inactive-panel-description,
  .new-client-action__copy small,
  .summary-card span,
  .attention-copy span
) {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .new-client-action__icon {
  color: var(--unni-theme-heading) !important;
  border-color: var(--unni-theme-line-strong) !important;
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .dashboard-collapsible {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(.dashboard-collapsible-toggle, .inactive-toggle) {
  color: var(--unni-theme-heading) !important;
  border-color: var(--unni-theme-line-strong) !important;
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .menu-popover {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line-strong) !important;
  background: var(--unni-theme-surface-raised) !important;
  box-shadow: var(--unni-theme-shadow) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .menu-popover :where(a, button) {
  color: var(--unni-theme-text) !important;
  background: transparent !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .menu-popover :where(a, button):hover {
  color: var(--unni-theme-heading) !important;
  background: var(--unni-theme-hover) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .menu-popover .danger {
  color: var(--unni-theme-danger) !important;
  background: transparent !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .menu-popover .restore {
  color: var(--unni-theme-success) !important;
}

/* A inteligência operacional tinha uma regra fixa para texto preto. */
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-kicker,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-count,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention .attention-copy strong,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention .attention-copy span,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention .attention-copy small,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention-meta,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention-meta time,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-attention-meta em,
:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency .intelligence-owner {
  color: var(--unni-theme-text) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .intelligence-agency :where(.intelligence-attention .attention-copy span, .intelligence-attention .attention-copy small, .intelligence-attention-meta, .intelligence-attention-meta time, .intelligence-attention-meta em) {
  color: var(--unni-theme-muted) !important;
}

/* Cadastro: autorização e serviços nunca devem conservar cartões claros no escuro. */
:root[data-unni-theme="dark"] body.unni-client-registration :where(.ai-consent-card, .service-choice) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

:root[data-unni-theme="dark"] body.unni-client-registration .service-choice:has(> input[type="checkbox"]:checked) {
  border-color: #5d8171 !important;
  background: #252b29 !important;
  box-shadow: 0 0 0 3px rgb(110 215 163 / 7%) !important;
}

:root[data-unni-theme="dark"] body.unni-client-registration :where(
  .ai-consent-card .check,
  .service-content strong
) {
  color: var(--unni-theme-heading) !important;
  background: transparent !important;
}

:root[data-unni-theme="dark"] body.unni-client-registration :where(
  .ai-consent-card p,
  .ai-term-state,
  .service-billing,
  .service-date-field small,
  .service-schedule-status,
  .contract-help,
  .field small
) {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme="dark"] body.unni-client-registration .service-choice :where(input, select, textarea):disabled {
  color: var(--unni-theme-muted) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-input) !important;
  -webkit-text-fill-color: var(--unni-theme-muted) !important;
  opacity: 1 !important;
}

:root[data-unni-theme="dark"] body.unni-client-registration .service-choice :where(input, textarea):disabled::placeholder {
  color: var(--unni-theme-soft) !important;
  -webkit-text-fill-color: var(--unni-theme-soft) !important;
  opacity: 1 !important;
}

/* O estado auxiliar também precisa manter contraste no tema claro. */
:root[data-unni-theme="light"] body.unni-client-registration .ai-term-state {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme] body :where(.footer) {
  border-color: var(--unni-theme-line) !important;
}

/* ==========================================================================
   CANONICAL THEME SWITCHER (COMPACT SQUARE CONTROL)
   ========================================================================== */
.u-theme-switcher,
.unni-theme-switcher {
  position: relative;
  z-index: 1200;
  margin: 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
  color: var(--unni-theme-text);
}

.u-theme-switcher__toggle,
.unni-theme-switcher > summary {
  display: inline-flex !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--unni-theme-line, var(--ui-border, rgba(255, 255, 255, 0.14))) !important;
  border-radius: var(--ui-radius-sm, 10px) !important;
  color: var(--unni-theme-text, var(--ui-text, #f4f3fb)) !important;
  background: var(--unni-theme-surface-soft, var(--ui-surface-input, rgba(255, 255, 255, 0.06))) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  font-weight: 650 !important;
  list-style: none !important;
  user-select: none !important;
  box-sizing: border-box !important;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease !important;
}

.u-theme-switcher__toggle::-webkit-details-marker,
.unni-theme-switcher > summary::-webkit-details-marker { display: none; }
.u-theme-switcher__toggle::marker,
.unni-theme-switcher > summary::marker { content: ""; }

.u-theme-switcher__toggle:hover,
.unni-theme-switcher > summary:hover {
  background: var(--unni-theme-hover, var(--ui-surface-2, rgba(255, 255, 255, 0.12))) !important;
  border-color: var(--unni-theme-line-strong, var(--ui-border-strong, rgba(255, 255, 255, 0.28))) !important;
  color: var(--unni-theme-heading, #ffffff) !important;
}

.u-theme-switcher__toggle:focus-visible,
.unni-theme-switcher > summary:focus-visible {
  outline: 2px solid var(--unni-theme-focus, var(--ui-focus, #9333ea)) !important;
  outline-offset: 2px !important;
}

.u-theme-switcher__icon,
.unni-theme-switcher__icon {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
  font-size: 1.1rem !important;
  line-height: 1 !important;
}

.unni-theme-switcher__label,
.u-theme-switcher__label {
  display: none !important;
}

.u-theme-switcher__menu,
.unni-theme-switcher__menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  width: 180px !important;
  min-width: 180px !important;
  max-width: calc(100vw - 24px) !important;
  padding: 6px !important;
  border: 1px solid var(--unni-theme-line-strong, var(--ui-border-strong, rgba(255, 255, 255, 0.14))) !important;
  border-radius: var(--ui-radius-md, 12px) !important;
  background: var(--unni-theme-surface-raised, var(--ui-surface-raised, #1c1c24)) !important;
  box-shadow: var(--unni-theme-shadow, var(--ui-shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.35))) !important;
  display: none;
  flex-direction: column !important;
  gap: 3px !important;
  z-index: 999999 !important;
  box-sizing: border-box !important;
}

.u-theme-switcher[data-open="true"] .u-theme-switcher__menu,
.unni-theme-switcher[data-open="true"] .unni-theme-switcher__menu,
details.unni-theme-switcher[open] .unni-theme-switcher__menu {
  display: flex !important;
}

.u-theme-switcher__option,
.unni-theme-switcher__menu button {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 40px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: var(--ui-radius-xs, 8px) !important;
  color: var(--unni-theme-text, #f4f3fb) !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font: inherit !important;
  font-size: 0.82rem !important;
  font-weight: 650 !important;
  text-align: left !important;
  box-sizing: border-box !important;
  transition: background 140ms ease, color 140ms ease !important;
}

.u-theme-switcher__option:hover,
.unni-theme-switcher__menu button:hover {
  background: var(--unni-theme-hover, rgba(255, 255, 255, 0.08)) !important;
  color: var(--unni-theme-heading, #ffffff) !important;
}

.u-theme-switcher__option[aria-checked="true"],
.u-theme-switcher__option.is-active,
.unni-theme-switcher__menu button[aria-pressed="true"],
.unni-theme-switcher__menu button.is-active {
  color: var(--unni-theme-heading, #ffffff) !important;
  background: var(--unni-theme-primary-soft, rgba(147, 51, 234, 0.16)) !important;
  font-weight: 750 !important;
}

.unni-theme-switcher__menu button::before {
  content: none !important;
}

.unni-theme-switcher--floating {
  display: none !important;
}

:root[data-unni-theme] body,
:root[data-unni-theme] body :where(.surface, .card, .panel, .topbar, input, select, textarea, button, .button) {
  transition: color var(--unni-theme-transition), background-color var(--unni-theme-transition), border-color var(--unni-theme-transition), box-shadow var(--unni-theme-transition);
}

@media (max-width: 760px) {
  .u-theme-switcher,
  .unni-theme-switcher { position: relative !important; }
  .u-theme-switcher__menu,
  .unni-theme-switcher__menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    right: 0 !important;
    left: auto !important;
    width: 180px !important;
    max-width: calc(100vw - 24px) !important;
    z-index: 999999 !important;
  }
}

/*
 * UNNI OS Staging v2.1.47 — pente-fino integral.
 * Camada final de normalização para raiz, agência, cliente e módulos UNNI OS.
 */
:root[data-unni-theme] body.unni-ui,
:root[data-unni-theme] body.unni-theme-enabled {
  --unni-card-stripe: linear-gradient(90deg, rgba(168, 85, 247, 0.6) 0%, rgba(219, 39, 119, 0.45) 50%, rgba(168, 85, 247, 0.15) 100%);
  --unni-radius-shell: var(--unni-radius-lg);
  --unni-radius-control: var(--unni-radius-md);
  --unni-control-height: var(--unni-touch-target);
  accent-color: var(--unni-theme-primary);
}

/* Superfícies e divisões seguem o mesmo ritmo do painel inicial. */
:root[data-unni-theme] body.unni-ui :where(
  .surface,
  .card,
  .panel,
  .hero,
  .intro,
  .section,
  .step,
  .form-panel,
  .settings-card,
  .security-card,
  .integration-card,
  .provider-card,
  .user-card,
  .projects-panel,
  .tools-panel,
  .attention-panel,
  .search-panel,
  .access-surface,
  .os-panel,
  .os-window,
  .journey-section,
  .timeline-section,
  .agency-maintenance,
  .agency-maintenance-notice
) {
  border-color: var(--unni-theme-line) !important;
  border-radius: var(--unni-radius-shell) !important;
  color: var(--unni-theme-text) !important;
  background-color: var(--unni-theme-surface) !important;
  box-shadow: var(--unni-theme-shadow-soft) !important;
}

/* Faixa Aurora: mesmo recuo, espessura e pontas em qualquer página. */
:root[data-unni-theme] body.unni-ui :where(
  .hero,
  .intro,
  .card,
  .panel,
  .section,
  .step,
  .form-panel,
  .settings-card,
  .security-card,
  .integration-card,
  .provider-card,
  .user-card,
  .projects-panel,
  .tools-panel,
  .attention-panel,
  .summary-strip,
  .access-card,
  .os-panel,
  .os-window,
  .journey-section,
  .timeline-section
) {
  position: relative;
}

:root[data-unni-theme] body.unni-ui :where(
  .hero,
  .intro,
  .card,
  .panel,
  .section,
  .step,
  .form-panel,
  .settings-card,
  .security-card,
  .integration-card,
  .provider-card,
  .user-card,
  .projects-panel,
  .tools-panel,
  .attention-panel,
  .access-card,
  .os-panel,
  .os-window,
  .journey-section,
  .timeline-section
)::before {
  content: "" !important;
  position: absolute !important;
  z-index: 2 !important;
  top: 0 !important;
  right: 12px !important;
  left: 12px !important;
  width: auto !important;
  height: 4px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--unni-card-stripe) !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

/* Cabeçalho universal: marca, título central e ações claramente separadas. */
:root[data-unni-theme] body.unni-ui .unni-standard-topbar {
  position: sticky !important;
  z-index: 1100 !important;
  top: max(8px, env(safe-area-inset-top, 0px)) !important;
  display: grid !important;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, auto) minmax(160px, 1fr) !important;
  min-height: 72px !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 10px 14px !important;
  overflow: visible !important;
  border: 1px solid var(--unni-theme-line) !important;
  border-radius: 20px !important;
  background: var(--unni-theme-surface) !important;
  box-shadow: var(--unni-theme-shadow-soft) !important;
  isolation: isolate !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-brand,
:root[data-unni-theme] body.unni-ui .unni-globalbar__identity {
  min-width: 0 !important;
  justify-self: start !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-brand {
  display: inline-flex !important;
  width: clamp(148px, 16vw, 184px) !important;
  height: 46px !important;
  align-items: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-brand .unni-brand-logo,
:root[data-unni-theme] body.unni-ui .unni-standard-brand > img {
  display: block;
  width: 100% !important;
  height: 46px !important;
  max-height: 46px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain !important;
  object-position: left center !important;
}

:root[data-unni-theme] body.unni-ui .unni-globalbar__center {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-title {
  display: flex !important;
  min-width: 0 !important;
  min-height: 46px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 22px !important;
  border-top: 0 !important;
  border-right: 1px solid var(--unni-theme-line) !important;
  border-bottom: 0 !important;
  border-left: 1px solid var(--unni-theme-line) !important;
  color: var(--unni-theme-heading) !important;
  font-size: clamp(1rem, 2.3vw, 1.42rem) !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  text-align: center !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-title small {
  margin-top: 3px !important;
  color: var(--unni-theme-muted) !important;
  font-size: 0.68rem !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-actions {
  display: flex !important;
  min-width: 0 !important;
  min-height: 46px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding-left: 14px !important;
}

/* Controles: mesma altura, alinhamento, foco e texto em toda a aplicação. */
:root[data-unni-theme] body.unni-ui :where(
  button,
  .button,
  .submit,
  .action,
  [role="button"],
  .integration-button,
  .access-button,
  .unni-standard-back,
  .unni-globalbar__action,
  .client-logout
) {
  display: inline-flex !important;
  min-height: 44px;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  padding-inline: 14px;
  border-radius: var(--unni-radius-control) !important;
  color: var(--unni-theme-heading) !important;
  font-weight: 780;
  line-height: 1.15;
  text-align: center !important;
  text-decoration: none !important;
}

:root[data-unni-theme] body.unni-ui :where(button, .button, .submit, .action, [role="button"]):focus-visible,
:root[data-unni-theme] body.unni-ui :where(a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--unni-theme-focus) !important;
  outline-offset: 2px !important;
}

:root[data-unni-theme] body.unni-ui :where(button, .button, .submit, .action)[disabled],
:root[data-unni-theme] body.unni-ui :where(button, .button, .submit, .action)[aria-disabled="true"] {
  cursor: not-allowed !important;
  filter: none !important;
  opacity: 0.58 !important;
}

:root[data-unni-theme] body.unni-ui :where(.filter-button, .pill, .chip, .badge, .status-badge, .approval-pill) {
  display: inline-flex !important;
  min-height: 34px;
  align-items: center !important;
  justify-content: center !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap;
}

:root[data-unni-theme] body.unni-ui :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  min-height: var(--unni-control-height);
  padding: 11px 13px;
  border: 1px solid var(--unni-theme-line-strong) !important;
  border-radius: var(--unni-radius-control) !important;
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-input) !important;
  -webkit-text-fill-color: var(--unni-theme-text) !important;
}

:root[data-unni-theme] body.unni-ui textarea {
  min-height: 112px;
  resize: vertical;
}

:root[data-unni-theme] body.unni-ui :where(input, select, textarea):disabled {
  color: var(--unni-theme-muted) !important;
  background: var(--unni-theme-surface-soft) !important;
  -webkit-text-fill-color: var(--unni-theme-muted) !important;
  opacity: 1 !important;
}

/* Texto branco absoluto vira marfim claro; o contraste continua alto sem ofuscar. */
:root[data-unni-theme="dark"] body.unni-ui :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  strong,
  b,
  legend,
  .unni-standard-title,
  .client-portal-title,
  .dashboard-collapsible-title,
  .inactive-panel-title,
  .project-title,
  .client-main h3
) {
  color: #f8f3ea !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  body,
  td,
  dd,
  li,
  .button,
  button,
  .action,
  .tool-link,
  .client-row,
  .integration-card
) {
  color: #f2ede4 !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  .button.primary,
  .button--primary,
  .submit,
  .access-button,
  .action.approve,
  .unni-globalbar__action--primary
) {
  color: #fff8ed !important;
}

/* Componentes com cores históricas fixas recebem a superfície corrente. */
:root[data-unni-theme="dark"] body.unni-ui :where(
  .type-option,
  .service-choice,
  .ai-consent-card,
  .channel-card,
  .client-card,
  .client-row,
  .attention-item,
  .tool-link,
  .integration-card,
  .status,
  .metric,
  .check,
  .event,
  .material,
  .delivery,
  .journey-card,
  .journey-material,
  .journey-steps li,
  .journey-summary > div,
  .os-metric
) {
  border-color: var(--unni-theme-line) !important;
  color: var(--unni-theme-text) !important;
  background-color: var(--unni-theme-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  .summary-strip,
  .summary-card,
  .journey-summary,
  .projects-summary,
  .summary-grid,
  .hero-stats
) {
  border-color: var(--unni-theme-line) !important;
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-surface) !important;
  background-image: none !important;
}

/* Tabelas e listas permanecem legíveis e alinhadas. */
:root[data-unni-theme] body.unni-ui :where(table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--unni-theme-line) !important;
  border-radius: 16px;
  background: var(--unni-theme-surface) !important;
}

:root[data-unni-theme] body.unni-ui :where(th, td) {
  padding: 12px 14px;
  vertical-align: middle;
}

/* O painel recolhível ocupa e preserva a mesma geometria dos demais painéis. */
:root[data-unni-theme] body.unni-dashboard :where(.inactive-panel, .tools-panel) {
  width: 100% !important;
  margin-inline: 0 !important;
  overflow: visible !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.inactive-panel-summary, .dashboard-collapsible-summary) {
  width: 100% !important;
  min-height: 76px !important;
  align-items: center !important;
}

/* Documentos continuam brancos ao imprimir; o tema só melhora a leitura em tela. */
@media print {
  :root[data-unni-theme] body.unni-ui :where(.card, .panel, .section, .document, .page) {
    color: #111827 !important;
    border-color: #d1d5db !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  :root[data-unni-theme] body.unni-ui :where(.card, .panel, .section)::before {
    display: none !important;
  }
}

/* UNNI OS Staging v2.1.48 — materiais, aprovações e galeria sem superfícies claras residuais. */
:root[data-unni-theme] body.unni-dashboard :where(
  .group,
  .client-uploads,
  .approval-control-card,
  .approval-summary-card,
  .approval-control-comment,
  .approval-history li,
  .approval-history-empty,
  .approval-control-empty
) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.group-head, .file, .approval-history, .approval-control-meta) {
  border-color: var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-dashboard .client-uploads {
  gap: 1px !important;
  background: var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.client-uploads .file, .group .file, .approval-control-meta > div) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme] body.unni-dashboard .approval-control-meta {
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-dashboard :where(
  .group-head h4,
  .file strong,
  .approval-control-card h4,
  .approval-control-meta dd,
  .approval-history summary,
  .approval-control-comment p,
  .approval-history li p
) {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme] body.unni-dashboard :where(
  .group-head span,
  .file small,
  .empty,
  .approval-control-card-head > div > span,
  .approval-control-meta dt,
  .approval-control-meta dd small,
  .approval-control-comment span,
  .approval-history summary span,
  .approval-history-event-head time,
  .approval-history-event-head > span:last-child
) {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme] body.unni-dashboard .approval-history-event-meta span {
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-surface) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-summary-card--aprovado {
  border-color: rgb(88 171 131 / 42%) !important;
  background: #20332a !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-summary-card--revisao {
  border-color: rgb(214 174 74 / 40%) !important;
  background: #332e20 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-summary-card--reprovado {
  border-color: rgb(211 102 137 / 40%) !important;
  background: #36252b !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(
  .approval-summary-card span,
  .approval-summary-card strong,
  .approval-control-status,
  .status
) {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(.approval-control-status--pendente, .status) {
  background: #343434 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-control-status--aprovado {
  color: #b9f0d2 !important;
  background: #234333 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-control-status--revisao {
  color: #f2d994 !important;
  background: #443a21 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-control-status--reprovado {
  color: #f4b9ca !important;
  background: #4a2834 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .status.hidden {
  color: #e2c4d0 !important;
  background: #3a2c32 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .approval-history summary::after {
  color: var(--unni-theme-heading) !important;
  background: var(--unni-theme-surface) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .button.preview {
  color: #c9dcff !important;
  border-color: #526a91 !important;
  background: #26344b !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard input[type="file"]::file-selector-button {
  color: var(--unni-theme-heading) !important;
  border: 1px solid var(--unni-theme-line-strong) !important;
  border-radius: 9px !important;
  background: var(--unni-theme-surface-raised) !important;
}

@media (max-width: 760px) {
  :root[data-unni-theme] body.unni-ui :where(
    .hero,
    .intro,
    .card,
    .panel,
    .section,
    .step,
    .form-panel,
    .settings-card,
    .security-card,
    .integration-card,
    .provider-card,
    .user-card,
    .projects-panel,
    .tools-panel,
    .attention-panel,
    .access-card,
    .os-panel,
    .os-window,
    .journey-section,
    .timeline-section
  )::before {
    right: 10px !important;
    left: 10px !important;
    height: 3px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-topbar {
    grid-template-columns: minmax(118px, 1fr) auto !important;
    grid-template-rows: 48px auto !important;
    min-height: 108px !important;
    gap: 8px 10px !important;
    padding: 9px 10px !important;
    border-radius: 18px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__identity {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: clamp(118px, 39vw, 150px) !important;
    height: 42px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-brand .unni-brand-logo,
  :root[data-unni-theme] body.unni-ui .unni-standard-brand > img {
    height: 42px !important;
    max-height: 42px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__center,
  :root[data-unni-theme] body.unni-ui .unni-standard-title {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-title {
    min-height: 38px !important;
    padding: 7px 4px 0 !important;
    border-top: 1px solid var(--unni-theme-line) !important;
    border-right: 0 !important;
    border-left: 0 !important;
    font-size: 0.96rem !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-height: 42px !important;
    justify-self: end !important;
    gap: 5px !important;
    padding: 0 !important;
  }

  :root[data-unni-theme] body.unni-ui :where(.button, .submit, .action, .integration-button, .access-button, .unni-standard-back) {
    min-height: 44px;
    padding-inline: 12px;
  }

  :root[data-unni-theme] body.unni-ui :where(.grid, .fields, .panels, .hero, .actions) {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-unni-theme] body,
  :root[data-unni-theme] body *,
  :root[data-unni-theme] body *::before,
  :root[data-unni-theme] body *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .unni-theme-switcher { display: none !important; }
  :root[data-unni-theme] body { color: #111827 !important; background: #ffffff !important; }
}

/* UNNI OS Staging v2.1.47 — refinamento integral do dashboard da agência. */

/* A instalação continua disponível pelo navegador, mas não ocupa a barra operacional. */
:root[data-unni-theme] body.unni-ui .unni-standard-actions .unni-pwa-install {
  display: none !important;
}

/* Marca transparente também nas telas internas que ainda usam apenas a imagem histórica. */
:root[data-unni-theme="dark"] body.unni-ui .unni-standard-brand:not(:has(.unni-brand-logo)) {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("/agencia/assets/unni-ui/brand/unnicora-logo-light.webp") left center / contain no-repeat !important;
  box-shadow: none !important;
}

:root[data-unni-theme="dark"] body.unni-ui .unni-standard-brand:not(:has(.unni-brand-logo)) > img {
  visibility: hidden !important;
}

/* Cabeçalho em três zonas proporcionais e logotipo sem cápsula de fundo. */
:root[data-unni-theme] body.unni-dashboard .unni-standard-topbar {
  grid-template-columns: minmax(168px, 1fr) minmax(230px, auto) minmax(260px, 1fr) !important;
  gap: 0 !important;
  padding: 10px 16px !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-brand {
  display: inline-flex !important;
  width: clamp(154px, 16vw, 184px) !important;
  height: 46px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-brand::after {
  content: none !important;
  display: none !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-brand .unni-brand-logo {
  width: 100% !important;
  height: 46px !important;
  max-height: 46px !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: left center !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .unni-brand-logo--dark-theme,
:root[data-unni-theme="dark"] body.unni-dashboard .unni-brand-logo--light-theme {
  display: none !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .unni-brand-logo--light-theme,
:root[data-unni-theme="dark"] body.unni-dashboard .unni-brand-logo--dark-theme {
  display: block !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-title {
  display: flex !important;
  width: 100% !important;
  height: 46px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 22px !important;
  border-right: 1px solid var(--unni-theme-line) !important;
  border-left: 1px solid var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-actions {
  min-height: 46px !important;
  padding-left: 14px !important;
  gap: 8px !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-actions :where(
  .unni-theme-switcher > summary,
  .profile-chip,
  .logout-button
) {
  min-height: 44px !important;
  border-color: var(--unni-theme-line-strong) !important;
  color: var(--unni-theme-heading) !important;
  background: var(--unni-theme-surface-raised) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .unni-standard-actions .profile-chip {
  max-width: 168px !important;
}

/* Botões de contexto, estados e indicadores: fundo temático e alinhamento real. */
:root[data-unni-theme] body.unni-dashboard .action-menu > summary {
  display: grid !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid var(--unni-theme-line-strong) !important;
  border-radius: 13px !important;
  color: var(--unni-theme-heading) !important;
  background: var(--unni-theme-surface-soft) !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

:root[data-unni-theme] body.unni-dashboard .action-menu > summary::before {
  content: "•••";
  display: block;
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  transform: translateX(1px);
}

:root[data-unni-theme] body.unni-dashboard :where(.status-badge, .approval-pill) {
  display: inline-flex !important;
  min-height: 28px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 5px 10px !important;
  border: 1px solid var(--unni-theme-line-strong) !important;
  border-radius: 999px !important;
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-surface-soft) !important;
  font-size: 0.64rem !important;
  font-weight: 850 !important;
  letter-spacing: 0.045em !important;
  line-height: 1.15 !important;
  text-align: center !important;
  text-transform: uppercase !important;
  white-space: normal !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.status-badge--done, .approval-pill--approved) {
  border-color: color-mix(in srgb, var(--unni-theme-success) 45%, var(--unni-theme-line)) !important;
  color: var(--unni-theme-success) !important;
  background: var(--unni-theme-success-soft) !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.status-badge--review, .status-badge--waiting, .approval-pill--review) {
  border-color: color-mix(in srgb, var(--unni-theme-warning) 45%, var(--unni-theme-line)) !important;
  color: var(--unni-theme-warning) !important;
  background: var(--unni-theme-warning-soft) !important;
}

:root[data-unni-theme] body.unni-dashboard .approval-pill--rejected {
  border-color: color-mix(in srgb, var(--unni-theme-danger) 45%, var(--unni-theme-line)) !important;
  color: var(--unni-theme-danger) !important;
  background: var(--unni-theme-danger-soft) !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.client-approvals, .status-stack) {
  align-items: center !important;
}

:root[data-unni-theme] body.unni-dashboard .filter-button[aria-pressed="true"] {
  border-color: #60758f !important;
  color: var(--unni-theme-on-accent) !important;
  background: #3b5068 !important;
  box-shadow: none !important;
}

/* O painel recolhível passa a usar a mesma largura, ritmo e superfície dos demais. */
:root[data-unni-theme] body.unni-dashboard .inactive-panel.dashboard-collapsible {
  width: 100% !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface) !important;
  box-shadow: var(--unni-theme-shadow-soft) !important;
}

:root[data-unni-theme] body.unni-dashboard .inactive-panel .inactive-panel-summary {
  width: 100% !important;
  min-height: 96px !important;
  padding: 20px 24px !important;
}

:root[data-unni-theme] body.unni-dashboard .inactive-panel[open] .inactive-panel-summary {
  border-bottom: 1px solid var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-dashboard .inactive-panel .inactive-panel-content {
  display: grid !important;
  width: 100% !important;
  gap: 16px !important;
  padding: 20px 24px 24px !important;
}

:root[data-unni-theme] body.unni-dashboard .inactive-panel :where(.inactive-filters, .inactive-client-list) {
  width: 100% !important;
  margin: 0 !important;
}

:root[data-unni-theme] body.unni-dashboard .inactive-panel .inactive-client-list > .empty-state {
  display: grid !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 96px !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 18px !important;
  border: 1px dashed var(--unni-theme-line-strong) !important;
  border-radius: 16px !important;
  color: var(--unni-theme-muted) !important;
  background: var(--unni-theme-surface-soft) !important;
  text-align: center !important;
}

@media (max-width: 760px) {
  :root[data-unni-theme] body.unni-dashboard .unni-standard-topbar {
    grid-template-columns: minmax(128px, 1fr) auto !important;
    grid-template-rows: 50px 38px !important;
    gap: 8px 10px !important;
    height: auto !important;
    min-height: 112px !important;
    max-height: none !important;
    padding: 10px 12px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: clamp(128px, 38vw, 150px) !important;
    height: 44px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-brand .unni-brand-logo {
    height: 44px !important;
    max-height: 44px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-title {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    height: 38px !important;
    padding: 8px 0 0 !important;
    border-top: 1px solid var(--unni-theme-line) !important;
    border-right: 0 !important;
    border-left: 0 !important;
    font-size: 0.98rem !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    width: auto !important;
    min-height: 44px !important;
    padding: 0 !important;
    align-self: center !important;
    gap: 6px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions :where(
    .unni-theme-switcher > summary,
    .profile-chip,
    .logout-form,
    .logout-button
  ) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    border-radius: 13px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions .profile-chip {
    display: grid !important;
    place-items: center !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions .profile-name,
  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions .logout-button > span:last-child {
    display: none !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions .profile-avatar {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .inactive-panel .inactive-panel-summary {
    min-height: 0 !important;
    padding: 18px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .inactive-panel .inactive-panel-content {
    padding: 18px !important;
  }
}

/* Neutralização final: nenhum contêiner estrutural mantém azul-marinho no escuro. */
:root[data-unni-theme="dark"] body.unni-ui :where(
  .app-shell,
  .content,
  .shell,
  .main,
  main
) {
  background-color: transparent !important;
  background-image: none !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  .surface,
  .topbar,
  .search-panel,
  .summary-strip,
  .summary-card,
  .attention-panel,
  .projects-panel,
  .client-row,
  .tools-panel,
  .tool-link,
  .form-panel,
  .intro,
  .hero,
  .section,
  .panel,
  .card,
  .settings-card,
  .access-surface,
  .agency-maintenance-notice,
  .client-journey
) {
  border-color: var(--unni-theme-line) !important;
  background-color: var(--unni-theme-surface) !important;
  background-image: none !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .input,
  .access-input
) {
  background-color: var(--unni-theme-input) !important;
  background-image: none !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard :where(.client-row, .tool-link, .attention-item),
:root[data-unni-theme="dark"] body.unni-client-registration :where(.ai-consent-card, .service-choice),
:root[data-unni-theme="dark"] body.unni-client-dashboard :where(
  .journey-header,
  .journey-summary > div,
  .journey-steps li,
  .journey-section,
  .journey-material,
  .journey-history,
  .journey-footer,
  .os-timeline-event
) {
  background-color: var(--unni-theme-surface-raised) !important;
  background-image: none !important;
}

@media (max-width: 390px) {
  :root[data-unni-theme] body.unni-dashboard .unni-standard-topbar {
    grid-template-columns: minmax(112px, 1fr) auto !important;
    padding-inline: 10px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-brand {
    width: clamp(112px, 34vw, 132px) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions {
    gap: 4px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .unni-standard-actions :where(
    .unni-theme-switcher > summary,
    .profile-chip,
    .logout-form,
    .logout-button
  ) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }
}

/*
 * Assinatura Aurora padronizada.
 * Todas as faixas usam o mesmo recuo, espessura e terminação arredondada,
 * sem depender do recorte ou do raio particular de cada cartão.
 */
:root[data-unni-theme] body.unni-portal {
  --unni-card-stripe: linear-gradient(
    90deg,
    #f20fae 0%,
    #cf14dc 17%,
    #7828ff 38%,
    #24c6df 61%,
    #68b993 79%,
    #f39a24 100%
  );
}

:root[data-unni-theme] body.unni-portal :where(
  .hero,
  .intro,
  .card,
  .panel,
  .section,
  .step,
  .attention-panel,
  .attention-item,
  .projects-panel,
  .client-row,
  .tools-panel,
  .tool-link,
  .include-bar,
  .metric,
  .user-card,
  .group,
  .client-uploads,
  .delivery,
  .event,
  .contract-total,
  .contract-status-card,
  .ai-consent-card,
  .summary article
)::before,
:root[data-unni-theme] body.unni-client-dashboard :where(
  .os-window,
  .os-metric,
  .os-next-milestone,
  .os-delivery-card,
  .os-approval-list .approval-item,
  .os-timeline-event,
  .identity-choice-gate,
  .upload-panel,
  #canais.section,
  #canais .material
)::after {
  top: 0 !important;
  right: 12px !important;
  left: 12px !important;
  width: auto !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: var(--unni-card-stripe) !important;
  pointer-events: none !important;
}

/* Barra superior única para as telas temáticas do staging. */
:root[data-unni-theme] body.unni-ui {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-topbar {
  position: sticky !important;
  z-index: 1100 !important;
  top: max(8px, env(safe-area-inset-top, 0px)) !important;
  display: grid !important;
  grid-template-columns: minmax(154px, 1fr) minmax(220px, auto) minmax(154px, 1fr) !important;
  width: 100% !important;
  min-height: 68px !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 10px 14px !important;
  border: 1px solid var(--unni-theme-line) !important;
  border-radius: 20px !important;
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-surface) !important;
  background-image: none !important;
  box-shadow: var(--unni-theme-shadow-soft) !important;
  isolation: isolate !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-brand {
  display: inline-flex !important;
  width: clamp(148px, 16vw, 184px) !important;
  height: 46px !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-self: start !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-brand > img {
  width: 100% !important;
  height: 46px !important;
  max-height: 46px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain !important;
  object-position: left center !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-title {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 22px !important;
  border-right: 1px solid var(--unni-theme-line) !important;
  border-left: 1px solid var(--unni-theme-line) !important;
  color: var(--unni-theme-heading) !important;
  font-size: clamp(1rem, 2.3vw, 1.42rem) !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  text-align: center !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-actions {
  display: flex !important;
  min-width: 0 !important;
  min-height: 46px !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding-left: 14px !important;
}

@media (max-width: 760px) {
  :root[data-unni-theme] body.unni-portal :where(
    .hero,
    .intro,
    .card,
    .panel,
    .section,
    .step,
    .summary-strip,
    .summary-card,
    .attention-panel,
    .attention-item,
    .projects-panel,
    .client-row,
    .tools-panel,
    .tool-link,
    .include-bar,
    .metric,
    .user-card,
    .group,
    .client-uploads,
    .delivery,
    .event,
    .contract-total,
    .contract-status-card,
    .ai-consent-card,
    .summary article
  )::before,
  :root[data-unni-theme] body.unni-client-dashboard :where(
    .os-window,
    .os-metric,
    .os-next-milestone,
    .os-delivery-card,
    .os-approval-list .approval-item,
    .os-timeline-event,
    .identity-choice-gate,
    .upload-panel,
    #canais.section,
    #canais .material
  )::after {
    right: 10px !important;
    left: 10px !important;
    height: 3px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-topbar {
    grid-template-columns: minmax(118px, 1fr) auto !important;
    grid-template-rows: 48px 38px !important;
    min-height: 108px !important;
    gap: 8px 10px !important;
    padding: 9px 10px !important;
    border-radius: 18px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: clamp(118px, 39vw, 150px) !important;
    height: 42px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-brand > img {
    height: 42px !important;
    max-height: 42px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-title {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    min-height: 38px !important;
    padding: 7px 4px 0 !important;
    border-top: 1px solid var(--unni-theme-line) !important;
    border-right: 0 !important;
    border-left: 0 !important;
    font-size: 0.96rem !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-height: 42px !important;
    align-self: center !important;
    gap: 5px !important;
    padding: 0 !important;
  }
}

/* Portal do cliente: cabeçalho limpo e jornada coerente durante a visualização da agência. */
:root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions .unni-pwa-install {
  display: none !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-topbar {
  grid-template-columns: minmax(168px, 1fr) minmax(220px, auto) minmax(220px, 1fr) !important;
  gap: 0 !important;
  padding: 10px 16px !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-brand {
  display: inline-flex !important;
  width: clamp(154px, 16vw, 184px) !important;
  height: 46px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-brand .unni-brand-logo {
  width: 100% !important;
  height: 46px !important;
  max-height: 46px !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: left center !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .unni-brand-logo--dark-theme,
:root[data-unni-theme="dark"] body.unni-client-dashboard .unni-brand-logo--light-theme {
  display: none !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .unni-brand-logo--light-theme,
:root[data-unni-theme="dark"] body.unni-client-dashboard .unni-brand-logo--dark-theme {
  display: block !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-title {
  display: flex !important;
  width: 100% !important;
  height: 46px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 22px !important;
  border-right: 1px solid var(--unni-theme-line) !important;
  border-left: 1px solid var(--unni-theme-line) !important;
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions {
  min-height: 46px !important;
  padding-left: 14px !important;
  gap: 8px !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions :where(
  .unni-theme-switcher > summary,
  .client-logout
) {
  min-height: 44px !important;
  border-color: var(--unni-theme-line-strong) !important;
  color: var(--unni-theme-heading) !important;
  background: var(--unni-theme-surface-raised) !important;
  box-shadow: none !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .client-journey {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface) !important;
  box-shadow: var(--unni-theme-shadow) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(
  .journey-header,
  .journey-steps li,
  .journey-section,
  .journey-material,
  .journey-history,
  .journey-footer,
  .journey-next,
  .journey-empty,
  .os-timeline-event,
  .journey-confirm-shell
) {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-summary {
  background: var(--unni-theme-line) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-summary > div {
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-surface-raised) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(
  .journey-header h2,
  .journey-summary strong,
  .journey-steps strong,
  .journey-section-head h3,
  .journey-material h4,
  .journey-history > summary strong,
  .os-timeline-event h3,
  .journey-confirm-shell h2
) {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(
  .journey-header p,
  .journey-summary span,
  .journey-steps small,
  .journey-material p,
  .journey-history > summary small,
  .journey-footer,
  .os-timeline-event p,
  .journey-confirm-shell > p
) {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(.journey-section--attention, .journey-history) {
  background: var(--unni-theme-surface-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-project-code,
:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-material-meta span {
  color: var(--unni-theme-primary) !important;
  background: var(--unni-theme-primary-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(.journey-empty--success, .journey-approved) {
  color: var(--unni-theme-success) !important;
  border-color: color-mix(in srgb, var(--unni-theme-success) 45%, var(--unni-theme-line)) !important;
  background: var(--unni-theme-success-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-receipt {
  color: var(--unni-theme-warning) !important;
  border-color: color-mix(in srgb, var(--unni-theme-warning) 45%, var(--unni-theme-line)) !important;
  background: var(--unni-theme-warning-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-material-meta strong {
  color: var(--unni-theme-success) !important;
  background: var(--unni-theme-success-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-decision {
  border-color: var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-section-head > strong {
  color: var(--unni-theme-on-accent) !important;
  background: #252a46 !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-footer time {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .agency-maintenance-notice strong,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-copy strong,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-meta dd {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .agency-maintenance-notice span,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-copy h2,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-copy p,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-meta dt,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-meta dd small,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-passive {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .intelligence-kicker {
  border-color: color-mix(in srgb, var(--unni-theme-success) 45%, var(--unni-theme-line)) !important;
  color: var(--unni-theme-success) !important;
  background: var(--unni-theme-success-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .intelligence-owner {
  color: var(--unni-theme-warning) !important;
  background: var(--unni-theme-warning-soft) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-meta > div,
:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-passive {
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface-soft) !important;
}

/* CTA Inteligente do Painel do Cliente (Botão Principal Elegante, Proporcional e Nobre) */
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence .client-intelligence-action {
  grid-column: 1 / -1 !important;
  justify-self: start !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: auto !important;
  max-width: max-content !important;
  min-width: 250px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 0 28px !important;
  margin-top: 14px !important;
  border-radius: 12px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-decoration: none !important;
  cursor: pointer !important;
  outline: none !important;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence .client-intelligence-action::after {
  content: '→' !important;
  font-size: 1.05rem !important;
  line-height: 1 !important;
  transition: transform 180ms ease !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence .client-intelligence-action:hover::after {
  transform: translateX(4px) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-action {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .client-intelligence .client-intelligence-action:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(147, 51, 234, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .client-intelligence .client-intelligence-action {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .client-intelligence .client-intelligence-action:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.4) !important;
}

/* Botão de Exibição de Material (Padrão Nobre Idêntico ao CTA) */
:root[data-unni-theme] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  max-width: max-content !important;
  min-width: 220px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 24px !important;
  margin-top: 14px !important;
  border-radius: 12px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-decoration: none !important;
  cursor: pointer !important;
  outline: none !important;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
)::after {
  content: '→' !important;
  font-size: 1.05rem !important;
  line-height: 1 !important;
  transition: transform 180ms ease !important;
}

:root[data-unni-theme] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
):hover::after {
  transform: translateX(4px) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
) {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
):hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(147, 51, 234, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
) {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard :where(
  .journey-material-main > .button,
  .identity-proposal > .button,
  [data-open-media-gallery],
  [data-open-presence-kit]
):hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.4) !important;
}

@media (max-width: 760px) {
  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-topbar {
    grid-template-columns: minmax(124px, 1fr) auto !important;
    grid-template-rows: 50px 38px !important;
    gap: 8px 10px !important;
    height: auto !important;
    min-height: 112px !important;
    max-height: none !important;
    padding: 10px 12px !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: clamp(124px, 37vw, 148px) !important;
    height: 44px !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-brand .unni-brand-logo {
    height: 44px !important;
    max-height: 44px !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-title {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    height: 38px !important;
    padding: 8px 0 0 !important;
    border-top: 1px solid var(--unni-theme-line) !important;
    border-right: 0 !important;
    border-left: 0 !important;
    font-size: 0.98rem !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    width: auto !important;
    min-height: 44px !important;
    padding: 0 !important;
    align-self: center !important;
    gap: 6px !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions .unni-theme-switcher > summary {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions .client-logout {
    min-height: 42px !important;
    padding-inline: 11px !important;
    font-size: 0.68rem !important;
  }
}

/* Fechamento responsivo da barra compartilhada do UNNI OS. */
@media (max-width: 760px) {
  :root[data-unni-theme] body.unni-ui .unni-globalbar__identity {
    gap: 4px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__identity .unni-standard-brand {
    width: 118px !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__menu {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    padding: 0 !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__profile {
    display: none !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__logout button {
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__logout button > span {
    display: none !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-globalbar__identity:has(.unni-globalbar__menu)
    ~ .unni-globalbar__actions .unni-globalbar__action {
    display: none !important;
  }
}

/* v2.1.49: esta declaração precisa ser a última regra estrutural do arquivo. */
:root[data-unni-theme] body.unni-ui,
:root[data-unni-theme] body.unni-ui > :is(main, .shell, .app-shell, .page-shell) {
  transform: none !important;
  contain: none !important;
}

:root[data-unni-theme] body.unni-ui {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-topbar {
  position: sticky !important;
  z-index: 2149 !important;
  top: max(8px, env(safe-area-inset-top, 0px)) !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  backface-visibility: visible !important;
}

/* v2.1.50: o UNNI OS possui sua própria pilha de navegação.
   A barra deve ficar abaixo do backdrop e da lateral quando o menu está aberto. */
:root[data-unni-theme] body.unni-module .unni-os-main > .unni-standard-topbar {
  z-index: 30 !important;
  width: calc(100% - 48px) !important;
  margin: 12px 24px 0 !important;
}

:root[data-unni-theme] body.unni-module .unni-os-menu-button,
:root[data-unni-theme] body.unni-module .unni-os-layout .nav-backdrop {
  display: none !important;
}

@media (max-width: 980px) {
  :root[data-unni-theme] body.unni-module .unni-os-main > .unni-standard-topbar {
    width: calc(100% - 20px) !important;
    margin: 10px 10px 0 !important;
  }

  :root[data-unni-theme] body.unni-module .unni-os-menu-button {
    display: grid !important;
  }

  :root[data-unni-theme] body.unni-module .unni-os-layout.is-nav-open .nav-backdrop {
    display: block !important;
  }
}

/* v2.1.51: contraste consistente para todas as listas nativas do staging.
   As opções precisam declarar fundo e texto próprios porque o popup do SO
   não herda de forma confiável a superfície do campo fechado. */
:root[data-unni-theme="dark"] body select {
  color-scheme: dark !important;
}

:root[data-unni-theme="dark"] body select :is(option, optgroup),
:root[data-unni-theme="dark"] body select option {
  color: #f2ede4 !important;
  background-color: #232323 !important;
  -webkit-text-fill-color: #f2ede4 !important;
}

:root[data-unni-theme="dark"] body select option:checked {
  color: #fff8ed !important;
  background-color: #3a3449 !important;
  -webkit-text-fill-color: #fff8ed !important;
}

:root[data-unni-theme="dark"] body select :is(option, optgroup):disabled,
:root[data-unni-theme="dark"] body select option:disabled {
  color: #9da0a8 !important;
  background-color: #232323 !important;
  -webkit-text-fill-color: #9da0a8 !important;
}

:root[data-unni-theme="light"] body select {
  color-scheme: light !important;
}

:root[data-unni-theme="light"] body select :is(option, optgroup),
:root[data-unni-theme="light"] body select option {
  color: #182039 !important;
  background-color: #ffffff !important;
  -webkit-text-fill-color: #182039 !important;
}

:root[data-unni-theme="light"] body select option:checked {
  color: #0e1631 !important;
  background-color: #eeecff !important;
  -webkit-text-fill-color: #0e1631 !important;
}

:root[data-unni-theme="light"] body select :is(option, optgroup):disabled,
:root[data-unni-theme="light"] body select option:disabled {
  color: #667085 !important;
  background-color: #f7f8fc !important;
  -webkit-text-fill-color: #667085 !important;
}

/* O picker moderno do Chromium não deve transformar cada opção em um cartão.
   A lista é contínua, sem bordas, lacunas ou pontas brancas entre as linhas. */
@supports (appearance: base-select) {
  :root[data-unni-theme] body select::picker(select) {
    gap: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--unni-theme-surface-raised) !important;
    box-shadow: var(--unni-theme-shadow) !important;
    overflow: hidden auto !important;
  }

  :root[data-unni-theme] body select option,
  :root[data-unni-theme] body select optgroup {
    inline-size: 100% !important;
    margin: 0 !important;
    padding-block: 9px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background-clip: border-box !important;
    clip-path: none !important;
  }

  :root[data-unni-theme] body select option:checked,
  :root[data-unni-theme] body select option:hover,
  :root[data-unni-theme] body select option:focus-visible {
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  :root[data-unni-theme] body select option::checkmark {
    margin-inline-end: 8px !important;
  }
}

/* A mesma autoridade visual cobre caixas de marcação e botões de opção,
   inclusive controles inseridos dinamicamente pelos formulários. */
:root[data-unni-theme] body input:is([type="checkbox"], [type="radio"]) {
  accent-color: #6f5cff !important;
}

:root[data-unni-theme="dark"] body input:is([type="checkbox"], [type="radio"]) {
  color-scheme: dark !important;
}

:root[data-unni-theme="light"] body input:is([type="checkbox"], [type="radio"]) {
  color-scheme: light !important;
}

:root[data-unni-theme] body input:is([type="checkbox"], [type="radio"]):disabled {
  opacity: 0.62 !important;
}

/* v2.1.52: a entrada pública e as telas de autenticação usam `.intro`
   como texto, não como superfície. A regra genérica não pode criar um card
   atrás dessas frases nem desenhar a faixa Aurora sobre o parágrafo. */
:root[data-unni-theme] body:is(.unni-portal-home, .unni-auth) .intro {
  position: static !important;
  color: var(--unni-theme-muted) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body:is(.unni-portal-home, .unni-auth) .intro::before,
:root[data-unni-theme] body:is(.unni-portal-home, .unni-auth) .intro::after {
  content: none !important;
  display: none !important;
}

/* Superfícies completas da página de escolha de acesso. */
:root[data-unni-theme] body.unni-portal-home .chooser {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line) !important;
  background: var(--unni-theme-surface) !important;
  box-shadow: var(--unni-theme-shadow) !important;
}

:root[data-unni-theme] body.unni-portal-home .access-card {
  color: var(--unni-theme-text) !important;
  border-color: var(--unni-theme-line-strong) !important;
  background: var(--unni-theme-surface-raised) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-portal-home .access-card:hover,
:root[data-unni-theme] body.unni-portal-home .access-card:focus-visible {
  border-color: var(--unni-theme-focus) !important;
  background: var(--unni-theme-hover) !important;
  box-shadow: var(--unni-theme-shadow-soft) !important;
}

:root[data-unni-theme] body.unni-portal-home .access-card :is(h2, .access-action) {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme] body.unni-portal-home .access-card p {
  color: var(--unni-theme-muted) !important;
}

/* A transição acompanha o tema ativo e cobre totalmente a página anterior,
   evitando o clarão branco e o texto sem contraste observado no modo escuro. */
:root[data-unni-theme] body.unni-portal-home .welcome-transition {
  color: var(--unni-theme-text) !important;
  background: var(--unni-theme-bg) !important;
}

:root[data-unni-theme] body.unni-portal-home .welcome-transition h2 {
  color: var(--unni-theme-heading) !important;
}

:root[data-unni-theme] body.unni-portal-home .welcome-transition p {
  color: var(--unni-theme-muted) !important;
}

:root[data-unni-theme] body.unni-portal-home .welcome-transition__line {
  background: var(--unni-theme-line) !important;
}

:root[data-unni-theme] body.unni-portal-home .welcome-transition__line::after {
  background: linear-gradient(90deg, #f20fae, #7828ff 42%, #24c6df 72%, #f39a24) !important;
}

/* UI-005 — Normalização limpa e universal de todas as caixas de seleção (sem bordas duplas nem caixas dentro de caixas) */
:root[data-unni-theme] body :is(input[type="checkbox"], input[type="radio"]) {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--unni-theme-line-strong) !important;
  border-radius: 4px !important;
  background: var(--unni-theme-input) !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  vertical-align: middle !important;
  accent-color: #6f5cff !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

:root[data-unni-theme="dark"] body :is(input[type="checkbox"], input[type="radio"]) {
  color-scheme: dark !important;
  border-color: #575757 !important;
  background: #1b1b1b !important;
}

:root[data-unni-theme="light"] body :is(input[type="checkbox"], input[type="radio"]) {
  color-scheme: light !important;
  border-color: #cbd3e1 !important;
  background: #ffffff !important;
}

/* UI-003 — Estabilização do cabeçalho global compartilhado (evita piscar, sumir ou colapsar em qualquer rota) */
:root[data-unni-theme] body.unni-ui :where(.unni-standard-topbar, .unni-globalbar, header.topbar) {
  position: sticky !important;
  top: max(8px, env(safe-area-inset-top, 0px)) !important;
  z-index: 1000 !important;
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* UI-004 — Proteção de visualização do modal de mídias e PDFs (o cabeçalho não cobre o modal) */
:root[data-unni-theme] body.client-modal-open :where(.unni-standard-topbar, .unni-globalbar, header.topbar) {
  z-index: 1 !important;
  pointer-events: none !important;
}

/* UI-006 — Padronização de campos de login, senhas e usuários no tema escuro */
:root[data-unni-theme="dark"] body.unni-auth :where(input[type="text"], input[type="password"], input[type="email"], select) {
  color: #f2ede4 !important;
  border-color: #3d3d3d !important;
  background: #1b1b1b !important;
  -webkit-text-fill-color: #f2ede4 !important;
}

:root[data-unni-theme="dark"] body.unni-auth :where(input:focus, select:focus, textarea:focus) {
  border-color: #a8c7fa !important;
  outline: 2px solid rgba(168, 199, 250, 0.3) !important;
}

/* ==========================================================================
   PERFEIÇÃO DE TRANSIÇÃO E CONTRASTE DE TEXTO (CLARO / ESCURO)
   ========================================================================== */

/* Transição global suave e sem cintilação ao trocar de tema */
:root[data-unni-theme] body,
:root[data-unni-theme] body :where(.surface, .card, .panel, .hero, .intro, .section, .step, .topbar, .unni-standard-topbar, .unni-globalbar, input, select, textarea, button, .button, h1, h2, h3, h4, h5, h6, p, span, label, td, th, dt, dd, li, a, strong, small) {
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, fill 200ms ease, stroke 200ms ease !important;
}

/* --- MODO CLARO (LIGHT THEME) --- */
:root[data-unni-theme="light"] body.unni-ui :where(
  h1, h2, h3, h4, h5, h6, strong, b, legend,
  .unni-standard-title, .client-portal-title, .dashboard-collapsible-title,
  .inactive-panel-title, .project-title, .hero h2, .panel h3, .section-head h3
) {
  color: #0e1631 !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(
  body, p, span:not(.pill):not(.status):not(.badge), td, dd, li,
  .client-row, .access-card, .file strong, .approval-control-card h4
) {
  color: #182039 !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(
  label, .label, th, dt, .field > span, .field-note, .service-picker-head > div > span,
  .selected-services-head > div > span
) {
  color: #344054 !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(
  small, .muted, .soft, .hint, .help, .intro, .caption, .description,
  .card-intro, .section-head p, .footer, .access-intro, .access-help, .access-support,
  .approval-history-event-head time, .approval-control-meta dt
) {
  color: #59637d !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  color: #182039 !important;
  border-color: #cbd3e1 !important;
  background-color: #ffffff !important;
  -webkit-text-fill-color: #182039 !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(input, select, textarea)::placeholder {
  color: #8b94aa !important;
  -webkit-text-fill-color: #8b94aa !important;
}

/* --- MODO ESCURO (DARK THEME) --- */
:root[data-unni-theme="dark"] body.unni-ui :where(
  h1, h2, h3, h4, h5, h6, strong, b, legend,
  .unni-standard-title, .client-portal-title, .dashboard-collapsible-title,
  .inactive-panel-title, .project-title, .hero h2, .panel h3, .section-head h3
) {
  color: #f8f3ea !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  body, p, span:not(.pill):not(.status):not(.badge), td, dd, li,
  .client-row, .access-card, .file strong, .approval-control-card h4
) {
  color: #f2ede4 !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  label, .label, th, dt, .field > span, .field-note, .service-picker-head > div > span,
  .selected-services-head > div > span
) {
  color: #d0d5dd !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  small, .muted, .soft, .hint, .help, .intro, .caption, .description,
  .card-intro, .section-head p, .footer, .access-intro, .access-help, .access-support,
  .approval-history-event-head time, .approval-control-meta dt
) {
  color: #b9bcc4 !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  color: #f2ede4 !important;
  border-color: #4d4d4d !important;
  background-color: #1b1b1b !important;
  -webkit-text-fill-color: #f2ede4 !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(input, select, textarea)::placeholder {
  color: #8c909a !important;
  -webkit-text-fill-color: #8c909a !important;
}

/* ==========================================================================
   HIGH-TECH ENTERPRISE DESIGN SYSTEM (CYBER-PRECISION & GLASSMORPHISM)
   ========================================================================== */

@keyframes unniPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.88); }
}

@keyframes unniGlowSubtle {
  0%, 100% { box-shadow: 0 0 15px rgba(121, 40, 202, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 25px rgba(0, 223, 216, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2); }
}

/* 1. Fundo do Sistema — Preto Ônix & Grafite Neutro (Zero Azul) */
:root[data-unni-theme="dark"] body.unni-ui,
:root[data-unni-theme="dark"] body {
  background: #111113 !important;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.025) 0%, transparent 60%) !important;
  background-attachment: fixed !important;
  color: #f4f4f5 !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  .surface, .card, .panel, .hero, .intro, .section, .step,
  .form-panel, .settings-card, .security-card, .integration-card,
  .provider-card, .user-card, .projects-panel, .tools-panel,
  .attention-panel, .search-panel, .access-surface, .os-panel,
  .os-window, .journey-section, .timeline-section, .client-journey
) {
  background: linear-gradient(180deg, rgba(26, 26, 30, 0.88) 0%, rgba(18, 18, 21, 0.94) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02) inset !important;
}

/* 2. Ajuste Fino da Barra Superior (Topbar Flutuante, Estável e Padronizada em 100% das páginas) */
:root[data-unni-theme="dark"] body.unni-ui :where(.unni-standard-topbar, .unni-globalbar, header.topbar, .auth-topbar) {
  position: sticky !important;
  top: max(10px, env(safe-area-inset-top, 0px)) !important;
  z-index: 1000 !important;
  display: grid !important;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr) !important;
  align-items: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 68px !important;
  background: rgba(20, 20, 24, 0.90) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(24px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03) inset !important;
  margin: 8px auto 16px auto !important;
  max-width: 1360px !important;
  padding: 8px 18px !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.topbar-title, .unni-standard-title) {
  color: #f4f4f5 !important;
  font-weight: 600 !important;
  font-size: 1.05rem !important;
  letter-spacing: -0.01em !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0 24px !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
}


/* 2.1 Separação dos Itens da Barra Superior (Tema à esquerda e Segurança à direita) */
:root[data-unni-theme] body.unni-ui :where(.unni-standard-actions, .top-actions, .topbar-actions, header.topbar .secure, .topbar .unni-standard-actions) {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Botão de Tema Totalmente Limpo (Zero Verde / Zero Ponto LED) */
:root[data-unni-theme] body.unni-ui .unni-theme-switcher {
  display: inline-flex !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-ui .unni-theme-switcher > summary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-weight: 550 !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
  box-shadow: none !important;
  outline: none !important;
  transition: all 160ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-ui .unni-theme-switcher > summary {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f4f4f5 !important;
  -webkit-text-fill-color: #f4f4f5 !important;
}

:root[data-unni-theme="dark"] body.unni-ui .unni-theme-switcher > summary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

:root[data-unni-theme="light"] body.unni-ui .unni-theme-switcher > summary {
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: rgba(0, 0, 0, 0.05) !important;
  color: #18181b !important;
  -webkit-text-fill-color: #18181b !important;
}

:root[data-unni-theme="light"] body.unni-ui .unni-theme-switcher > summary:hover {
  background: rgba(0, 0, 0, 0.09) !important;
  border-color: rgba(0, 0, 0, 0.22) !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

:root[data-unni-theme] body.unni-ui .unni-theme-switcher__label {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-ui .unni-theme-switcher__label::before {
  content: none !important;
  display: none !important;
}

/* Selo de Segurança Independente (Apenas para o texto de segurança, NUNCA no theme-switcher) */
:root[data-unni-theme] body.unni-ui :where(
  header.topbar .secure > span,
  .topbar-actions > span,
  .top-actions > span,
  .unni-standard-actions > span
):not(.unni-theme-switcher__label) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 13px !important;
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  border-radius: 10px !important;
  color: #34d399 !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

:root[data-unni-theme] body.unni-ui :where(
  header.topbar .secure > span,
  .topbar-actions > span,
  .top-actions > span,
  .unni-standard-actions > span
):not(.unni-theme-switcher__label)::before {
  content: '' !important;
  display: inline-block !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 8px #10b981 !important;
  animation: unniPulse 2s infinite ease-in-out !important;
}



/* 3. Botões e Controles Refinados & Elegantes (Zero Saturação Excessiva) */

/* Botões Primários de Ação (CTAs Principais como Salvar, Cadastrar) */
:root[data-unni-theme] body.unni-ui :where(
  .button.primary,
  .button--primary,
  .submit,
  button.primary,
  .access-button,
  #saveButton
) {
  background: linear-gradient(180deg, #2e214d 0%, #1e1533 100%) !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.92rem !important;
  letter-spacing: 0.01em !important;
  border-radius: 11px !important;
  padding: 10px 22px !important;
  min-height: 42px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .button.primary,
  .button--primary,
  .submit,
  button.primary,
  .access-button,
  #saveButton
):hover:not(:disabled) {
  background: linear-gradient(180deg, #3d2a66 0%, #271a45 100%) !important;
  border-color: rgba(168, 85, 247, 0.7) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Botões Secundários, Ghost e de Ações do Painel */
:root[data-unni-theme] body.unni-ui :where(
  .button:not(.primary):not(.button--primary),
  .button--ghost,
  .secondary-button,
  .integration-button,
  #clientAccessButton,
  #contractButton,
  #aiTermButton,
  #pdfButton,
  a.button:not(.primary)
) {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e4e4e7 !important;
  -webkit-text-fill-color: #e4e4e7 !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  border-radius: 11px !important;
  padding: 9px 18px !important;
  min-height: 40px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  .button:not(.primary):not(.button--primary),
  .button--ghost,
  .secondary-button,
  .integration-button,
  #clientAccessButton,
  #contractButton,
  #aiTermButton,
  #pdfButton,
  a.button:not(.primary)
):hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  transform: translateY(-1px) !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(
  .button:not(.primary):not(.button--primary),
  .button--ghost,
  .secondary-button,
  .integration-button,
  #clientAccessButton,
  #contractButton,
  #aiTermButton,
  #pdfButton,
  a.button:not(.primary)
):hover:not(:disabled) {
  color: var(--unni-text-primary) !important;
  -webkit-text-fill-color: var(--unni-text-primary) !important;
}

:root[data-unni-theme] body.unni-ui :where(button, .button):disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Pílulas e Filtros de Status (Todos, Briefing, Criação, Revisão, etc.) */
:root[data-unni-theme] body.unni-ui :where(
  .filter-pill,
  .status-filter,
  .chips-filter button,
  .chips button,
  .segmented-control button,
  [data-project-filter],
  [data-status-filter]
) {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #a1a1aa !important;
  -webkit-text-fill-color: #a1a1aa !important;
  font-weight: 500 !important;
  font-size: 0.82rem !important;
  border-radius: 9999px !important;
  padding: 6px 16px !important;
  min-height: 32px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 160ms ease !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .filter-pill,
  .status-filter,
  .chips-filter button,
  .chips button,
  .segmented-control button,
  [data-project-filter],
  [data-status-filter]
):hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .filter-pill.is-active,
  .filter-pill.active,
  .status-filter.is-active,
  .status-filter.active,
  [data-project-filter][aria-pressed="true"],
  [data-status-filter][aria-pressed="true"]
) {
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 600 !important;
}

/* Garantir que barras superiores não cortem o dropdown do tema */
:root[data-unni-theme] body :where(.topbar, .unni-standard-topbar, .top-actions, .unni-standard-actions) {
  overflow: visible !important;
}

/* Menu Dropdown do Seletor de Aparência / Tema (Abertura Estritamente para Baixo) */
:root[data-unni-theme] body .unni-theme-switcher,
:root body .unni-theme-switcher,
.unni-theme-switcher {
  position: relative !important;
  display: inline-flex !important;
}

:root[data-unni-theme] body .unni-theme-switcher__menu,
:root body .unni-theme-switcher__menu,
.unni-theme-switcher__menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  inset-block-start: calc(100% + 8px) !important;
  inset-block-end: auto !important;
  right: 0 !important;
  left: auto !important;
  margin: 0 !important;
  transform: none !important;
  width: 180px !important;
  min-width: 170px !important;
  max-width: calc(100vw - 24px) !important;
  z-index: 999999 !important;
  background: #18181b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 14px !important;
  padding: 6px !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

:root[data-unni-theme="light"] body .unni-theme-switcher__menu,
:root[data-unni-theme="light"] .unni-theme-switcher__menu {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

:root[data-unni-theme] body.unni-ui .unni-theme-switcher__menu button,
:root[data-unni-theme] body.unni-client-dashboard .unni-theme-switcher__menu button {
  background: transparent !important;
  border: 0 !important;
  color: #a1a1aa !important;
  -webkit-text-fill-color: #a1a1aa !important;
  padding: 9px 12px !important;
  border-radius: 9px !important;
  font-weight: 500 !important;
  font-size: 0.86rem !important;
  box-shadow: none !important;
  min-height: 40px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  cursor: pointer !important;
  transition: all 140ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-ui .unni-theme-switcher__menu button:hover,
:root[data-unni-theme="dark"] body.unni-ui .unni-theme-switcher__menu button[aria-pressed="true"],
:root[data-unni-theme="dark"] body.unni-client-dashboard .unni-theme-switcher__menu button:hover,
:root[data-unni-theme="dark"] body.unni-client-dashboard .unni-theme-switcher__menu button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

:root[data-unni-theme="light"] body.unni-ui .unni-theme-switcher__menu button {
  color: #52525b !important;
  -webkit-text-fill-color: #52525b !important;
}

:root[data-unni-theme="light"] body.unni-ui .unni-theme-switcher__menu button:hover,
:root[data-unni-theme="light"] body.unni-ui .unni-theme-switcher__menu button[aria-pressed="true"],
:root[data-unni-theme="light"] body.unni-client-dashboard .unni-theme-switcher__menu button:hover,
:root[data-unni-theme="light"] body.unni-client-dashboard .unni-theme-switcher__menu button[aria-pressed="true"] {
  background: rgba(124, 58, 237, 0.08) !important;
  color: #7c3aed !important;
  -webkit-text-fill-color: #7c3aed !important;
}

/* 4. Inputs Acetinados em Preto Grafite */
:root[data-unni-theme="dark"] body.unni-ui :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  background: #18181b !important;
  border: 1px solid #2e2e33 !important;
  border-radius: 12px !important;
  color: #f4f4f5 !important;
  padding: 12px 16px !important;
  font-size: 0.95rem !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}


:root[data-unni-theme="dark"] body.unni-ui :where(input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus) {
  border-color: #a855f7 !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
  outline: none !important;
}

/* 5. Cards de Clientes e Projetos com Microinteração Neutra */
:root[data-unni-theme="dark"] body.unni-ui .access-card {
  transition: all 260ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .access-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
}

/* 6. Badges & Pílulas */
:root[data-unni-theme] body.unni-ui :where(.pill, .badge, .status) {
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  border-radius: 8px !important;
  text-transform: uppercase !important;
  font-size: 0.74rem !important;
}

/* 7. Ajuste do Tamanho da Logo (Mais proeminente e nítida) */
:root[data-unni-theme] body.unni-ui .unni-standard-brand,
:root[data-unni-theme] body.unni-ui .brand {
  display: inline-flex !important;
  align-items: center !important;
  width: clamp(175px, 20vw, 235px) !important;
  height: 56px !important;
  min-height: 56px !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-brand .unni-brand-logo,
:root[data-unni-theme] body.unni-ui .unni-standard-brand > img,
:root[data-unni-theme] body.unni-ui .brand img,
:root[data-unni-theme] body.unni-ui .unni-brand-logo {
  height: 52px !important;
  max-height: 52px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  object-position: left center !important;
}
/* 8. Botão Flutuante Unnicora (Desativado / Removido) */
:root[data-unni-theme] body :where(.back-to-top, #backToTop),
.back-to-top,
#backToTop {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* 9. Harmonização dos Botões da Barra Superior (Voltar ao Painel, Sair, Tema) */
:root[data-unni-theme="dark"] body.unni-ui :where(
  .unni-standard-back,
  .unni-globalbar__action,
  .unni-standard-actions > a,
  .top-actions > a,
  .topbar-actions > a,
  .topbar .actions > a,
  .topbar a.button,
  .topbar-right a,
  .client-logout,
  .unni-theme-switcher > summary
) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f4f4f5 !important;
  -webkit-text-fill-color: #f4f4f5 !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(
  .unni-standard-back,
  .unni-globalbar__action,
  .unni-standard-actions > a,
  .top-actions > a,
  .topbar-actions > a,
  .topbar .actions > a,
  .topbar a.button,
  .topbar-right a,
  .client-logout,
  .unni-theme-switcher > summary
):hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(
  .unni-standard-back,
  .unni-globalbar__action,
  .unni-standard-actions > a,
  .top-actions > a,
  .topbar-actions > a,
  .topbar .actions > a,
  .topbar a.button,
  .topbar-right a,
  .client-logout,
  .unni-theme-switcher > summary
) {
  border-color: rgba(0, 0, 0, 0.14) !important;
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(
  .unni-standard-back,
  .unni-globalbar__action,
  .unni-standard-actions > a,
  .top-actions > a,
  .topbar-actions > a,
  .topbar .actions > a,
  .topbar a.button,
  .topbar-right a,
  .client-logout,
  .unni-theme-switcher > summary
):hover {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-ui .unni-standard-back::before {
  content: '← ' !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
}

/* 10. Normalização e Centralização Perfeita de Telas de Autenticação & 2FA (Zero Azul / Padrão Cyber-Obsidian 2026) */
/* A geometria da superfície auth é compartilhada; o tema altera apenas a pintura. */
:root[data-unni-theme] body.unni-auth {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

:root[data-unni-theme="dark"] body.unni-auth {
  background: #09090b !important;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(147, 51, 234, 0.07) 0%, transparent 65%),
    radial-gradient(circle at 85% 90%, rgba(219, 39, 119, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #09090b 0%, #0d0d11 100%) !important;
  background-attachment: fixed !important;
}

:root[data-unni-theme] body.unni-auth :where(.shell, .page, .auth-page, main) {
  width: min(1200px, calc(100% - 32px)) !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 auto !important;
  padding: max(16px, env(safe-area-inset-top, 0px)) 0 max(16px, env(safe-area-inset-bottom, 0px)) !important;
  display: grid !important;
  grid-template-rows: auto 1fr !important;
  gap: 20px !important;
  align-items: center !important;
}

:root[data-unni-theme="dark"] body.unni-auth :where(.card, .auth-card, section.card) {
  width: min(500px, 100%) !important;
  margin: auto !important;
  align-self: center !important;
  justify-self: center !important;
  padding: clamp(28px, 5vw, 46px) !important;
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.85) 0%, rgba(13, 13, 16, 0.95) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 22px !important;
  backdrop-filter: blur(24px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04) inset !important;
  position: relative !important;
  overflow: hidden !important;
}


:root[data-unni-theme="dark"] body.unni-auth :where(.card, .auth-card, section.card)::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent 0%, rgba(147, 51, 234, 0.6) 35%, rgba(219, 39, 119, 0.5) 65%, transparent 100%) !important;
}

:root[data-unni-theme="dark"] body.unni-auth :where(.eyebrow, .kicker) {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace !important;
  color: #c084fc !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  display: block !important;
  margin-bottom: 8px !important;
}

:root[data-unni-theme] body.unni-auth h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem) !important;
  font-weight: 750 !important;
  letter-spacing: -0.04em !important;
  line-height: 1.05 !important;
  margin: 10px 0 12px 0 !important;
}

:root[data-unni-theme="dark"] body.unni-auth h1 {
  color: #ffffff !important;
}

:root[data-unni-theme] body.unni-auth p {
  font-size: 0.94rem !important;
  line-height: 1.55 !important;
}

:root[data-unni-theme="dark"] body.unni-auth p {
  color: #a1a1aa !important;
}

:root[data-unni-theme="dark"] body.unni-auth label {
  color: #a1a1aa !important;
}

/* Botão Primário em Telas de Autenticação (Agência, Cliente, 2FA) */
:root[data-unni-theme="dark"] body.unni-auth form :where(button[type="submit"], button.submit, button.button, input[type="submit"], .submit, .button:not(.toggle-password)) {
  width: 100% !important;
  min-height: 48px !important;
  background: linear-gradient(110deg, #7c3aed 0%, #9333ea 50%, #db2777 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: 12px !important;
  font-weight: 650 !important;
  font-size: 0.96rem !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  cursor: pointer !important;
  margin-top: 14px !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-auth form :where(button[type="submit"], button.submit, button.button, input[type="submit"], .submit, .button:not(.toggle-password)):hover {
  background: linear-gradient(110deg, #8b5cf6 0%, #a855f7 50%, #ec4899 100%) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

:root[data-unni-theme="light"] body.unni-auth form :where(button[type="submit"], button.submit, button.button, input[type="submit"], .submit, .button:not(.toggle-password)) {
  width: 100% !important;
  min-height: 48px !important;
  background: linear-gradient(110deg, #7c3aed 0%, #9333ea 50%, #db2777 100%) !important;
  border: 1px solid rgba(124, 58, 237, 0.2) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: 12px !important;
  font-weight: 650 !important;
  font-size: 0.96rem !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25) !important;
  cursor: pointer !important;
  margin-top: 14px !important;
  transition: all 180ms ease !important;
}

/* Links Secundários ("Não tenho acesso", "Voltar ao login") em Dark Grafite Fosco */
:root[data-unni-theme="dark"] body.unni-auth :where(.links a, a.back, .links .back) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  width: 100% !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 11px !important;
  color: #a1a1aa !important;
  -webkit-text-fill-color: #a1a1aa !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 160ms ease !important;
  margin-top: 8px !important;
}

:root[data-unni-theme="dark"] body.unni-auth :where(.links a, a.back, .links .back):hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  transform: translateY(-1px) !important;
}

/* 11. Painel Heroico Harmônico da Agência (Estrutura Base Universal para Modo Escuro e Claro) */
:root[data-unni-theme] body.unni-ui .dashboard-hero-panel {
  display: grid !important;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 16px !important;
  padding: 16px !important;
  border-radius: 18px !important;
  margin-bottom: 18px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-ui .user-greeting-card {
  display: flex !important;
  align-items: stretch !important;
  height: 100% !important;
  min-height: 100% !important;
  width: 100% !important;
}

:root[data-unni-theme] body.unni-ui .profile-hero-chip {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  align-items: center !important;
  gap: 20px !important;
  padding: 18px 24px !important;
  border-radius: 14px !important;
  text-decoration: none !important;
  transition: all 180ms ease !important;
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-ui .profile-avatar--hero {
  width: 64px !important;
  height: 64px !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

:root[data-unni-theme] body.unni-ui .profile-avatar--hero img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

:root[data-unni-theme] body.unni-ui .profile-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  width: 100% !important;
}

:root[data-unni-theme] body.unni-ui .profile-greeting {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

:root[data-unni-theme] body.unni-ui .profile-info strong.profile-name {
  font-size: 1.3rem !important;
  font-weight: 750 !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

:root[data-unni-theme] body.unni-ui .profile-role {
  font-size: 0.76rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}

/* Coluna de Ações à Direita: Cadastrar Novo Cliente em Destaque */
:root[data-unni-theme] body.unni-ui .dashboard-actions-column {
  display: flex !important;
  flex-direction: column !important;
  justify-content: stretch !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 84px !important;
  padding: 16px 22px !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%) !important;
  color: #fff !important;
  display: grid !important;
  place-items: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4) !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__icon svg {
  width: 22px !important;
  height: 22px !important;
  stroke: #ffffff !important;
  fill: none !important;
  stroke-width: 2 !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__copy strong {
  font-size: 1.02rem !important;
  font-weight: 700 !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__copy small {
  font-size: 0.78rem !important;
}

:root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__badge {
  margin-left: auto !important;
  padding: 6px 14px !important;
  border-radius: 10px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 180ms ease !important;
}

/* Barra de Busca Inline no Header de Projetos em Andamento */
:root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  width: 100% !important;
  margin-bottom: 14px !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row .panel-head {
  flex: 0 0 auto !important;
  margin: 0 !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row .panel-head h2 {
  margin: 0 !important;
  white-space: nowrap !important;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem) !important;
  letter-spacing: -0.03em !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .projects-search-inline {
  flex: 1 1 auto !important;
  max-width: 620px !important;
  min-width: 220px !important;
  margin: 0 !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row .project-count {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  font-size: 0.84rem !important;
  color: var(--unni-theme-muted, #a1a1aa) !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel :where(.search, .search-input-wrapper, label.search) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .search-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .search-icon svg {
  width: 16px !important;
  height: 16px !important;
}

:root[data-unni-theme] body.unni-ui .projects-panel .search input,
:root[data-unni-theme] body.unni-ui .projects-panel #clientSearch {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  border-radius: 10px !important;
  padding: 0 14px 0 40px !important;
  font-size: 0.88rem !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: all 180ms ease !important;
}

@media (max-width: 860px) {
  :root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  :root[data-unni-theme] body.unni-ui .projects-panel .projects-search-inline {
    order: 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 4px 0 0 0 !important;
  }
}

/* === TEMA ESCURO (DARK MODE) === */
:root[data-unni-theme="dark"] body.unni-ui .dashboard-hero-panel {
  background: linear-gradient(180deg, rgba(22, 22, 26, 0.85) 0%, rgba(14, 14, 17, 0.94) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.65) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-hero-chip {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f4f4f5 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-hero-chip:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-1px) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-avatar--hero {
  border: 2px solid rgba(168, 85, 247, 0.55) !important;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.35) !important;
  background: #18181b !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-greeting {
  color: #a1a1aa !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-info strong.profile-name {
  color: #ffffff !important;
}

:root[data-unni-theme="dark"] body.unni-ui .profile-role {
  color: #c084fc !important;
}

:root[data-unni-theme="dark"] body.unni-ui .dashboard-actions-column .new-client-action {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

:root[data-unni-theme="dark"] body.unni-ui .dashboard-actions-column .new-client-action:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  transform: translateY(-1px) !important;
}

:root[data-unni-theme="dark"] body.unni-ui .dashboard-actions-column .new-client-action__copy strong {
  color: #ffffff !important;
}

:root[data-unni-theme="dark"] body.unni-ui .dashboard-actions-column .new-client-action__copy small {
  color: #a1a1aa !important;
}

:root[data-unni-theme="dark"] body.unni-ui .dashboard-actions-column .new-client-action__badge {
  background: rgba(168, 85, 247, 0.12) !important;
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
  color: #c084fc !important;
}

:root[data-unni-theme="dark"] body.unni-ui .new-client-action:hover .new-client-action__badge {
  background: rgba(168, 85, 247, 0.22) !important;
  color: #ffffff !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
  transform: translateX(2px) !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) .search-icon svg {
  stroke: #a1a1aa !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) .search input,
:root[data-unni-theme="dark"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) #clientSearch {
  background: #111114 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f4f4f5 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) .search input:focus,
:root[data-unni-theme="dark"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) #clientSearch:focus {
  border-color: #a855f7 !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.22), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* === TEMA CLARO (LIGHT MODE) === */
:root[data-unni-theme="light"] body.unni-ui {
  background: #f8fafc !important;
  color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-ui .unni-standard-topbar {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

:root[data-unni-theme="light"] body.unni-ui .unni-standard-title {
  color: #09090b !important;
  -webkit-text-fill-color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.unni-theme-switcher > summary, .logout-button, .unni-standard-back, .top-actions > a) {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #18181b !important;
  -webkit-text-fill-color: #18181b !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.unni-theme-switcher > summary, .logout-button, .unni-standard-back, .top-actions > a):hover {
  background: rgba(0, 0, 0, 0.09) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

:root[data-unni-theme="light"] body.unni-ui .dashboard-hero-panel {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.06) !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-hero-chip {
  background: #fbfbfe !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-hero-chip:hover {
  background: #f4f4f8 !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
  transform: translateY(-1px) !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-avatar--hero {
  border: 2px solid #7c3aed !important;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.2) !important;
  background: #e2e8f0 !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-greeting {
  color: #71717a !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-info strong.profile-name {
  color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-ui .profile-role {
  color: #7c3aed !important;
}

:root[data-unni-theme="light"] body.unni-ui .dashboard-actions-column .new-client-action {
  background: #fbfbfe !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-ui .dashboard-actions-column .new-client-action:hover {
  background: #f4f4f8 !important;
  border-color: rgba(124, 58, 237, 0.3) !important;
  transform: translateY(-1px) !important;
}

:root[data-unni-theme="light"] body.unni-ui .dashboard-actions-column .new-client-action__copy strong {
  color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-ui .dashboard-actions-column .new-client-action__copy small {
  color: #71717a !important;
}

:root[data-unni-theme="light"] body.unni-ui .dashboard-actions-column .new-client-action__badge {
  background: rgba(124, 58, 237, 0.08) !important;
  border: 1px solid rgba(124, 58, 237, 0.25) !important;
  color: #7c3aed !important;
}

:root[data-unni-theme="light"] body.unni-ui .new-client-action:hover .new-client-action__badge {
  background: rgba(124, 58, 237, 0.15) !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
  transform: translateX(2px) !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) .search-icon svg {
  stroke: #71717a !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) .search input,
:root[data-unni-theme="light"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) #clientSearch {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #09090b !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) .search input:focus,
:root[data-unni-theme="light"] body.unni-ui :where(.dashboard-actions-column, .projects-panel) #clientSearch:focus {
  background: #ffffff !important;
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

@media (max-width: 768px) {
  :root[data-unni-theme] body.unni-ui .dashboard-hero-panel {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* 12. Botão Principal de Exibição de Material na Jornada do Cliente (Padrão Nobre Idêntico ao CTA) */
:root[data-unni-theme] body.unni-client-dashboard .journey-material-main > .button,
:root[data-unni-theme] body.unni-client-dashboard .identity-proposal > .button,
:root[data-unni-theme] body.unni-client-dashboard .journey-materials .button,
:root[data-unni-theme] body.unni-client-dashboard [data-open-media-gallery],
:root[data-unni-theme] body.unni-client-dashboard [data-open-presence-kit] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  max-width: max-content !important;
  min-width: 220px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 24px !important;
  margin-top: 14px !important;
  border-radius: 12px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  text-decoration: none !important;
  cursor: pointer !important;
  outline: none !important;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-material-main > .button,
:root[data-unni-theme="dark"] body.unni-client-dashboard .identity-proposal > .button,
:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-materials .button,
:root[data-unni-theme="dark"] body.unni-client-dashboard [data-open-media-gallery],
:root[data-unni-theme="dark"] body.unni-client-dashboard [data-open-presence-kit] {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-material-main > .button:hover,
:root[data-unni-theme="dark"] body.unni-client-dashboard .identity-proposal > .button:hover,
:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-materials .button:hover,
:root[data-unni-theme="dark"] body.unni-client-dashboard [data-open-media-gallery]:hover,
:root[data-unni-theme="dark"] body.unni-client-dashboard [data-open-presence-kit]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 28px rgba(147, 51, 234, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #d946ef 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-material-main > .button,
:root[data-unni-theme="light"] body.unni-client-dashboard .identity-proposal > .button,
:root[data-unni-theme="light"] body.unni-client-dashboard .journey-materials .button,
:root[data-unni-theme="light"] body.unni-client-dashboard [data-open-media-gallery],
:root[data-unni-theme="light"] body.unni-client-dashboard [data-open-presence-kit] {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-material-main > .button:hover,
:root[data-unni-theme="light"] body.unni-client-dashboard .identity-proposal > .button:hover,
:root[data-unni-theme="light"] body.unni-client-dashboard .journey-materials .button:hover,
:root[data-unni-theme="light"] body.unni-client-dashboard [data-open-media-gallery]:hover,
:root[data-unni-theme="light"] body.unni-client-dashboard [data-open-presence-kit]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.4) !important;
  background: linear-gradient(135deg, #6d28d9 0%, #7e22ce 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* 13. Proteção e Bloqueio de Cópia / Download no Visualizador de Mídia do Cliente */
:root[data-unni-theme] body.unni-client-dashboard [data-media-download],
:root[data-unni-theme] body.unni-client-dashboard .client-media-actions a {
  display: none !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-media-modal,
:root[data-unni-theme] body.unni-client-dashboard .client-media-stage,
:root[data-unni-theme] body.unni-client-dashboard .client-media-viewer,
:root[data-unni-theme] body.unni-client-dashboard .client-media-stage img,
:root[data-unni-theme] body.unni-client-dashboard .client-media-viewer img,
:root[data-unni-theme] body.unni-client-dashboard [data-kit-protected] img {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
  -webkit-touch-callout: none !important;
}

/* 14. Modal de Confirmação de Decisão do Cliente */
.journey-confirm-modal[hidden],
.journey-confirm-choice[hidden],
.journey-confirm-fields[hidden],
.journey-feedback[hidden],
[data-identity-target-field][hidden] {
  display: none !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-confirm-shell {
  width: min(520px, 94vw) !important;
  padding: 24px !important;
  border-radius: 20px !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-shell {
  background: #18181b !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7) !important;
  color: #f4f4f5 !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-shell {
  background: #ffffff !important;
  border: 1px solid #e4e4e7 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.14) !important;
  color: #09090b !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-confirm-fields textarea {
  width: 100% !important;
  min-height: 110px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  font-size: 0.88rem !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 150ms ease, box-shadow 150ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-fields textarea,
:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-fields select {
  background: #111114 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #f4f4f5 !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-fields textarea:focus,
:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-fields select:focus {
  border-color: #9333ea !important;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.25) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-fields textarea,
:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-fields select {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #09090b !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-fields textarea:focus,
:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-fields select:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
  background: #ffffff !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-confirm-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  margin-top: 20px !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-confirm-actions button {
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 16px !important;
  border-radius: 12px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-cancel] {
  background: #27272a !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #e4e4e7 !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-cancel]:hover {
  background: #3f3f46 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-cancel] {
  background: #f4f4f5 !important;
  border: 1px solid #d4d4d8 !important;
  color: #27272a !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-cancel]:hover {
  background: #e4e4e7 !important;
  border-color: #a1a1aa !important;
  color: #09090b !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-submit] {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35) !important;
}

:root[data-unni-theme="dark"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-submit]:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.5) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-submit] {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25) !important;
}

:root[data-unni-theme="light"] body.unni-client-dashboard .journey-confirm-actions [data-confirm-submit]:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35) !important;
}

/* 15. Estilização Nobre dos Ícones e Cards do Painel de Ferramentas da Agência */
:root[data-unni-theme] body.unni-dashboard .tools-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

@media (max-width: 1024px) {
  :root[data-unni-theme] body.unni-dashboard .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  :root[data-unni-theme] body.unni-dashboard .tools-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Card do Link */
:root[data-unni-theme] body.unni-dashboard .tool-link {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 78px !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  text-decoration: none !important;
  outline: none !important;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

:root[data-unni-theme] body.unni-dashboard .tool-link::after {
  display: none !important;
}

/* Dark Mode - Tool Link */
:root[data-unni-theme="dark"] body.unni-dashboard .tool-link {
  background: #18181b !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .tool-link:hover {
  background: #202024 !important;
  border-color: rgba(147, 51, 234, 0.45) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2) !important;
}

/* Light Mode - Tool Link */
:root[data-unni-theme="light"] body.unni-dashboard .tool-link {
  background: #ffffff !important;
  border: 1px solid #e4e4e7 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .tool-link:hover {
  background: #fafafa !important;
  border-color: #7c3aed !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.12) !important;
}

/* Quadrado do Ícone (.tool-icon) */
:root[data-unni-theme] body.unni-dashboard .tool-icon {
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  max-width: 46px !important;
  max-height: 46px !important;
  border-radius: 12px !important;
  transition: all 180ms ease !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Dark Mode - Quadrado e SVG do Ícone */
:root[data-unni-theme="dark"] body.unni-dashboard .tool-icon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(147, 51, 234, 0.08)) !important;
  border: 1px solid rgba(147, 51, 234, 0.3) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .tool-link:hover .tool-icon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.32), rgba(192, 38, 211, 0.18)) !important;
  border-color: rgba(192, 38, 211, 0.5) !important;
  transform: scale(1.05) !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .tool-icon svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  stroke: #d8b4fe !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .tool-link:hover .tool-icon svg {
  stroke: #ffffff !important;
}

/* Light Mode - Quadrado e SVG do Ícone */
:root[data-unni-theme="light"] body.unni-dashboard .tool-icon {
  background: rgba(124, 58, 237, 0.08) !important;
  border: 1px solid rgba(124, 58, 237, 0.2) !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .tool-link:hover .tool-icon {
  background: rgba(124, 58, 237, 0.15) !important;
  border-color: rgba(124, 58, 237, 0.4) !important;
  transform: scale(1.05) !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .tool-icon svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  stroke: #7c3aed !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
  transition: all 180ms ease !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .tool-link:hover .tool-icon svg {
  stroke: #6d28d9 !important;
}

/* Textos do Card */
:root[data-unni-theme] body.unni-dashboard .tool-copy {
  display: block !important;
  min-width: 0 !important;
}

:root[data-unni-theme="dark"] body.unni-dashboard .tool-copy strong {
  color: #f4f4f5 !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
}

:root[data-unni-theme="light"] body.unni-dashboard .tool-copy strong {
  color: #09090b !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
}

/* 16. Eliminação de Ícone Duplicado na Barra de Busca */
:root[data-unni-theme] body.unni-ui :where(.search, label.search, .search-input-wrapper)::before,
:root[data-unni-theme] body.unni-ui .search::before,
:root[data-unni-theme] body.unni-ui label.search::before,
:root[data-unni-theme] body.unni-ui .search-input-wrapper::before,
.search::before,
label.search::before,
.search-input-wrapper::before {
  content: none !important;
  display: none !important;
}

:root[data-unni-theme] body.unni-ui input[type="search"]::-webkit-search-decoration,
:root[data-unni-theme] body.unni-ui input[type="search"]::-webkit-search-cancel-button,
:root[data-unni-theme] body.unni-ui input[type="search"]::-webkit-search-results-button,
:root[data-unni-theme] body.unni-ui input[type="search"]::-webkit-search-results-decoration {
  display: none !important;
  -webkit-appearance: none !important;
}

/* ==========================================================================
   17. OTIMIZAÇÃO ULTRA-RESPONSIVA CROSS-PLATFORM & MOBILE
   (iOS Safari, iPhone Safe-Areas, Android Chrome, iPad, Tablets & Desktops)
   ========================================================================== */

/* 17.1. Regras Globais Cross-Platform e Anti-Zoom iOS */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

* {
  -webkit-tap-highlight-color: transparent !important;
  box-sizing: border-box;
}

/* Prevenção de Auto-Zoom no iOS Safari (font-size >= 16px obrigatório no mobile) */
@media (max-width: 860px) {
  :root[data-unni-theme] input,
  :root[data-unni-theme] select,
  :root[data-unni-theme] textarea,
  :root[data-unni-theme] #clientSearch,
  :root[data-unni-theme] .search input,
  :root[data-unni-theme] .filter-button {
    font-size: 16px !important;
  }

  /* Garantia Mobile iOS / Safari de Abertura para Baixo do Dropdown do Tema */
  :root[data-unni-theme] body .unni-theme-switcher__menu,
  :root body .unni-theme-switcher__menu,
  .unni-theme-switcher__menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    inset-block-start: calc(100% + 8px) !important;
    inset-block-end: auto !important;
    right: 0 !important;
    left: auto !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 999999 !important;
  }
}

/* 17.2. Suporte a Safe-Areas do iPhone (Notch, Dynamic Island e Home Indicator) */
:root[data-unni-theme] body.unni-ui .app-shell,
:root[data-unni-theme] body.unni-client-dashboard .app-shell {
  padding-left: max(12px, env(safe-area-inset-left)) !important;
  padding-right: max(12px, env(safe-area-inset-right)) !important;
  padding-bottom: max(24px, calc(16px + env(safe-area-inset-bottom))) !important;
}

:root[data-unni-theme] body.unni-ui .topbar,
:root[data-unni-theme] body.unni-client-dashboard .topbar {
  padding-top: max(10px, env(safe-area-inset-top)) !important;
  padding-left: max(14px, env(safe-area-inset-left)) !important;
  padding-right: max(14px, env(safe-area-inset-right)) !important;
}

:root[data-unni-theme] body.unni-ui .back-to-top {
  right: max(16px, calc(12px + env(safe-area-inset-right))) !important;
  bottom: max(16px, calc(12px + env(safe-area-inset-bottom))) !important;
}

/* 17.3. Rolagem Suave com Momentum Touch nos Filtros e Barras Horizontais */
:root[data-unni-theme] body.unni-ui .filters,
:root[data-unni-theme] body.unni-client-dashboard .filters,
:root[data-unni-theme] body.unni-ui [data-client-filter] {
  -webkit-overflow-scrolling: touch !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  touch-action: pan-x !important;
}

:root[data-unni-theme] body.unni-ui .filters::-webkit-scrollbar,
:root[data-unni-theme] body.unni-client-dashboard .filters::-webkit-scrollbar {
  display: none !important;
}

/* 17.4. Modais e Diálogos com Suporte a Dynamic Viewport (100dvh) e Touch Containment */
:root[data-unni-theme] dialog,
:root[data-unni-theme] .modal,
:root[data-unni-theme] .status-dialog,
:root[data-unni-theme] .journey-confirm-dialog,
:root[data-unni-theme] .media-gallery-modal {
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom)) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

/* 17.5. Touch Targets Mínimos (Apple HIG: 44x44px / Material: 48x48px) */
:root[data-unni-theme] .button,
:root[data-unni-theme] button:not(.status-dialog__close):not(.dashboard-toggle-arrow),
:root[data-unni-theme] .filter-button,
:root[data-unni-theme] .open-button,
:root[data-unni-theme] .action-menu summary,
:root[data-unni-theme] .new-client-action {
  min-height: 44px !important;
}

/* 17.6. Layout Ultra-Responsivo para Smartphones (< 768px) */
@media (max-width: 768px) {
  /* Topbar */
  :root[data-unni-theme] body.unni-ui .topbar {
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    border-radius: 18px !important;
  }

  :root[data-unni-theme] body.unni-ui .topbar .brand:not(.unni-standard-brand) img {
    width: 38px !important;
    height: 38px !important;
  }

  /* Hero Panel: Fernando + Novo Cliente */
  :root[data-unni-theme] body.unni-ui .dashboard-hero-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  :root[data-unni-theme] body.unni-ui .profile-hero-chip {
    padding: 12px 14px !important;
    min-height: 74px !important;
    border-radius: 14px !important;
  }

  :root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action {
    min-height: 68px !important;
    padding: 12px 16px !important;
    border-radius: 14px !important;
  }

  :root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  :root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__copy strong {
    font-size: 0.92rem !important;
  }

  :root[data-unni-theme] body.unni-ui .dashboard-actions-column .new-client-action__badge {
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
  }

  /* Resumo de Métricas (Grid 2 colunas no mobile) */
  :root[data-unni-theme] body.unni-ui .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1px !important;
    border-radius: 18px !important;
  }

  :root[data-unni-theme] body.unni-ui .summary-card {
    min-height: 84px !important;
    padding: 12px !important;
  }

  :root[data-unni-theme] body.unni-ui .summary-card strong {
    font-size: 1.55rem !important;
    margin-top: 4px !important;
  }

  /* Painel de Projetos em Andamento e Busca no Mobile */
  :root[data-unni-theme] body.unni-ui .projects-panel {
    padding: 14px 12px !important;
    border-radius: 18px !important;
  }

  :root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  :root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row .panel-head h2 {
    font-size: 1.18rem !important;
  }

  :root[data-unni-theme] body.unni-ui .projects-panel .projects-title-row .project-count {
    font-size: 0.78rem !important;
  }

  :root[data-unni-theme] body.unni-ui .projects-panel .projects-search-inline {
    order: 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin: 2px 0 0 0 !important;
  }

  :root[data-unni-theme] body.unni-ui .projects-panel .projects-search-inline :where(.search, .search-input-wrapper, label.search) {
    height: 46px !important;
    min-height: 46px !important;
  }

  :root[data-unni-theme] body.unni-ui .projects-panel .projects-search-inline #clientSearch {
    height: 46px !important;
    min-height: 46px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
  }

  /* Cards de Clientes no Mobile */
  :root[data-unni-theme] body.unni-ui .client-list {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  :root[data-unni-theme] body.unni-ui .client-row {
    grid-template-columns: 50px minmax(0, 1fr) 40px !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }

  :root[data-unni-theme] body.unni-ui .client-profile {
    width: 50px !important;
    height: 50px !important;
  }

  :root[data-unni-theme] body.unni-ui .client-main h3 {
    font-size: 0.96rem !important;
  }

  :root[data-unni-theme] body.unni-ui .row-actions {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  :root[data-unni-theme] body.unni-ui .open-button {
    min-height: 44px !important;
    font-size: 0.82rem !important;
  }

  /* Ferramentas no Mobile (Grid 2 colunas ou 1 coluna em telas estreitas) */
  :root[data-unni-theme] body.unni-dashboard .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .tool-link {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    min-height: 68px !important;
    padding: 10px 12px !important;
    gap: 10px !important;
    border-radius: 14px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .tool-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .tool-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  :root[data-unni-theme] body.unni-dashboard .tool-copy strong {
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
  }

  /* Jornada do Cliente no Mobile */
  :root[data-unni-theme] body.unni-client-dashboard .journey-material-main > .button,
  :root[data-unni-theme] body.unni-client-dashboard .identity-proposal > .button,
  :root[data-unni-theme] body.unni-client-dashboard .journey-materials .button,
  :root[data-unni-theme] body.unni-client-dashboard [data-open-media-gallery],
  :root[data-unni-theme] body.unni-client-dashboard [data-open-presence-kit] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    min-height: 48px !important;
    font-size: 0.92rem !important;
  }

  /* Modais de Decisão no Mobile */
  :root[data-unni-theme] body.unni-client-dashboard .journey-confirm-dialog {
    width: calc(100% - 20px) !important;
    padding: 18px 16px !important;
    border-radius: 20px !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-confirm-actions {
    flex-direction: column-reverse !important;
    gap: 10px !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-confirm-actions button {
    width: 100% !important;
    min-height: 48px !important;
  }
}

/* 17.7. Telas Muito Estreitas (iPhone SE / Galaxy Fold - <= 375px) */
@media (max-width: 375px) {
  :root[data-unni-theme] body.unni-dashboard .tools-grid {
    grid-template-columns: 1fr !important;
  }

  :root[data-unni-theme] body.unni-ui .summary-strip {
    grid-template-columns: 1fr !important;
  }

  :root[data-unni-theme] body.unni-ui .brand h1 {
    font-size: 1.05rem !important;
  }
}

/* 17.8. Tablets & iPads (769px a 1100px) */
@media (min-width: 769px) and (max-width: 1100px) {
  :root[data-unni-theme] body.unni-ui .client-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  :root[data-unni-theme] body.unni-ui .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ==========================================================================
   CORREÇÕES CIRÚRGICAS CONSOLIDADAS
   ========================================================================== */

/* 1. Caixa de login compacta e elegante */
:root body.unni-ui.unni-auth :where(.card, .auth-card, section.card, .login-card),
:root[data-unni-theme] body.unni-auth :where(.card, .auth-card, section.card, .login-card) {
  width: min(410px, calc(100% - 24px)) !important;
  max-width: 410px !important;
  padding: 28px 24px !important;
  border-radius: 20px !important;
  margin: 0 auto !important;
}

:root body.unni-ui.unni-auth :where(h1#access-title, h1#login-title, .auth-card h1, .hero h1),
:root[data-unni-theme] body.unni-auth :where(h1#access-title, h1#login-title, .auth-card h1, .hero h1) {
  font-size: 1.55rem !important;
  letter-spacing: -0.02em !important;
  line-height: 1.15 !important;
  margin: 6px 0 6px !important;
}

:root body.unni-ui.unni-auth .intro,
:root[data-unni-theme] body.unni-auth .intro {
  font-size: 0.84rem !important;
  line-height: 1.45 !important;
  margin-bottom: 16px !important;
}

:root body.unni-ui.unni-auth .form input,
:root[data-unni-theme] body.unni-auth .form input {
  min-height: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  padding: 0 14px !important;
  font-size: 0.9rem !important;
}

:root body.unni-ui.unni-auth .button,
:root[data-unni-theme] body.unni-auth .button {
  min-height: 46px !important;
  height: 46px !important;
  font-size: 0.92rem !important;
  border-radius: 999px !important;
  margin-top: 10px !important;
}

/* 2. Botão de Liberação de Próximo Passo na Esteira */
.unni-btn-journey-release {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 14px 28px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 45%, #f59e0b 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 0.95rem !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 18px rgba(217, 70, 239, 0.45), 0 0 24px rgba(139, 92, 246, 0.3) !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.unni-btn-journey-release:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(217, 70, 239, 0.65), 0 0 32px rgba(139, 92, 246, 0.45) !important;
}

/* 3. Cursor Padrão do Sistema (Sem Interrupções de Texto) */
html, body {
  cursor: auto !important;
}

button, a, select, summary, [role="button"], .button, .btn, .unni-btn-journey-release, .unni-btn-back-to-top {
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

button *, a *, .button *, .btn *, .unni-btn-journey-release * {
  cursor: pointer !important;
  user-select: none !important;
  pointer-events: none !important;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea {
  cursor: text !important;
  user-select: text !important;
  pointer-events: auto !important;
}

/* 4. Tipografia Preto Profundo nos Contratos & Recibos */
.sheet, .receipt-container {
  background: #ffffff !important;
  color: #09090b !important;
}
.sheet *, .receipt-container * {
  color: #09090b !important;
}
.sheet h1, .sheet h2, .sheet h3, .receipt-title {
  color: #000000 !important;
  font-weight: 900 !important;
}




  




  :root body button.unni-back-to-top-unicorn img,
  


/* ==========================================================================
   BOTÃO VOLTAR AO TOPO — INTENSIDADE HARMONIZADA COM A AURA DA LOGO
   ========================================================================== */
@keyframes unniRainbowRotateCenter {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

:root body button.unni-back-to-top-unicorn,
:root[data-unni-theme] body button.unni-back-to-top-unicorn,
:root body .unni-back-to-top-unicorn,
:root[data-unni-theme] body .unni-back-to-top-unicorn,
button.unni-back-to-top-unicorn,
.unni-back-to-top-unicorn {
  position: fixed !important;
  bottom: 28px !important;
  right: 28px !important;
  left: auto !important;
  z-index: 9999 !important;
  width: 68px !important;
  height: 68px !important;
  min-height: 68px !important;
  max-width: 68px !important;
  max-height: 68px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(16px) scale(0.9) !important;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

:root body button.unni-back-to-top-unicorn.is-visible,
:root[data-unni-theme] body button.unni-back-to-top-unicorn.is-visible,
.unni-back-to-top-unicorn.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

/* Aura Arco-íris Suave (Mesma intensidade luminosa da logo) */
:root body button.unni-back-to-top-unicorn::before,
:root[data-unni-theme] body button.unni-back-to-top-unicorn::before,
.unni-back-to-top-unicorn::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: auto !important;
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: conic-gradient(
    from 0deg,
    rgba(255, 79, 216, 0.75) 0deg,
    rgba(139, 92, 246, 0.75) 60deg,
    rgba(59, 130, 246, 0.7) 120deg,
    rgba(6, 182, 212, 0.7) 180deg,
    rgba(16, 185, 129, 0.65) 240deg,
    rgba(245, 158, 11, 0.7) 300deg,
    rgba(255, 79, 216, 0.75) 360deg
  ) !important;
  filter: blur(12px) !important;
  opacity: 0.55 !important;
  animation: unniRainbowRotateCenter 4s linear infinite !important;
  transform-origin: center center !important;
  pointer-events: none !important;
  z-index: 1 !important;
  transition: opacity 0.35s ease, filter 0.35s ease, width 0.35s ease, height 0.35s ease !important;
}

/* Símbolo do Unicórnio */
:root body button.unni-back-to-top-unicorn img,
:root[data-unni-theme] body button.unni-back-to-top-unicorn img,
.unni-back-to-top-unicorn img {
  position: relative !important;
  z-index: 2 !important;
  width: 58px !important;
  height: 58px !important;
  max-width: 58px !important;
  max-height: 58px !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
  pointer-events: none !important;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45)) !important;
  transition: transform 0.25s ease, filter 0.25s ease !important;
}

/* Hover e Active */
:root body button.unni-back-to-top-unicorn:hover,
.unni-back-to-top-unicorn:hover {
  transform: translateY(-4px) scale(1.08) !important;
}

:root body button.unni-back-to-top-unicorn:hover::before,
.unni-back-to-top-unicorn:hover::before {
  opacity: 0.78 !important;
  filter: blur(15px) !important;
  width: 58px !important;
  height: 58px !important;
  animation-duration: 2.8s !important;
}

:root body button.unni-back-to-top-unicorn:hover img,
.unni-back-to-top-unicorn:hover img {
  filter: drop-shadow(0 6px 16px rgba(217, 70, 239, 0.5)) !important;
}

:root body button.unni-back-to-top-unicorn:active,
.unni-back-to-top-unicorn:active {
  transform: scale(0.94) !important;
}

/* Rastro Suave de Luz ao Rolar (Harmonizado com a Logo) */
@keyframes unniRainbowBeamSweep {
  0% {
    transform: translateY(100%) scaleY(0.4);
    opacity: 0;
  }
  35% {
    opacity: 0.65;
  }
  100% {
    transform: translateY(-100%) scaleY(1.4);
    opacity: 0;
  }
}

.unni-rainbow-scroll-beam {
  position: fixed !important;
  right: 58px !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 4px !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 9998 !important;
  background: linear-gradient(
    to top,
    rgba(255, 79, 216, 0) 0%,
    rgba(255, 79, 216, 0.3) 20%,
    rgba(139, 92, 246, 0.35) 40%,
    rgba(59, 130, 246, 0.35) 60%,
    rgba(16, 185, 129, 0.3) 80%,
    rgba(245, 158, 11, 0) 100%
  ) !important;
  filter: blur(6px) drop-shadow(0 0 14px rgba(139, 92, 246, 0.45)) !important;
  animation: unniRainbowBeamSweep 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes unniUnicornLaunch {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-10px) scale(1.15) rotate(-5deg);
  }
  60% {
    transform: translateY(-5px) scale(1.08) rotate(2deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.unni-back-to-top-unicorn.is-launching {
  animation: unniUnicornLaunch 0.85s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.unni-back-to-top-unicorn.is-launching::before {
  opacity: 0.85 !important;
  filter: blur(16px) !important;
  width: 62px !important;
  height: 62px !important;
  animation-duration: 1.5s !important;
}

/* Mobile: Ajuste de Tamanho Padrão */
@media (max-width: 768px) {
  .unni-back-to-top-unicorn {
    bottom: 18px !important;
    right: 18px !important;
    left: auto !important;
    width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
  }

  .unni-back-to-top-unicorn::before {
    width: 38px !important;
    height: 38px !important;
    filter: blur(8px) !important;
    opacity: 0.55 !important;
  }

  .unni-back-to-top-unicorn img {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
  }

  .unni-rainbow-scroll-beam {
    right: 40px !important;
    width: 3px !important;
  }
}


/* ==========================================================================
   PORTAL UNNICORA — MASTER DESIGN SYSTEM (UPVS v2.4.1 AUDITADO)
   Tokens Globais, Tipografia Fluida, Semântica de Cores e Topbar Uniforme
   ========================================================================== */

:root {
  /* Topbar Universal (Sem Saltos) */
  --topbar-height-compact: 60px;
  --topbar-height-regular: 64px;
  --topbar-height: var(--topbar-height-regular);

  /* Containers por Contexto */
  --container-max-auth: 410px;
  --container-max-sheet: 900px;
  --container-max-app: 1280px;
  --container-max-reading: 68ch;
  --container-fluid-padding: clamp(16px, 3vw, 32px);

  /* Controles & Alvos Táteis */
  --control-height: 48px;
  --control-radius: var(--unni-radius-md);
  --button-radius: 999px;
  --touch-target-preferred: var(--unni-touch-target);

  /* Aliases semânticos do legado para a geometria canônica */
  --radius-sm: var(--unni-radius-md);
  --radius-md: var(--unni-radius-card);
  --radius-lg: var(--unni-radius-lg);
  --radius-xl: 20px;

  /* Aliases do spacing histórico para a escala canônica */
  --space-2xs: var(--unni-space-2xs);
  --space-xs: var(--unni-space-xs);
  --space-sm: var(--unni-space-sm);
  --space-md: var(--unni-space-md);
  --space-lg: var(--unni-space-xl);
  --space-xl: var(--unni-space-2xl);
  --space-2xl: 48px;

  /* Tipografia Oficial de Interface */
  --font-family-ui: var(--unni-font-sans);
  --font-family-mono: var(--unni-font-mono);

  /* Escala Fluida Revisada (Piso de 1rem) */
  --font-size-display: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --font-size-h1: clamp(1.625rem, 1.35rem + 1.35vw, 2.375rem);
  --font-size-h2: clamp(1.375rem, 1.18rem + 0.95vw, 1.875rem);
  --font-size-h3: clamp(1.1875rem, 1.08rem + 0.55vw, 1.5rem);
  --font-size-h4: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --font-size-body: clamp(1rem, 0.975rem + 0.12vw, 1.0625rem);
  --font-size-body-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --font-size-label: clamp(0.8125rem, 0.79rem + 0.08vw, 0.875rem);
  --font-size-caption: clamp(0.8125rem, 0.79rem + 0.06vw, 0.875rem);

  /* Alturas de Linha */
  --line-height-tight: 1.1;
  --line-height-heading: 1.2;
  --line-height-body: 1.55;
  --line-height-relaxed: 1.7;

  /* Anel de Foco Acessível */
  --focus-ring: 0 0 0 3px rgba(147, 51, 234, 0.35);
}

@media (max-width: 767px) {
  :root {
    --topbar-height: var(--topbar-height-compact);
  }
}

/* --------------------------------------------------------------------------
   PALETA SEMÂNTICA — DARK MODE (DEFAULT)
   -------------------------------------------------------------------------- */
:root,
:root[data-unni-theme="dark"] {
  color-scheme: dark;
  --surface-page: var(--unni-bg-primary);
  --surface-primary: var(--unni-bg-secondary);
  --surface-secondary: var(--unni-bg-tertiary);
  --surface-elevated: var(--unni-bg-elevated);
  --surface-subtle: var(--unni-bg-tertiary);
  --surface-input: var(--unni-bg-elevated);

  --text-primary: var(--unni-text-primary);
  --text-secondary: var(--unni-text-secondary);
  --text-muted: var(--unni-text-muted);
  --text-disabled: var(--unni-text-disabled);
  --text-inverse: var(--unni-text-inverse);

  --border-subtle: var(--unni-border-subtle);
  --border-default: var(--unni-border-default);
  --border-strong: var(--unni-border-strong);
  --border-focus: var(--unni-border-focus);

  /* Estados Semânticos Oficiais */
  --status-info-text: var(--unni-status-info-text);
  --status-info-background: var(--unni-status-info-bg);
  --status-info-border: var(--unni-status-info-border);

  --status-success-text: var(--unni-status-success-text);
  --status-success-background: var(--unni-status-success-bg);
  --status-success-border: var(--unni-status-success-border);

  --status-warning-text: var(--unni-status-warning-text);
  --status-warning-background: var(--unni-status-warning-bg);
  --status-warning-border: var(--unni-status-warning-border);

  --status-danger-text: var(--unni-status-danger-text);
  --status-danger-background: var(--unni-status-danger-bg);
  --status-danger-border: var(--unni-status-danger-border);

  --status-neutral-text: #cbd5e1;
  --status-neutral-background: rgba(255, 255, 255, 0.06);
  --status-neutral-border: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   PALETA SEMÂNTICA — LIGHT MODE
   -------------------------------------------------------------------------- */
:root[data-unni-theme="light"] {
  color-scheme: light;
  --surface-page: var(--unni-bg-primary);
  --surface-primary: var(--unni-bg-secondary);
  --surface-secondary: var(--unni-bg-tertiary);
  --surface-elevated: var(--unni-bg-elevated);
  --surface-subtle: var(--unni-bg-primary);
  --surface-input: var(--unni-bg-elevated);

  --text-primary: var(--unni-text-primary);
  --text-secondary: var(--unni-text-secondary);
  --text-muted: var(--unni-text-muted);
  --text-disabled: var(--unni-text-disabled);
  --text-inverse: var(--unni-text-inverse);

  --border-subtle: var(--unni-border-subtle);
  --border-default: var(--unni-border-default);
  --border-strong: var(--unni-border-strong);
  --border-focus: var(--unni-border-focus);

  /* Estados Semânticos Oficiais (Light) */
  --status-info-text: var(--unni-status-info-text);
  --status-info-background: var(--unni-status-info-bg);
  --status-info-border: var(--unni-status-info-border);

  --status-success-text: var(--unni-status-success-text);
  --status-success-background: var(--unni-status-success-bg);
  --status-success-border: var(--unni-status-success-border);

  --status-warning-text: var(--unni-status-warning-text);
  --status-warning-background: var(--unni-status-warning-bg);
  --status-warning-border: var(--unni-status-warning-border);

  --status-danger-text: var(--unni-status-danger-text);
  --status-danger-background: var(--unni-status-danger-bg);
  --status-danger-border: var(--unni-status-danger-border);

  --status-neutral-text: #475569;
  --status-neutral-background: #f1f5f9;
  --status-neutral-border: #e2e8f0;
}

/* --------------------------------------------------------------------------
   TOPBAR GLOBAL SEM SALTOS (UX4)
   -------------------------------------------------------------------------- */
.topbar,
.unni-standard-topbar,
.auth-topbar,
header.topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  height: var(--topbar-height) !important;
  min-height: var(--topbar-height) !important;
  max-height: var(--topbar-height) !important;
  padding-inline: var(--container-fluid-padding) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

/* --------------------------------------------------------------------------
   SISTEMA DE BOTÕES COM ALTO CONTRASTE (UX5)
   -------------------------------------------------------------------------- */
.button.primary,
.button--primary,
.unni-btn-journey-release {
  background: linear-gradient(135deg, #5b21b6 0%, #7e22ce 55%, #86198f 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 14px rgba(126, 34, 206, 0.35) !important;
  cursor: pointer !important;
  min-height: var(--control-height) !important;
  padding-inline: 22px !important;
  border-radius: var(--button-radius) !important;
  transition: transform 150ms ease, box-shadow 150ms ease !important;
}

.button.primary:hover,
.unni-btn-journey-release:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(126, 34, 206, 0.5) !important;
}

.button.primary:active,
.unni-btn-journey-release:active {
  transform: translateY(0) scale(0.98) !important;
}

/* --------------------------------------------------------------------------
   CURSORES NATIVOS DO SISTEMA OPERACIONAL (UX15)
   -------------------------------------------------------------------------- */
html, body {
  cursor: auto !important;
}

button, a, select, summary, [role="button"], .button, .btn {
  cursor: pointer !important;
}

input, textarea {
  cursor: text !important;
}

/* --------------------------------------------------------------------------
   CONTRATOS E RECIBOS: FOLHA BRANCA E PRETO PROFUNDO (UX22)
   -------------------------------------------------------------------------- */
.sheet, .receipt-container {
  background: #ffffff !important;
  color: #09090b !important;
}

.sheet *, .receipt-container * {
  color: #09090b !important;
}

.sheet h1, .sheet h2, .sheet h3, .receipt-title {
  color: #000000 !important;
  font-weight: 900 !important;
}

/* ==========================================================================
   PORTAL UNNICORA — MASTER MOBILE ARCHITECTURE (MB3 FINAL PASS)
   Topbar 2-Linhas com Máxima Especificidade, Autofill, Cards e Viewport
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOPBAR MOBILE EM 2 LINHAS (GOVERNA 100% DAS PÁGINAS SEM COLISÃO)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root[data-unni-theme] body :where(.topbar, .unni-standard-topbar, .auth-topbar, header.surface, .access-topbar),
  :root[data-unni-theme] body.unni-ui :where(.topbar, .unni-standard-topbar, .auth-topbar, header.surface, .access-topbar),
  :root[data-unni-theme] body.unni-dashboard :where(.topbar, .unni-standard-topbar, .auth-topbar, header.surface, .access-topbar),
  :root[data-unni-theme] body.unni-portal :where(.topbar, .unni-standard-topbar, .auth-topbar, header.surface, .access-topbar),
  :root[data-unni-theme] body.unni-portal-home :where(.topbar, .unni-standard-topbar, .auth-topbar, header.surface, .access-topbar),
  body.unni-portal-home header.topbar,
  .topbar,
  .unni-standard-topbar,
  .auth-topbar,
  header.topbar,
  header.surface {
    display: grid !important;
    grid-template-areas:
      "brand actions"
      "title title" !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 8px 12px 10px !important;
    gap: 4px 8px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 500 !important;
    background: var(--unni-theme-overlay, var(--unni-surface-glass)) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--unni-theme-line, var(--unni-border-subtle)) !important;
    box-shadow: var(--unni-shadow-sm) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Nas telas de autenticação e Home, o header não é sticky no mobile */
  body.unni-portal-home header.topbar,
  .auth-topbar,
  header.auth-topbar {
    position: static !important;
  }

  /* Linha 1 - Esquerda: Brand / Logo */
  :root[data-unni-theme] body :where(.unni-standard-brand, .brand, .auth-brand),
  .unni-standard-brand,
  .brand,
  .auth-brand {
    grid-area: brand !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: 34px !important;
    max-height: 34px !important;
    width: auto !important;
    max-width: 130px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .unni-brand-logo,
  .brand img,
  .auth-brand img {
    height: 28px !important;
    max-height: 28px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  /* Linha 1 - Direita: Ações Compactas (Tema + Segurança / Voltar / Logout) */
  :root[data-unni-theme] body :where(.unni-standard-actions, .top-actions, .topbar-actions),
  .unni-standard-actions,
  .top-actions,
  .topbar-actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Selos de Segurança ("Conexão segura" / "Ambiente protegido") -> Indicador Compacto */
  :root[data-unni-theme] body :where(.secure, .security-badge, .unni-security-indicator) > span,
  .secure > span,
  .security-indicator > span,
  .topbar .secure span {
    display: none !important;
  }

  :root[data-unni-theme] body :where(.secure, .security-badge, .unni-security-indicator),
  .secure,
  .security-badge,
  .security-indicator {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    background: rgba(16, 185, 129, 0.14) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
  }

  :root[data-unni-theme] body :where(.secure, .security-badge, .unni-security-indicator)::before,
  .secure::before,
  .security-badge::before {
    content: "🔒" !important;
    font-size: 0.8rem !important;
    display: block !important;
  }

  /* Seletor de Tema em Ícone Compacto (44x44px) */
  .unni-theme-switcher > summary {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 0 !important;
  }

  .unni-theme-switcher > summary::after,
  .unni-theme-switcher__label {
    display: none !important;
  }

  :root[data-unni-theme] body :where(
    .unni-standard-back,
    .client-logout,
    .unni-globalbar__menu,
    .unni-globalbar__profile,
    .unni-globalbar__logout button
  ) {
    min-width: 44px;
    min-height: 44px !important;
  }

  /* Botão Voltar Compacto nas Páginas Internas */
  .unni-standard-back,
  .btn-back,
  a.unni-standard-back {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }

  /* Linha 2: Título da Página em Largura Total */
  :root[data-unni-theme] body :where(.unni-standard-title, .topbar-title, .auth-title-topbar, header.topbar h1, header.surface h1),
  .unni-standard-title,
  .topbar-title,
  .auth-title-topbar,
  header.topbar h1,
  header.surface h1 {
    grid-area: title !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    text-align: center !important;
    font-size: 0.94rem !important;
    line-height: 1.25 !important;
    font-weight: 750 !important;
    letter-spacing: -0.01em !important;
    color: var(--text-primary, #fbf8ff) !important;
    white-space: normal !important;
    text-wrap: balance !important;
    overflow: visible !important;
    border: none !important;
  }
}

/* Tablet mantém a estrutura desktop; somente controles e spacing são compactados. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  :root[data-unni-theme] body.unni-ui .unni-standard-topbar {
    gap: 0 !important;
    row-gap: 0 !important;
    column-gap: 0 !important;
  }

  :root[data-unni-theme] body.unni-ui .unni-standard-title {
    white-space: nowrap !important;
  }

  .unni-theme-switcher > summary {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 0 !important;
  }

  .unni-theme-switcher > summary::after,
  .unni-theme-switcher__label {
    display: none !important;
  }
}

@media (max-width: 767px) {
  :root[data-unni-theme] body .unni-standard-brand {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    justify-content: center !important;
  }

  :root[data-unni-theme] body .unni-standard-brand::before {
    content: "";
    display: block;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background: url("/brand/unnicora-unicorn-symbol-mobile-v2.png") center / contain no-repeat;
  }

  :root[data-unni-theme] body .unni-standard-brand > .unni-brand-logo,
  :root[data-unni-theme] body .unni-standard-brand > img {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   2. SAFARI AUTOFILL ROBUSTO (ELIMINAÇÃO DO FUNDO AMARELO)
   -------------------------------------------------------------------------- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
  -webkit-text-fill-color: #fbf8ff !important;
  caret-color: #fbf8ff !important;
  -webkit-box-shadow: 0 0 0 1000px #161426 inset !important;
  box-shadow: 0 0 0 1000px #161426 inset !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  transition: background-color 9999s ease-out 0s !important;
}

:root[data-unni-theme="light"] input:-webkit-autofill,
:root[data-unni-theme="light"] input:-webkit-autofill:hover,
:root[data-unni-theme="light"] input:-webkit-autofill:focus,
:root[data-unni-theme="light"] input:-webkit-autofill:active {
  -webkit-text-fill-color: #09090b !important;
  caret-color: #09090b !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  border-color: #cbd5e1 !important;
}

/* --------------------------------------------------------------------------
   3. CARDS DE PROJETOS CONTENT-DRIVEN & BOTTOM SHEET
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .client-row,
  .client-card,
  article.client-row {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) 40px !important;
    grid-template-rows: auto auto !important;
    gap: 8px 10px !important;
    align-items: start !important;
    padding: 14px 12px !important;
    min-height: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
    border-radius: 18px !important;
  }

  .client-profile {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border-radius: 12px !important;
    margin-top: 2px !important;
  }

  .client-main {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    padding-right: 4px !important;
  }

  .client-main h3 {
    margin: 2px 0 0 !important;
    font-size: 0.96rem !important;
    line-height: 1.2 !important;
    font-weight: 750 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  .client-main p {
    margin: 3px 0 0 !important;
    font-size: 0.72rem !important;
    line-height: 1.35 !important;
    color: var(--text-muted, #94a3b8) !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  .client-type {
    font-size: 0.64rem !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    color: #c084fc !important;
  }

  .status-stack {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
    margin-top: 4px !important;
    min-width: 0 !important;
  }

  .row-actions {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
  }

  .action-menu summary {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 9px !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
    font-size: 1.1rem !important;
    line-height: 1 !important;
  }

  .next-step,
  .status-priority {
    display: none !important;
  }

  /* Bottom Sheet Flutuante */
  .action-menu[open] {
    position: static !important;
  }

  .action-menu[open]::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9998 !important;
    display: block !important;
  }

  .action-menu[open] > .menu-popover {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(72dvh, 520px) !important;
    border-radius: 22px !important;
    background: #18152c !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85) !important;
    z-index: 9999 !important;
    transform: translateY(0) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .menu-popover a,
  .menu-popover button {
    display: flex !important;
    align-items: center !important;
    min-height: 46px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    color: #fbf8ff !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    text-align: left !important;
  }

  .menu-popover a:hover,
  .menu-popover button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
  }

  .menu-popover .danger {
    color: #fca5a5 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
  }
}

/* --------------------------------------------------------------------------
   4. HOME "/" CARDS & RODAPÉ DINÂMICO
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  body.unni-portal-home .page {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px 0 calc(24px + env(safe-area-inset-bottom, 16px)) !important;
  }

  body.unni-portal-home .center {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 8px 0 !important;
  }

  body.unni-portal-home .chooser {
    width: 100% !important;
    max-width: 100% !important;
    padding: 22px 14px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
  }

  body.unni-portal-home .access-card {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 20px 14px !important;
    border-radius: 18px !important;
  }

  body.unni-portal-home .access-action {
    margin-top: 14px !important;
    padding-top: 14px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 8px !important;
  }

  body.unni-portal-home .access-action > span:first-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    font-size: 0.82rem !important;
  }

  body.unni-portal-home .access-arrow {
    position: static !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    right: auto !important;
    bottom: auto !important;
  }
}

/* Contraste de Alto Padrão para Botões Secundários no Light Mode */
:root[data-unni-theme="light"] body.unni-ui :where(.button:not(.primary):not(.button--primary):not(.danger), button:not([class*="primary"]):not([class*="danger"]), a.button:not(.primary), .btn-secondary, .action.open, .unni-btn-secondary) {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

:root[data-unni-theme="light"] body.unni-ui :where(.button:not(.primary):not(.button--primary):not(.danger), button:not([class*="primary"]):not([class*="danger"]), a.button:not(.primary), .btn-secondary, .action.open, .unni-btn-secondary):hover {
  background: #e2e8f0 !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
  border-color: #94a3b8 !important;
}

/* Enxugamento dos Cards de Projetos no Mobile (Sem Vazios Verticais) */
@media (max-width: 768px) {
  body.unni-dashboard .client-row,
  body.unni-portal .client-row,
  .client-row,
  article.client-row {
    grid-template-columns: 46px minmax(0, 1fr) 40px !important;
    grid-template-rows: auto auto !important;
    gap: 6px 10px !important;
    padding: 12px 12px 10px !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin-bottom: 8px !important;
  }
}

/* UNNI OS & Modules: Proteção de Contraste Dark Neutro para Cards, KPIs e Indicadores */
:root[data-unni-theme="dark"] body.unni-ui :where(.kpi, .metric, .quality-item, .unni-os-layout .card, .unni-os-layout .kpi, .unni-os-layout .section.card, .unni-os-layout aside.card, .unni-os-layout article.card) {
  background: var(--unni-theme-surface, #232323) !important;
  color: var(--unni-theme-text, #f2ede4) !important;
  border-color: var(--unni-theme-line, #3d3d3d) !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.kpi, .metric, .quality-item, .unni-os-layout .card) :where(strong, b, h1, h2, h3, h4, .score) {
  color: var(--unni-theme-heading, #f8f3ea) !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(.kpi, .metric, .quality-item, .unni-os-layout .card) :where(span, p, small, .muted) {
  color: var(--unni-theme-muted, #b9bcc4) !important;
}

/* ==========================================================================
   LOT 04 — FORMS, CONTROLS & AUTH SURFACES
   Contrato final do Forms V2.1 / Selection Controls V2.1 sobre a cascade
   histórica. A camada preserva markup, validação nativa e comportamento.
   ========================================================================== */

/* Wrappers visuais não desenham uma segunda caixa ao redor do input real. */
:root[data-unni-theme] body.unni-ui :where(
  .input.auth-input,
  .access-input,
  .input-shell
) {
  position: relative;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Labels, grupos e mensagens usam o ritmo do componente congelado. */
:root[data-unni-theme] body.unni-ui :where(.field, .form-group) {
  min-width: 0;
  gap: 6px;
}

:root[data-unni-theme] body.unni-ui :where(
  .field > label,
  .form-group > label,
  .auth-form > label,
  .access-form > label,
  .field > span:not(.input):not(.access-input),
  .field > small
) {
  color: var(--unni-theme-heading) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .hint,
  .help,
  .field-note,
  .cep-status,
  .form-helper,
  .field-help
) {
  color: var(--unni-theme-soft) !important;
  font-size: 0.75rem !important;
  line-height: 1.4 !important;
}

/* Campo base: text/email/password/number/date/time, select e textarea. */
:root[data-unni-theme] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  select,
  textarea
) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--unni-touch-target) !important;
  padding: 0 14px !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  outline: 0 !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  -webkit-text-fill-color: var(--unni-text-primary) !important;
  box-shadow: none !important;
  font-family: var(--unni-font-sans) !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  text-align: left !important;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease !important;
}

:root[data-unni-theme] body.unni-ui textarea {
  min-height: 112px !important;
  padding-block: 12px !important;
  resize: vertical;
}

:root[data-unni-theme] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  select,
  textarea
)::placeholder {
  color: var(--unni-text-muted) !important;
  -webkit-text-fill-color: var(--unni-text-muted) !important;
  opacity: 0.78 !important;
}

@media (hover: hover) {
  :root[data-unni-theme] body.unni-ui :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    select,
    textarea
  ):hover:not(:focus):not(:disabled):not([readonly]) {
    border-color: var(--unni-border-strong) !important;
  }
}

:root[data-unni-theme] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  select,
  textarea
):is(:focus, :focus-visible) {
  border-color: var(--unni-brand-primary) !important;
  outline: 0 !important;
  background: var(--unni-surface-1) !important;
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
):disabled {
  cursor: not-allowed !important;
  color: var(--unni-text-disabled) !important;
  border-color: var(--unni-border-subtle) !important;
  background: var(--unni-surface-1) !important;
  -webkit-text-fill-color: var(--unni-text-disabled) !important;
  box-shadow: none !important;
  opacity: 0.62 !important;
}

:root[data-unni-theme] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not(:disabled)[readonly],
  textarea:not(:disabled)[readonly]
) {
  cursor: default !important;
  color: var(--unni-text-primary) !important;
  border-color: var(--unni-border-subtle) !important;
  background: color-mix(in srgb, var(--unni-surface-1) 94%, var(--unni-text-primary) 6%) !important;
  -webkit-text-fill-color: var(--unni-text-primary) !important;
  opacity: 1 !important;
}

:root[data-unni-theme] body.unni-ui :where(
  input:not([type="checkbox"]):not([type="radio"]):not(:disabled)[readonly],
  textarea:not(:disabled)[readonly]
):is(:focus, :focus-visible) {
  border-color: var(--unni-border-default) !important;
  box-shadow: none !important;
}

/* Validação explícita: classes existentes e aria-invalid, sem antecipar erro. */
:root[data-unni-theme] body.unni-ui :where(.field.has-error, .form-group.has-error) :where(input, select, textarea),
:root[data-unni-theme] body.unni-ui :where(input, select, textarea).is-error,
:root[data-unni-theme] body.unni-ui :where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--unni-status-danger) !important;
  background: color-mix(in srgb, var(--unni-status-danger-bg) 36%, var(--unni-surface-2)) !important;
}

:root[data-unni-theme] body.unni-ui :where(.field.has-error, .form-group.has-error) :where(input, select, textarea):is(:focus, :focus-visible),
:root[data-unni-theme] body.unni-ui :where(input, select, textarea).is-error:is(:focus, :focus-visible),
:root[data-unni-theme] body.unni-ui :where(input, select, textarea)[aria-invalid="true"]:is(:focus, :focus-visible) {
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-status-danger) !important;
}

:root[data-unni-theme] body.unni-ui :where(.field.has-success, .form-group.has-success) :where(input, select, textarea),
:root[data-unni-theme] body.unni-ui :where(input, select, textarea).is-success {
  border-color: var(--unni-status-success) !important;
  background: color-mix(in srgb, var(--unni-status-success-bg) 36%, var(--unni-surface-2)) !important;
}

:root[data-unni-theme] body.unni-ui :where(.field.has-success, .form-group.has-success) :where(input, select, textarea):is(:focus, :focus-visible),
:root[data-unni-theme] body.unni-ui :where(input, select, textarea).is-success:is(:focus, :focus-visible) {
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-status-success) !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .field-error,
  .form-error,
  .validation-error,
  .unni-msg-error
) {
  color: var(--unni-status-danger-text) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .field-success,
  .form-success,
  .validation-success,
  .unni-msg-success
) {
  color: var(--unni-status-success-text) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .message.error,
  .access-message.error,
  .errors[role="alert"],
  .error[role="alert"]
) {
  color: var(--unni-status-danger-text) !important;
  border: 1px solid var(--unni-status-danger-border) !important;
  background: var(--unni-status-danger-bg) !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .message.ok,
  .notice.success,
  .contract-data-success
) {
  color: var(--unni-status-success-text) !important;
  border-color: var(--unni-status-success-border) !important;
  background: var(--unni-status-success-bg) !important;
}

/* Grupos semânticos preservam respiro e geometria idênticos nos dois temas. */
:root[data-unni-theme] body.unni-ui form fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--unni-border-default);
  border-radius: var(--unni-radius-md);
}

:root[data-unni-theme] body.unni-ui form fieldset > legend {
  max-width: calc(100% - 12px);
  margin: 0 0 2px;
  padding: 0 6px;
  color: var(--unni-theme-heading) !important;
  font-family: var(--unni-font-sans) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Checkboxes e radios permanecem nativos; a caixa externa legada é removida. */
:root[data-unni-theme] body.unni-ui input:is([type="checkbox"], [type="radio"]) {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  accent-color: var(--unni-brand-primary) !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

:root[data-unni-theme] body.unni-ui input[type="checkbox"] {
  border-radius: var(--unni-radius-sm) !important;
}

:root[data-unni-theme] body.unni-ui input[type="radio"] {
  border-radius: var(--unni-radius-full) !important;
}

:root[data-unni-theme] body.unni-ui input:is([type="checkbox"], [type="radio"]):focus-visible {
  outline: 2px solid var(--unni-brand-primary) !important;
  outline-offset: 3px !important;
}

:root[data-unni-theme] body.unni-ui label:is(
  .check,
  .declaration,
  .type-option,
  .service-picker-option,
  .service-choice,
  .checkbox,
  .radio
),
:root[data-unni-theme] body.unni-ui .partner-toggle > label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  width: 100%;
  min-height: var(--unni-touch-target);
  padding: 10px 12px;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-md);
  align-items: center;
  gap: 10px;
  color: var(--unni-theme-text) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: none !important;
  font-family: var(--unni-font-sans) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  text-align: left !important;
  text-transform: none !important;
  cursor: pointer;
}

:root[data-unni-theme] body.unni-ui label:is(.check, .declaration, .type-option, .service-picker-option, .service-choice, .checkbox, .radio):has(input:checked),
:root[data-unni-theme] body.unni-ui .partner-toggle > label:has(input:checked) {
  border-color: color-mix(in srgb, var(--unni-brand-primary) 52%, var(--unni-border-default)) !important;
  background: var(--unni-brand-primary-soft) !important;
}

:root[data-unni-theme] body.unni-ui label:is(.check, .declaration, .type-option, .service-picker-option, .service-choice, .checkbox, .radio):has(input:disabled),
:root[data-unni-theme] body.unni-ui .partner-toggle > label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.62;
}

:root[data-unni-theme] body.unni-ui label:is(.check, .declaration, .type-option, .service-picker-option, .service-choice, .checkbox, .radio) input:disabled,
:root[data-unni-theme] body.unni-ui .partner-toggle > label input:disabled {
  opacity: 1 !important;
}

/* Botões ligados a formulários compartilham geometria, toque e foco. */
:root[data-unni-theme] body.unni-ui form :where(
  button:not(.toggle-password):not(.access-toggle),
  input[type="submit"],
  .button,
  .submit
) {
  min-height: var(--unni-touch-target) !important;
  max-width: 100%;
  padding-inline: 18px !important;
  border-radius: var(--unni-radius-md) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
}

:root[data-unni-theme] body.unni-ui form :where(
  button:not(.toggle-password):not(.access-toggle),
  input[type="submit"],
  .button,
  .submit
):focus-visible {
  outline: 0 !important;
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .toggle-password,
  .access-toggle,
  .input-shell > .toggle
) {
  width: var(--unni-touch-target) !important;
  min-width: var(--unni-touch-target) !important;
  height: var(--unni-touch-target) !important;
  min-height: var(--unni-touch-target) !important;
  padding: 0 !important;
  border-radius: var(--unni-radius-md) !important;
}

:root[data-unni-theme] body.unni-ui :where(
  .auth-input--password,
  .access-password,
  .input-shell
) > input {
  padding-right: 52px !important;
}

/* Auth comum permanece legível; somente OTP/TOTP recebe tratamento de código. */
:root[data-unni-theme] body.unni-auth :where(
  input:not([type="hidden"]):not([type="submit"]):not([type="button"]),
  select,
  textarea
) {
  font-family: var(--unni-font-sans) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
  text-align: left !important;
}

:root[data-unni-theme] body.unni-ui :where(
  input[autocomplete~="one-time-code"],
  input.code,
  .access-code > input,
  #recovery_code
) {
  font-family: var(--unni-font-mono) !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em !important;
  text-align: center !important;
}

/* Autofill segue a superfície ativa em dark e light, inclusive com foco. */
:root[data-unni-theme] body.unni-ui :where(input, textarea, select):-webkit-autofill,
:root[data-unni-theme] body.unni-ui :where(input, textarea, select):-webkit-autofill:hover,
:root[data-unni-theme] body.unni-ui :where(input, textarea, select):-webkit-autofill:active {
  -webkit-text-fill-color: var(--unni-text-primary) !important;
  caret-color: var(--unni-text-primary) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--unni-surface-2) inset !important;
  box-shadow: 0 0 0 1000px var(--unni-surface-2) inset !important;
  border-color: var(--unni-border-default) !important;
  transition: background-color 9999s ease-out 0s !important;
}

:root[data-unni-theme] body.unni-ui :where(input, textarea, select):-webkit-autofill:focus {
  -webkit-text-fill-color: var(--unni-text-primary) !important;
  caret-color: var(--unni-text-primary) !important;
  -webkit-box-shadow:
    0 0 0 1000px var(--unni-surface-1) inset,
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
  box-shadow:
    0 0 0 1000px var(--unni-surface-1) inset,
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
  border-color: var(--unni-brand-primary) !important;
}

:root[data-unni-theme="dark"] body.unni-ui :where(input[type="date"], input[type="time"], input[type="datetime-local"]) {
  color-scheme: dark;
}

:root[data-unni-theme="light"] body.unni-ui :where(input[type="date"], input[type="time"], input[type="datetime-local"]) {
  color-scheme: light;
}

@media (max-width: 600px) {
  :root[data-unni-theme] body.unni-ui :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    select,
    textarea
  ) {
    font-size: 16px !important;
  }

  :root[data-unni-theme] body.unni-ui :where(
    input[autocomplete~="one-time-code"],
    input.code,
    .access-code > input,
    #recovery_code
  ) {
    font-size: 1.25rem !important;
  }
}

/* ===========================================================================
   LOT 05 — Agency data surfaces
   Camada visual canônica para métricas, listas, busca, filtros e estados.
   O escopo explícito de página impede impacto intencional no Client Workspace.
   ========================================================================== */

/* Contenção estrutural: superfícies de dados nunca ampliam o canvas global. */
:root[data-unni-theme] body.unni-dashboard :where(
  .content,
  .search-panel,
  .summary-strip,
  .attention-panel,
  .attention-list,
  .projects-panel,
  .client-list,
  .client-row,
  .next-step,
  .row-actions
) {
  min-width: 0 !important;
  max-width: 100%;
}

/* Search/data toolbar: geometria compartilhada pelo dark e light. */
:root[data-unni-theme] body.unni-dashboard .search-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: stretch !important;
  gap: var(--unni-space-sm) !important;
  padding: var(--unni-space-sm) !important;
  overflow: visible !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel--single {
  grid-template-columns: minmax(0, 1fr) !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel .search {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel #clientSearch {
  width: 100% !important;
  min-width: 0 !important;
  min-height: var(--unni-touch-target) !important;
  height: var(--unni-touch-target) !important;
  padding: 0 14px !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel #clientSearch:focus-visible {
  border-color: var(--unni-brand-primary) !important;
  outline: 0 !important;
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel .new-client-action {
  min-height: var(--unni-touch-target) !important;
  padding: 8px 14px !important;
  border: 1px solid var(--unni-brand-primary) !important;
  border-radius: var(--unni-radius-md) !important;
  color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel .new-client-action :where(.new-client-action__icon, .new-client-action__copy strong, .new-client-action__copy small) {
  color: #ffffff !important;
}

:root[data-unni-theme] body.unni-dashboard .search-panel .new-client-action .new-client-action__icon {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

/* Metrics V2: nove contadores factuais em uma matriz estável, sem deltas novos. */
:root[data-unni-theme] body.unni-dashboard .summary-strip {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  width: 100% !important;
  gap: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-dashboard .summary-card {
  display: flex !important;
  min-width: 0 !important;
  min-height: 92px !important;
  padding: 14px 16px !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: var(--unni-space-xs) !important;
  border: 0 !important;
  border-right: 1px solid var(--unni-border-subtle) !important;
  border-bottom: 1px solid var(--unni-border-subtle) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .summary-card:nth-child(3n) {
  border-right: 0 !important;
}

:root[data-unni-theme] body.unni-dashboard .summary-card:nth-last-child(-n + 3) {
  border-bottom: 0 !important;
}

:root[data-unni-theme] body.unni-dashboard .summary-card span {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  gap: 7px !important;
  color: var(--unni-text-secondary) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  line-height: 1.3 !important;
  text-transform: none !important;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-dashboard .summary-card span::before {
  width: 6px !important;
  min-width: 6px !important;
  height: 6px !important;
  margin: 0 !important;
  border-radius: var(--unni-radius-full) !important;
  background: var(--unni-brand-primary) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .summary-card strong {
  margin: 0 !important;
  color: var(--unni-text-primary) !important;
  font-size: clamp(1.55rem, 3vw, 1.9rem) !important;
  font-weight: 750 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em !important;
  line-height: 1.15 !important;
}

/* Painéis e listas operacionais seguem Cards V2.1 e Lists V2. */
:root[data-unni-theme] body.unni-dashboard :where(.attention-panel, .projects-panel) {
  overflow: visible !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-dashboard .attention-list {
  gap: var(--unni-space-xs) !important;
}

:root[data-unni-theme] body.unni-dashboard .attention-item {
  min-width: 0 !important;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-dashboard .filters {
  display: flex;
  width: 100% !important;
  max-width: 100%;
  flex-wrap: wrap;
  gap: var(--unni-space-xs) !important;
  margin-top: var(--unni-space-md) !important;
  padding: 0 !important;
  overflow: visible;
  touch-action: auto !important;
}

:root[data-unni-theme] body.unni-dashboard .filter-button {
  min-height: var(--unni-touch-target) !important;
  padding: 0 14px !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-full) !important;
  color: var(--unni-text-secondary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

:root[data-unni-theme] body.unni-dashboard .filter-button[aria-pressed="true"] {
  border-color: var(--unni-brand-primary) !important;
  color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-dashboard .filter-button:focus-visible {
  outline: 0 !important;
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-dashboard .client-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  gap: var(--unni-space-xs) !important;
  overflow: visible !important;
}

:root[data-unni-theme] body.unni-dashboard .client-row {
  display: grid !important;
  grid-template-columns: 58px minmax(180px, 1fr) minmax(132px, 0.55fr) minmax(220px, 1.15fr) minmax(164px, auto) !important;
  grid-template-rows: auto !important;
  grid-template-areas: none !important;
  width: 100% !important;
  min-height: 96px !important;
  align-items: center !important;
  gap: var(--unni-space-md) !important;
  padding: 14px 16px !important;
  overflow: visible !important;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
  transform: none !important;
}

:root[data-unni-theme] body.unni-dashboard .client-row:focus-within {
  border-color: var(--unni-border-highlight) !important;
}

:root[data-unni-theme] body.unni-dashboard .client-row > :where(.client-profile, .client-main, .status-stack, .next-step, .row-actions) {
  grid-column: auto !important;
  grid-row: auto !important;
  min-width: 0 !important;
}

:root[data-unni-theme] body.unni-dashboard .client-row .next-step {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

:root[data-unni-theme] body.unni-dashboard .client-row .row-actions {
  display: grid !important;
  grid-template-columns: minmax(112px, 1fr) 44px !important;
  width: auto !important;
  align-items: center !important;
  gap: var(--unni-space-xs) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Badges V2: capitalização natural; pill fica reservado aos contadores. */
:root[data-unni-theme] body.unni-dashboard :where(.status-badge, .approval-pill, .dashboard-situation) {
  display: inline-flex !important;
  width: fit-content;
  min-height: 24px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 3px 8px !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-sm) !important;
  color: var(--unni-text-secondary) !important;
  background: var(--unni-surface-1) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-transform: none !important;
  white-space: normal !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.status-badge--done, .approval-pill--approved) {
  border-color: var(--unni-status-success-border) !important;
  color: var(--unni-status-success-text) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-dashboard :where(.status-badge--review, .status-badge--waiting, .approval-pill--review) {
  border-color: var(--unni-status-warning-border) !important;
  color: var(--unni-status-warning-text) !important;
  background: var(--unni-status-warning-bg) !important;
}

:root[data-unni-theme] body.unni-dashboard .approval-pill--rejected {
  border-color: var(--unni-status-danger-border) !important;
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
}

/* Estado sem dados, no-results e feedback reutilizam somente estados já emitidos. */
:root[data-unni-theme] body.unni-dashboard .empty-state {
  display: grid !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 96px !important;
  margin: 0 !important;
  padding: 20px !important;
  place-items: center !important;
  border: 1px dashed var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-muted) !important;
  background: var(--unni-surface-2) !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  text-align: center !important;
}

:root[data-unni-theme] body.unni-dashboard .feedback {
  margin: var(--unni-space-sm) 0 0 !important;
  padding: 12px 14px !important;
  border: 1px solid var(--unni-status-info-border) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-status-info-text) !important;
  background: var(--unni-status-info-bg) !important;
  font-size: 0.875rem !important;
  line-height: 1.45 !important;
}

:root[data-unni-theme] body.unni-dashboard .feedback[data-type="success"] {
  border-color: var(--unni-status-success-border) !important;
  color: var(--unni-status-success-text) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-dashboard .feedback[data-type="error"] {
  border-color: var(--unni-status-danger-border) !important;
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
}

/* Menus de linha permanecem visíveis fora do item e com foco de teclado. */
:root[data-unni-theme] body.unni-dashboard :where(.projects-panel, .client-list, .client-row, .row-actions, .action-menu) {
  overflow: visible !important;
}

:root[data-unni-theme] body.unni-dashboard .menu-popover {
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-lg) !important;
}

:root[data-unni-theme] body.unni-dashboard .menu-popover :where(a, button):focus-visible {
  outline: 2px solid var(--unni-brand-primary) !important;
  outline-offset: -2px !important;
}

/* Superfícies administrativas diretamente ligadas pelo dashboard. */
:root[data-unni-theme] body.unni-users .metrics,
:root[data-unni-theme] body.unni-email-settings .status-grid {
  gap: var(--unni-space-xs) !important;
}

:root[data-unni-theme] body.unni-users .metric,
:root[data-unni-theme] body.unni-email-settings .status {
  min-width: 0 !important;
  padding: 14px 16px !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-users .metric span,
:root[data-unni-theme] body.unni-email-settings .status small {
  color: var(--unni-text-secondary) !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  line-height: 1.3 !important;
  text-transform: none !important;
}

:root[data-unni-theme] body.unni-users .metric strong,
:root[data-unni-theme] body.unni-email-settings .status strong {
  margin-top: var(--unni-space-xs) !important;
  color: var(--unni-text-primary) !important;
  font-variant-numeric: tabular-nums;
}

:root[data-unni-theme] body.unni-users .users {
  gap: 0 !important;
  overflow: visible !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-users .user-card {
  min-width: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--unni-border-subtle) !important;
  border-radius: 0 !important;
  color: var(--unni-text-primary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-users .user-card:last-of-type {
  border-bottom: 0 !important;
}

:root[data-unni-theme] body.unni-users :where(.badge, .mfa-state),
:root[data-unni-theme] body.integrations-page .status-badge {
  min-height: 24px !important;
  padding: 3px 8px !important;
  border-radius: var(--unni-radius-sm) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1px !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

:root[data-unni-theme] body.unni-users .badge--role,
:root[data-unni-theme] body.integrations-page .status-badge.is-ready {
  border: 1px solid var(--unni-status-info-border) !important;
  color: var(--unni-status-info-text) !important;
  background: var(--unni-status-info-bg) !important;
}

:root[data-unni-theme] body.unni-users .badge--active,
:root[data-unni-theme] body.integrations-page .status-badge.is-connected {
  border: 1px solid var(--unni-status-success-border) !important;
  color: var(--unni-status-success-text) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-users .badge--blocked {
  border: 1px solid var(--unni-status-danger-border) !important;
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
}

:root[data-unni-theme] body.unni-users :where(.badge--change, .mfa-state.pending),
:root[data-unni-theme] body.integrations-page .status-badge.is-pending {
  border: 1px solid var(--unni-status-warning-border) !important;
  color: var(--unni-status-warning-text) !important;
  background: var(--unni-status-warning-bg) !important;
}

:root[data-unni-theme] body.unni-users .empty,
:root[data-unni-theme] body.integrations-page .whatsapp-test-list li.is-empty {
  border: 1px dashed var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-muted) !important;
  background: var(--unni-surface-2) !important;
  line-height: 1.5 !important;
  text-align: center !important;
}

@media (hover: hover) and (pointer: fine) {
  :root[data-unni-theme] body.unni-dashboard :where(.client-row, .attention-item):hover,
  :root[data-unni-theme] body.unni-users .user-card:hover {
    border-color: var(--unni-border-highlight) !important;
    background: color-mix(in srgb, var(--unni-brand-primary) 6%, var(--unni-surface-2)) !important;
    transform: none !important;
  }
}

@media (max-width: 1000px) {
  :root[data-unni-theme] body.unni-dashboard .client-row {
    grid-template-columns: 58px minmax(0, 1fr) minmax(164px, auto) !important;
    grid-template-rows: auto auto auto !important;
    grid-template-areas:
      "profile main actions"
      "status status actions"
      "next next actions" !important;
    align-items: start !important;
  }

  :root[data-unni-theme] body.unni-dashboard .client-profile { grid-area: profile !important; }
  :root[data-unni-theme] body.unni-dashboard .client-main { grid-area: main !important; }
  :root[data-unni-theme] body.unni-dashboard .status-stack { grid-area: status !important; }
  :root[data-unni-theme] body.unni-dashboard .next-step { grid-area: next !important; }
  :root[data-unni-theme] body.unni-dashboard .row-actions { grid-area: actions !important; }
}

@media (max-width: 760px) {
  :root[data-unni-theme] body.unni-dashboard .search-panel {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .filters {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    flex-wrap: wrap;
    margin-inline: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    touch-action: auto !important;
  }

  :root[data-unni-theme] body.unni-dashboard .filter-button {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
  }

  :root[data-unni-theme] body.unni-dashboard .filters .filter-button:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  :root[data-unni-theme] body.unni-dashboard .client-row {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
    grid-template-areas:
      "profile main"
      "status status"
      "next next"
      "actions actions" !important;
    gap: var(--unni-space-sm) !important;
    padding: var(--unni-space-sm) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .client-row .row-actions {
    grid-template-columns: minmax(0, 1fr) 44px !important;
    width: 100% !important;
    padding-top: var(--unni-space-2xs) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .client-row .status-priority {
    display: inline-flex !important;
  }

  :root[data-unni-theme] body.unni-dashboard .client-row .next-step {
    display: block !important;
  }

  :root[data-unni-theme] body.unni-dashboard .client-row .action-menu {
    grid-column: 2 !important;
    justify-self: end !important;
  }
}

@media (max-width: 600px) {
  :root[data-unni-theme] body.unni-dashboard .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .summary-card,
  :root[data-unni-theme] body.unni-dashboard .summary-card:nth-child(3n),
  :root[data-unni-theme] body.unni-dashboard .summary-card:nth-last-child(-n + 3) {
    min-height: 76px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--unni-border-subtle) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .summary-card:last-child {
    grid-column: 1 / -1 !important;
    border-bottom: 0 !important;
  }

  :root[data-unni-theme] body.unni-dashboard .summary-card:nth-child(odd):not(:last-child) {
    border-right: 1px solid var(--unni-border-subtle) !important;
  }

  :root[data-unni-theme] body.unni-users .metrics,
  :root[data-unni-theme] body.unni-email-settings .status-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 340px) {
  :root[data-unni-theme] body.unni-dashboard .summary-strip {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :root[data-unni-theme] body.unni-dashboard .summary-card,
  :root[data-unni-theme] body.unni-dashboard .summary-card:nth-child(odd):not(:last-child),
  :root[data-unni-theme] body.unni-dashboard .summary-card:last-child {
    grid-column: auto !important;
    border-right: 0 !important;
  }
}

/* ============================================================
   LOT 06 — Agency client detail & contracted projects
   ============================================================ */

/*
 * A ficha canônica da Agência é a rota cadastro-cliente, usada tanto para
 * criação quanto para edição. O escopo explícito impede alcance no Client
 * Workspace e neutraliza apenas a pintura clara fixa das camadas históricas.
 */
:root[data-unni-theme] body.unni-client-registration {
  --client-line: var(--unni-border-subtle);
  --client-line-strong: var(--unni-border-default);
  --client-soft-surface: var(--unni-surface-2);
  --client-disabled-surface: var(--unni-surface-3);
  --client-label: var(--unni-text-secondary);
  --client-placeholder: var(--unni-text-muted);
}

:root[data-unni-theme] body.unni-client-registration .shell {
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px;
  min-width: 0;
}

/* Resumo compacto: mesma linguagem da Composition 03, sem dados inventados. */
:root[data-unni-theme] body.unni-client-registration .intro {
  display: grid;
  gap: var(--unni-space-xs);
  margin-top: var(--unni-space-md);
  padding: clamp(20px, 3vw, 28px) !important;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-client-registration .intro .pill {
  width: fit-content;
  min-height: 24px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--unni-border-highlight) !important;
  border-radius: var(--unni-radius-sm) !important;
  color: var(--unni-text-secondary) !important;
  background: var(--unni-brand-primary-soft) !important;
  font-size: var(--unni-font-size-xs);
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

:root[data-unni-theme] body.unni-client-registration .intro h2 {
  max-width: none;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: var(--unni-line-height-tight);
  letter-spacing: -0.035em;
}

:root[data-unni-theme] body.unni-client-registration #clientForm {
  gap: var(--unni-space-md);
  margin-top: var(--unni-space-md);
}

/* Seções principais são painéis; cards internos ficam limitados a dois níveis. */
:root[data-unni-theme] body.unni-client-registration .section {
  min-width: 0;
  padding: var(--unni-space-xl);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-client-registration .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  align-items: start;
  gap: var(--unni-space-lg);
  margin-bottom: var(--unni-space-lg);
  padding-bottom: var(--unni-space-md);
  border-bottom: 1px solid var(--unni-border-subtle);
}

:root[data-unni-theme] body.unni-client-registration .section-head > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--unni-space-sm);
  min-width: 0;
}

:root[data-unni-theme] body.unni-client-registration .section-head .pill {
  min-width: 28px;
  min-height: 24px;
  margin: 0;
  padding: 4px 7px;
  justify-content: center;
  border: 1px solid var(--unni-border-highlight) !important;
  border-radius: var(--unni-radius-sm) !important;
  color: var(--unni-text-secondary) !important;
  background: var(--unni-brand-primary-soft) !important;
  font-size: var(--unni-font-size-xs);
  line-height: 1.2;
  letter-spacing: 0;
}

:root[data-unni-theme] body.unni-client-registration .section-head h3 {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: var(--unni-line-height-tight);
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-client-registration .section-head p {
  max-width: 440px;
  margin: 0;
  padding: 0;
  justify-self: end;
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-sm);
  line-height: var(--unni-line-height-body);
  text-align: right;
}

:root[data-unni-theme] body.unni-client-registration :where(
  .grid,
  .location-row,
  .service-picker,
  .service-picker-head,
  .service-picker-options,
  .selected-services-head,
  .services-grid,
  .service-choice,
  .service-content,
  .service-details,
  .financial-summary,
  .client-situation-card,
  .actions
) {
  min-width: 0;
}

:root[data-unni-theme] body.unni-client-registration :where(.grid, .services-grid) {
  gap: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-registration .grid--spaced {
  margin-top: var(--unni-space-md);
}

/* Seleção existente de serviços: catálogo, contagem e projetos revelados. */
:root[data-unni-theme] body.unni-client-registration .service-picker {
  gap: var(--unni-space-md);
  margin-bottom: var(--unni-space-lg);
  padding: var(--unni-space-lg);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-registration :where(.service-picker-head, .selected-services-head) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-registration :where(.service-picker-head, .selected-services-head) > div {
  display: grid;
  gap: var(--unni-space-2xs);
  min-width: 0;
}

:root[data-unni-theme] body.unni-client-registration :where(.service-picker-head, .selected-services-head) strong {
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-md);
  line-height: var(--unni-line-height-tight);
}

:root[data-unni-theme] body.unni-client-registration :where(.service-picker-head, .selected-services-head) > div > span {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-client-registration .service-picker-count {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-full) !important;
  color: var(--unni-text-secondary) !important;
  background: var(--unni-surface-1) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 700;
}

:root[data-unni-theme] body.unni-client-registration .service-picker-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-client-registration .service-picker-option {
  min-height: 60px;
  padding: var(--unni-space-sm);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: none !important;
  transform: none !important;
}

:root[data-unni-theme] body.unni-client-registration .service-picker-option strong {
  color: var(--unni-text-primary) !important;
  font-size: 0.8125rem;
  line-height: 1.3;
}

:root[data-unni-theme] body.unni-client-registration .service-picker-option small {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
  line-height: 1.3;
}

:root[data-unni-theme] body.unni-client-registration .service-picker-option.is-selected {
  border-color: var(--unni-status-success-border) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-client-registration .service-picker-option:focus-within {
  border-color: var(--unni-border-focus) !important;
  box-shadow:
    0 0 0 2px var(--unni-bg-canvas),
    0 0 0 4px var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-client-registration .selected-services-head {
  margin: var(--unni-space-xs) 0 var(--unni-space-sm);
  padding-inline: 0;
}

:root[data-unni-theme] body.unni-client-registration .services-empty {
  padding: var(--unni-space-lg);
  border: 1px dashed var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-muted) !important;
  background: var(--unni-surface-2) !important;
  font-size: var(--unni-font-size-sm);
  line-height: var(--unni-line-height-body);
  text-align: center;
}

:root[data-unni-theme] body.unni-client-registration .services-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

:root[data-unni-theme] body.unni-client-registration .service-choice {
  position: relative;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: var(--unni-space-sm);
  padding: var(--unni-space-md) 112px var(--unni-space-md) var(--unni-space-md);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-registration .service-choice:has(> input[type="checkbox"]:checked) {
  border-color: var(--unni-status-success-border) !important;
  background: color-mix(in srgb, var(--unni-status-success-bg) 70%, var(--unni-surface-2)) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-registration .service-content {
  grid-column: 2;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-client-registration .service-content strong {
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-sm);
  line-height: 1.35;
}

:root[data-unni-theme] body.unni-client-registration :where(.service-billing, .service-date-field small, .service-schedule-status) {
  color: var(--unni-text-muted) !important;
}

:root[data-unni-theme] body.unni-client-registration .service-details {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-client-registration .service-details textarea,
:root[data-unni-theme] body.unni-client-registration .service-details > [data-service-notes],
:root[data-unni-theme] body.unni-client-registration .service-details > .service-schedule-status {
  grid-column: 1 / -1;
}

:root[data-unni-theme] body.unni-client-registration .service-remove {
  top: var(--unni-space-sm);
  right: var(--unni-space-sm);
  min-height: var(--unni-touch-target);
  padding-inline: var(--unni-space-sm);
  border: 1px solid var(--unni-status-danger-border) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 700;
}

:root[data-unni-theme] body.unni-client-registration .financial-summary {
  gap: var(--unni-space-sm);
  margin-top: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-registration .contract-total {
  padding: var(--unni-space-md);
  border: 1px solid var(--unni-status-success-border) !important;
  border-radius: var(--unni-radius-card) !important;
  background: var(--unni-status-success-bg) !important;
}

/* Blocos operacionais preservam seus campos e regras; só muda a composição. */
:root[data-unni-theme] body.unni-client-registration :where(.ai-consent-card, .client-situation-card) {
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-card) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-registration .ai-consent-card {
  padding: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-registration .ai-consent-card .check {
  color: var(--unni-text-primary) !important;
  background: transparent !important;
}

:root[data-unni-theme] body.unni-client-registration .client-situation-card {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: var(--unni-space-lg);
  margin-top: var(--unni-space-md);
  padding: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-registration .client-situation-copy strong {
  color: var(--unni-text-primary) !important;
}

:root[data-unni-theme] body.unni-client-registration :where(
  .client-situation-copy span,
  .client-situation-note,
  .ai-consent-card p,
  .ai-term-state,
  .contract-help
) {
  color: var(--unni-text-muted) !important;
}

/* Hierarquia de ações sem alterar handlers, links, permissões ou ordem. */
:root[data-unni-theme] body.unni-client-registration .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--unni-space-xs);
  margin-top: var(--unni-space-lg);
  padding-top: var(--unni-space-md);
  border-top: 1px solid var(--unni-border-subtle);
}

:root[data-unni-theme] body.unni-client-registration .actions #saveButton {
  border: 1px solid var(--unni-brand-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-registration .actions .button--ghost {
  border: 1px solid var(--unni-border-default) !important;
  color: var(--unni-text-primary) !important;
  -webkit-text-fill-color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-registration .actions :where(.button, button, a):disabled {
  border-color: var(--unni-border-subtle) !important;
  color: var(--unni-text-disabled) !important;
  -webkit-text-fill-color: var(--unni-text-disabled) !important;
  background: var(--unni-surface-3) !important;
  opacity: 0.72;
}

@media (hover: hover) and (pointer: fine) {
  :root[data-unni-theme] body.unni-client-registration .service-picker-option:hover,
  :root[data-unni-theme] body.unni-client-registration .service-choice:hover {
    border-color: var(--unni-border-highlight) !important;
    background: color-mix(in srgb, var(--unni-brand-primary) 5%, var(--unni-surface-2)) !important;
    transform: none !important;
  }

  :root[data-unni-theme] body.unni-client-registration .actions #saveButton:hover {
    border-color: var(--unni-brand-primary-hover) !important;
    background: var(--unni-brand-primary-hover) !important;
  }

  :root[data-unni-theme] body.unni-client-registration .actions .button--ghost:hover {
    border-color: var(--unni-border-highlight) !important;
    background: var(--unni-surface-3) !important;
  }
}

@media (max-width: 900px) {
  :root[data-unni-theme] body.unni-client-registration .service-picker-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-client-registration .services-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  :root[data-unni-theme] body.unni-client-registration .shell {
    width: 100%;
    max-width: none;
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
  }

  :root[data-unni-theme] body.unni-client-registration :where(.intro, .section) {
    padding: var(--unni-space-md) !important;
  }

  :root[data-unni-theme] body.unni-client-registration .section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--unni-space-xs);
    margin-bottom: var(--unni-space-md);
  }

  :root[data-unni-theme] body.unni-client-registration .section-head p {
    max-width: none;
    justify-self: stretch;
    text-align: left;
  }

  :root[data-unni-theme] body.unni-client-registration .client-situation-card {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-client-registration .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-client-registration .actions :where(.button, button, a) {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 600px) {
  /* LOT 06.2: a ficha preserva a topbar canônica sem compressão das ações. */
  :root[data-unni-theme] body.unni-client-registration .unni-standard-topbar {
    top: 0 !important;
    grid-template-columns: minmax(44px, 1fr) auto !important;
    margin: 0 !important;
    background: var(--unni-surface-1) !important;
  }

  :root[data-unni-theme] body.unni-client-registration .unni-standard-actions {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }

  :root[data-unni-theme] body.unni-client-registration .unni-theme-switcher > summary {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
  }

  :root[data-unni-theme] body.unni-client-registration a.unni-standard-back {
    width: auto !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    flex: 0 0 auto !important;
    padding-inline: 10px !important;
  }

  :root[data-unni-theme] body.unni-client-registration .section {
    padding: var(--unni-space-sm) !important;
  }

  :root[data-unni-theme] body.unni-client-registration .service-picker {
    padding: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-client-registration :where(.service-picker-head, .selected-services-head) {
    display: grid;
    gap: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-client-registration .service-picker-count {
    justify-self: start;
  }

  :root[data-unni-theme] body.unni-client-registration .service-picker-options,
  :root[data-unni-theme] body.unni-client-registration .service-details,
  :root[data-unni-theme] body.unni-client-registration .financial-summary,
  :root[data-unni-theme] body.unni-client-registration .actions {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-client-registration .service-choice {
    padding: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-client-registration .service-remove {
    position: static;
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin-top: var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-client-registration .service-content {
    grid-row: 1;
  }

  :root[data-unni-theme] body.unni-client-registration .service-details {
    grid-row: 2;
  }
}

@media (max-width: 430px) {
  :root[data-unni-theme] body.unni-client-registration .intro {
    padding: var(--unni-space-sm) !important;
  }

  :root[data-unni-theme] body.unni-client-registration .section-head > div:first-child {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-client-registration .section-head .pill {
    justify-self: start;
  }
}

/* ===========================================================================
   LOT 08 — Agency materials and media operations
   Compatibility source: portal-v3.css. Canonical authority remains here.
   All geometry is shared by Light and Dark; theme differences use tokens only.
   ========================================================================== */

:root[data-unni-theme]:has(> body.unni-materials-page) {
  min-width: 0;
}

:root[data-unni-theme] body.unni-materials-page {
  min-width: 0;
  overflow-x: clip;
  color: var(--unni-text-primary);
  background: var(--unni-bg-canvas);
}

:root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) > main.u-container {
  width: min(1180px, calc(100% - 32px));
  max-width: 100%;
  margin-inline: auto;
}

:root[data-unni-theme] body.unni-materials-page :where(.hero, .panel, .group, .file, .client-uploads, .approval-control-card) {
  min-width: 0;
}

/* Canonical LOT 03 topbar; the component markup and global breakpoints remain unchanged. */
:root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) .u-topbar {
  position: sticky;
  top: var(--unni-space-xs);
  z-index: 100;
  margin-bottom: var(--unni-space-md);
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary);
  background: var(--unni-bg-glass);
  box-shadow: var(--unni-shadow-sm);
}

:root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) .u-topbar__title {
  color: var(--unni-text-primary);
}

:root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) :where(.u-theme-switcher__toggle, .u-theme-switcher__option, .u-btn-back) {
  min-height: var(--unni-touch-target);
  border-color: var(--unni-border-default);
  color: var(--unni-text-primary);
  background: var(--unni-surface-2);
}

:root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) .u-theme-switcher__menu {
  border-color: var(--unni-border-default);
  background: var(--unni-surface-1);
  box-shadow: var(--unni-shadow-md);
}

/* Client context and primary operation surfaces. */
:root[data-unni-theme] body.unni-materials-page .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: var(--unni-space-lg);
  margin: 0 0 var(--unni-space-md);
  padding: clamp(var(--unni-space-lg), 4vw, var(--unni-space-2xl));
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary);
  background: var(--unni-surface-1);
  box-shadow: var(--unni-shadow-sm);
}

:root[data-unni-theme] body.unni-materials-page .hero > div:first-child > span {
  display: inline-block;
  color: var(--unni-brand-primary);
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:root[data-unni-theme] body.unni-materials-page .hero h2 {
  margin: var(--unni-space-xs) 0 var(--unni-space-xs);
  color: var(--unni-text-primary);
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-materials-page :where(.hero p, .panel-head p, .footer) {
  color: var(--unni-text-muted);
}

:root[data-unni-theme] body.unni-materials-page .hero p {
  max-width: 720px;
  margin: 0;
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-materials-page .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-materials-page .panel {
  margin: 0 0 var(--unni-space-md);
  padding: clamp(var(--unni-space-md), 3vw, var(--unni-space-xl));
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary);
  background: var(--unni-surface-1);
  box-shadow: var(--unni-shadow-sm);
}

:root[data-unni-theme] body.unni-materials-page .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--unni-space-md);
  margin-bottom: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-materials-page .panel-head h3 {
  margin: 0 0 var(--unni-space-2xs);
  color: var(--unni-text-primary);
  font-size: var(--unni-font-size-xl);
  line-height: var(--unni-line-height-tight);
}

:root[data-unni-theme] body.unni-materials-page .panel-head p {
  max-width: 820px;
  margin: 0;
  font-size: var(--unni-font-size-sm);
  line-height: var(--unni-line-height-body);
}

/* LOT 04 controls and upload feedback. */
:root[data-unni-theme] body.unni-materials-page .upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-materials-page .field {
  display: grid;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-materials-page .field label {
  color: var(--unni-text-secondary);
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[data-unni-theme] body.unni-materials-page .field :where(select, input) {
  width: 100%;
  min-height: var(--unni-touch-target) !important;
  padding-inline: var(--unni-space-sm) !important;
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
  font-family: var(--unni-font-sans) !important;
  font-size: var(--unni-font-size-md) !important;
  line-height: var(--unni-line-height-body) !important;
}

:root[data-unni-theme] body.unni-materials-page .field input[type="file"] {
  height: 52px !important;
  min-height: 52px !important;
  padding: var(--unni-space-xs) !important;
  overflow: hidden;
}

/* The earlier historical materials block forces this pseudo-element in Dark. */
:root[data-unni-theme] body.unni-materials-page input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: var(--unni-space-sm);
  padding-inline: var(--unni-space-sm);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-sm) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-3) !important;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

:root[data-unni-theme] body.unni-materials-page :where(.button, .client-media-close, .client-media-nav, .client-media-actions a, .client-media-actions button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--unni-touch-target);
  min-height: var(--unni-touch-target);
  padding-inline: var(--unni-space-md);
  border: 1px solid var(--unni-border-default);
  border-radius: var(--unni-radius-md);
  color: var(--unni-text-primary);
  background: var(--unni-surface-2);
  box-shadow: none;
  font: inherit;
  font-size: var(--unni-font-size-sm);
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* The historical refined-button blocks force 40/42px and theme-specific type. */
:root[data-unni-theme] body.unni-materials-page :where(.button, .client-media-close, .client-media-actions a, .client-media-actions button) {
  height: var(--unni-touch-target) !important;
  min-height: var(--unni-touch-target) !important;
  max-height: var(--unni-touch-target) !important;
  padding-inline: var(--unni-space-md) !important;
  border-radius: var(--unni-radius-md) !important;
  font-family: var(--unni-font-sans) !important;
  font-size: var(--unni-font-size-sm) !important;
  font-weight: 750 !important;
  letter-spacing: normal !important;
  line-height: 1.2 !important;
}

:root[data-unni-theme] body.unni-materials-page .button {
  border-color: var(--unni-border-default) !important;
  color: var(--unni-text-primary) !important;
  -webkit-text-fill-color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
  transform: none !important;
}

:root[data-unni-theme] body.unni-materials-page .button.primary {
  border-color: var(--unni-brand-primary) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
  box-shadow: none !important;
}

/* Historical Dark declarations are important; these color-only resets keep parity. */
:root[data-unni-theme] body.unni-materials-page .button.preview {
  border-color: var(--unni-status-info-border) !important;
  color: var(--unni-status-info-text) !important;
  background: var(--unni-status-info-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page .button.danger {
  border-color: var(--unni-status-danger-border) !important;
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page :where(button, a, select, input, summary):focus-visible {
  outline: 2px solid var(--unni-border-focus);
  outline-offset: 2px;
}

:root[data-unni-theme] body.unni-materials-page :where(button, input, select):disabled {
  color: var(--unni-text-disabled);
  cursor: not-allowed;
  opacity: 0.62;
}

:root[data-unni-theme] body.unni-materials-page .upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-materials-page .upload-progress[hidden] {
  display: none;
}

:root[data-unni-theme] body.unni-materials-page .upload-progress progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: var(--unni-radius-full);
  background: var(--unni-surface-3);
  accent-color: var(--unni-brand-primary);
}

:root[data-unni-theme] body.unni-materials-page .upload-progress progress::-webkit-progress-bar {
  border-radius: var(--unni-radius-full);
  background: var(--unni-surface-3);
}

:root[data-unni-theme] body.unni-materials-page .upload-progress progress::-webkit-progress-value,
:root[data-unni-theme] body.unni-materials-page .upload-progress progress::-moz-progress-bar {
  border-radius: var(--unni-radius-full);
  background: var(--unni-brand-primary);
}

:root[data-unni-theme] body.unni-materials-page .upload-progress strong {
  min-width: 3ch;
  color: var(--unni-text-primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

:root[data-unni-theme] body.unni-materials-page .upload-optimizer {
  min-height: 20px;
  margin: 0;
  color: var(--unni-text-muted);
  font-size: var(--unni-font-size-xs);
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-materials-page .upload-optimizer[data-type="success"] {
  color: var(--unni-status-success-text);
}

:root[data-unni-theme] body.unni-materials-page .upload-optimizer[data-type="error"] {
  color: var(--unni-status-danger-text);
}

/* LOT 05 metrics, operational lists, statuses and data states. */
:root[data-unni-theme] body.unni-materials-page .approval-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--unni-space-xs);
  margin-bottom: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--unni-space-sm);
  min-height: 76px;
  padding: var(--unni-space-sm) var(--unni-space-md);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card span {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card strong {
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-2xl);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card--aprovado {
  border-color: var(--unni-status-success-border) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card--aprovado strong {
  color: var(--unni-status-success-text) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card--revisao {
  border-color: var(--unni-status-warning-border) !important;
  background: var(--unni-status-warning-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card--revisao strong {
  color: var(--unni-status-warning-text) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card--reprovado {
  border-color: var(--unni-status-danger-border) !important;
  background: var(--unni-status-danger-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-summary-card--reprovado strong {
  color: var(--unni-status-danger-text) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-materials-page .approval-control-card {
  padding: var(--unni-space-md);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-materials-page .approval-control-card-head > div > span {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-card h4 {
  margin: var(--unni-space-2xs) 0 0;
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-md);
}

:root[data-unni-theme] body.unni-materials-page :where(.approval-control-status, .status) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: var(--unni-space-2xs) var(--unni-space-xs);
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-full);
  color: var(--unni-text-secondary) !important;
  background: var(--unni-surface-3) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

:root[data-unni-theme] body.unni-materials-page .status.hidden {
  display: inline-flex !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-status--aprovado,
:root[data-unni-theme] body.unni-materials-page .status:not(.hidden) {
  border-color: var(--unni-status-success-border);
  color: var(--unni-status-success-text) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-status--revisao {
  border-color: var(--unni-status-warning-border);
  color: var(--unni-status-warning-text) !important;
  background: var(--unni-status-warning-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page :where(.approval-control-status--reprovado, .status.hidden) {
  border-color: var(--unni-status-danger-border);
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr) minmax(0, 0.8fr);
  gap: 1px;
  margin: var(--unni-space-sm) 0 0;
  overflow: hidden;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-md);
  background: var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-meta > div {
  min-width: 0;
  padding: var(--unni-space-xs) var(--unni-space-sm);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-meta dt,
:root[data-unni-theme] body.unni-materials-page .approval-control-comment span {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-meta dd {
  margin: var(--unni-space-2xs) 0 0;
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-sm);
  font-weight: 700;
  line-height: var(--unni-line-height-body);
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-materials-page .approval-control-meta dd small {
  display: block;
  margin-top: var(--unni-space-2xs);
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
}

:root[data-unni-theme] body.unni-materials-page .approval-control-comment {
  margin-top: var(--unni-space-sm);
  padding: var(--unni-space-sm);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-md);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
}

:root[data-unni-theme] body.unni-materials-page :where(.approval-control-comment p, .approval-history li p) {
  margin: var(--unni-space-xs) 0 0;
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-sm);
  line-height: var(--unni-line-height-body);
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-materials-page .approval-history {
  margin-top: var(--unni-space-sm);
  border-top: 1px solid var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-history summary {
  display: flex;
  align-items: center;
  gap: var(--unni-space-xs);
  min-height: var(--unni-touch-target);
  padding-top: var(--unni-space-xs);
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-sm);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

:root[data-unni-theme] body.unni-materials-page .approval-history summary::-webkit-details-marker {
  display: none;
}

:root[data-unni-theme] body.unni-materials-page .approval-history summary span {
  margin-left: auto;
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
}

:root[data-unni-theme] body.unni-materials-page .approval-history summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-3) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-history[open] summary::after {
  content: "−";
}

:root[data-unni-theme] body.unni-materials-page .approval-history ol {
  display: grid;
  gap: var(--unni-space-xs);
  margin: var(--unni-space-xs) 0 0;
  padding: 0;
  list-style: none;
}

:root[data-unni-theme] body.unni-materials-page .approval-history li,
:root[data-unni-theme] body.unni-materials-page :where(.approval-history-empty, .approval-control-empty) {
  padding: var(--unni-space-sm);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-md);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
}

:root[data-unni-theme] body.unni-materials-page .approval-history-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-materials-page .approval-history-event-head :where(time, span:last-child) {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
  text-align: right;
}

:root[data-unni-theme] body.unni-materials-page .approval-history-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unni-space-2xs);
  margin-top: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-materials-page .approval-history-event-meta span {
  padding: var(--unni-space-2xs) var(--unni-space-xs);
  border-radius: var(--unni-radius-full);
  color: var(--unni-text-secondary) !important;
  background: var(--unni-surface-3) !important;
  font-size: var(--unni-font-size-xs);
  font-weight: 700;
}

:root[data-unni-theme] body.unni-materials-page .groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-materials-page .group,
:root[data-unni-theme] body.unni-materials-page .client-uploads {
  overflow: hidden;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
}

:root[data-unni-theme] body.unni-materials-page .group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--unni-space-xs);
  min-height: 52px;
  padding: var(--unni-space-sm) var(--unni-space-md);
  border-bottom: 1px solid var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-materials-page .group-head h4 {
  min-width: 0;
  margin: 0;
  color: var(--unni-text-primary) !important;
  font-size: var(--unni-font-size-md);
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-materials-page .group-head span,
:root[data-unni-theme] body.unni-materials-page .file small {
  color: var(--unni-text-muted) !important;
  font-size: var(--unni-font-size-xs);
}

:root[data-unni-theme] body.unni-materials-page .files {
  display: grid;
}

:root[data-unni-theme] body.unni-materials-page .file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--unni-space-sm);
  padding: var(--unni-space-sm) var(--unni-space-md);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
}

:root[data-unni-theme] body.unni-materials-page .file + .file {
  border-top: 1px solid var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-materials-page .file strong,
:root[data-unni-theme] body.unni-materials-page .file small {
  display: block;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-materials-page .file strong {
  color: var(--unni-text-primary) !important;
}

:root[data-unni-theme] body.unni-materials-page .file small {
  margin-top: var(--unni-space-2xs);
}

:root[data-unni-theme] body.unni-materials-page .group .file .status {
  grid-column: 1;
  justify-self: start;
}

:root[data-unni-theme] body.unni-materials-page .file-actions {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--unni-space-xs);
  width: min(224px, 100%);
}

:root[data-unni-theme] body.unni-materials-page .inline-form {
  display: flex;
  margin: 0;
}

:root[data-unni-theme] body.unni-materials-page .file-actions :where(.inline-form, .button) {
  width: 100%;
  min-width: 0;
}

:root[data-unni-theme] body.unni-materials-page .client-uploads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-materials-page .client-uploads .file {
  border: 0;
}

:root[data-unni-theme] body.unni-materials-page .client-uploads .empty {
  grid-column: 1 / -1;
}

:root[data-unni-theme] body.unni-materials-page .empty {
  padding: var(--unni-space-md);
  color: var(--unni-text-muted) !important;
  background: var(--unni-surface-1) !important;
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-materials-page .notice {
  margin: var(--unni-space-sm) 0 0;
  padding: var(--unni-space-sm) var(--unni-space-md);
  border: 1px solid var(--unni-status-success-border);
  border-radius: var(--unni-radius-md);
  color: var(--unni-status-success-text);
  background: var(--unni-status-success-bg);
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-materials-page .notice.error {
  border-color: var(--unni-status-danger-border);
  color: var(--unni-status-danger-text);
  background: var(--unni-status-danger-bg);
}

:root[data-unni-theme] body.unni-materials-page .footer {
  padding: var(--unni-space-xs) var(--unni-space-2xs) var(--unni-space-lg);
  font-size: var(--unni-font-size-xs);
}

/* LOT 07 viewer geometry; existing JS, PDF.js, zoom and navigation stay authoritative. */
:root[data-unni-theme] body.unni-materials-page .client-media-modal {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  color: #f8fafc;
  background: #070a18;
  isolation: isolate;
  overscroll-behavior: none;
}

:root[data-unni-theme] body.unni-materials-page .client-media-modal[hidden] {
  display: none !important;
}

:root[data-unni-theme] body.unni-materials-page.client-modal-open .u-topbar {
  z-index: 1;
  pointer-events: none;
}

:root[data-unni-theme] body.unni-materials-page .client-media-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  color: #f8fafc;
  background: #11162a;
}

:root[data-unni-theme] body.unni-materials-page .client-media-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--unni-space-md);
  min-height: 68px;
  padding: max(var(--unni-space-sm), env(safe-area-inset-top)) max(var(--unni-space-md), env(safe-area-inset-right)) var(--unni-space-sm) max(var(--unni-space-md), env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: #11162a;
}

:root[data-unni-theme] body.unni-materials-page .client-media-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1rem, 2.2vw, 1.45rem);
  line-height: var(--unni-line-height-tight);
  overflow-wrap: anywhere;
}

/* Viewer filenames stay legible on the fixed dark-blue header in both themes. */
:root[data-unni-theme] body.unni-materials-page .client-media-head h2[data-agency-media-name] {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 800;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72), 0 0 16px rgba(69, 183, 255, 0.2);
}

:root[data-unni-theme] body.unni-materials-page :where(.client-media-close, .client-media-nav, .client-media-actions a, .client-media-actions button) {
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--unni-radius-full);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

:root[data-unni-theme] body.unni-materials-page .client-media-viewer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: clamp(7px, 1vw, 14px);
  background: #080b16;
}

:root[data-unni-theme] body.unni-materials-page .client-media-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border-radius: var(--unni-radius-card);
  background: #080b16;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

:root[data-unni-theme] body.unni-materials-page .client-media-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

:root[data-unni-theme] body.unni-materials-page .client-media-stage[data-media-kind="image"] {
  touch-action: pan-x pan-y;
}

:root[data-unni-theme] body.unni-materials-page .client-media-stage[data-media-kind="pdf"] {
  place-items: start center;
  padding: var(--unni-space-sm);
  background: #202434;
  scroll-behavior: smooth;
  touch-action: pan-y;
}

:root[data-unni-theme] body.unni-materials-page .client-pdf-document {
  display: grid;
  justify-items: center;
  gap: var(--unni-space-md);
  width: 100%;
  padding-bottom: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-materials-page .client-pdf-page {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--unni-radius-xs, 8px);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

:root[data-unni-theme] body.unni-materials-page .client-pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
  background: #ffffff;
}

:root[data-unni-theme] body.unni-materials-page .client-pdf-page-number {
  position: absolute;
  right: var(--unni-space-xs);
  bottom: var(--unni-space-xs);
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding-inline: var(--unni-space-xs);
  border-radius: var(--unni-radius-full);
  color: #ffffff;
  background: rgba(9, 12, 24, 0.76);
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
}

:root[data-unni-theme] body.unni-materials-page :where(.client-pdf-loading, .client-pdf-error) {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: var(--unni-space-xs);
  width: min(420px, calc(100% - 24px));
  margin: auto;
  padding: var(--unni-space-xl) var(--unni-space-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--unni-radius-lg);
  color: #f8fafc;
  background: rgba(17, 22, 42, 0.78);
  text-align: center;
}

:root[data-unni-theme] body.unni-materials-page :where(.client-pdf-loading, .client-pdf-error) small {
  color: rgba(248, 250, 252, 0.72);
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-materials-page .client-media-stage[data-zoomed="true"] {
  place-items: start;
}

:root[data-unni-theme] body.unni-materials-page .client-media-stage[data-zoomed="true"] img {
  max-width: none;
  max-height: none;
}

:root[data-unni-theme] body.unni-materials-page .client-media-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 46px;
  height: 58px;
  padding: 0;
  border-radius: var(--unni-radius-card);
  font-size: var(--unni-font-size-2xl);
  transform: translateY(-50%);
}

:root[data-unni-theme] body.unni-materials-page .client-media-nav[data-agency-media-prev] {
  left: max(var(--unni-space-sm), env(safe-area-inset-left));
}

:root[data-unni-theme] body.unni-materials-page .client-media-nav[data-agency-media-next] {
  right: max(var(--unni-space-sm), env(safe-area-inset-right));
}

:root[data-unni-theme] body.unni-materials-page .client-media-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--unni-space-sm);
  min-height: 70px;
  padding: var(--unni-space-sm) max(var(--unni-space-md), env(safe-area-inset-right)) max(var(--unni-space-sm), env(safe-area-inset-bottom)) max(var(--unni-space-md), env(safe-area-inset-left));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: #11162a;
}

:root[data-unni-theme] body.unni-materials-page .client-media-meta {
  min-width: 0;
}

:root[data-unni-theme] body.unni-materials-page .client-media-meta :where(strong, small) {
  display: block;
}

:root[data-unni-theme] body.unni-materials-page .client-media-meta strong {
  color: #f8fafc;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-materials-page .client-media-meta small {
  margin-top: var(--unni-space-2xs);
  color: rgba(248, 250, 252, 0.72);
}

:root[data-unni-theme] body.unni-materials-page .client-media-actions {
  display: flex;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme].client-modal-open:has(> body.unni-materials-page),
body.unni-materials-page.client-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (hover: hover) and (pointer: fine) {
  :root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) :where(.button, .u-btn-back, .u-theme-switcher__toggle):not(:disabled):hover {
    border-color: var(--unni-border-strong);
    background: var(--unni-surface-3);
    transform: none;
  }

  :root[data-unni-theme] body.unni-materials-page .button.primary:not(:disabled):hover {
    border-color: var(--unni-brand-primary-hover) !important;
    background: var(--unni-brand-primary-hover) !important;
    box-shadow: none !important;
    transform: none !important;
  }
}

@media (min-width: 1024px) {
  :root[data-unni-theme] body.unni-materials-page .hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  :root[data-unni-theme] body.unni-materials-page .hero-actions {
    justify-content: flex-end;
  }

  :root[data-unni-theme] body.unni-materials-page .upload {
    grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr) auto;
  }

  :root[data-unni-theme] body.unni-materials-page :where(.upload-progress, .upload-optimizer) {
    grid-column: 2 / -1;
  }
}

@media (max-width: 1023px) {
  :root[data-unni-theme] body.unni-materials-page .approval-control-list,
  :root[data-unni-theme] body.unni-materials-page .groups {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  :root[data-unni-theme] body.unni-materials-page .approval-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-materials-page .approval-control-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-materials-page .approval-control-meta > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  :root[data-unni-theme] body.unni-materials-page > main.u-container {
    width: min(100% - 16px, 1180px);
    padding-top: var(--unni-space-xs) !important;
  }

  :root[data-unni-theme] body:is([data-unni-surface="agency-operational"], .unni-materials-page, .unni-portal.unni-dashboard) .u-topbar {
    top: var(--unni-space-2xs);
    margin-bottom: var(--unni-space-sm);
    padding-inline: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-materials-page :where(.hero, .panel) {
    padding: var(--unni-space-md) var(--unni-space-sm);
    border-radius: var(--unni-radius-card);
  }

  :root[data-unni-theme] body.unni-materials-page .hero h2 {
    font-size: clamp(1.8rem, 10vw, 2.65rem);
  }

  :root[data-unni-theme] body.unni-materials-page .hero-actions,
  :root[data-unni-theme] body.unni-materials-page .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-materials-page :where(.hero-actions .button, .panel-head > .button, .upload > .button) {
    width: 100%;
  }

  :root[data-unni-theme] body.unni-materials-page .approval-control-card {
    padding: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-materials-page .approval-control-card-head,
  :root[data-unni-theme] body.unni-materials-page .approval-history-event-head {
    align-items: flex-start;
    flex-direction: column;
  }

  :root[data-unni-theme] body.unni-materials-page .approval-control-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-materials-page .approval-control-meta > div:first-child {
    grid-column: auto;
  }

  :root[data-unni-theme] body.unni-materials-page .approval-history-event-head :where(time, span:last-child) {
    text-align: left;
  }

  :root[data-unni-theme] body.unni-materials-page .client-uploads {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-materials-page .file {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-materials-page .group .file {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-materials-page .group .file .status,
  :root[data-unni-theme] body.unni-materials-page .group .file .file-actions {
    grid-column: 1;
    grid-row: auto;
  }

  :root[data-unni-theme] body.unni-materials-page .file-actions {
    width: 100%;
    margin-top: var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-head {
    min-height: 62px;
    padding-inline: max(var(--unni-space-sm), env(safe-area-inset-left)) max(var(--unni-space-sm), env(safe-area-inset-right));
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-viewer {
    padding: var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-stage {
    border-radius: var(--unni-radius-sm);
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-stage[data-media-kind="pdf"] {
    padding: var(--unni-space-xs) var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-nav {
    width: var(--unni-touch-target);
    height: 50px;
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-nav[data-agency-media-prev] {
    left: max(var(--unni-space-xs), env(safe-area-inset-left));
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-nav[data-agency-media-next] {
    right: max(var(--unni-space-xs), env(safe-area-inset-right));
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-footer {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--unni-space-xs) max(var(--unni-space-sm), env(safe-area-inset-right)) max(var(--unni-space-xs), env(safe-area-inset-bottom)) max(var(--unni-space-sm), env(safe-area-inset-left));
  }

  :root[data-unni-theme] body.unni-materials-page .client-media-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  :root[data-unni-theme] body.unni-materials-page .approval-summary-card {
    min-height: 68px;
    padding: var(--unni-space-xs) var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-materials-page .approval-summary-card span {
    font-size: 0.68rem;
  }

  :root[data-unni-theme] body.unni-materials-page .approval-summary-card strong {
    font-size: var(--unni-font-size-xl);
  }

  :root[data-unni-theme] body.unni-materials-page .client-uploads .file {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-materials-page .client-uploads .file .button {
    width: 100%;
  }
}

@media (max-width: 340px) {
  :root[data-unni-theme] body.unni-materials-page .approval-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-materials-page .u-topbar {
    padding-inline: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-materials-page .u-topbar__actions {
    gap: var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-materials-page .u-btn-back {
    padding-inline: var(--unni-space-xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-unni-theme] body.unni-materials-page *,
  :root[data-unni-theme] body.unni-materials-page *::before,
  :root[data-unni-theme] body.unni-materials-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==========================================================================
   LOT 07 — Client Workspace core experience
   Rotas: cliente/painel.php e cliente/projeto.php.
   Geometria compartilhada entre Light e Dark; apenas tokens mudam a cor.
   ========================================================================== */

:root[data-unni-theme]:has(> body:is(.unni-client-dashboard, .unni-client-project)) {
  min-width: 0;
}

:root[data-unni-theme] body:is(.unni-client-dashboard, .unni-client-project) {
  min-width: 0;
  color: var(--unni-text-primary) !important;
  background: var(--unni-bg-canvas) !important;
  background-image: none !important;
  overflow-x: clip;
}

:root[data-unni-theme] body:is(.unni-client-dashboard, .unni-client-project) > main.shell {
  width: min(1180px, calc(100% - 24px));
  max-width: 1180px;
  margin-inline: auto;
  padding: var(--unni-space-sm) 0 var(--unni-space-2xl);
}

:root[data-unni-theme] body:is(.unni-client-dashboard, .unni-client-project) :where(
  .client-intelligence,
  .client-intelligence-copy,
  .client-intelligence-meta,
  .client-journey,
  .journey-header,
  .journey-summary,
  .journey-next,
  .journey-steps,
  .journey-section,
  .journey-material,
  .journey-material-main,
  .journey-decision,
  .journey-history,
  .os-resources,
  .upload-panel,
  .section,
  .materials,
  .material,
  .hero,
  .grid,
  .card,
  .delivery,
  .approval,
  .actions,
  .timeline,
  .event,
  .report-data,
  .metric
) {
  min-width: 0;
}

/* Client Workspace: topbar canônica, próxima ação e resumo operacional. */
:root[data-unni-theme] body.unni-client-dashboard .unni-standard-topbar {
  top: 0 !important;
  z-index: 100 !important;
  margin: 0 !important;
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-lg) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
  backdrop-filter: none !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-title {
  min-width: 220px !important;
  font-size: 1rem !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
}

:root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions .unni-theme-switcher > summary {
  width: 132px !important;
  min-width: 132px !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--unni-space-md);
  margin-top: var(--unni-space-sm);
  padding: var(--unni-space-lg);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-copy h2,
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-copy p,
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-meta dt,
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-meta dd small,
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-passive {
  color: var(--unni-text-muted) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-copy strong,
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-meta dd {
  color: var(--unni-text-primary) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-meta > div,
:root[data-unni-theme] body.unni-client-dashboard .client-intelligence-passive {
  padding: var(--unni-space-sm);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card);
  background: var(--unni-surface-2) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence .intelligence-kicker {
  border-color: var(--unni-status-success-border) !important;
  color: var(--unni-status-success-text) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence .intelligence-owner {
  color: var(--unni-status-warning-text) !important;
  background: var(--unni-status-warning-bg) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .client-intelligence .client-intelligence-action {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: var(--unni-touch-target) !important;
  height: auto !important;
  max-height: none !important;
  margin-top: 0 !important;
  padding: 12px var(--unni-space-lg) !important;
  border: 1px solid var(--unni-brand-primary) !important;
  border-radius: var(--unni-radius-md) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
  box-shadow: none !important;
  line-height: 1.35;
  white-space: normal;
}

/* Jornada, materiais, aprovações, feedback e histórico factual. */
:root[data-unni-theme] body.unni-client-dashboard .client-journey {
  margin-top: var(--unni-space-md);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-client-dashboard :where(
  .journey-header,
  .journey-summary > div,
  .journey-next,
  .journey-steps li,
  .journey-section,
  .journey-material,
  .journey-history,
  .os-timeline-event,
  .journey-confirm-shell
) {
  color: var(--unni-text-primary) !important;
  border-color: var(--unni-border-subtle) !important;
  background: var(--unni-surface-2) !important;
  background-image: none !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-header {
  padding: var(--unni-space-xl);
}

:root[data-unni-theme] body.unni-client-dashboard .journey-summary {
  gap: 1px;
  background: var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-summary > div {
  padding: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-dashboard :where(
  .journey-header h2,
  .journey-summary strong,
  .journey-next strong,
  .journey-steps strong,
  .journey-section-head h3,
  .journey-material h4,
  .journey-history > summary strong,
  .os-timeline-event h3,
  .journey-confirm-shell h2
) {
  color: var(--unni-text-primary) !important;
}

:root[data-unni-theme] body.unni-client-dashboard :where(
  .journey-header p,
  .journey-summary span,
  .journey-steps small,
  .journey-material p,
  .journey-history > summary small,
  .journey-footer,
  .os-timeline-event p,
  .journey-confirm-shell > p
) {
  color: var(--unni-text-muted) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-project-code,
:root[data-unni-theme] body.unni-client-dashboard .journey-material-meta span {
  color: var(--unni-brand-primary) !important;
  background: var(--unni-brand-primary-soft) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-section {
  border-radius: var(--unni-radius-lg);
}

:root[data-unni-theme] body.unni-client-dashboard .journey-section--attention {
  border-color: var(--unni-status-warning-border) !important;
  background: color-mix(in srgb, var(--unni-status-warning-bg) 50%, var(--unni-surface-2)) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-section-head > strong {
  color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-material {
  border-radius: var(--unni-radius-card);
}

:root[data-unni-theme] body.unni-client-dashboard .journey-decision {
  border-color: var(--unni-border-subtle) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .decision-options button {
  min-height: var(--unni-touch-target);
  border-color: var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .decision-options button small {
  color: var(--unni-text-muted) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-feedback[data-type="success"],
:root[data-unni-theme] body.unni-client-dashboard :where(.journey-empty--success, .journey-approved) {
  color: var(--unni-status-success-text) !important;
  border-color: var(--unni-status-success-border) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-receipt {
  color: var(--unni-status-warning-text) !important;
  border-color: var(--unni-status-warning-border) !important;
  background: var(--unni-status-warning-bg) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-material-meta strong {
  color: var(--unni-status-success-text) !important;
  background: var(--unni-status-success-bg) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .journey-history,
:root[data-unni-theme] body.unni-client-dashboard .journey-footer {
  border-color: var(--unni-border-subtle) !important;
  background: var(--unni-surface-2) !important;
}

/* Recursos e canais permanecem nas superfícies e ações existentes. */
:root[data-unni-theme] body.unni-client-dashboard .os-resources {
  display: grid;
  gap: var(--unni-space-md);
  margin-top: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-dashboard :where(.upload-panel, #canais.section) {
  margin-top: 0;
  padding: var(--unni-space-lg);
  border: 1px solid var(--unni-border-default) !important;
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-1) !important;
  box-shadow: var(--unni-shadow-sm) !important;
}

:root[data-unni-theme] body.unni-client-dashboard #canais .materials {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-client-dashboard #canais .material {
  min-height: 116px;
  padding: var(--unni-space-md);
  border: 1px solid var(--unni-border-subtle) !important;
  border-radius: var(--unni-radius-card);
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
}

:root[data-unni-theme] body.unni-client-dashboard :where(
  .upload-panel p,
  #canais .section-head p,
  #canais .material > span
) {
  color: var(--unni-text-muted) !important;
}

:root[data-unni-theme] body.unni-client-dashboard .channel-link {
  color: var(--unni-text-primary) !important;
  overflow-wrap: anywhere;
}

/* Viewer: somente integração visual; handlers e fluxo funcional permanecem intactos. */
:root[data-unni-theme] body.unni-client-dashboard .client-media-modal {
  inset: 0 !important;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: hidden;
}

:root[data-unni-theme] body.unni-client-dashboard .client-media-shell {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
}

:root[data-unni-theme] body.unni-client-dashboard :where(.client-media-close, .client-media-nav, .client-media-actions a, .client-media-actions button) {
  min-width: var(--unni-touch-target);
  min-height: var(--unni-touch-target);
}

/* Página factual de projeto: cards, entrega, aprovação e timeline. */
:root[data-unni-theme] body.unni-client-project .u-topbar {
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary);
  background: var(--unni-surface-1);
  box-shadow: var(--unni-shadow-sm);
  backdrop-filter: none;
}

@media (min-width: 1024px) {
  :root[data-unni-theme] body.unni-client-project .u-topbar__brand {
    width: clamp(175px, 20vw, 235px) !important;
    height: 56px !important;
    min-height: 56px !important;
  }

  :root[data-unni-theme] body.unni-client-project .u-topbar__brand img {
    width: auto !important;
    height: 52px !important;
    max-width: 100% !important;
    max-height: 52px !important;
    object-fit: contain !important;
    object-position: left center !important;
  }
}

:root[data-unni-theme="light"] body.unni-client-dashboard .unni-standard-actions .client-logout {
  color: var(--unni-text-primary) !important;
  -webkit-text-fill-color: var(--unni-text-primary) !important;
}

:root[data-unni-theme] body.unni-client-project .hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: var(--unni-space-md);
  margin-top: var(--unni-space-md);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:root[data-unni-theme] body.unni-client-project .grid {
  gap: var(--unni-space-md);
  margin-top: var(--unni-space-md);
}

:root[data-unni-theme] body.unni-client-project .card {
  padding: clamp(var(--unni-space-lg), 3vw, var(--unni-space-2xl));
  border: 1px solid var(--unni-border-default);
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary);
  background: var(--unni-surface-1);
  box-shadow: var(--unni-shadow-sm);
}

:root[data-unni-theme] body.unni-client-project :where(h1, h2, h3, .metric strong) {
  color: var(--unni-text-primary);
}

:root[data-unni-theme] body.unni-client-project h1 {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: var(--unni-line-height-tight);
}

:root[data-unni-theme] body.unni-client-project p,
:root[data-unni-theme] body.unni-client-project .footer {
  color: var(--unni-text-muted);
}

:root[data-unni-theme] body.unni-client-project .eyebrow {
  color: var(--unni-brand-primary);
}

:root[data-unni-theme] body.unni-client-project .progress,
:root[data-unni-theme] body.unni-client-project .progress::-webkit-progress-bar {
  background: var(--unni-surface-3);
}

:root[data-unni-theme] body.unni-client-project .progress::-webkit-progress-value,
:root[data-unni-theme] body.unni-client-project .progress::-moz-progress-bar {
  background: var(--unni-brand-primary);
}

:root[data-unni-theme] body.unni-client-project .chip {
  border-color: var(--unni-border-default);
  color: var(--unni-text-secondary);
  background: var(--unni-surface-2);
}

:root[data-unni-theme] body.unni-client-project .chip.good {
  border-color: var(--unni-status-success-border);
  color: var(--unni-status-success-text);
  background: var(--unni-status-success-bg);
}

:root[data-unni-theme] body.unni-client-project .chip.warn {
  border-color: var(--unni-status-warning-border);
  color: var(--unni-status-warning-text);
  background: var(--unni-status-warning-bg);
}

:root[data-unni-theme] body.unni-client-project .button.primary {
  height: var(--unni-touch-target) !important;
  min-height: var(--unni-touch-target) !important;
  max-height: var(--unni-touch-target) !important;
  border: 1px solid var(--unni-brand-primary);
  border-radius: var(--unni-radius-md);
  color: #ffffff;
  background: var(--unni-brand-primary);
}

:root[data-unni-theme] body.unni-client-project .approval {
  border-color: var(--unni-border-subtle);
}

:root[data-unni-theme] body.unni-client-project .approval label {
  display: block;
  margin-bottom: var(--unni-space-xs);
  color: var(--unni-text-secondary);
  font-size: var(--unni-font-size-sm);
  font-weight: 700;
}

:root[data-unni-theme] body.unni-client-project textarea {
  min-height: 112px;
  border-color: var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
}

:root[data-unni-theme] body.unni-client-project .actions {
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-client-project .action {
  min-height: var(--unni-touch-target);
  border-color: var(--unni-border-default);
  border-radius: var(--unni-radius-md);
  color: var(--unni-text-primary);
  background: var(--unni-surface-2);
}

:root[data-unni-theme] body.unni-client-project .action.approve {
  border-color: var(--unni-status-success-border);
  color: var(--unni-status-success-text);
  background: var(--unni-status-success-bg);
}

:root[data-unni-theme] body.unni-client-project .action.revision {
  border-color: var(--unni-status-warning-border);
  color: var(--unni-status-warning-text);
  background: var(--unni-status-warning-bg);
}

:root[data-unni-theme] body.unni-client-project .action.reject {
  border-color: var(--unni-status-danger-border);
  color: var(--unni-status-danger-text);
  background: var(--unni-status-danger-bg);
}

:root[data-unni-theme] body.unni-client-project .report-data {
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-client-project .metric,
:root[data-unni-theme] body.unni-client-project .event {
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-card);
  color: var(--unni-text-secondary);
  background: var(--unni-surface-2);
}

:root[data-unni-theme] body.unni-client-project .event {
  border-left: 3px solid var(--unni-status-info);
}

@media (hover: hover) and (pointer: fine) {
  :root[data-unni-theme] body.unni-client-dashboard .client-intelligence .client-intelligence-action:hover,
  :root[data-unni-theme] body.unni-client-dashboard :where(.journey-material-main > .button, [data-open-media-gallery]):hover,
  :root[data-unni-theme] body.unni-client-project .button.primary:hover {
    border-color: var(--unni-brand-primary-hover) !important;
    background: var(--unni-brand-primary-hover) !important;
    box-shadow: none !important;
    transform: none !important;
  }
}

@media (max-width: 900px) {
  :root[data-unni-theme] body.unni-client-dashboard .journey-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-material {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-client-project .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  :root[data-unni-theme] body:is(.unni-client-dashboard, .unni-client-project) > main.shell {
    width: calc(100% - 20px);
    padding-top: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-topbar {
    grid-template-columns: minmax(44px, 1fr) auto !important;
    grid-template-rows: 44px auto !important;
    gap: var(--unni-space-xs) !important;
    min-height: 0 !important;
    padding: var(--unni-space-xs) var(--unni-space-sm) !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: var(--unni-touch-target) !important;
    min-width: var(--unni-touch-target) !important;
    height: var(--unni-touch-target) !important;
    background: url("/brand/unnicora-unicorn-symbol-mobile-v2.png") center / 32px 32px no-repeat !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-brand .unni-brand-logo {
    display: none !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-title {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    height: auto !important;
    min-height: 36px !important;
    padding: var(--unni-space-xs) 0 0 !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-height: var(--unni-touch-target) !important;
    padding: 0 !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .unni-standard-actions :where(
    .unni-theme-switcher > summary,
    .client-logout
  ) {
    width: var(--unni-touch-target) !important;
    min-width: var(--unni-touch-target) !important;
    height: var(--unni-touch-target) !important;
    min-height: var(--unni-touch-target) !important;
    max-height: var(--unni-touch-target) !important;
    padding-inline: var(--unni-space-xs) !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard .client-intelligence {
    padding: var(--unni-space-md);
  }

  :root[data-unni-theme] body.unni-client-dashboard .client-intelligence-meta,
  :root[data-unni-theme] body.unni-client-dashboard #canais .materials {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-header {
    padding: var(--unni-space-md);
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-summary > div:first-child {
    grid-column: 1 / -1;
  }

  :root[data-unni-theme] body.unni-client-dashboard :where(.journey-next, .journey-steps, .journey-section, .journey-history) {
    margin-right: var(--unni-space-sm);
    margin-left: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-client-dashboard :where(.journey-steps, .decision-options) {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-section,
  :root[data-unni-theme] body.unni-client-dashboard .journey-material,
  :root[data-unni-theme] body.unni-client-dashboard :where(.upload-panel, #canais.section) {
    padding: var(--unni-space-sm);
  }

  :root[data-unni-theme] body.unni-client-dashboard .journey-decision {
    padding-top: var(--unni-space-md);
    border-top: 1px solid var(--unni-border-subtle) !important;
    border-left: 0 !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard :where(
    .client-intelligence-action,
    .journey-material-main > .button,
    [data-open-media-gallery],
    .upload-panel .button
  ) {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  :root[data-unni-theme] body.unni-client-dashboard #canais .material {
    min-height: 0;
  }

  :root[data-unni-theme] body.unni-client-project .u-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  :root[data-unni-theme] body.unni-client-project .u-topbar__brand a > img {
    display: none !important;
  }

  :root[data-unni-theme] body.unni-client-project :where(.hero, .grid) {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-client-project .card {
    padding: var(--unni-space-md);
  }

  :root[data-unni-theme] body.unni-client-project :where(.actions, .action) {
    width: 100%;
  }

  :root[data-unni-theme] body.unni-client-project .report-data {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  :root[data-unni-theme] body:is(.unni-client-dashboard, .unni-client-project) > main.shell {
    width: calc(100% - 12px);
  }

  :root[data-unni-theme] body.unni-client-dashboard .client-journey {
    border-radius: var(--unni-radius-card);
  }

  :root[data-unni-theme] body.unni-client-project .u-topbar {
    padding-inline: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-client-project .u-topbar__actions {
    gap: var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-client-project .u-btn-back {
    padding-inline: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-client-project h1 {
    font-size: clamp(1.8rem, 10vw, 2.5rem);
  }
}

/* ==========================================================================
   LOT 09 — Agency client portal configuration
   Page-specific geometry is shared by both themes; tokens own color changes.
   ========================================================================== */

:root[data-unni-theme] body.unni-portal-client-settings {
  color: var(--unni-text-primary);
  background: var(--unni-bg-canvas);
}

:root[data-unni-theme] body.unni-portal-client-settings > main.shell {
  width: min(1180px, calc(100% - 28px));
  min-width: 0;
  margin-inline: auto;
  padding: var(--unni-space-md) 0 var(--unni-space-2xl);
}

:root[data-unni-theme] body.unni-portal-client-settings :where(.hero, .panel) {
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-lg);
  color: var(--unni-text-primary);
  background: var(--unni-surface-1);
  box-shadow: var(--unni-shadow-sm);
}

:root[data-unni-theme] body.unni-portal-client-settings .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  align-items: end;
  gap: var(--unni-space-xl);
  margin-top: var(--unni-space-sm);
  padding: clamp(20px, 3vw, 32px);
}

:root[data-unni-theme] body.unni-portal-client-settings .eyebrow {
  color: var(--unni-brand-primary);
  font-size: var(--unni-font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-unni-theme] body.unni-portal-client-settings .hero h2 {
  max-width: 760px;
  margin: var(--unni-space-xs) 0 var(--unni-space-xs);
  color: var(--unni-text-primary);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: var(--unni-line-height-tight);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-portal-client-settings :where(.hero p, .panel p, .help, .footer) {
  color: var(--unni-text-muted);
}

:root[data-unni-theme] body.unni-portal-client-settings .hero > div:first-child > p:not(.notice) {
  max-width: 760px;
  margin: 0;
  line-height: var(--unni-line-height-relaxed);
}

:root[data-unni-theme] body.unni-portal-client-settings .hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-portal-client-settings :where(.button, .remove-event) {
  min-height: var(--unni-touch-target) !important;
  border-color: var(--unni-border-default) !important;
  border-radius: var(--unni-radius-md) !important;
  color: var(--unni-text-primary) !important;
  background: var(--unni-surface-2) !important;
  box-shadow: none !important;
  transform: none !important;
}

:root[data-unni-theme] body.unni-portal-client-settings .button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 var(--unni-space-md) !important;
  font-family: var(--unni-font-sans) !important;
  font-size: var(--unni-font-size-sm) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-decoration: none !important;
}

:root[data-unni-theme] body.unni-portal-client-settings .button.primary {
  border-color: var(--unni-brand-primary) !important;
  color: #ffffff !important;
  background: var(--unni-brand-primary) !important;
}

:root[data-unni-theme] body.unni-portal-client-settings .unni-theme-switcher__menu button {
  min-height: var(--unni-touch-target) !important;
}

:root[data-unni-theme] body.unni-portal-client-settings .panel {
  margin-top: var(--unni-space-sm);
  padding: clamp(18px, 2.6vw, 28px);
}

:root[data-unni-theme] body.unni-portal-client-settings .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--unni-space-md);
  margin-bottom: var(--unni-space-lg);
}

:root[data-unni-theme] body.unni-portal-client-settings .panel h3 {
  margin: 0 0 var(--unni-space-2xs);
  color: var(--unni-text-primary);
  font-size: var(--unni-font-size-xl);
  line-height: var(--unni-line-height-tight);
}

:root[data-unni-theme] body.unni-portal-client-settings .panel p {
  margin: 0;
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-portal-client-settings .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-portal-client-settings .field {
  display: grid;
  min-width: 0;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-portal-client-settings [hidden] {
  display: none !important;
}

:root[data-unni-theme] body.unni-portal-client-settings .field.full {
  grid-column: 1 / -1;
}

:root[data-unni-theme] body.unni-portal-client-settings .field :where(label, > span) {
  color: var(--unni-text-secondary);
  font-size: var(--unni-font-size-sm);
  font-weight: 700;
  letter-spacing: normal;
  line-height: var(--unni-line-height-body);
  text-transform: none;
}

:root[data-unni-theme] body.unni-portal-client-settings .field :where(input, select, textarea) {
  min-width: 0;
}

:root[data-unni-theme] body.unni-portal-client-settings .checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-portal-client-settings label.check {
  min-width: 0;
  border-color: var(--unni-border-subtle);
  background: var(--unni-surface-2);
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery-list,
:root[data-unni-theme] body.unni-portal-client-settings .event-list {
  display: grid;
  gap: var(--unni-space-xs);
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery,
:root[data-unni-theme] body.unni-portal-client-settings .event {
  min-width: 0;
  border: 1px solid var(--unni-border-subtle);
  border-radius: var(--unni-radius-card);
  color: var(--unni-text-primary);
  background: var(--unni-surface-2);
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) repeat(4, minmax(118px, 0.75fr));
  align-items: end;
  gap: var(--unni-space-xs);
  padding: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery-title {
  min-width: 0;
  align-self: center;
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery-title :where(strong, span) {
  display: block;
  overflow-wrap: anywhere;
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery-title strong {
  color: var(--unni-text-primary);
  font-size: var(--unni-font-size-md);
  line-height: var(--unni-line-height-tight);
}

:root[data-unni-theme] body.unni-portal-client-settings .delivery-title span {
  margin-top: var(--unni-space-2xs);
  color: var(--unni-text-muted);
  font-size: var(--unni-font-size-xs);
}

:root[data-unni-theme] body.unni-portal-client-settings .event {
  display: grid;
  grid-template-columns: 142px 142px minmax(160px, 1fr) minmax(190px, 1.35fr) var(--unni-touch-target);
  align-items: end;
  gap: var(--unni-space-xs);
  padding: var(--unni-space-sm);
}

:root[data-unni-theme] body.unni-portal-client-settings .remove-event {
  width: var(--unni-touch-target);
  min-width: var(--unni-touch-target);
  padding: 0;
  border-color: var(--unni-status-danger-border) !important;
  color: var(--unni-status-danger-text) !important;
  background: var(--unni-status-danger-bg) !important;
  font-size: var(--unni-font-size-xl);
  cursor: pointer;
}

:root[data-unni-theme] body.unni-portal-client-settings .notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--unni-space-xs);
  margin: var(--unni-space-sm) 0 0;
  padding: var(--unni-space-sm) var(--unni-space-md);
  border: 1px solid var(--unni-status-success-border);
  border-radius: var(--unni-radius-md);
  color: var(--unni-status-success-text);
  background: var(--unni-status-success-bg);
  line-height: var(--unni-line-height-body);
}

:root[data-unni-theme] body.unni-portal-client-settings .notice::before {
  content: "\2713";
  font-weight: 900;
}

:root[data-unni-theme] body.unni-portal-client-settings .notice.error {
  border-color: var(--unni-status-danger-border);
  color: var(--unni-status-danger-text);
  background: var(--unni-status-danger-bg);
}

:root[data-unni-theme] body.unni-portal-client-settings .notice.error::before {
  content: "!";
}

:root[data-unni-theme] body.unni-portal-client-settings [data-empty-events]:not([hidden]) {
  display: block;
  margin-top: var(--unni-space-xs);
  padding: var(--unni-space-md);
  border: 1px dashed var(--unni-border-default);
  border-radius: var(--unni-radius-md);
  color: var(--unni-text-muted);
  background: var(--unni-surface-2);
  text-align: center;
}

:root[data-unni-theme] body.unni-portal-client-settings .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unni-space-xs);
  margin-top: var(--unni-space-lg);
  padding-top: var(--unni-space-md);
  border-top: 1px solid var(--unni-border-subtle);
}

:root[data-unni-theme] body.unni-portal-client-settings .footer {
  padding: var(--unni-space-lg) var(--unni-space-2xs) 0;
  font-size: var(--unni-font-size-xs);
}

@media (hover: hover) and (pointer: fine) {
  :root[data-unni-theme] body.unni-portal-client-settings :where(.button, .remove-event):not(:disabled):hover {
    border-color: var(--unni-border-strong) !important;
    background: var(--unni-surface-3) !important;
    transform: none !important;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .button.primary:not(:disabled):hover {
    border-color: var(--unni-brand-primary-hover) !important;
    background: var(--unni-brand-primary-hover) !important;
  }
}

@media (min-width: 1024px) {
  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar__brand {
    width: clamp(175px, 20vw, 235px);
    height: 56px;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar__brand img {
    width: auto;
    height: 52px;
    max-height: 52px;
  }
}

@media (max-width: 1023px) {
  :root[data-unni-theme] body.unni-portal-client-settings .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .hero-actions {
    justify-content: flex-start;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .delivery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-portal-client-settings .delivery-title {
    grid-column: 1 / -1;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .event {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root[data-unni-theme] body.unni-portal-client-settings .event .field:nth-child(3),
  :root[data-unni-theme] body.unni-portal-client-settings .event .field:nth-child(4) {
    grid-column: 1 / -1;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .remove-event {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 767px) {
  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar {
    position: relative;
    z-index: 100;
    overflow: visible;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar__brand a > :is(img, picture) {
    display: none !important;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar .unni-theme-switcher > summary {
    width: var(--unni-touch-target) !important;
    min-width: var(--unni-touch-target) !important;
    height: var(--unni-touch-target) !important;
    min-height: var(--unni-touch-target) !important;
    transform: none !important;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar .unni-theme-switcher__menu {
    position: absolute !important;
    top: calc(100% + var(--unni-space-xs)) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1000 !important;
  }

  :root[data-unni-theme] body.unni-portal-client-settings > main.shell {
    width: min(100% - 16px, 1180px);
    padding-top: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .hero,
  :root[data-unni-theme] body.unni-portal-client-settings .panel {
    padding: var(--unni-space-md) var(--unni-space-sm);
    border-radius: var(--unni-radius-card);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .hero h2 {
    font-size: clamp(1.75rem, 9vw, 2.4rem);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .hero-actions,
  :root[data-unni-theme] body.unni-portal-client-settings .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .hero-actions .button,
  :root[data-unni-theme] body.unni-portal-client-settings .panel-head > .button {
    width: 100%;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .grid,
  :root[data-unni-theme] body.unni-portal-client-settings .checks,
  :root[data-unni-theme] body.unni-portal-client-settings .delivery,
  :root[data-unni-theme] body.unni-portal-client-settings .event {
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .field.full,
  :root[data-unni-theme] body.unni-portal-client-settings .delivery-title,
  :root[data-unni-theme] body.unni-portal-client-settings .event .field:nth-child(3),
  :root[data-unni-theme] body.unni-portal-client-settings .event .field:nth-child(4),
  :root[data-unni-theme] body.unni-portal-client-settings .remove-event {
    grid-column: auto;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .remove-event {
    justify-self: stretch;
    width: 100%;
  }

  :root[data-unni-theme] body.unni-portal-client-settings .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .actions .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  :root[data-unni-theme] body.unni-portal-client-settings > main.shell {
    width: calc(100% - 12px);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar {
    padding-inline: var(--unni-space-xs);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-topbar__actions {
    gap: var(--unni-space-2xs);
  }

  :root[data-unni-theme] body.unni-portal-client-settings .u-btn-back {
    padding-inline: var(--unni-space-xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-unni-theme] body.unni-portal-client-settings *,
  :root[data-unni-theme] body.unni-portal-client-settings *::before,
  :root[data-unni-theme] body.unni-portal-client-settings *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
