@tailwind base;
@tailwind components;
@tailwind utilities;

    /* Cor principal do sistema: padrão (azul do Tailwind). A "Cor do Layout" das
       Configurações sobrescreve estes tons em layouts/partials/cores.blade.php. */
    :root {
      --cor-50: 239 246 255; --cor-100: 219 234 254; --cor-200: 191 219 254; --cor-300: 147 197 253;
      --cor-400: 96 165 250; --cor-500: 59 130 246; --cor-600: 37 99 235; --cor-700: 29 78 216;
      --cor-800: 30 64 175; --cor-900: 30 58 138; --cor-950: 23 37 84;
    }

    body {
      box-sizing: border-box;
    }
    
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .menu li {
      list-style: none;
    }

    .menu {
      list-style: none;
      padding-left: 0;
      margin: 0;
    }
    
    .fade-in {
      animation: fadeIn 0.3s ease-out;
    }
    
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .select2-container .select2-selection--single {
      height: 42px !important;
      display: flex !important;
      align-items: center !important;
      border-radius: 0.5rem !important;
      border: 1px solid #d1d5db !important;
      padding-left: 0.75rem !important;
    }

    .select2-container--default .select2-selection--single:focus {
        outline: none !important;
        border-color: rgb(var(--cor-500)) !important;
        box-shadow: 0 0 0 2px rgb(var(--cor-500) / 0.2) !important;
    }

    .select2-dropdown {
        border-radius: 0.5rem !important;
        overflow: hidden;
    }

    .select2-container--open {
        z-index: 99999 !important;
    }

    .ephox-chameleon-layer-menus,
    .ephox-polish-layer-menus,
    .ephox-polish-above-outside,
    .ephox-polish-layer-below-dialog,
    .ephox-polish-layer-dialog,
    .ephox-polish-layer-above-dialog,
    .ephox-polish-fullscreen-maximized,
    .ephox-dragster-blocker {
        z-index: 999 !important;
    }
    /* O editor de texto vem com camadas em z-index 90 a 110, acima do cabeçalho fixo, do menu
       lateral e dos modais (z 30 a 50). Rebaixadas aqui, mantendo a ordem entre elas; os menus
       e diálogos do próprio editor continuam no alto (regra acima). */
    .ephox-polish-editor-container .ephox-polish-layer-below-editor { z-index: 0 !important; }
    .ephox-polish-layer-editor.ephox-polish-editor-main:not(.ephox-polish-fullscreen-maximized) { z-index: 1 !important; }
    .ephox-polish-editor-container.ephox-polish-editor-main .ephox-polish-layer-toolbar { z-index: 2 !important; }
    .ephox-polish-editor-container.ephox-polish-editor-main .ephox-polish-layer-above-editor { z-index: 3 !important; }

    .spinner {
      border: 3px solid rgba(255, 255, 255, 0.3);
      border-top: 3px solid #ffffff;
      border-radius: 50%;
      width: 20px;
      height: 20px;
      animation: spin 0.8s linear infinite;
      display: inline-block;
    }
    
    .spinner-dark {
      border: 3px solid #f3f4f6;
      border-top: 3px solid rgb(var(--cor-500));
    }

