:root {
    --color-surface: #ffffff;      /* slate-50 */
    --color-text-primary: #0f172a; /* slate-900 */
    --color-bg-primary: #0f172a;   /* slate-900 */
    --color-bg-primary-hover: #1e293b; /* slate-800 */
    --color-secondary: #10b981;    /* emerald-500 */
    --color-secondary-hover: #059669; /* emerald-600 */
    --color-neutralDim: #64748b;   /* slate-500 */
    --color-neutralSoft: #e2e8f0;  /* slate-200 */
    --color-amberSoft: #fef3c7;
    --color-amberDark: #b45309;
    --color-blueSoft: #dbeafe;
    --color-blueDark: #1d4ed8;
    --color-bg-white: #ffffff;
    --color-text-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-500: #64748b;
    --color-gray-700: #334155;
    --color-emerald-soft: #e6fbf2;
}

html.dark {
    --color-surface: #0f172a;      /* slate-900 (Cards) */
    --color-text-primary: #f8fafc; /* slate-50 */
    --color-bg-primary: #1e293b;   /* slate-800 */
    --color-bg-primary-hover: #334155; /* slate-700 */
    --color-secondary: #10b981;    /* emerald-500 */
    --color-secondary-hover: #047857; /* emerald-700 */
    --color-neutralDim: #94a3b8;   /* slate-400 */
    --color-neutralSoft: #334155;  /* slate-700 */
    --color-amberSoft: #451a03;    
    --color-amberDark: #fef3c7;    
    --color-blueSoft: #1e3a8a;     
    --color-blueDark: #bfdbfe;     
    --color-bg-white: #0f172a;     /* slate-900 (Cards) */
    --color-text-white: #f8fafc;   
    --color-gray-50: #020617;      
    --color-gray-100: #0f172a;
    --color-gray-200: #1e293b;
    --color-gray-300: #334155;
    --color-gray-500: #94a3b8;
    --color-gray-700: #f1f5f9;
    --color-emerald-soft: #064e3b; /* emerald-900 */
}

html.dark input,
html.dark textarea,
html.dark select {
    background-color: transparent;
    color: var(--color-text-white);
}

html.dark option {
    background-color: var(--color-surface);
    color: var(--color-text-white);
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: var(--color-neutralDim);
}

/* Modern Inputs Focus */
input:focus, textarea:focus, select:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: var(--color-neutralSoft) !important;
    border-left: 2px solid var(--color-secondary) !important;
}

/* Softer Shadows */
.shadow-sm {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
}

html.dark .shadow-sm {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.2) !important;
}

.active-nav-item {
    background-color: var(--color-emerald-soft) !important;
    color: var(--color-secondary) !important;
    font-weight: 600 !important;
    transform: translateX(4px);
}

.active-nav-item .nav-icon {
    background-color: var(--color-surface) !important;
    border-color: var(--color-secondary) !important;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    color: var(--color-neutralDim);
    margin-bottom: 0.25rem;
}

.nav-btn:hover {
    background-color: var(--color-gray-100); /* was gray-50 - changed for better hover contrast */
    color: var(--color-text-primary);
    transform: translateX(4px);
}

.nav-icon {
    margin-right: 0.875rem;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.375rem;
    background-color: var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    border: 1px solid var(--color-neutralSoft);
    transition: background-color 0.2s ease;
}

/* Animações e Estilos Customizados que vão além do Tailwind utilitário */

/* Toast Animations */
.toast-enter {
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast-leave {
    animation: slideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-neutralSoft);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutralDim);
}

/* For Firefox */
html, .overflow-y-auto, .overflow-x-auto, #mobile-sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--color-neutralSoft) transparent;
}

/* Range Slider Customizado (Progresso do Projeto) */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]:focus {
    outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #006c49; /* Secondary color */
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #e1e3e4;
    border-radius: 2px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
    background: #c5c6cd;
}

