/* Temas Escuro (roxo/violeta) e Azul (ocean) — mesmas paletas do app celular (public/agenda/style.css) */

/* —— Escuro: paleta do tema escuro padrão do app celular —— */
[data-theme="dark"] {
  --primary: #f8f7fc;
  --primary-light: #ede9fe;
  --sidebar-bg: #2d005e;
  --sidebar-purple: #2d005e;
  --brand-purple: #7c3aed;
  --brand-purple-light: #6d28d9;
  --sidebar-border: rgba(196, 181, 253, 0.14);
  --sidebar-item-active-glow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 24px rgba(124, 58, 237, 0.32);
  --accent: #a78bfa;
  --accent-light: #c4b5fd;
  --accent-hover: #8b5cf6;
  --accent-muted: rgba(167, 139, 250, 0.22);
  --success: #10b981;
  --danger: #ef4444;

  --bg: #16042d;
  --bg-secondary: #34145f;
  --surface: #240541;
  --surface-glass: rgba(36, 5, 65, 0.88);
  --text: #f8f7fc;
  --text-light: #c4b5fd;
  --border: rgba(196, 181, 253, 0.22);

  --shadow-sm: 0 1px 2px rgba(22, 4, 45, 0.35);
  --shadow-md: 0 12px 32px rgba(22, 4, 45, 0.45);
  --shadow-lg: 0 22px 48px rgba(22, 4, 45, 0.55);
  --shadow-glow: 0 0 0 1px rgba(196, 181, 253, 0.16);
}

/* —— Azul: paleta do tema "ocean" do app celular —— */
[data-theme="blue"] {
  --primary: #f0f9ff;
  --primary-light: #e0f2fe;
  --sidebar-bg: #0c4a6e;
  --sidebar-purple: #0c4a6e;
  --brand-purple: #0ea5e9;
  --brand-purple-light: #0284c7;
  --sidebar-border: rgba(125, 211, 252, 0.16);
  --sidebar-item-active-glow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 8px 24px rgba(14, 165, 233, 0.3);
  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-hover: #0ea5e9;
  --accent-muted: rgba(56, 189, 248, 0.2);
  --success: #10b981;
  --danger: #ef4444;
  --info: #38bdf8;

  --bg: #082f49;
  --bg-secondary: #155e75;
  --surface: #0c4a6e;
  --surface-glass: rgba(12, 74, 110, 0.88);
  --text: #f0f9ff;
  --text-light: #7dd3fc;
  --border: rgba(125, 211, 252, 0.24);

  --shadow-sm: 0 1px 2px rgba(8, 47, 73, 0.35);
  --shadow-md: 0 12px 32px rgba(8, 47, 73, 0.45);
  --shadow-lg: 0 22px 48px rgba(8, 47, 73, 0.55);
  --shadow-glow: 0 0 0 1px rgba(125, 211, 252, 0.18);
}

/* Especificidade acima do CSS crítico inline do index.html (login pré-autenticação) */
[data-theme="dark"] #login-screen,
[data-theme="dark"] body:not(.app-logged-in) #login-screen {
  background: linear-gradient(135deg, #2d005e 0%, #16042d 100%);
}

[data-theme="blue"] #login-screen,
[data-theme="blue"] body:not(.app-logged-in) #login-screen {
  background: linear-gradient(135deg, #0c4a6e 0%, #082f49 100%);
}

[data-theme="dark"] #login-screen .login-card {
  background: rgba(36, 5, 65, 0.72);
  border: 1px solid rgba(196, 181, 253, 0.22);
}

[data-theme="blue"] #login-screen .login-card {
  background: rgba(12, 74, 110, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.28);
}

/* O painel direito do login permanece claro nos dois temas escuros */
:is([data-theme="dark"], [data-theme="blue"]) #login-screen .login-title {
  color: #111827;
}

:is([data-theme="dark"], [data-theme="blue"]) #login-screen .login-right {
  background: #fff;
  color: #111827;
}

:is([data-theme="dark"], [data-theme="blue"]) #login-screen .form-group label,
:is([data-theme="dark"], [data-theme="blue"]) #login-screen .login-remember {
  color: #2b2e38;
}

:is([data-theme="dark"], [data-theme="blue"]) #login-screen input[type="email"],
:is([data-theme="dark"], [data-theme="blue"]) #login-screen input[type="password"] {
  background: #fff;
  color: #111827;
  border-color: #ddd9e7;
}

[data-theme="dark"] .tabs-header,
[data-theme="blue"] .tabs-header {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .tabs-content,
[data-theme="blue"] .tabs-content {
  background: var(--surface);
}

[data-theme="dark"] .tab-button,
[data-theme="blue"] .tab-button {
  color: var(--text-light);
}

[data-theme="dark"] .tab-button.active,
[data-theme="blue"] .tab-button.active {
  color: var(--accent-light);
}

:is([data-theme="dark"], [data-theme="blue"]) .execucao-table tbody td {
  background: var(--surface);
}

[data-theme="dark"] .execucao-table tbody tr:nth-child(even) td {
  background: #34145f;
}

[data-theme="blue"] .execucao-table tbody tr:nth-child(even) td {
  background: #155e75;
}

:is([data-theme="dark"], [data-theme="blue"]) .calendar-grid,
:is([data-theme="dark"], [data-theme="blue"]) .calendar-day-view {
  background: var(--surface);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) td {
  background: rgba(52, 20, 95, 0.72);
}

[data-theme="blue"] .data-table tbody tr:nth-child(even) td {
  background: rgba(21, 94, 117, 0.72);
}

[data-theme="dark"] .data-table tbody tr:hover td {
  background: rgba(167, 139, 250, 0.16);
}

[data-theme="blue"] .data-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.16);
}

[data-theme="dark"] .kpi-card__value,
[data-theme="blue"] .kpi-card__value {
  color: var(--text);
}

[data-theme="blue"] .topbar-util-btn:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* Azul: os acentos violeta de cada módulo assumem o azul do tema "ocean" */
[data-theme="blue"] .btn-primary {
  background: #0ea5e9;
}

[data-theme="blue"] .btn-primary:hover {
  background: #0284c7;
}

[data-theme="blue"] .form-wizard {
  --client-action: #0ea5e9;
  --client-action-hover: #0284c7;
}

[data-theme="blue"] #configuracoes-view,
[data-theme="blue"] #temisia-view {
  --section-purple: #0ea5e9;
  --section-purple-dark: #0284c7;
}

[data-theme="blue"] #clientes-view {
  --cli-purple: #0ea5e9;
}

[data-theme="blue"] #planner-view {
  --planner-purple: #0ea5e9;
  --planner-purple-dark: #0284c7;
}

[data-theme="blue"] #processos-view,
[data-theme="blue"] #modal-parte-oposta,
[data-theme="blue"] #modal-visualizar-parte-oposta {
  --proc-purple: #0ea5e9;
  --proc-purple-dark: #0284c7;
}

[data-theme="blue"] #financeiro-view {
  --finance-purple: #0ea5e9;
  --finance-purple-dark: #0284c7;
}

[data-theme="blue"] #recebiveis-view {
  --recebiveis-purple: #0ea5e9;
  --recebiveis-purple-dark: #0284c7;
}

[data-theme="blue"] #calendario-view,
[data-theme="blue"] #modal-calendario-tarefa {
  --calendar-purple: #0ea5e9;
  --calendar-purple-dark: #0284c7;
}

[data-theme="dark"] mark.busca-highlight,
[data-theme="blue"] mark.busca-highlight {
  background: #facc15;
  color: #1e1b4b;
  box-shadow: none;
}
