/* ═══════════════════════════════════════════════════════════════
   FACECRED - SISTEMA DE CREDENCIAMENTO
   Estilo Principal
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary: #007bff;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f5f5;
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   NAVEGAÇÃO
   ═══════════════════════════════════════════════════════════════ */

.navbar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    color: var(--white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.navbar::-webkit-scrollbar {
    width: 6px;
}

.navbar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.navbar-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: bold;
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar-brand i {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.navbar-menu {
    list-style: none;
    padding: 15px 0;
    flex: 1;
}

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

.navbar-menu > li > a {
    color: var(--white);
    text-decoration: none;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 14px;
}

.navbar-menu > li > a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.navbar-menu > li > a:hover,
.navbar-menu > li > a.active {
    background-color: rgba(255,255,255,0.1);
    border-left-color: #ffc107;
    padding-left: 24px;
}

.navbar-user {
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    padding: 15px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--white);
    text-decoration: none;
    font-size: 13px;
}

.user-menu i.fa-user-circle {
    font-size: 32px;
}

.user-menu span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu:hover {
    background-color: rgba(255,255,255,0.15);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    background-color: rgba(0,0,0,0.3);
    list-style: none;
    padding: 5px 0;
    margin-left: 20px;
    border-left: 2px solid rgba(255,255,255,0.2);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    color: rgba(255,255,255,0.9);
    padding: 10px 20px 10px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    font-size: 13px;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--white);
}

.dropdown-menu a i {
    width: 16px;
    font-size: 12px;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown > a .fa-chevron-down {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown.open > a .fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown do usuário */
.navbar-user .dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 15px;
    right: 15px;
    margin: 0 0 10px 0;
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    border: none;
    max-height: 300px;
    overflow-y: auto;
    margin-left: 0;
    border-left: none;
}

.navbar-user .dropdown-menu a {
    color: var(--dark);
    padding: 12px 20px;
}

.navbar-user .dropdown-menu a:hover {
    background-color: var(--light);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 8px 0;
    border: none;
}

/* Toggle Button Mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    font-size: 18px;
}

.sidebar-toggle:hover {
    background: #0056b3;
}

/* Overlay para mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ═══════════════════════════════════════════════════════════════
   CONTAINER PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */

.main-container {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    width: calc(100% - 260px);
    transition: all 0.3s ease;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   CABEÇALHO DE PÁGINA
   ═══════════════════════════════════════════════════════════════ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header h1 i {
    color: var(--primary);
}

.page-header p {
    color: var(--secondary);
    margin-top: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light);
}

.card-header h2 {
    font-size: 1.3rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

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

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.stat-primary { border-color: var(--primary); }
.stat-success { border-color: var(--success); }
.stat-info { border-color: var(--info); }
.stat-warning { border-color: var(--warning); }
.stat-danger { border-color: var(--danger); }

.stat-icon {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.8;
}

.stat-primary .stat-icon { color: var(--primary); background: rgba(0, 123, 255, 0.1); }
.stat-success .stat-icon { color: var(--success); background: rgba(40, 167, 69, 0.1); }
.stat-info .stat-icon { color: var(--info); background: rgba(23, 162, 184, 0.1); }
.stat-warning .stat-icon { color: var(--warning); background: rgba(255, 193, 7, 0.1); }
.stat-danger .stat-icon { color: var(--danger); background: rgba(220, 53, 69, 0.1); }

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-content p {
    color: var(--secondary);
    font-size: 0.9rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* ═══════════════════════════════════════════════════════════════
   TABELAS
   ═══════════════════════════════════════════════════════════════ */

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

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

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.85rem;
    text-transform: uppercase;
}

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

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
}

.table-info {
    width: 100%;
}

.table-info th {
    font-weight: 600;
    padding: 12px;
    background-color: var(--light);
    width: 200px;
}

.table-info td {
    padding: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   FORMULÁRIOS
   ═══════════════════════════════════════════════════════════════ */

.form {
    max-width: 100%;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
}

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

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

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

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

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--secondary);
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

/* Grid system */
.row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.col-md-4 { flex: 0 0 33.333%; }
.col-md-6 { flex: 0 0 50%; }
.col-md-8 { flex: 0 0 66.666%; }
.col-md-12 { flex: 0 0 100%; }

/* ═══════════════════════════════════════════════════════════════
   BOTÕES
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

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

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

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

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

.btn-success:hover {
    background-color: #218838;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

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

.btn-info:hover {
    background-color: #138496;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--dark);
}

.btn-warning:hover {
    background-color: #e0a800;
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-lg {
    padding: 8px 16px;
    font-size: 1rem;
}

.badge-primary { background-color: var(--primary); color: var(--white); }
.badge-secondary { background-color: var(--secondary); color: var(--white); }
.badge-success { background-color: var(--success); color: var(--white); }
.badge-danger { background-color: var(--danger); color: var(--white); }
.badge-warning { background-color: var(--warning); color: var(--dark); }
.badge-info { background-color: var(--info); color: var(--white); }

/* ═══════════════════════════════════════════════════════════════
   ALERTAS
   ═══════════════════════════════════════════════════════════════ */

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

.alert i {
    font-size: 1.3rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-error, .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   ESTADOS VAZIOS
   ═══════════════════════════════════════════════════════════════ */

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

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.empty-state p {
    margin-bottom: 20px;
}

.empty-state-small {
    text-align: center;
    padding: 30px;
    color: var(--secondary);
}

.empty-state-small i {
    font-size: 2rem;
    opacity: 0.3;
    margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   AVATARES E IMAGENS
   ═══════════════════════════════════════════════════════════════ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* ═══════════════════════════════════════════════════════════════
   AÇÕES RÁPIDAS
   ═══════════════════════════════════════════════════════════════ */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.quick-action-card {
    padding: 20px;
    text-align: center;
    background-color: var(--light);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
}

.quick-action-card:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: translateY(-5px);
}

.quick-action-card i {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 20px 0;
    margin-top: 50px;
}

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

/* ═══════════════════════════════════════════════════════════════
   PÁGINA DE LOGIN
   ═══════════════════════════════════════════════════════════════ */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

.login-header i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.login-header p {
    opacity: 0.9;
}

.login-form {
    padding: 30px;
}

.login-form .form-control {
    width: 100%;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

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

.login-footer {
    text-align: center;
    padding: 20px 30px;
    background-color: var(--light);
    border-top: 1px solid #e9ecef;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITÁRIOS
   ═══════════════════════════════════════════════════════════════ */

.text-muted {
    color: var(--secondary) !important;
}

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

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

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 10px !important; }
.mb-2 { margin-bottom: 20px !important; }
.mb-3 { margin-bottom: 30px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 10px !important; }
.mt-2 { margin-top: 20px !important; }
.mt-3 { margin-top: 30px !important; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVIDADE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .navbar-menu a {
        padding: 12px 18px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-12 {
        flex: 0 0 100%;
    }
}

/* Responsive fix for sidebar/hamburger */
@media (max-width: 992px) {
    .navbar { transform: translateX(-100%); }
    .navbar.show { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .sidebar-overlay.show { display: block; }
    .main-container { margin-left: 0; width: 100%; padding: 80px 20px 30px; }
}