:root {
    --gold: #C5A059;
    --gold-dark: #9A7B34;
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #AA8A26 100%);
    --white: #FFFFFF;
    --gray-light: #F4F4F4;
    --text: #1A1A1A;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Montserrat', sans-serif; }

body { background-color: var(--gray-light); color: var(--text); height: 100vh; overflow: hidden; }

/* Utilitários */
.hidden { display: none !important; }
.btn {
    background: var(--gold-gradient);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4); }

.btn-outline {
    background: transparent;
    border: 1px solid #333;
    color: #333;
    padding: 8px 16px;
}
.btn-outline:hover { background: #333; color: white; transform: none; box-shadow: none; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; margin-top: 1rem; }

/* Botões de Ícone (Tabelas) */
.btn-icon {
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}
.btn-icon:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.btn-icon.btn-delete {
    color: #c0392b;
}
.btn-icon.btn-delete:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* Login - Tela com Fundo Branco e Gradiente Dourado */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #faf8f5 50%, #f5f0e8 100%);
    position: relative;
    overflow: hidden;
}

/* Elementos decorativos de fundo */
#login-screen .bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

#login-screen .shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.15) 0%, rgba(154, 123, 52, 0.1) 100%);
    top: -150px;
    left: -150px;
    animation: floatShape 10s ease-in-out infinite;
}

#login-screen .shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(154, 123, 52, 0.08) 100%);
    bottom: -100px;
    right: -100px;
    animation: floatShape 12s ease-in-out infinite reverse;
}

#login-screen .shape-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.08) 0%, rgba(154, 123, 52, 0.05) 100%);
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, 40px); }
}

@keyframes pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

/* Caixa de Login maior e mais bonita */
.login-box {
    background: #ffffff;
    padding: 3rem 4rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 520px;
    text-align: center;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

/* Barra dourada no topo */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark), var(--gold));
    border-radius: 16px 16px 0 0;
}

/* Animação para a tela de login sair para a direita */
.slide-out-right {
    animation: slideOutRight 0.7s cubic-bezier(0.550, 0.085, 0.680, 0.530) forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
    }
}

/* Inputs Animados */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
    text-align: left;
}
.input-group input {
    width: 100%;
    padding: 14px 0;
    border: none;
    border-bottom: 2px solid #ddd;
    outline: none;
    background: transparent;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 14px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}
.password-toggle:hover {
    color: var(--gold-dark);
}

.input-group label {
    position: absolute;
    top: 14px;
    left: 0;
    color: #999;
    pointer-events: none;
    transition: 0.3s ease all;
    font-size: 0.9rem;
    font-weight: 500;
}
.input-group input:focus, .input-group input:valid {
    border-bottom: 2px solid var(--gold);
}
.input-group input:focus ~ label, .input-group input:valid ~ label {
    top: -8px;
    font-size: 0.75rem;
    color: var(--gold-dark);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold-dark);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    border: 2px solid var(--gold);
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
}

.brand-title {
    color: var(--gold-dark);
    letter-spacing: 1px;
}

.welcome-msg {
    color: #333;
    margin-bottom: 2.5rem;
    font-weight: 400;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

/* --- LAYOUT DASHBOARD (SIDEBAR) --- */
#dashboard-screen, .dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: #1a1a1a;
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid #333;
    margin-bottom: 1rem;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

/* Personalização da barra de rolagem */
.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 2rem;
    color: #aaa;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background: rgba(255,255,255,0.05);
    color: var(--gold);
    border-left-color: var(--gold);
}

.sidebar-footer {
    padding: 2rem;
    border-top: 1px solid #333;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.container { padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

.grid-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: none;
    border-top: 4px solid var(--gold);
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-5px); }

.card h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* Tabela Moderna */
table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0 10px;
    margin-top: 1rem; 
}

th { 
    color: #888; 
    padding: 15px; 
    text-align: left; 
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border: none;
}

