:root {
    --royal-blue: #002366; --royal-light: #1A3A75;
    --gold: #D4AF37; --gold-light: #F4E5BC;
    --bg-body: #F4F7FA; --bg-surface: #FFFFFF; --bg-column: #EBEEF2;
    --text-primary: #1A202C; --text-secondary: #718096;
    --border: #E2E8F0;
    --st-todo: #718096; --st-doing: #3182CE; --st-done: #38A169;
    --urg-high: #E53E3E;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-body: #0F172A; --bg-surface: #1E293B; --bg-column: #162032;
    --text-primary: #F8FAFC; --text-secondary: #94A3B8; --border: #334155;
    --royal-blue: #3B82F6;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Montserrat', sans-serif; outline: none; }
body { background: var(--bg-body); color: var(--text-primary); height: 100vh; overflow: hidden; transition: 0.3s; }

/* UTILS */
.hidden { display: none !important; }
.gold-text { color: var(--gold); }
.full-width { width: 100%; }
.spacer { height: 15px; }
.divider { margin: 20px 0; border: 0; border-top: 1px solid #eee; }

/* REQUIRED MARKER */
.required-label::after { content: " *"; color: var(--urg-high); font-weight: bold; }

/* TOASTS */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; padding: 16px; border-radius: var(--radius); background: var(--bg-surface); box-shadow: 0 10px 30px rgba(0,0,0,0.2); border-left: 5px solid; display: flex; align-items: center; justify-content: space-between; animation: slideInRight 0.3s forwards; cursor: pointer; }
.toast-success { border-color: var(--st-done); } .toast-error { border-color: var(--urg-high); } .toast-info { border-color: var(--royal-blue); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* AUTH */
.auth-wrapper { position: fixed; inset: 0; background: radial-gradient(circle at center, #002366 0%, #000 100%); display: flex; align-items: center; justify-content: center; z-index: 999; }
.auth-card { background: white; padding: 2.5rem; border-radius: 16px; width: 100%; max-width: 420px; box-shadow: 0 25px 50px rgba(0,0,0,0.5); text-align: center; border-top: 4px solid var(--gold); max-height: 90vh; overflow-y: auto; }
.auth-card h1 { color: #002366; font-size: 1.8rem; margin-bottom: 5px; font-weight: 800; }

/* INPUTS */
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.input-group input, .modern-select { 
    width: 100%; padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    background: var(--bg-surface); color: var(--text-primary); 
    font-size: 0.95rem; height: 45px; transition: 0.2s;
    appearance: none; /* Remove estilo nativo feio */
}
/* Correção específica para INPUT DATE */
input[type="date"] {
    display: block;
    width: 100%;
    min-height: 45px;
    padding: 10px;
}
.input-group input:focus, .modern-select:focus { border-color: var(--royal-blue); box-shadow: 0 0 0 2px rgba(0,35,102,0.1); }

/* BUTTONS */
.btn-primary { background: var(--royal-blue); color: white; border: none; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--royal-blue); color: var(--royal-blue); padding: 11px 23px; border-radius: var(--radius); font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; }
body.dark-mode .btn-outline { border-color: var(--gold); color: var(--gold); }
.btn-ghost, .btn-icon { background: none; border: none; font-size: 1rem; cursor: pointer; color: var(--text-secondary); }

/* APP LAYOUT */
.app-wrapper { height: 100vh; display: flex; flex-direction: column; }
.top-nav { height: 70px; background: var(--bg-surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 2rem; }
.nav-brand { display: flex; align-items: center; gap: 15px; }
.logo { font-weight: 800; font-size: 1.2rem; }
.company-code-display { font-size: 0.8rem; background: rgba(0,0,0,0.05); padding: 6px 12px; border-radius: 20px; cursor: pointer; border: 1px dashed var(--royal-blue); color: var(--royal-blue); font-weight: 600; }
.nav-controls { display: flex; align-items: center; gap: 1rem; }
.nav-select { background: var(--bg-column); border: none; padding: 6px 12px; border-radius: 4px; color: var(--text-primary); font-weight: 600; cursor: pointer; }

/* WORKSPACE */
.workspace { flex: 1; display: flex; flex-direction: column; padding: 1.5rem 2rem; overflow: hidden; }
.action-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.workspace-container { flex: 1; overflow: hidden; }

/* KANBAN & LIST */
.kanban-board { display: flex; gap: 1.5rem; height: 100%; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { flex: 1; min-width: 320px; background: var(--bg-column); border-radius: 12px; display: flex; flex-direction: column; border: 1px solid var(--border); }
.column-header { padding: 1rem; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: space-between; }
.column-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; overflow-y: auto; height: 100%; padding-bottom: 20px; }

/* CARDS */
.task-card { background: var(--bg-surface); padding: 1.2rem; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--border); cursor: pointer; transition: 0.2s; border-left: 4px solid transparent; position: relative; }
.task-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.prio-alta { border-left-color: var(--urg-high); } .prio-média { border-left-color: var(--gold); } .prio-baixa { border-left-color: var(--st-done); }
.card-meta, .card-footer { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); }
.card-title { font-size: 1rem; font-weight: 600; margin: 10px 0; }
.expired-warning { position: absolute; top: 10px; right: 10px; color: var(--urg-high); font-size: 1.2rem; font-weight: bold; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* MODALS */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 5000; }
.modal { background: var(--bg-surface); padding: 2.5rem; border-radius: 12px; width: 95%; max-width: 600px; animation: slideUp 0.3s; }
.small-modal { max-width: 350px; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 2rem; }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); }
.form-row { display: flex; gap: 20px; margin-bottom: 5px; }
.flex-1 { flex: 1; } .flex-2 { flex: 2; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* TOGGLE VIEW */
.view-toggle-wrapper { display: flex; background: var(--bg-column); padding: 4px; border-radius: var(--radius); }
.toggle-btn { background: transparent; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; transition: 0.2s; }
.toggle-btn.active { background: var(--bg-surface); color: var(--royal-blue); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* PRINT */
.print-only { display: none; }
@media print { .no-print, .auth-wrapper, .app-wrapper { display: none !important; } .print-only { display: block; padding: 40px; } .print-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 12px; } .print-table th, .print-table td { border: 1px solid #ccc; padding: 8px; text-align: left; } }