/* ============================================
   SISTEMA DE FECHAMENTO - TEMA CLARO MODERNO
   WhiteLabel Premium Theme
   ============================================ */

/* ===== VARIÁVEIS DE CORES ===== */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #6366f1;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    /* Tema Claro */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== MELHORIAS DE UX ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== NOTIFICAÇÕES TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
}

.toast-custom {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    margin-bottom: 10px;
    border-left: 4px solid var(--success-color);
    transform: translateX(400px);
    transition: var(--transition);
    max-width: 400px;
    color: var(--text-primary);
}

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

.toast-custom.success { border-left-color: var(--success-color); }
.toast-custom.error { border-left-color: var(--danger-color); }
.toast-custom.warning { border-left-color: var(--warning-color); }
.toast-custom.info { border-left-color: var(--info-color); }

/* ===== NAVBAR MODERNA ===== */
.navbar {
    background: var(--bg-primary) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: var(--primary-dark) !important;
}

.navbar-brand i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.nav-link i {
    margin-right: 0.5rem;
}

/* ===== DROPDOWN COM Z-INDEX CORRIGIDO ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    margin-top: 0.5rem !important;
    z-index: 9999 !important;
    position: absolute !important;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-weight: 500;
    display: block;
    width: 100%;
    text-decoration: none;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ===== MELHORIAS DE FORMULÁRIOS ===== */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
    transition: var(--transition);
    outline: none;
}

.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='m2.3 6.73.94-.94 2.94 2.94L8.5 6.4l.94.94L6.5 10.27z'/%3e%3c/svg%3e");
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.5 5.5 1 1m0-1-1 1'/%3e%3c/svg%3e");
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ===== BOTÕES MELHORADOS ===== */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    padding: 0.75rem 1.5rem;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

/* ===== CARDS MELHORADOS ===== */
.card {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--bg-primary);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* ===== TABELAS RESPONSIVAS ===== */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--bg-primary);
}

.table {
    margin-bottom: 0;
    color: var(--text-primary);
}

.table thead th {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

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

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

/* ===== BADGES MELHORADOS ===== */
.badge {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

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

.badge-warning {
    background: var(--warning-color);
    color: white;
}

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

.badge-info {
    background: var(--info-color);
    color: white;
}

.badge-secondary {
    background: var(--text-muted);
    color: white;
}

/* ===== CONTAINER E LAYOUT ===== */
main.container-fluid {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.container-fluid {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== ESTADOS DE LOADING ===== */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* ===== ALERTAS ===== */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

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

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--text-muted);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    main.container-fluid {
        padding: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .toast-custom {
        max-width: none;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        background: var(--bg-secondary);
        margin-top: 0 !important;
    }
}

/* ===== UTILITÁRIOS ===== */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.bg-light { background-color: var(--bg-secondary) !important; }
.bg-white { background-color: var(--bg-primary) !important; }

.border-light { border-color: var(--border-light) !important; }
.border { border-color: var(--border-color) !important; }

.rounded { border-radius: var(--border-radius-sm) !important; }
.rounded-lg { border-radius: var(--border-radius) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ===== PÁGINA DE LOGIN ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-body {
    padding: 2rem;
}

/* ===== MELHORIAS ESPECÍFICAS ===== */
.page-header {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.page-header h1 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stats-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
