/* Importar fonte Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Reset e variáveis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #5B8DEF;
    --secondary-blue: #4A7FDB;
    --success-green: #4CAF50;
    --light-green: #68D391;
    --warning-orange: #FF9F43;
    --danger-red: #EF4444;
    --light-gray: #F7F9FC;
    --medium-gray: #E5E7EB;
    --dark-gray: #6B7280;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Botão do menu mobile */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    font-size: 20px;
}

.mobile-menu-btn:hover {
    background: var(--secondary-blue);
}

/* Layout com sidebar */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--medium-gray);
}

.sidebar-logo h1 {
    font-size: 24px;
    color: var(--primary-blue);
    font-weight: 700;
}

.sidebar-logo small {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-top: 5px;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.menu-item:hover,
.menu-item.active {
    background-color: var(--light-gray);
    color: var(--primary-blue);
    border-left: 3px solid var(--primary-blue);
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Header da página */
.page-header {
    background: var(--white);
    padding: 25px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

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

.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.dashboard-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.dashboard-card-icon.blue {
    background: rgba(91, 141, 239, 0.1);
    color: var(--primary-blue);
}

.dashboard-card-icon.green {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-green);
}

.dashboard-card-icon.orange {
    background: rgba(255, 159, 67, 0.1);
    color: var(--warning-orange);
}

.dashboard-card-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.dashboard-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Botões */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-green);
    color: var(--white);
}

.btn-success:hover {
    background: #45A049;
}

.btn-danger {
    background: var(--danger-red);
    color: var(--white);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--medium-gray);
}

.btn-secondary:hover {
    background: var(--light-gray);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px 12px;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

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

.form-label.required:after {
    content: " *";
    color: var(--danger-red);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.1);
}

.form-control.error {
    border-color: var(--danger-red);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table thead {
    background: var(--light-gray);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
    font-size: 14px;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
}

.table tbody tr:hover {
    background: var(--light-gray);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-rascunho {
    background: rgba(107, 114, 128, 0.1);
    color: var(--dark-gray);
}

.badge-enviado {
    background: rgba(91, 141, 239, 0.1);
    color: var(--primary-blue);
}

.badge-aprovado {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-green);
}

.badge-reprovado {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-green);
    border-left: 4px solid var(--success-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
    border-left: 4px solid var(--danger-red);
}

/* Login/Registro */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

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

.auth-header h1 {
    font-size: 32px;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Proposta Pública */
.public-container {
    min-height: 100vh;
    background: var(--light-gray);
    padding: 40px 20px;
}

.public-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.public-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 40px;
    text-align: center;
}

.public-content {
    padding: 40px;
}

.public-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Filtros */
.filters {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

/* Gráfico */
.chart-container {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

/* Lista de itens da proposta */
.proposta-itens {
    margin-top: 30px;
}

.proposta-item {
    background: var(--light-gray);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsivo */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 70px 15px 15px 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .public-actions {
        flex-direction: column;
    }
    
    .table-actions {
        flex-wrap: wrap;
    }
}

/* Loader */
.loader {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.flex { display: flex; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
