/* ===================================
   SISTEMA DE GESTÃO PATRIMONIAL VLOCA
   Estilos Principais
   =================================== */

:root {
    /* Cores VLoca */
    --vloca-laranja: #FF6B2B;
    --vloca-laranja-escuro: #E85A1F;
    --vloca-azul: #2563EB;
    --vloca-azul-escuro: #1E40AF;
    
    /* Cores do Sistema */
    --cor-primaria: #FF6B2B;
    --cor-secundaria: #2563EB;
    --cor-sucesso: #10B981;
    --cor-alerta: #F59E0B;
    --cor-erro: #EF4444;
    --cor-info: #3B82F6;
    
    /* Cores de Fundo */
    --bg-body: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-sidebar: #1F2937;
    --bg-hover: #F9FAFB;
    
    /* Cores de Texto */
    --texto-primario: #111827;
    --texto-secundario: #6B7280;
    --texto-claro: #FFFFFF;
    
    /* Bordas */
    --borda-cor: #E5E7EB;
    --borda-radius: 8px;
    
    /* Sombras */
    --sombra-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --sombra-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --sombra-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--texto-primario);
    line-height: 1.6;
}

/* ===================================
   PÁGINA DE LOGIN
   =================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--vloca-azul) 0%, var(--vloca-laranja) 100%);
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--sombra-lg);
    width: 100%;
    max-width: 420px;
}

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

.login-logo .logo-icon {
    font-size: 60px;
    color: var(--vloca-laranja);
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 28px;
    color: var(--texto-primario);
    font-weight: 700;
}

.login-logo p {
    color: var(--texto-secundario);
    margin-top: 5px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--borda-cor);
    border-radius: var(--borda-radius);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--vloca-laranja);
    box-shadow: 0 0 0 3px rgba(255, 107, 43, 0.1);
}

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

.form-group .required {
    color: var(--cor-erro);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--borda-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--vloca-laranja);
    color: var(--texto-claro);
    width: 100%;
}

.btn-primary:hover {
    background: var(--vloca-laranja-escuro);
    transform: translateY(-2px);
    box-shadow: var(--sombra-md);
}

.btn-secondary {
    background: var(--vloca-azul);
    color: var(--texto-claro);
}

.btn-secondary:hover {
    background: var(--vloca-azul-escuro);
}

.btn-success {
    background: var(--cor-sucesso);
    color: var(--texto-claro);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--cor-erro);
    color: var(--texto-claro);
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--vloca-laranja);
    color: var(--vloca-laranja);
}

.btn-outline:hover {
    background: var(--vloca-laranja);
    color: var(--texto-claro);
}

/* ===================================
   LAYOUT PRINCIPAL
   =================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--texto-claro);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #FFFFFF;
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-logo .logo-icon {
    font-size: 40px;
    color: var(--vloca-laranja);
}

.sidebar-logo h2 {
    font-size: 20px;
    margin-top: 10px;
}

.sidebar-logo p {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 5px;
}

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

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--texto-claro);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    background: rgba(255, 107, 43, 0.1);
    border-left: 3px solid var(--vloca-laranja);
}

.sidebar-menu a.active {
    background: rgba(255, 107, 43, 0.2);
    border-left: 3px solid var(--vloca-laranja);
}

.sidebar-menu i {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--bg-sidebar);
}

/* CONTEÚDO PRINCIPAL */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    transition: all 0.3s ease;
}

.topbar {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--borda-radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--sombra-sm);
}

.topbar h1 {
    font-size: 24px;
    color: var(--texto-primario);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--vloca-laranja);
    color: var(--texto-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ===================================
   DASHBOARD
   =================================== */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--borda-radius);
    box-shadow: var(--sombra-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

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

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--texto-secundario);
    font-size: 14px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.laranja {
    background: rgba(255, 107, 43, 0.1);
    color: var(--vloca-laranja);
}

.stat-icon.azul {
    background: rgba(37, 99, 235, 0.1);
    color: var(--vloca-azul);
}

.stat-icon.verde {
    background: rgba(16, 185, 129, 0.1);
    color: var(--cor-sucesso);
}