@view-transition { navigation: auto; }
    /* ==========================================================================
       Modo escuro
       Ativado pela classe "dark" no <html> (botão da lua no cabeçalho).
       As telas usam as classes claras do Tailwind; em vez de repetir "dark:" em
       cada view, este bloco remapeia as cores neutras e as de destaque de uma vez.
       ========================================================================== */
    html.dark { color-scheme: dark; }
    /* Bordas sem cor definida (ex.: "border-b" sozinho) usam o cinza claro padrão do Tailwind,
       que vira uma linha branca no escuro. :where() mantém a especificidade zero para não
       atropelar as classes de cor de borda. */
    :where(html.dark) *,
    :where(html.dark) ::before,
    :where(html.dark) ::after { border-color: #1e293b; }
    html.dark body { background-color: #020617; color: #e2e8f0; }

    html.dark .bg-white:not(canvas):not(img) { background-color: #0f172a; }
    html.dark .bg-gray-50 { background-color: #020617; }
    html.dark .bg-slate-50 { background-color: #020617; }
    html.dark .bg-gray-100 { background-color: #1e293b; }
    html.dark .bg-slate-100 { background-color: #1e293b; }
    html.dark .bg-gray-200 { background-color: #334155; }
    html.dark .bg-slate-200 { background-color: #334155; }
    html.dark .bg-gray-300 { background-color: #475569; }
    html.dark .hover\:bg-white:hover { background-color: #1e293b; }
    html.dark .hover\:bg-gray-50:hover { background-color: #1e293b; }
    html.dark .hover\:bg-slate-50:hover { background-color: #1e293b; }
    html.dark .hover\:bg-gray-100:hover { background-color: #334155; }
    html.dark .hover\:bg-slate-100:hover { background-color: #1e293b; }
    html.dark .hover\:bg-slate-200:hover { background-color: #334155; }
    html.dark .hover\:bg-gray-200:hover { background-color: #475569; }
    html.dark .hover\:bg-gray-300:hover { background-color: #475569; }
    html.dark .text-black { color: #f1f5f9; }
    html.dark .text-gray-900 { color: #f1f5f9; }
    html.dark .text-slate-900 { color: #f1f5f9; }
    html.dark .text-gray-800 { color: #e2e8f0; }
    html.dark .text-slate-800 { color: #e2e8f0; }
    html.dark .text-gray-700 { color: #e2e8f0; }
    html.dark .text-slate-700 { color: #e2e8f0; }
    html.dark .text-gray-600 { color: #cbd5e1; }
    html.dark .text-slate-600 { color: #94a3b8; }
    html.dark .text-gray-500 { color: #94a3b8; }
    html.dark .text-slate-500 { color: #94a3b8; }
    html.dark .text-gray-400 { color: #64748b; }
    html.dark .hover\:text-black:hover { color: #ffffff; }
    html.dark .hover\:text-gray-900:hover { color: #ffffff; }
    html.dark .hover\:text-gray-800:hover { color: #ffffff; }
    html.dark .hover\:text-gray-700:hover { color: #ffffff; }
    html.dark .hover\:text-gray-600:hover { color: #ffffff; }
    html.dark .border-gray-100 { border-color: #1e293b; }
    html.dark .border-gray-200 { border-color: #1e293b; }
    html.dark .border-slate-200 { border-color: #1e293b; }
    html.dark .border-gray-300 { border-color: #334155; }
    html.dark .border-slate-300 { border-color: #334155; }
    html.dark .border-white { border-color: #0f172a; }
    html.dark .hover\:border-gray-300:hover { border-color: #64748b; }
    html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #1e293b; }
    html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #1e293b; }
    html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) { border-color: #1e293b; }
    html.dark .ring-white { --tw-ring-color: #0f172a; }
    html.dark .to-white { --tw-gradient-to: #0f172a var(--tw-gradient-to-position); }
    html.dark .from-white { --tw-gradient-from: #0f172a var(--tw-gradient-from-position); }
    html.dark .from-gray-50 { --tw-gradient-from: #020617 var(--tw-gradient-from-position); }
    html.dark .from-gray-50\/50 { --tw-gradient-from: rgb(2 6 23 / 0.5) var(--tw-gradient-from-position); }

    /* Rodapés de formulário (Cancelar / Salvar) têm o cinza claro fixado direto no HTML */
    html.dark [style*="background-color: rgb(247, 249, 250)"] { background-color: #0b1220 !important; }

    /* Cores de destaque: fundos claros viram um tom translúcido e os textos escuros clareiam */
    html.dark .bg-red-50 { background-color: rgb(239 68 68 / 0.12); }
    html.dark .bg-red-100 { background-color: rgb(239 68 68 / 0.2); }
    html.dark .bg-red-200 { background-color: rgb(239 68 68 / 0.3); }
    html.dark .hover\:bg-red-50:hover { background-color: rgb(239 68 68 / 0.2); }
    html.dark .hover\:bg-red-100:hover { background-color: rgb(239 68 68 / 0.3); }
    html.dark .text-red-600, html.dark .text-red-700, html.dark .text-red-800, html.dark .text-red-900 { color: #fca5a5; }
    html.dark .hover\:text-red-600:hover, html.dark .hover\:text-red-700:hover, html.dark .hover\:text-red-800:hover, html.dark .hover\:text-red-900:hover { color: #ffffff; }
    html.dark .border-red-100, html.dark .border-red-200, html.dark .border-red-300 { border-color: rgb(239 68 68 / 0.4); }
    html.dark .bg-blue-50 { background-color: rgb(var(--cor-500) / 0.12); }
    html.dark .bg-blue-100 { background-color: rgb(var(--cor-500) / 0.2); }
    html.dark .bg-blue-200 { background-color: rgb(var(--cor-500) / 0.3); }
    html.dark .hover\:bg-blue-50:hover { background-color: rgb(var(--cor-500) / 0.2); }
    html.dark .hover\:bg-blue-100:hover { background-color: rgb(var(--cor-500) / 0.3); }
    html.dark .text-blue-600, html.dark .text-blue-700, html.dark .text-blue-800, html.dark .text-blue-900 { color: rgb(var(--cor-300)); }
    html.dark .hover\:text-blue-600:hover, html.dark .hover\:text-blue-700:hover, html.dark .hover\:text-blue-800:hover, html.dark .hover\:text-blue-900:hover { color: #ffffff; }
    html.dark .border-blue-100, html.dark .border-blue-200, html.dark .border-blue-300 { border-color: rgb(var(--cor-500) / 0.4); }
    html.dark .bg-green-50 { background-color: rgb(34 197 94 / 0.12); }
    html.dark .bg-green-100 { background-color: rgb(34 197 94 / 0.2); }
    html.dark .bg-green-200 { background-color: rgb(34 197 94 / 0.3); }
    html.dark .hover\:bg-green-50:hover { background-color: rgb(34 197 94 / 0.2); }
    html.dark .hover\:bg-green-100:hover { background-color: rgb(34 197 94 / 0.3); }
    html.dark .text-green-600, html.dark .text-green-700, html.dark .text-green-800, html.dark .text-green-900 { color: #86efac; }
    html.dark .hover\:text-green-600:hover, html.dark .hover\:text-green-700:hover, html.dark .hover\:text-green-800:hover, html.dark .hover\:text-green-900:hover { color: #ffffff; }
    html.dark .border-green-100, html.dark .border-green-200, html.dark .border-green-300 { border-color: rgb(34 197 94 / 0.4); }
    html.dark .bg-yellow-50 { background-color: rgb(234 179 8 / 0.12); }
    html.dark .bg-yellow-100 { background-color: rgb(234 179 8 / 0.2); }
    html.dark .bg-yellow-200 { background-color: rgb(234 179 8 / 0.3); }
    html.dark .hover\:bg-yellow-50:hover { background-color: rgb(234 179 8 / 0.2); }
    html.dark .hover\:bg-yellow-100:hover { background-color: rgb(234 179 8 / 0.3); }
    html.dark .text-yellow-600, html.dark .text-yellow-700, html.dark .text-yellow-800, html.dark .text-yellow-900 { color: #fde047; }
    html.dark .hover\:text-yellow-600:hover, html.dark .hover\:text-yellow-700:hover, html.dark .hover\:text-yellow-800:hover, html.dark .hover\:text-yellow-900:hover { color: #ffffff; }
    html.dark .border-yellow-100, html.dark .border-yellow-200, html.dark .border-yellow-300 { border-color: rgb(234 179 8 / 0.4); }
    html.dark .bg-purple-50 { background-color: rgb(168 85 247 / 0.12); }
    html.dark .bg-purple-100 { background-color: rgb(168 85 247 / 0.2); }
    html.dark .bg-purple-200 { background-color: rgb(168 85 247 / 0.3); }
    html.dark .hover\:bg-purple-50:hover { background-color: rgb(168 85 247 / 0.2); }
    html.dark .hover\:bg-purple-100:hover { background-color: rgb(168 85 247 / 0.3); }
    html.dark .text-purple-600, html.dark .text-purple-700, html.dark .text-purple-800, html.dark .text-purple-900 { color: #d8b4fe; }
    html.dark .hover\:text-purple-600:hover, html.dark .hover\:text-purple-700:hover, html.dark .hover\:text-purple-800:hover, html.dark .hover\:text-purple-900:hover { color: #ffffff; }
    html.dark .border-purple-100, html.dark .border-purple-200, html.dark .border-purple-300 { border-color: rgb(168 85 247 / 0.4); }
    html.dark .bg-indigo-50 { background-color: rgb(99 102 241 / 0.12); }
    html.dark .bg-indigo-100 { background-color: rgb(99 102 241 / 0.2); }
    html.dark .bg-indigo-200 { background-color: rgb(99 102 241 / 0.3); }
    html.dark .hover\:bg-indigo-50:hover { background-color: rgb(99 102 241 / 0.2); }
    html.dark .hover\:bg-indigo-100:hover { background-color: rgb(99 102 241 / 0.3); }
    html.dark .text-indigo-600, html.dark .text-indigo-700, html.dark .text-indigo-800, html.dark .text-indigo-900 { color: #a5b4fc; }
    html.dark .hover\:text-indigo-600:hover, html.dark .hover\:text-indigo-700:hover, html.dark .hover\:text-indigo-800:hover, html.dark .hover\:text-indigo-900:hover { color: #ffffff; }
    html.dark .border-indigo-100, html.dark .border-indigo-200, html.dark .border-indigo-300 { border-color: rgb(99 102 241 / 0.4); }
    html.dark .bg-orange-50 { background-color: rgb(249 115 22 / 0.12); }
    html.dark .bg-orange-100 { background-color: rgb(249 115 22 / 0.2); }
    html.dark .bg-orange-200 { background-color: rgb(249 115 22 / 0.3); }
    html.dark .hover\:bg-orange-50:hover { background-color: rgb(249 115 22 / 0.2); }
    html.dark .hover\:bg-orange-100:hover { background-color: rgb(249 115 22 / 0.3); }
    html.dark .text-orange-600, html.dark .text-orange-700, html.dark .text-orange-800, html.dark .text-orange-900 { color: #fdba74; }
    html.dark .hover\:text-orange-600:hover, html.dark .hover\:text-orange-700:hover, html.dark .hover\:text-orange-800:hover, html.dark .hover\:text-orange-900:hover { color: #ffffff; }
    html.dark .border-orange-100, html.dark .border-orange-200, html.dark .border-orange-300 { border-color: rgb(249 115 22 / 0.4); }
    html.dark .bg-amber-50 { background-color: rgb(245 158 11 / 0.12); }
    html.dark .bg-amber-100 { background-color: rgb(245 158 11 / 0.2); }
    html.dark .bg-amber-200 { background-color: rgb(245 158 11 / 0.3); }
    html.dark .hover\:bg-amber-50:hover { background-color: rgb(245 158 11 / 0.2); }
    html.dark .hover\:bg-amber-100:hover { background-color: rgb(245 158 11 / 0.3); }
    html.dark .text-amber-600, html.dark .text-amber-700, html.dark .text-amber-800, html.dark .text-amber-900 { color: #fcd34d; }
    html.dark .hover\:text-amber-600:hover, html.dark .hover\:text-amber-700:hover, html.dark .hover\:text-amber-800:hover, html.dark .hover\:text-amber-900:hover { color: #ffffff; }
    html.dark .border-amber-100, html.dark .border-amber-200, html.dark .border-amber-300 { border-color: rgb(245 158 11 / 0.4); }
    html.dark .bg-emerald-50 { background-color: rgb(16 185 129 / 0.12); }
    html.dark .bg-emerald-100 { background-color: rgb(16 185 129 / 0.2); }
    html.dark .bg-emerald-200 { background-color: rgb(16 185 129 / 0.3); }
    html.dark .hover\:bg-emerald-50:hover { background-color: rgb(16 185 129 / 0.2); }
    html.dark .hover\:bg-emerald-100:hover { background-color: rgb(16 185 129 / 0.3); }
    html.dark .text-emerald-600, html.dark .text-emerald-700, html.dark .text-emerald-800, html.dark .text-emerald-900 { color: #6ee7b7; }
    html.dark .hover\:text-emerald-600:hover, html.dark .hover\:text-emerald-700:hover, html.dark .hover\:text-emerald-800:hover, html.dark .hover\:text-emerald-900:hover { color: #ffffff; }
    html.dark .border-emerald-100, html.dark .border-emerald-200, html.dark .border-emerald-300 { border-color: rgb(16 185 129 / 0.4); }
    html.dark .bg-teal-50 { background-color: rgb(20 184 166 / 0.12); }
    html.dark .bg-teal-100 { background-color: rgb(20 184 166 / 0.2); }
    html.dark .bg-teal-200 { background-color: rgb(20 184 166 / 0.3); }
    html.dark .hover\:bg-teal-50:hover { background-color: rgb(20 184 166 / 0.2); }
    html.dark .hover\:bg-teal-100:hover { background-color: rgb(20 184 166 / 0.3); }
    html.dark .text-teal-600, html.dark .text-teal-700, html.dark .text-teal-800, html.dark .text-teal-900 { color: #5eead4; }
    html.dark .hover\:text-teal-600:hover, html.dark .hover\:text-teal-700:hover, html.dark .hover\:text-teal-800:hover, html.dark .hover\:text-teal-900:hover { color: #ffffff; }
    html.dark .border-teal-100, html.dark .border-teal-200, html.dark .border-teal-300 { border-color: rgb(20 184 166 / 0.4); }
    html.dark .bg-cyan-50 { background-color: rgb(6 182 212 / 0.12); }
    html.dark .bg-cyan-100 { background-color: rgb(6 182 212 / 0.2); }
    html.dark .bg-cyan-200 { background-color: rgb(6 182 212 / 0.3); }
    html.dark .hover\:bg-cyan-50:hover { background-color: rgb(6 182 212 / 0.2); }
    html.dark .hover\:bg-cyan-100:hover { background-color: rgb(6 182 212 / 0.3); }
    html.dark .text-cyan-600, html.dark .text-cyan-700, html.dark .text-cyan-800, html.dark .text-cyan-900 { color: #67e8f9; }
    html.dark .hover\:text-cyan-600:hover, html.dark .hover\:text-cyan-700:hover, html.dark .hover\:text-cyan-800:hover, html.dark .hover\:text-cyan-900:hover { color: #ffffff; }
    html.dark .border-cyan-100, html.dark .border-cyan-200, html.dark .border-cyan-300 { border-color: rgb(6 182 212 / 0.4); }
    html.dark .bg-pink-50 { background-color: rgb(236 72 153 / 0.12); }
    html.dark .bg-pink-100 { background-color: rgb(236 72 153 / 0.2); }
    html.dark .bg-pink-200 { background-color: rgb(236 72 153 / 0.3); }
    html.dark .hover\:bg-pink-50:hover { background-color: rgb(236 72 153 / 0.2); }
    html.dark .hover\:bg-pink-100:hover { background-color: rgb(236 72 153 / 0.3); }
    html.dark .text-pink-600, html.dark .text-pink-700, html.dark .text-pink-800, html.dark .text-pink-900 { color: #f9a8d4; }
    html.dark .hover\:text-pink-600:hover, html.dark .hover\:text-pink-700:hover, html.dark .hover\:text-pink-800:hover, html.dark .hover\:text-pink-900:hover { color: #ffffff; }
    html.dark .border-pink-100, html.dark .border-pink-200, html.dark .border-pink-300 { border-color: rgb(236 72 153 / 0.4); }
    html.dark .bg-rose-50 { background-color: rgb(244 63 94 / 0.12); }
    html.dark .bg-rose-100 { background-color: rgb(244 63 94 / 0.2); }
    html.dark .bg-rose-200 { background-color: rgb(244 63 94 / 0.3); }
    html.dark .hover\:bg-rose-50:hover { background-color: rgb(244 63 94 / 0.2); }
    html.dark .hover\:bg-rose-100:hover { background-color: rgb(244 63 94 / 0.3); }
    html.dark .text-rose-600, html.dark .text-rose-700, html.dark .text-rose-800, html.dark .text-rose-900 { color: #fda4af; }
    html.dark .hover\:text-rose-600:hover, html.dark .hover\:text-rose-700:hover, html.dark .hover\:text-rose-800:hover, html.dark .hover\:text-rose-900:hover { color: #ffffff; }
    html.dark .border-rose-100, html.dark .border-rose-200, html.dark .border-rose-300 { border-color: rgb(244 63 94 / 0.4); }
    html.dark .bg-sky-50 { background-color: rgb(14 165 233 / 0.12); }
    html.dark .bg-sky-100 { background-color: rgb(14 165 233 / 0.2); }
    html.dark .bg-sky-200 { background-color: rgb(14 165 233 / 0.3); }
    html.dark .hover\:bg-sky-50:hover { background-color: rgb(14 165 233 / 0.2); }
    html.dark .hover\:bg-sky-100:hover { background-color: rgb(14 165 233 / 0.3); }
    html.dark .text-sky-600, html.dark .text-sky-700, html.dark .text-sky-800, html.dark .text-sky-900 { color: #7dd3fc; }
    html.dark .hover\:text-sky-600:hover, html.dark .hover\:text-sky-700:hover, html.dark .hover\:text-sky-800:hover, html.dark .hover\:text-sky-900:hover { color: #ffffff; }
    html.dark .border-sky-100, html.dark .border-sky-200, html.dark .border-sky-300 { border-color: rgb(14 165 233 / 0.4); }
    html.dark .bg-violet-50 { background-color: rgb(139 92 246 / 0.12); }
    html.dark .bg-violet-100 { background-color: rgb(139 92 246 / 0.2); }
    html.dark .bg-violet-200 { background-color: rgb(139 92 246 / 0.3); }
    html.dark .hover\:bg-violet-50:hover { background-color: rgb(139 92 246 / 0.2); }
    html.dark .hover\:bg-violet-100:hover { background-color: rgb(139 92 246 / 0.3); }
    html.dark .text-violet-600, html.dark .text-violet-700, html.dark .text-violet-800, html.dark .text-violet-900 { color: #c4b5fd; }
    html.dark .hover\:text-violet-600:hover, html.dark .hover\:text-violet-700:hover, html.dark .hover\:text-violet-800:hover, html.dark .hover\:text-violet-900:hover { color: #ffffff; }
    html.dark .border-violet-100, html.dark .border-violet-200, html.dark .border-violet-300 { border-color: rgb(139 92 246 / 0.4); }

    /* Campos de formulário */
    html.dark input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']):not([type='submit']):not([type='button']),
    html.dark select,
    html.dark textarea {
      background-color: #0f172a;
      border-color: #334155;
      color: #f1f5f9;
    }
    html.dark input::placeholder,
    html.dark textarea::placeholder { color: #64748b; }
    html.dark input:disabled,
    html.dark select:disabled,
    html.dark textarea:disabled { background-color: #020617; color: #94a3b8; }
    html.dark input[type='checkbox']:not(:checked),
    html.dark input[type='radio']:not(:checked) { background-color: #0f172a; border-color: #475569; }

    /* Select2 */
    html.dark .select2-container .select2-selection--single,
    html.dark .select2-container .select2-selection--multiple {
      background-color: #0f172a !important;
      border-color: #334155 !important;
    }
    html.dark .select2-container--default .select2-selection--single .select2-selection__rendered { color: #f1f5f9; }
    html.dark .select2-dropdown { background-color: #0f172a; border-color: #334155; color: #e2e8f0; }
    html.dark .select2-container--default .select2-results__option--selected { background-color: #1e293b; }
    html.dark .select2-container--default .select2-search--dropdown .select2-search__field {
      background-color: #020617;
      border-color: #334155;
      color: #f1f5f9;
    }

    html.dark ::-webkit-scrollbar-thumb { background: #334155; }
    html.dark .spinner-dark { border-color: #1e293b; border-top-color: rgb(var(--cor-500)); }
