/* Reset e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1d29;
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

.dark-theme {
    background: linear-gradient(135deg, #1a1d29 0%, #2d3748 100%);
}

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

/* Barra Superior */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 29, 41, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid #2d3748;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn.active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.nav-btn.contabilidade {
    background: #4285f4;
    color: white;
}

.nav-btn.patrimonio {
    background: #ea4335;
    color: white;
}

.nav-btn.folha {
    background: #9c27b0;
    color: white;
}

.nav-btn.frota {
    background: #4caf50;
    color: white;
}

.nav-btn.portal {
    background: #ff9800;
    color: white;
}

.nav-btn.transparencia {
    background: #00bcd4;
    color: white;
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

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

.login-btn, .logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-btn {
    background: #4285f4;
    color: white;
}

.login-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
}

.logout-btn {
    background: #f44336;
    color: white;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #2d3748;
    color: #ffffff;
    border: 1px solid #4a5568;
    border-radius: 8px;
    font-weight: 600;
    cursor: default;
    white-space: nowrap;
}

/* Conteúdo Principal */
.main-content {
    margin-top: 100px;
    padding: 30px 0;
}

/* Seção de Busca */
.search-section {
    margin-bottom: 30px;
}

.search-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.client-selector {
    flex: 0 0 auto;
}

.client-selector select {
    padding: 12px 16px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    min-width: 250px;
}

.client-selector select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.search-input-group {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 16px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
}

.search-input-group input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.search-input-group input::placeholder {
    color: #a0aec0;
}

.search-btn, .clear-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn {
    background: #ffffff;
    color: #1a1d29;
}

.clear-btn {
    background: #4a5568;
    color: #ffffff;
}

.search-btn:hover, .clear-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Seção de Filtros */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(45, 55, 72, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #4a5568;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.filter-btn:hover,
.filter-btn.active {
    background: #4285f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.entity-counter {
    color: #a0aec0;
    font-size: 14px;
    font-weight: 500;
}

/* Título da Seção */
.section-title {
    margin-bottom: 30px;
}

.section-title h1 {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
}

/* Grid de Cartões */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.entity-card {
    background: #2d3748;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid #4a5568;
}

.entity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border-color: #4285f4;
}

.card-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4a5568;
    color: #ffffff;
    font-size: 32px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.card-content h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.card-category {
    text-align: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.card-category.prefeitura {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.card-category.camara {
    background: rgba(66, 133, 244, 0.2);
    color: #4285f4;
    border: 1px solid rgba(66, 133, 244, 0.3);
}

.card-category.autarquia {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    border: 1px solid rgba(0, 188, 212, 0.3);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.card-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.open-btn {
    background: #4caf50;
    color: white;
}

.edit-btn {
    background: #ff9800;
    color: white;
}

.delete-btn {
    background: #f44336;
    color: white;
}

.card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

.loading-indicator i {
    font-size: 32px;
    margin-bottom: 15px;
    color: #4285f4;
}

/* Dica de Uso */
.usage-tip {
    text-align: center;
    margin: 40px 0;
    color: #a0aec0;
    font-size: 14px;
}

/* Controles de Dados */
.data-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #4a5568;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.control-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #2d3748;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid #4a5568;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #4a5568;
}

.modal-header h2 {
    color: #ffffff;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #a0aec0;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #4a5568;
    color: #ffffff;
}

.modal-form {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: #1a1d29;
    border: 1px solid #4a5568;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.form-group small {
    color: #a0aec0;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.cancel-btn,
.submit-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #4a5568;
    color: #ffffff;
}

.submit-btn {
    background: #4285f4;
    color: white;
}

.cancel-btn:hover,
.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Modal de Login */
.login-modal {
    max-width: 450px;
    width: 90%;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.login-logo i {
    font-size: 48px;
    color: #4285f4;
    margin-bottom: 15px;
}

.login-logo h3 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 24px;
}

.login-logo p {
    color: #a0aec0;
    font-size: 14px;
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #4285f4;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    position: relative;
}

.login-actions {
    margin-top: 25px;
}

.login-submit-btn {
    width: 100%;
    padding: 15px 20px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-submit-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
}

.login-submit-btn:disabled {
    background: #4a5568;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
    text-align: center;
}

.login-footer p {
    color: #a0aec0;
    font-size: 14px;
    margin-bottom: 15px;
}

.demo-users {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.demo-user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #2d3748;
    color: #a0aec0;
    border: 1px solid #4a5568;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-user-btn:hover {
    background: #4a5568;
    color: #ffffff;
    border-color: #4285f4;
}

.login-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mensagem de Nenhum Resultado */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: rgba(45, 55, 72, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.no-results i {
    font-size: 48px;
    color: #4a5568;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #a0aec0;
    margin-bottom: 10px;
}

.no-results p {
    color: #718096;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 29, 41, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 48px;
    color: #4285f4;
    margin-bottom: 20px;
}

.loading-spinner p {
    color: #a0aec0;
    font-weight: 600;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #2d3748;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #4285f4;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #4caf50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.warning {
    border-left-color: #ff9800;
}

/* Responsividade */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-bar .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-buttons {
        justify-content: center;
        width: 100%;
    }

    .nav-btn {
        padding: 10px 15px;
        font-size: 12px;
    }

    .main-content {
        margin-top: 160px;
    }

    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .client-selector select {
        min-width: auto;
        width: 100%;
    }

    .search-input-group {
        min-width: auto;
    }

    .filter-section {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
    }

    .section-title h1 {
        font-size: 24px;
        text-align: center;
    }

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

    .data-controls {
        flex-direction: column;
        align-items: center;
    }

    .modal {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .filter-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .main-content {
        margin-top: 180px;
    }
}

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

.entity-card {
    animation: fadeInUp 0.6s ease forwards;
	display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.entity-card:nth-child(1) { animation-delay: 0.1s; }
.entity-card:nth-child(2) { animation-delay: 0.2s; }
.entity-card:nth-child(3) { animation-delay: 0.3s; }
.entity-card:nth-child(4) { animation-delay: 0.4s; }
.entity-card:nth-child(5) { animation-delay: 0.5s; }
.entity-card:nth-child(6) { animation-delay: 0.6s; }

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1d29;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d3748;
}