.stat-icon.amarelo {
    background: rgba(245, 158, 11, 0.1);
    color: var(--cor-alerta);
}

/* GRÁFICOS */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--borda-radius);
    box-shadow: var(--sombra-sm);
}

.chart-card h3 {
    margin-bottom: 5px;
    font-size: 18px;
}

.chart-card p {
    color: var(--texto-secundario);
    font-size: 13px;
    margin-bottom: 20px;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* ===================================
   TABELAS
   =================================== */

.table-container {
    background: var(--bg-card);
    border-radius: var(--borda-radius);
    box-shadow: var(--sombra-sm);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--borda-cor);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header h2 {
    font-size: 20px;
}

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

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--borda-cor);
    border-radius: var(--borda-radius);
    font-size: 14px;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--texto-secundario);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-hover);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--texto-primario);
    font-size: 14px;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--borda-cor);
    font-size: 14px;
}

tbody tr:hover {
    background: var(--bg-hover);
}

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

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-primary {
    background: #FFE4DB;
    color: #C2410C;
}

/* ===================================
   MODAL
   =================================== */

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

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

.modal-content {
    background: var(--bg-card);
    border-radius: var(--borda-radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sombra-lg);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--borda-cor);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    font-size: 28px;
    font-weight: 300;
    color: var(--texto-secundario);
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.modal-close:hover {
    color: var(--texto-primario);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--borda-cor);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===================================
   FORMULÁRIO COM ABAS/SEÇÕES
   =================================== */

.form-sections {
    position: relative;
}

.section-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.section-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--borda-cor);
    z-index: 0;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--borda-cor);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
    border-color: var(--vloca-laranja);
    background: var(--vloca-laranja);
    color: var(--texto-claro);
}

.progress-step.completed .progress-step-circle {
    border-color: var(--cor-sucesso);
    background: var(--cor-sucesso);
    color: var(--texto-claro);
}

.progress-step-label {
    font-size: 12px;
    color: var(--texto-secundario);
    font-weight: 500;
}

.progress-step.active .progress-step-label {
    color: var(--vloca-laranja);
    font-weight: 600;
}

.form-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-section.active {
    display: block;
}

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

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--texto-primario);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--vloca-laranja);
}

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

.section-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--borda-cor);
}

/* ===================================
   UPLOAD DE FOTOS
   =================================== */

.photo-upload-zone {
    border: 2px dashed var(--borda-cor);
    border-radius: var(--borda-radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-upload-zone:hover {
    border-color: var(--vloca-laranja);
    background: rgba(255, 107, 43, 0.05);
}

.photo-upload-zone i {
    font-size: 48px;
    color: var(--texto-secundario);
    margin-bottom: 15px;
}

.photo-upload-zone p {
    color: var(--texto-secundario);
    margin-bottom: 10px;
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--borda-radius);
    overflow: hidden;
    border: 2px solid var(--borda-cor);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .primary-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--vloca-laranja);
    color: var(--texto-claro);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.photo-preview-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.photo-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: var(--texto-claro);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* ===================================
   NOTIFICATION BADGE
   =================================== */

.notif-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #EF4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    animation: pulse 2s infinite;
}

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

.stat-icon.vermelho {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}


.photo-action-btn:hover {
    background: var(--vloca-laranja);
}

/* ===================================
   ALERTAS E MENSAGENS
   =================================== */

.alert {
    padding: 15px 20px;
    border-radius: var(--borda-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--cor-sucesso);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--cor-alerta);
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--cor-erro);
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--cor-info);
}

/* ===================================
   PAGINAÇÃO
   =================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--borda-cor);
    background: var(--bg-card);
    border-radius: var(--borda-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--vloca-laranja);
    color: var(--texto-claro);
    border-color: var(--vloca-laranja);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: var(--texto-secundario);
}

/* ===================================
   LOADING
   =================================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--texto-claro);
    animation: spin 1s ease-in-out infinite;
}

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

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   UTILITÁRIOS
   =================================== */

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

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.gap-10 {
    gap: 10px;
}
