/* ============================================
   ProShot AI - Admin Panel Styles
   ============================================ */

.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--ps-bg);
}

.admin-body::before {
    display: none;
}

/* === SIDEBAR === */
.sidebar {
    width: 260px;
    background: var(--ps-bg-elevated);
    border-right: 1px solid var(--ps-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--ps-transition-base);
}

.sidebar-header {
    padding: var(--ps-space-6);
    border-bottom: 1px solid var(--ps-border);
}

.sidebar-nav {
    flex: 1;
    padding: var(--ps-space-4);
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--ps-space-3);
    padding: var(--ps-space-3) var(--ps-space-4);
    border-radius: var(--ps-radius-md);
    color: var(--ps-text-muted);
    font-weight: 500;
    font-size: var(--ps-text-sm);
    margin-bottom: var(--ps-space-1);
    transition: all var(--ps-transition-fast);
}

.sidebar-link:hover {
    background: var(--ps-surface-hover);
    color: var(--ps-text);
}

.sidebar-link.active {
    background: var(--ps-gradient-subtle);
    color: var(--ps-primary-light);
    border: 1px solid rgba(124,58,237,0.3);
}

.sidebar-link.active svg {
    color: var(--ps-primary);
}

.sidebar-badge {
    margin-left: auto;
    background: var(--ps-accent);
    color: white;
    font-size: var(--ps-text-xs);
    font-weight: 700;
    padding: 1px 8px;
    border-radius: var(--ps-radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--ps-space-4);
    border-top: 1px solid var(--ps-border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: var(--ps-space-3);
    padding: var(--ps-space-3);
    border-radius: var(--ps-radius-md);
    background: var(--ps-surface);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ps-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    font-size: var(--ps-text-sm);
}

.user-role {
    font-size: var(--ps-text-xs);
    color: var(--ps-text-muted);
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.topbar {
    height: var(--ps-navbar-height);
    background: rgba(10,10,15,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ps-border);
    display: flex;
    align-items: center;
    padding: 0 var(--ps-space-8);
    gap: var(--ps-space-4);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    color: var(--ps-text-secondary);
    padding: var(--ps-space-2);
}

.page-title {
    font-size: var(--ps-text-xl);
    font-weight: 700;
    flex: 1;
}

.topbar-actions {
    display: flex;
    gap: var(--ps-space-2);
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--ps-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ps-text-muted);
    transition: all var(--ps-transition-fast);
}

.icon-btn:hover {
    background: var(--ps-surface-hover);
    color: var(--ps-text);
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--ps-accent);
    border-radius: 50%;
    border: 2px solid var(--ps-bg-elevated);
}

.page-content {
    padding: var(--ps-space-8);
    flex: 1;
}

/* === STAT CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ps-space-5);
    margin-bottom: var(--ps-space-8);
}

.stat-card {
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-lg);
    padding: var(--ps-space-6);
    transition: all var(--ps-transition-base);
}

.stat-card:hover {
    border-color: var(--ps-primary);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--ps-space-4);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ps-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-purple { background: rgba(124,58,237,0.15); color: var(--ps-primary-light); }
.stat-icon-pink { background: rgba(236,72,153,0.15); color: var(--ps-accent); }
.stat-icon-green { background: rgba(16,185,129,0.15); color: var(--ps-success); }
.stat-icon-blue { background: rgba(59,130,246,0.15); color: var(--ps-info); }

.stat-value {
    font-size: var(--ps-text-4xl);
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--ps-space-2);
}

.stat-label {
    font-size: var(--ps-text-sm);
    color: var(--ps-text-muted);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--ps-text-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--ps-radius-full);
}

.stat-trend.up {
    color: var(--ps-success);
    background: var(--ps-success-bg);
}

.stat-trend.down {
    color: var(--ps-danger);
    background: var(--ps-danger-bg);
}

/* === PANELS === */
.panel {
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-lg);
    padding: var(--ps-space-6);
    margin-bottom: var(--ps-space-6);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--ps-space-5);
}

.panel-title {
    font-size: var(--ps-text-lg);
    font-weight: 700;
}

.panel-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--ps-space-6);
}

/* === TABLE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: var(--ps-space-3) var(--ps-space-4);
    font-size: var(--ps-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ps-text-muted);
    border-bottom: 1px solid var(--ps-border);
}

.data-table td {
    padding: var(--ps-space-4);
    border-bottom: 1px solid var(--ps-border);
    font-size: var(--ps-text-sm);
}

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

.data-table tr:hover {
    background: var(--ps-surface-hover);
}

.table-avatar {
    display: flex;
    align-items: center;
    gap: var(--ps-space-3);
}

.table-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ps-gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--ps-primary-light);
    flex-shrink: 0;
}

/* === CHART PLACEHOLDER === */
.chart-container {
    height: 280px;
    display: flex;
    align-items: flex-end;
    gap: var(--ps-space-3);
    padding: var(--ps-space-4) 0;
}

.chart-bar {
    flex: 1;
    background: var(--ps-gradient);
    border-radius: var(--ps-radius-sm) var(--ps-radius-sm) 0 0;
    min-height: 20px;
    position: relative;
    transition: opacity var(--ps-transition-fast);
    opacity: 0.8;
}

.chart-bar:hover {
    opacity: 1;
}

.chart-bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--ps-text-xs);
    color: var(--ps-text-muted);
    white-space: nowrap;
}

.chart-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--ps-text-xs);
    font-weight: 600;
    color: var(--ps-text-secondary);
}

/* === MODEL GRID === */
.modelos-grid-admin {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ps-space-4);
}

.modelo-tile {
    background: var(--ps-bg-elevated);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius-md);
    padding: var(--ps-space-4);
    text-align: center;
    transition: all var(--ps-transition-fast);
}

.modelo-tile:hover {
    border-color: var(--ps-primary);
}

.modelo-tile-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--ps-radius-md);
    background: var(--ps-gradient-subtle);
    margin-bottom: var(--ps-space-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modelo-tile-name {
    font-size: var(--ps-text-sm);
    font-weight: 600;
    margin-bottom: var(--ps-space-1);
}

.modelo-tile-cat {
    font-size: var(--ps-text-xs);
    color: var(--ps-text-muted);
    text-transform: uppercase;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: var(--ps-border);
    border-radius: var(--ps-radius-full);
    position: relative;
    cursor: pointer;
    transition: background var(--ps-transition-fast);
}

.toggle-switch.on {
    background: var(--ps-success);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform var(--ps-transition-fast);
}

.toggle-switch.on::after {
    transform: translateX(18px);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel-grid-2 {
        grid-template-columns: 1fr;
    }

    .modelos-grid-admin {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modelos-grid-admin {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-content {
        padding: var(--ps-space-4);
    }

    .data-table {
        font-size: var(--ps-text-xs);
    }
}
