/* Estilo para o Painel Administrativo */
:root {
    --primary-color: #0b2c48;
    --secondary-color: #1f4f5f;
    --accent-color: #d4ac38;
    --success-color: #1f6f6e;
    --warning-color: #d4ac38;
    --danger-color: #c44536;
    --info-color: #1f8a9e;
    --dark-color: #0b1c2d;
    --surface-color: #f4f6f8;
    --gradient-primary: linear-gradient(135deg, #0b2c48 0%, #0a223a 100%);
    --gradient-secondary: linear-gradient(135deg, #1f4f5f 0%, #0b2c48 100%);
}

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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--gradient-primary);
    color: white;
    transition: all 0.3s ease-in-out;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header {
    padding: 15px 10px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header > * {
    display: none !important;
}

.sidebar.collapsed .sidebar-header a {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header a > div {
    display: none !important;
}

.sidebar.collapsed .sidebar-header img {
    width: 40px;
    height: 40px;
    display: block !important;
    object-fit: contain;
}

.sidebar.collapsed .nav-link {
    position: relative;
    text-align: center;
    padding: 20px 0;
    height: 60px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar.collapsed .nav-link span {
    display: none !important;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
    text-align: center;
    font-size: 1.4rem;
    display: block;
}

.sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 10px;
    z-index: 1000;
}

.sidebar.collapsed .sidebar-footer {
    text-align: center;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar.collapsed .sidebar-footer .btn {
    padding: 12px 0;
    width: 100%;
    max-width: 60px;
    height: 50px;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-footer .btn span,
.sidebar.collapsed .sidebar-footer .btn i + * {
    display: none !important;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-header small {
    opacity: 0.8;
    font-size: 0.85rem;
}

.sidebar .components {
    padding: 20px 0;
}

.sidebar .components li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    display: block;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    background: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar .nav-link span {
    transition: all 0.3s ease;
    display: inline-block;
}

/* Tooltip para menu colapsado */
.sidebar.collapsed .nav-link {
    position: relative;
    text-align: center;
    padding: 20px 10px;
}

.sidebar.collapsed .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.875rem;
    z-index: 1000;
    margin-left: 10px;
    opacity: 0;
    animation: fadeInTooltip 0.2s ease forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
}

/* Content */
.content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    transition: all 0.3s ease-in-out;
    background-color: #f8f9fa;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

.content.expanded {
    margin-left: 80px;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 2px solid var(--primary-color);
    padding: 15px;
    background-color: white;
}

.main-content {
    padding: 30px;
    min-height: calc(100vh - 80px);
}

/* Content Sections */
.content-section {
    display: none !important;
}

.content-section.active {
    display: block !important;
    animation: fadeIn 0.3s ease-in;
}

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

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-card.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.stat-card.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.stat-card.info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.stat-card i {
    font-size: 3rem;
    opacity: 0.7;
    margin-bottom: 10px;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Badges */
.badge {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 20px;
}

.badge.status-ativo {
    background-color: #28a745;
}

.badge.status-inativo {
    background-color: #6c757d;
}

.badge.status-pendente {
    background-color: #ffc107;
    color: #000;
}

.badge.status-aprovado {
    background-color: #28a745;
}

.badge.status-rejeitado {
    background-color: #dc3545;
}

.badge.status-confirmada {
    background-color: #28a745;
}

.badge.status-cancelada {
    background-color: #dc3545;
}

.badge.status-finalizada {
    background-color: #6f42c1;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary {
    background: var(--accent-color);
    border: none;
    color: var(--dark-color);
    font-weight: 600;
}

.btn-primary:hover {
    background: #c49a2f;
    color: var(--dark-color);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border: none;
}

.btn-info {
    background: var(--primary-color);
    border: none;
}

.btn-info:hover {
    background: #051e33;
    border-color: #051e33;
}

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

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 12px 15px;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* Modals */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 20px;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #dee2e6;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
}

.loading i {
    font-size: 2rem;
    color: #667eea;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* Indicador visual para botão de menu ativo */
@media (max-width: 992px) {
    #sidebarCollapse.active {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        border-color: #28a745;
        transform: scale(1.05);
    }
}

/* Responsive */
@media (min-width: 993px) {
    /* Garantir comportamento desktop */
    .sidebar.show {
        transform: none;
    }
    
    .mobile-overlay {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        z-index: 1001;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed.show {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .content.expanded {
        margin-left: 0 !important;
    }
    
    .navbar .btn {
        z-index: 1002;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Esconder textos no menu colapsado apenas em mobile */
    .sidebar.collapsed .sidebar-header h4,
    .sidebar.collapsed .sidebar-header small,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .sidebar-footer .btn span {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Desabilitar tooltips em mobile */
    .sidebar .nav-link:hover::after {
        display: none;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .row.g-3 > * {
        margin-bottom: 1rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }
    
    .d-flex.justify-content-end {
        justify-content: center !important;
    }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

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

.content-section.active {
    animation: fadeIn 0.3s ease;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.online {
    background-color: #28a745;
}

.status-indicator.offline {
    background-color: #dc3545;
}

.status-indicator.pending {
    background-color: #ffc107;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

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

.empty-state h5 {
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 0;
}

/* Estilos específicos para seções */
.filter-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.results-counter {
    border-left: 4px solid #0d6efd;
}

/* Melhorias responsivas */
@media (max-width: 768px) {
    /* Botão Novo em telas pequenas */
    .d-flex.justify-content-end {
        justify-content: center !important;
    }
    
    .col-md-3 {
        margin-bottom: 1rem;
    }
}