tbody tr {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
tbody tr:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

td { padding: 15px; color: #444; font-weight: 500; border: none; }
td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-pendente { background-color: #FFF4E5; color: #B76E00; }
.status-andamento { background-color: #E3F2FD; color: #1565C0; }
.status-finalizado { background-color: #E8F5E9; color: #2E7D32; }

/* Phase Badges (Processos) */
.phase-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.phase-administrativa {
    background-color: #FEF3C7;
    color: #92400E;
}
.phase-judicial {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* Input de Arquivo */
.file-input {
    border: 1px dashed #ccc;
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
}
.file-input:hover { border-color: var(--gold); background: #fff; }

/* Splash Screen (Tela de Entrada) */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #2a2a2a 0%, #000000 100%);
    background-size: 200% 200%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#splash-screen.show {
    animation: splashContainer 3.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    visibility: visible;
}

.splash-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.splash-icon {
    font-size: 5rem;
    color: var(--gold);
    margin-bottom: 20px;
    opacity: 0;
    transform: scale(0.5) translateY(-50px);
    animation: iconEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
    text-shadow: 0 0 30px rgba(197, 160, 89, 0.4);
}

.splash-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    color: #fff;
    margin-bottom: 15px;
    letter-spacing: 10px;
    text-transform: uppercase;
    opacity: 0;
    filter: blur(10px);
    animation: textFocusIn 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.8s forwards;
}

.splash-name {
    font-size: 2.2rem;
    color: var(--gold);
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUpSmooth 1s ease-out 1.2s forwards;
    position: relative;
}

/* Animação do Container (Fundo) */
@keyframes splashContainer {
    0% { opacity: 0; background-position: 50% 50%; }
    10% { opacity: 1; }
    80% { opacity: 1; transform: scale(1); filter: blur(0px); }
    100% { opacity: 0; transform: scale(1.05); filter: blur(10px); visibility: hidden; background-position: 0% 50%; }
}

/* Entrada do Ícone (Efeito Elástico) */
@keyframes iconEntrance {
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Entrada do Título (Foco + Espaçamento) */
@keyframes textFocusIn {
    0% { letter-spacing: 15px; filter: blur(12px); opacity: 0; }
    100% { letter-spacing: 3px; filter: blur(0px); opacity: 1; }
}

/* Entrada do Nome (Suave) */
@keyframes fadeInUpSmooth {
    to { opacity: 1; transform: translateY(0); }
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    border-top: 4px solid var(--gold);
    animation: fadeInUp 0.3s ease-out;
}

.modal-content h3 { margin-bottom: 1.5rem; }

.close-btn { position: absolute; top: 15px; right: 5px; font-size: 1.5rem; cursor: pointer; color: #999; }
.close-btn:hover { color: var(--gold-dark); }

.select-button-style {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--white);
    border: 1px solid #ddd;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 1rem;
    color: #555;
    cursor: pointer;
    width: 100%;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    transition: border-color 0.2s;
}

.select-button-style:hover { border-color: var(--gold); }

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.card-animated {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-animated:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Estilos para o novo cabeçalho do card de clientes */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.card-header h3 {
    margin: 0;
}
.card-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.card-header-actions .btn {
    margin-top: 0;
}
.form-control-page {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    width: 100%;
}
.form-control-page:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.2);
}
.form-control-search {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-family: 'Montserrat', sans-serif;
}

/* Filtros de Relatório */
.filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.filter-btn:hover { background: #f4f4f4; color: #333; }
.filter-btn.active { background: var(--gold); color: white; border-color: var(--gold); box-shadow: 0 4px 10px rgba(197, 160, 89, 0.3); }

/* Widgets do Dashboard */
.widget-list {
    list-style: none;
    margin-top: 1rem;
}

/* Cores para fases de perícia */
.expertise-admin {
    border-left: 4px solid var(--gold);
}
.expertise-judicial {
    border-left: 4px solid #1565C0;
}

.widget-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.widget-item:last-child { border-bottom: none; }

.widget-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f4f4f4;
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.widget-content { flex: 1; }
.widget-title { font-weight: 600; color: #333; font-size: 0.95rem; }
.widget-subtitle { font-size: 0.8rem; color: #777; margin-top: 2px; }

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.priority-high { background-color: #e74c3c; }
.priority-normal { background-color: #f1c40f; }

/* Kanban Simples */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-column {
    min-width: 350px;
    max-width: 350px;
    flex-shrink: 0;
    background: #f4f4f4;
    border-radius: 8px;
    padding: 15px;
    min-height: 400px;
}

.kanban-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    font-size: 1.1rem;
    color: #555;
}
.header-todo { border-color: #e74c3c; }
.header-doing { border-color: #f1c40f; }
.header-done { border-color: #2ecc71; }

.task-card {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: grab;
    border-left: 4px solid var(--gold);
    transition: transform 0.2s;
}
.task-card:active { cursor: grabbing; }
.task-card:hover { transform: translateY(-2px); }

/* Barras de Progresso (Dashboard) */
.progress-container {
    background: #eee;
    border-radius: 10px;
    height: 6px;
    width: 100%;
    margin: 5px 0 15px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}
.bg-gold { background: var(--gold); }
.bg-blue { background: #1565C0; }
.bg-green { background: #2E7D32; }

/* --- ESTÉTICA DO HISTÓRICO --- */
.history-row {
    background-color: #fcfcfc;
    color: #666;
    transition: all 0.3s ease;
    border-left: 4px solid #ddd;
}

.history-row:hover {
    background-color: #fff;
    transform: scale(1.005);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    border-left-color: var(--gold);
    z-index: 1;
    position: relative;
}

.history-row td {
    padding: 18px 15px; /* Mais espaçamento para estética */
    border-bottom: 1px solid #f0f0f0;
}
