@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body {
    background-color: #f3f4f6; /* Cinza bem claro */
    color: #374151; /* Texto escuro suave */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh;
}

.login-container {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    color: #111827;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-container p {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-group input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    background-color: #ffffff;
}

.input-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: #2563eb; /* Azul corporativo */
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.btn:hover {
    background: #1d4ed8;
}


/* =======================================
   ESTILOS DO DASHBOARD (ÁREA RESTRITA)
   ======================================= */
.dashboard-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: #f3f4f6;
    color: #374151;
}

.sidebar {
    width: 250px;
    background-color: #1e293b; /* Azul marinho escuro */
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    text-align: center;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    list-style: none;
}

.sidebar-nav a {
    display: block;
    padding: 0.85rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.sidebar-nav a:hover {
    background-color: #334155;
    color: #ffffff;
    border-left: 4px solid #2563eb;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    background-color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.topbar .user-info {
    font-weight: 500;
    color: #111827;
}

.content-area {
    padding: 2rem;
}

.card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.card p {
    color: #6b7280;
    font-size: 0.9rem;
}


/* =======================================
   ESTILOS DE FORMULÁRIOS NO DASHBOARD
   ======================================= */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Duas colunas iguais */
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2; /* Ocupa as duas colunas */
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #2563eb;
}

.section-title {
    grid-column: span 2;
    font-size: 1.1rem;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.btn-success {
    background-color: #10b981; /* Verde para salvar */
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: background 0.2s;
}

.btn-success:hover {
    background-color: #059669;
}


/* =======================================
   TABELAS E BADGES DO DASHBOARD
   ======================================= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.data-table tr:hover {
    background-color: #f1f5f9;
}

/* Etiquetas de Status (Semáforo) */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-danger { background-color: #fee2e2; color: #ef4444; } /* Vencido ou < 30 dias */
.badge-warning { background-color: #fef3c7; color: #f59e0b; } /* Entre 31 e 60 dias */
.badge-info { background-color: #e0f2fe; color: #0ea5e9; }    /* Entre 61 e 90 dias */


/* =======================================
   ESTEIRA DE PROCESSOS (KANBAN)
   ======================================= */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 60vh;
}

.kanban-column {
    background: #f8fafc;
    border-radius: 8px;
    min-width: 300px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
}

.kanban-header {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Cores das colunas baseadas no status */
.col-aguardando .kanban-header { border-bottom-color: #f59e0b; color: #b45309; } /* Amarelo */
.col-protocolado .kanban-header { border-bottom-color: #3b82f6; color: #1d4ed8; } /* Azul */
.col-exigencia .kanban-header { border-bottom-color: #ef4444; color: #b91c1c; } /* Vermelho */
.col-finalizado .kanban-header { border-bottom-color: #10b981; color: #047857; } /* Verde */

.kanban-cards {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kanban-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #cbd5e1;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.kanban-card h4 {
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.kanban-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.kanban-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #e2e8f0;
    color: #475569;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* =======================================
   LINHA DO TEMPO (HISTÓRICO DO PROCESSO)
   ======================================= */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.85rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.timeline-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.timeline-content {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.timeline-content strong {
    color: #0f172a;
}


/* =======================================
   MODAL DE VISUALIZAÇÃO (POP-UP)
   ======================================= */
.modal-overlay {
    display: none; /* Começa escondido */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7); /* Fundo escuro transparente */
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex; /* Aparece quando a classe 'active' é ativada via JS */
}

.modal-content {
    background: #ffffff;
    width: 95%; 
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    max-height: 90vh; 
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem; 
    border-bottom: 1px solid #e2e8f0;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
}

.modal-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; }
.btn-close { cursor: pointer; font-size: 1.5rem; color: #64748b; font-weight: bold; }
.btn-close:hover { color: #ef4444; }

.modal-body { padding: 1.5rem; }

.modal-footer {
    padding: 1rem 1.5rem; 
    border-top: 1px solid #e2e8f0;
    background: #f8fafc; 
    display: flex; 
    justify-content: flex-end; 
    gap: 1rem;
    border-radius: 0 0 8px 8px;
}

/* Grid interno da ficha do cliente */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.info-item { background: #f1f5f9; padding: 0.8rem; border-radius: 6px; border-left: 3px solid #3b82f6;}
.info-item label { display: block; font-size: 0.75rem; color: #64748b; text-transform: uppercase; font-weight: 600; margin-bottom: 0.2rem;}
.info-item span { font-size: 0.95rem; color: #0f172a; font-weight: 500; }
.info-item.full-width { grid-column: span 2; }


/* =======================================
   CONFIGURAÇÃO PARA GERAR PDF / IMPRESSÃO
   ======================================= */
@media print {
    /* Esconde elementos que não devem ir para o papel/PDF */
    .sidebar, 
    .topbar, 
    .btn-success, 
    .badge[href],
    button,
    a[href]:not(.print-link) {
        display: none !important;
    }

    /* Expande a área principal para usar toda a folha A4 */
    .dashboard-layout { display: block !important; }
    .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    
    /* Remove sombras e ajusta as cores para o modo documento */
    body { background: #ffffff !important; }
    .card { 
        box-shadow: none !important; 
        border: 1px solid #cbd5e1 !important; 
        margin-bottom: 1rem !important;
        page-break-inside: avoid; /* Evita que um card seja cortado no meio da página */
    }

    /* Ajusta o grid para ficar em coluna única se necessário, ou mantém lado a lado se couber */
    .profile-grid { display: block !important; }
    
    /* Força a impressão das cores de fundo (como os status verde/vermelho) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}