/* =====================================================================
   ADMIN LAYOUT - SIDEBAR NOTURNA EXECUTIVA E PAINEL MODERNO
===================================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Azul Noturno Profundo */
.admin-sidebar {
    width: 260px;
    background: var(--sidebar-gradient);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--secondary-gradient);
    color: #1A1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 0 16px rgba(255, 184, 0, 0.4);
}

.sidebar-title h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.2;
}

.sidebar-title p {
    font-size: 0.72rem;
    color: #94A3B8;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    color: #CBD5E1;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.15rem;
    width: 22px;
    color: #94A3B8;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.nav-item:hover i {
    color: var(--secondary);
}

.nav-item.active {
    background: rgba(255, 184, 0, 0.14);
    color: #FFFFFF;
    font-weight: 700;
    border-left: 4px solid var(--secondary);
    box-shadow: inset 0 0 15px rgba(255, 184, 0, 0.1);
}

.nav-item.active i {
    color: var(--secondary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #F87171;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Área de Conteúdo Principal */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-main);
}

.admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-toggle-sidebar {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-main);
    cursor: pointer;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-clock {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-main);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.admin-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 800;
}

.user-info strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.2;
}

.user-info span {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--secondary-dark);
}

.content-container {
    padding: 32px;
    flex: 1;
}

/* KPIs Temáticos com Marca d'Água */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* Variações de Cores nos Cards de Estatísticas */
.stat-card.stat-primary::before { background: var(--primary); }
.stat-card.stat-gold::before    { background: var(--secondary); }
.stat-card.stat-green::before   { background: var(--success); }
.stat-card.stat-purple::before  { background: var(--purple); }

.stat-card-watermark {
    position: absolute;
    right: -12px;
    bottom: -15px;
    font-size: 5rem;
    opacity: 0.05;
    pointer-events: none;
    transform: rotate(-15deg);
}

.stat-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Tabelas Administrativas */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.table-custom th {
    background: #F8FAFC;
    color: var(--text-muted);
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-custom td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.table-custom tr:last-child td {
    border-bottom: none;
}

.table-custom tr:hover td {
    background: #F8FAFC;
}

/* Responsividade Mobile */
@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .btn-toggle-sidebar { display: block; }
}

/* Impressão Oficial do Cartaz QR Code */
@media print {
    body * { visibility: hidden; }
    #modal-qrcode, #modal-qrcode * { visibility: visible; }
    #modal-qrcode {
        position: fixed;
        inset: 0;
        background: #FFFFFF !important;
        padding: 0;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    #modal-qrcode .modal-box {
        box-shadow: none !important;
        border: 4px solid var(--primary) !important;
        border-radius: 16px !important;
        max-width: 100% !important;
        width: 85% !important;
        padding: 40px !important;
    }
    #modal-qrcode .modal-close,
    #modal-qrcode .modal-footer {
        display: none !important;
    }
}