@keyframes flash-highlight { 0% { background-color: #fef08a; } 100% { background-color: transparent; } }
.highlight-flash { animation: flash-highlight 3s ease-out; }
.dark .highlight-flash { animation: flash-highlight-dark 3s ease-out; }
@keyframes flash-highlight-dark { 0% { background-color: #854d0e; } 100% { background-color: transparent; } }

/* Custom Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background-color: var(--color-bg-primary);
    color: var(--color-text-white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover { background-color: var(--color-bg-primary-hover); }



.btn-secondary {
    background-color: var(--color-secondary);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover { background-color: var(--color-secondary-hover); }

.btn-block {
    width: 100%;
    display: flex;
}

/* --- ESTILOS DESTAQUE (CARD E BOTÃO ESTILO PWA) --- */
/* Pode ser usado futuramente para banners, convites e áreas de destaque */
.card-highlight-gradient {
    /* bg-gradient-to-r from-emerald-700 to-teal-500 */
    background: linear-gradient(to right, #047857, #14b8a6);
    /* border border-emerald-600/50 */
    border: 1px solid rgba(5, 150, 105, 0.5);
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    color: #ffffff;
    transition: all 0.3s ease;
}

.btn-highlight-contrast {
    background-color: #ffffff;
    color: #065f46; /* emerald-800 */
    font-weight: 700;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-highlight-contrast:hover {
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    transform: translateY(-0.25rem) scale(1.05);
    background-color: #ecfdf5; /* emerald-50 */
}

/* Modo escuro - Adaptação do botão contrastante */
html.dark .btn-highlight-contrast {
    background-color: #1e293b; /* slate-800 */
    color: #d1fae5; /* emerald-100 */
    border-color: #475569; /* slate-600 */
}

html.dark .btn-highlight-contrast:hover {
    background-color: #334155; /* slate-700 */
}

/* Ocultar barra de rolagem em elementos roláveis sem quebrar a rolagem funcional */
.no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.no-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Revelação de botões de ação secundários da tarefa ao tocar/clicar (PWA / Mobile) */
.task-actions-revealed {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
}

.task-row-active {
    outline: 2px solid var(--color-secondary) !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}

/* Animação e Badge de Destino para Esclarecimento da Inbox */
.destination-badge {
    animation: badgeFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    white-space: nowrap;
}

@keyframes badgeFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.task-collapsing {
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    transition: all 0.28s ease !important;
}

/* Toast Notification Flutuante */
#system-toast {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

#system-toast .toast-card {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25) !important;
    max-width: min(92vw, 440px);
}

#system-toast .toast-message {
    color: #ffffff !important;
}

html.dark #system-toast .toast-card {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.08) !important;
}

html.dark #system-toast .toast-message {
    color: #ffffff !important;
}

/* Ícone do calendário do input date: Preto no modo claro, Branco no modo escuro */
input[type="date"] {
    color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.85;
    filter: brightness(0); /* Preto absoluto no modo claro */
    transition: opacity 0.2s ease, filter 0.2s ease;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
html.dark input[type="date"] {
    color-scheme: dark;
}
html.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) invert(1); /* Branco puro no modo escuro */
    opacity: 0.9;
}
html.dark input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Animação suave de shake para clique em botão bloqueado */
@keyframes gentleShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}
.shake-animation {
    animation: gentleShake 0.4s ease-in-out;
}

/* Botão de Esclarecer / Triagem: Cinza escuro no modo claro, Cinza claro no modo escuro */
.btn-clarify {
    background-color: #1e293b; /* slate-800 */
    color: #ffffff;
    transition: all 0.2s ease;
}
.btn-clarify:hover {
    background-color: #0f172a; /* slate-900 */
}
html.dark .btn-clarify {
    background-color: #e2e8f0; /* slate-200 */
    color: #0f172a; /* slate-900 */
}
html.dark .btn-clarify:hover {
    background-color: #ffffff;
}


