/* Sistema Administrativo - CSS Personalizado */

:root {
    --primary-color: #D6A23B;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #000000;
}

/* ========================================
   SIDEBAR
   ======================================== */

/* Sidebar Container */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    z-index: 1050;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.show {
    left: 0;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo-container {
    display: flex;
    align-items: center;
}

.sidebar-header .logo {
    height: 32px;
    margin-right: 0.5rem;
}

.sidebar-header .logo-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-close {
    padding: 0.25rem;
    color: white !important;
    text-decoration: none;
}

.sidebar-close:hover {
    color: #f8f9fa !important;
}

/* Sidebar Content */
.sidebar-content {
    padding: 1rem 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Sidebar Items */
.sidebar-item {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #007bff;
    text-decoration: none;
}

.sidebar-link.active {
    color: white;
    background: rgba(0, 123, 255, 0.2);
    border-left-color: #007bff;
}

.sidebar-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-link span {
    flex: 1;
    font-weight: 500;
}

/* Sidebar Dropdown */
.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown i.bi-chevron-down {
    transition: transform 0.3s ease;
}

.sidebar-dropdown[aria-expanded="true"] i.bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 3rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-dropdown-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.sidebar-dropdown-item i {
    width: 16px;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.sidebar-divider {
    margin: 0.5rem 1rem;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Sidebar Toggle Button */
.sidebar-toggle {
    padding: 0.5rem;
    margin-right: 0.5rem;
    border: none;
    background: transparent;
    color: white !important;
    text-decoration: none;
}

.sidebar-toggle:hover {
    color: #f8f9fa !important;
}

/* Main Content Adjustment */
body.sidebar-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .sidebar.show {
        left: 0;
    }
}

/* ========================================
   ESTILOS GERAIS
   ======================================== */

/* Estilos para a Logo */
.logo {
    max-height: 50px;
    max-width: 200px;
    height: auto;
    width: auto;
    filter: brightness(0) invert(1); /* Torna a logo branca para o navbar */
}

.logo-dark {
    filter: none; /* Mantém as cores originais para fundos claros */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

.logo-text-dark {
    color: var(--text-dark);
}

/* Responsividade da logo */
@media (max-width: 768px) {
    .logo {
        max-height: 40px;
        max-width: 150px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .logo {
        max-height: 35px;
        max-width: 120px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
}

/* Layout geral */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar personalizada */
.navbar {
    background: linear-gradient(135deg, #000000, #D6A23B) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar.bg-primary {
    background: linear-gradient(135deg, #000000, #D6A23B) !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.dropdown-menu {
    border: 1px solid #e9ecef; /* Borda visível e definida */
    box-shadow: none; /* Sem sombras */
    border-radius: 8px;
    background: rgba(255,255,255,0.95); /* Background sólido */
}

.dropdown-item:hover {
    background-color: rgba(214, 162, 59, 0.1);
    color: #D6A23B;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler:focus {
    box-shadow: none; /* Sem sombras */
    border-color: #D6A23B; /* Borda dourada no foco */
}

/* Cards de Navegação Responsivos */
.nav-card {
    background: rgba(255,255,255,0.95); /* Background sólido */
    border-radius: 8px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    position: relative;
    cursor: pointer;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Sombra sutil */
}

.nav-card:hover {
    border-color: #D6A23B;
    transform: translateY(-2px);
}

.nav-card.active {
    background: linear-gradient(135deg, #000000, #D6A23B);
    color: white;
    border-color: #D6A23B;
}

.nav-card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #D6A23B;
}

.nav-card.active .nav-card-icon {
    color: white;
}

.nav-card:hover .nav-card-icon {
    transform: scale(1.1);
}

.nav-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin: 0;
}

.nav-card.active .nav-card-title {
    color: white;
}

.nav-card:hover .nav-card-title {
    color: #D6A23B;
}

/* Dropdown dos cards */
.nav-card.dropdown {
    position: relative;
}

.nav-card-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95); /* Background sólido */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Sombra sutil */
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    min-width: 200px;
}

.nav-card.dropdown:hover .nav-card-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-card-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

.nav-card-dropdown .dropdown-item:hover {
    background: rgba(214, 162, 59, 0.1);
    color: #D6A23B;
    text-decoration: none;
    transform: translateX(5px);
}

.nav-card-dropdown .dropdown-item:active {
    background: rgba(214, 162, 59, 0.2);
    transform: translateX(3px);
}

.nav-card-dropdown .dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Responsividade dos cards */
@media (max-width: 768px) {
    .nav-card {
        min-height: 100px;
        padding: 1rem 0.5rem;
    }
    
    .nav-card-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .nav-card-title {
        font-size: 0.8rem;
    }
    
    .nav-card-dropdown {
        position: fixed;
        top: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        width: 90%;
        max-width: 300px;
    }
    
    .nav-card.dropdown:hover .nav-card-dropdown {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 576px) {
    .nav-card {
        min-height: 80px;
        padding: 0.75rem 0.25rem;
    }
    
    .nav-card-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .nav-card-title {
        font-size: 0.7rem;
    }
}

/* Animações dos cards */
.nav-card.loading {
    position: relative;
    overflow: hidden;
}

.nav-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 0.8s ease-in-out;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Estado ativo dos dropdowns */
.nav-card-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Melhorias para mobile */
@media (max-width: 768px) {
    .nav-card-dropdown.show {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
        z-index: 9999;
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .nav-card-dropdown.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
}

/* Breadcrumb personalizado */
.breadcrumb {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(214, 162, 59, 0.1));
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0;
}

.breadcrumb-item a {
    color: #D6A23B;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: #B8860B;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 600;
}

/* Footer personalizado */
footer {
    background: linear-gradient(135deg, #000000, #D6A23B) !important;
    color: white;
    margin-top: auto;
}

footer.bg-light {
    background: linear-gradient(135deg, #000000, #D6A23B) !important;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Cards personalizados */
.card {
    border: 1px solid #e9ecef; /* Borda visível e definida */
    border-radius: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Sombra sutil */
}

.card:hover {
    border-color: #D6A23B;
    transform: translateY(-1px);
}

.card-header {
    background: #f8f9fa; /* Cor neutra mais leve */
    color: #495057; /* Cor de texto neutra */
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef; /* Borda sutil */
}

/* Botões personalizados */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #000000, #D6A23B);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #D6A23B, #B8860B);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
    border: none;
}

/* Formulários */
.form-control, .form-select {
    background-color: rgba(255,255,255,0.95); /* Background sólido */
    border-radius: 4px;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05); /* Sombra sutil */
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-control:focus, .form-select:focus {
    background-color: white;
    border-color: #D6A23B;
    border-width: 0.3px; /* Manter borda extremamente fina */
    box-shadow: none; /* Sem sombras */
    outline: none;
    transform: translateY(-1px);
}

.form-control:hover, .form-select:hover {
    background-color: white;
    border-color: #D6A23B;
    border-width: 0.3px; /* Manter borda extremamente fina */
}

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

/* Formulários de Ações Rápidas */
.quick-actions-form {
    background-color: rgba(255,255,255,0.95); /* Background sólido */
    border: 1px solid #e9ecef; /* Borda visível e definida */
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: none; /* Sem sombras */
}

/* Títulos de Seções */
.section-title {
    background: #f8f9fa; /* Cor neutra mais leve */
    border: 1px solid #e9ecef; /* Borda visível e definida */
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 500;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: none; /* Sem sombras */
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #D6A23B 0%, #B8860B 100%);
}

.section-title i {
    margin-right: 0.5rem;
    color: #D6A23B;
}

/* Tabelas */
.table {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    box-shadow: none; /* Sem sombras */
}

.table thead th {
    background: #f8f9fa; /* Cor neutra mais leve */
    color: #495057; /* Cor de texto neutra */
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9ecef; /* Borda sutil */
}

.table tbody tr:hover {
    background-color: rgba(214, 162, 59, 0.1);
}

/* Dashboard cards */
.dashboard-card {
    background: rgba(255,255,255,0.95); /* Background sólido */
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    transition: all 0.2s ease;
    border-left: 3px solid #D6A23B;
    box-shadow: none; /* Sem sombras */
}

.dashboard-card:hover {
    border-color: #D6A23B;
    transform: translateY(-1px);
}

.dashboard-card .card-icon {
    font-size: 2.5rem;
    color: #D6A23B;
    margin-bottom: 1rem;
}

.dashboard-card .card-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.dashboard-card .card-title {
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Status badges */
.badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

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

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

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

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

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

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

/* Webcam container */
.webcam-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    background: rgba(255,255,255,0.95); /* Background sólido */
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* Sem sombras */
}

#video {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    background: #000;
    display: block;
}

#canvas {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

.webcam-controls {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.webcam-container:empty::before {
    content: "Inicializando webcam...";
    color: #6c757d;
    font-style: italic;
}

/* Estado de erro da webcam */
.webcam-error {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.webcam-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dc3545;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000, #D6A23B);
}

.login-card {
    background: rgba(255,255,255,0.95); /* Background sólido */
    border-radius: 8px;
    border: 1px solid #e9ecef; /* Borda visível e definida */
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    box-shadow: none; /* Sem sombras */
}

.login-header {
    background: #f8f9fa; /* Cor neutra mais leve */
    color: #495057; /* Cor de texto neutra */
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e9ecef; /* Borda sutil */
}

.login-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.login-body {
    padding: 2rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
        padding: 1rem;
        border-radius: 6px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .card-header {
        font-size: 1rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}

/* Print styles */
@media print {
    .navbar, .footer, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table {
        box-shadow: none;
    }
}

/* Utility classes */
.text-primary-custom {
    color: #D6A23B !important;
}

.bg-primary-custom {
    background-color: #D6A23B !important;
}

.border-primary-custom {
    border-color: #D6A23B !important;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #D6A23B !important;
    border-color: #D6A23B !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #B8860B !important;
    border-color: #B8860B !important;
    color: white !important;
}

/* Footer do Sistema */
.system-footer {
    background: linear-gradient(135deg, #000000, #D6A23B);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
    position: relative;
    bottom: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.system-footer .footer-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin: 0;
}

.system-footer .footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.system-footer .footer-link:hover {
    color: white;
    text-decoration: underline;
}

/* Garantir que o footer fique no final da página */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Responsividade do Footer */
@media (max-width: 768px) {
    .system-footer {
        padding: 0.75rem 0;
    }
    
    .system-footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 0.5rem;
    }
    
    .system-footer .col-md-6:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .system-footer {
        padding: 0.5rem 0;
    }
    
    .system-footer .footer-text {
        font-size: 0.8rem;
    }
}
