* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #1a1a1a;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #FFC107;
}

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

.logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

header h1 {
    color: #FFC107;
    font-size: 2.5em;
    margin: 0;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1;
}

.subtitle {
    color: #fff;
    font-size: 1.1em;
    margin-top: 5px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.user-info span {
    font-size: 1em;
    font-weight: 500;
}

.nivel-badge {
    background: #FFC107;
    color: #1a1a1a;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em !important;
    font-weight: 600 !important;
}

.btn-logout {
    padding: 8px 20px;
    background: #E53935;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c62828;
}

/* Navigation */
nav {
    background: #2d2d2d;
    padding: 15px 0;
    margin-top: 0;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

nav .container {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.nav-btn {
    padding: 12px 30px;
    border: 2px solid #FFC107;
    background: transparent;
    color: #FFC107;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #FFC107;
    color: #1a1a1a;
}

.nav-btn.active {
    background: #E53935;
    border-color: #E53935;
    color: white;
}

/* Main */
main {
    margin: 30px auto;
    padding-bottom: 50px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    color: #FFC107;
    margin-bottom: 20px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 900;
    text-transform: uppercase;
}

/* Cards */
.form-card, .list-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.form-card h3, .list-card h3 {
    color: #E53935;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 700;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group select optgroup {
    font-weight: 700;
    color: #E53935;
    background: #f9f9f9;
    font-size: 0.9em;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FFC107;
}

.btn-primary {
    background: #E53935;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #C62828;
}

.btn-secondary {
    background: #666;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
    margin-left: 5px;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: #f44336;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
    margin-left: 5px;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.8em;
    margin: 0;
}

/* Lista de Funcionários */
.funcionario-item, .consumo-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #E53935;
}

.funcionario-item h4, .consumo-item h4 {
    color: #E53935;
    margin-bottom: 5px;
    font-weight: 700;
}

.funcionario-item p, .consumo-item p {
    color: #666;
    margin: 3px 0;
}

.funcionario-item .acoes {
    margin-top: 10px;
}

.empty-message {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

/* Relatório */
.relatorio-filtros {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: end;
}

.relatorio-filtros .form-group {
    flex: 1;
    margin-bottom: 0;
}

.relatorio-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.relatorio-card h3 {
    color: #E53935;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #FFC107;
    padding-bottom: 10px;
    font-weight: 700;
}

.relatorio-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 5px;
}

.info-item label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.info-item .valor {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.info-item.destaque .valor {
    color: #E53935;
    font-size: 1.5em;
}

.info-item.positivo .valor {
    color: #4caf50;
}

.info-item.negativo .valor {
    color: #f44336;
}

.consumo-detalhes {
    margin-top: 15px;
}

.consumo-detalhes table {
    width: 100%;
    border-collapse: collapse;
}

.consumo-detalhes th,
.consumo-detalhes td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.consumo-detalhes th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
}

.consumo-detalhes td {
    color: #666;
}

.consumo-detalhes td:nth-child(3),
.consumo-detalhes td:nth-child(4),
.consumo-detalhes td:nth-child(5) {
    text-align: right;
}

.consumo-detalhes th:nth-child(3),
.consumo-detalhes th:nth-child(4),
.consumo-detalhes th:nth-child(5) {
    text-align: right;
}

.consumo-detalhes tr:hover {
    background: #f0f0f0;
}

/* Footer */
footer {
    background: #1a1a1a;
    padding: 20px 0;
    text-align: center;
    color: #FFC107;
    margin-top: 50px;
    border-top: 3px solid #FFC107;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        height: 80px;
    }

    .header-text {
        align-items: center;
        text-align: center;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    nav .container {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    .relatorio-filtros {
        flex-direction: column;
    }

    .relatorio-filtros button {
        width: 100%;
    }

    .relatorio-info {
        grid-template-columns: 1fr;
    }

    .filtros-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Estilos para filtros personalizados de relatório */
.filtros-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.relatorio-filtros h3 {
    color: #FFC107;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.botoes-relatorio {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.botoes-relatorio button {
    flex: 1;
}

.btn-success {
    background: #4CAF50;
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

/* Responsividade para filtros */
@media (max-width: 768px) {
    .botoes-relatorio {
        flex-direction: column;
    }

    .botoes-relatorio button {
        width: 100%;
    }
}

/* ========== MODAIS CUSTOMIZADOS ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.25s ease-out;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    min-width: 450px;
    max-width: 650px;
    width: 100%;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 28px 32px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-header h3 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 32px;
    color: #2d3748;
    min-height: 80px;
}

.modal-body p {
    margin: 0 0 20px 0;
    font-size: 18px;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #2d3748;
    font-weight: 500;
}

.modal-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    font-size: 17px;
    font-family: inherit;
    transition: all 0.3s;
    margin-top: 12px;
    font-weight: 500;
}

.modal-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.modal-footer {
    padding: 20px 32px;
    background: #f7fafc;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    border-top: 1px solid #e2e8f0;
}

.btn-modal {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 15px;
}

.btn-cancel {
    background: #718096;
    color: white;
}

.btn-cancel:hover {
    background: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 85, 104, 0.4);
}

.btn-cancel:active {
    transform: translateY(0);
}

.btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    filter: brightness(1.1);
}

.btn-confirm:active {
    transform: translateY(0);
}

.btn-confirm.btn-danger {
    background: linear-gradient(135deg, #fc5c65 0%, #eb3b5a 100%);
}

.btn-confirm.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(252, 92, 101, 0.5);
    filter: brightness(1.1);
}

.btn-confirm.btn-success {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
}

.btn-confirm.btn-success:hover {
    box-shadow: 0 6px 20px rgba(38, 222, 129, 0.5);
    filter: brightness(1.1);
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.8) translateY(-30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Responsividade para modais */
@media (max-width: 768px) {
    .modal-container {
        min-width: 90%;
        max-width: 90%;
        margin: 20px;
    }

    .modal-header h3 {
        font-size: 22px;
    }

    .modal-body p {
        font-size: 16px;
    }

    .btn-modal {
        padding: 12px 24px;
        font-size: 14px;
    }
}
