:root {
    --primary: #4F46E5;
    /* Indigo Profundo */
    --primary-light: #EEF2FF;
    --primary-dark: #4338ca;
    --secondary: #10B981;
    /* Verde Esmeralda */
    --accent: #F59E0B;
    /* Âmbar */
    --bg-body: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
}

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

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

.app-container {
    display: flex;
    height: 100%;
    position: relative;
}

/* ===========================
   SIDEBAR (MENU LATERAL)
   =========================== */
.sidebar {
    width: var(--sidebar-width);
    background: #111827;
    /* Dark Slate */
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
    justify-content: space-between;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 100;
    position: relative;
}

.sidebar-header {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    white-space: nowrap;
}

.logo h2 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #9CA3AF;
    padding: 14px 16px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-btn.active {
    background: rgba(79, 70, 229, 0.15);
    color: white;
    font-weight: 600;
    border-left: 4px solid var(--primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #374151;
    white-space: nowrap;
    overflow: hidden;
}

.avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
}

.user-info .name {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.user-info .role {
    font-size: 0.75rem;
    color: #9CA3AF;
}

/* --- MINI SIDEBAR (Desktop) --- */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .hide-on-collapse {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .nav-btn {
    justify-content: center;
    padding: 14px 0;
}

.sidebar.collapsed .logo {
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

/* Botão Toggle Desktop */
.sidebar-toggle-btn {
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: #111827;
    border: 4px solid var(--bg-body);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .sidebar-toggle-btn #toggle-icon {
    transform: rotate(180deg);
}

/* ===========================
   HEADER MOBILE & OVERLAY
   =========================== */
.mobile-topbar {
    display: none;
    /* Desktop */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 90;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.mobile-logo h2 {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 700;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
}

.mobile-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    backdrop-filter: blur(2px);
}

/* ===========================
   CONTEÚDO PRINCIPAL
   =========================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    transition: margin-left 0.3s ease;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active-view {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- FILTROS MODERNOS --- */
.date-filter-container {
    background: #FFFFFF;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-end;
    gap: 15px;
    margin-top: 25px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    max-width: fit-content;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    background: #F9FAFB;
    transition: all 0.2s;
    outline: none;
    min-width: 160px;
    font-family: 'Inter', sans-serif;
}

.filter-group input:hover {
    border-color: #cbd5e1;
}

.filter-group input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* DASHBOARD CARDS */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card.highlight {
    border: 1px solid rgba(79, 70, 229, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon span {
    font-size: 28px;
    color: white;
}

.blue {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.green {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.orange {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.purple {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
}

.card-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info p {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

/* SEÇÕES SPLIT & GRÁFICOS */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.chart-container {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chart-container h2 {
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 700;
}

.employee-cards {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.emp-card {
    flex: 1;
    background: #F8FAFC;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.emp-card:hover {
    border-color: var(--primary);
}

.emp-card span {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}

.emp-card h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.emp-card p {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-top: 5px;
}

.emp-divider {
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 0 15px;
    font-weight: bold;
}

/* FORMULÁRIOS */
.form-container {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    background: #F9FAFB;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.alert-box {
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    color: #1E40AF;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* TABELAS */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table th,
.data-table td {
    padding: 18px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #F8FAFC;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #F8FAFC;
}

.data-table td {
    font-size: 0.95rem;
}

/* PROGRESS BAR */
.progress-bg {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 10px;
}

/* BADGES */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-done {
    background: #DCFCE7;
    color: #166534;
}

.badge-pending {
    background: #FEF9C3;
    color: #854D0E;
}

/* FILTROS DE TABELA E BOTÕES */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-outline {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #EEF2FF;
}

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

.modal {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 420px;
    animation: fadeIn 0.2s;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* GRÁFICO BARRAS SIMPLES */
.simple-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 160px;
    margin-top: 20px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 12%;
}

.bar {
    width: 100%;
    background: var(--primary);
    border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 4px;
    position: relative;
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    font-size: 0.75rem;
    margin-top: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================
 * RESPONSIVIDADE
 * ========================================== */

@media (max-width: 1024px) {
    .split-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        padding-top: 60px;
    }

    .app-container {
        display: block;
        height: auto;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar-toggle-btn {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-overlay.active {
        display: block;
    }

    .mobile-close-btn {
        display: block;
    }

    .main-content {
        padding: 20px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .date-filter-container {
        width: 100%;
        max-width: 100%;
    }

    .filter-group {
        flex: 1;
    }

    .filter-group input {
        width: 100%;
        min-width: 0;
    }
}

/* ===========================
   TELA DE LOGIN (NOVO)
   =========================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    position: relative;
    overflow: hidden;
}

/* Efeito de fundo decorativo */
.login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    top: -100px;
    right: -100px;
    z-index: 0;
}

.login-card {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: fadeIn 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    color: white;
}

.login-logo span {
    font-size: 32px;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Inputs com ícones */
.input-icon {
    position: relative;
}

.input-icon span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 20px;
}

.input-icon input {
    padding-left: 40px;
    /* Espaço para o ícone */
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.section-divider {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 20px 0 10px 0;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 5px;
}