/* ==================== ADMIN PANEL STYLES - FULLSCREEN LAYOUT ==================== */

/* ---- Reset: remover header/footer da página admin ---- */
.page-admin .header,
.page-admin .footer {
    display: none !important;
}

.page-admin {
    overflow-x: hidden;
}

.admin-section {
    background: var(--bg-darker);
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TOP NAVIGATION BAR (Tabs horizontais)
   ============================================ */
.admin-topbar {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 20px;
    height: 56px;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 24px;
    margin-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.admin-topbar__brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.admin-topbar__brand-icon i,
.admin-topbar__brand-icon svg {
    width: 18px;
    height: 18px;
}

.admin-topbar__brand-text {
    font-weight: 700;
    font-size: 1rem;
    color: white;
    letter-spacing: -0.3px;
}

.admin-topbar__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-topbar__nav::-webkit-scrollbar {
    display: none;
}

.admin-topbar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
}

.admin-topbar-link i,
.admin-topbar-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-topbar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.admin-topbar-link.active {
    background: rgba(255, 51, 102, 0.12);
    color: var(--accent);
    font-weight: 600;
}

.admin-topbar-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.admin-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 16px;
}

.admin-topbar-exit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: inherit;
}

.admin-topbar-exit:hover {
    background: rgba(244, 63, 94, 0.2);
}

.admin-topbar-exit i,
.admin-topbar-exit svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   BODY LAYOUT (Sidebar contextual + Conteúdo)
   ============================================ */
.admin-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Sidebar contextual esquerda */
.admin-context-sidebar {
    width: 60px;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 12px;
    flex-shrink: 0;
}

.admin-ctx-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.admin-ctx-btn i,
.admin-ctx-btn svg {
    width: 18px;
    height: 18px;
}

.admin-ctx-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.admin-ctx-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.admin-ctx-btn[title]::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.admin-ctx-btn:hover[title]::after {
    opacity: 1;
}

.admin-ctx-spacer {
    flex: 1;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.admin-main {
    flex: 1;
    padding: 30px 35px;
    overflow-y: auto;
    min-width: 0;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
    animation: adminFadeIn 0.3s ease-out;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-section-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.admin-section-header p {
    color: var(--text-muted);
    margin: 5px 0 0;
}

/* Stats Admin */
.stats-grid--admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.stats-grid--admin .stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal Admin */
.modal--admin {
    max-width: 600px;
    padding: 40px;
}

.admin-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-family: inherit;
}

.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ============================================
   TABLES ADMIN - Alinhamento correto
   ============================================ */
.admin-main .admin-table-wrapper {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    width: 100%;
}

.admin-main .modern-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.admin-main .modern-table th,
.admin-main .modern-table td {
    text-align: left;
    padding: 14px 20px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-main .modern-table thead th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.admin-main .modern-table tbody tr {
    transition: background 0.2s ease;
}

.admin-main .modern-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.admin-main .modern-table tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: transparent;
    border-radius: 0;
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 1024px) {
    .admin-topbar {
        padding: 0 12px;
        height: 50px;
    }

    .admin-topbar__brand {
        display: none;
    }

    .admin-topbar__nav {
        gap: 0;
    }

    .admin-topbar-link {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    .admin-topbar-link span {
        display: none;
    }

    .admin-context-sidebar {
        width: 48px;
    }

    .admin-ctx-btn {
        width: 34px;
        height: 34px;
    }

    .admin-main {
        padding: 20px 16px;
    }
}

@media (max-width: 768px) {
    .admin-context-sidebar {
        display: none;
    }

    .admin-topbar-exit span {
        display: none;
    }

    .admin-main {
        padding: 16px 12px;
    }

    .admin-section-header h2 {
        font-size: 1.4rem;
    }
}

/* ============================================
   BADGES DE NOTIFICAÇÃO NAS TABS
   ============================================ */
.admin-tab-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 6px;
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.admin-tab-badge--warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.admin-tab-badge--danger {
    background: rgba(244, 63, 94, 0.2);
    color: #f43f5e;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ============================================
   BARRA DE AÇÕES EM LOTE
   ============================================ */
.admin-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CARDS DE SISTEMA (Tab Sistema)
   ============================================ */
.admin-system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.admin-system-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: border-color 0.2s, background 0.2s;
}

.admin-system-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.admin-system-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.admin-system-card__icon svg {
    width: 24px;
    height: 24px;
}

.admin-system-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-system-card__info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-system-card__info strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   LOG DETAIL CHIPS
   ============================================ */
.log-detail-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    margin: 2px 4px 2px 0;
}

/* Checkbox styling in tables */
.modern-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #a855f7;
}

/* ============================================
   RESPONSIVE: System Grid
   ============================================ */
@media (max-width: 768px) {
    .admin-system-grid {
        grid-template-columns: 1fr;
    }

    .admin-bulk-bar {
        flex-wrap: wrap;
    }
}