/* =====================================================
   OneTV Panel - Refined Neon Theme v4.0
   Futuristic with cleaner sizes and proportions
   ===================================================== */

:root {
    /* Neon Colors */
    --neon-blue: #00d4ff;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
    --neon-green: #10b981;
    
    /* Backgrounds */
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(20, 20, 45, 0.8);
    --bg-card-hover: rgba(30, 30, 60, 0.9);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --text-muted: #606080;
    
    /* Borders & Effects */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 212, 255, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.1);
    
    /* Layout - Cleaner Sizes */
    --sidebar-width: 220px;
    --header-height: 56px;
    --radius: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition: 0.2s ease;
}

/* ==================== BASE ==================== */

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

/* ==================== LAYOUT ==================== */

.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

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

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #0d0d20 0%, #080815 100%);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.sidebar-brand-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
    margin: 1px 0;
}

.nav-link i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.15), rgba(168, 85, 247, 0.1));
    color: var(--neon-blue);
    border-left: 2px solid var(--neon-blue);
}

.nav-link.logout {
    color: #f87171;
}

.nav-link.logout:hover {
    background: rgba(248, 113, 113, 0.1);
}

.nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 0;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Header */
.header {
    height: var(--header-height);
    background: rgba(15, 15, 30, 0.8);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-badge {
    font-size: 10px;
    color: var(--text-muted);
}

/* Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ==================== CARDS ==================== */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--neon-blue);
    font-size: 12px;
}

.card-body {
    padding: 16px;
}

/* ==================== METRICS ==================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 14px;
    transition: all var(--transition);
}

.metric-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-bottom: 8px;
}

.metric-icon.blue { background: rgba(0, 212, 255, 0.15); color: var(--neon-blue); }
.metric-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--neon-purple); }
.metric-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--neon-green); }
.metric-icon.pink { background: rgba(236, 72, 153, 0.15); color: var(--neon-pink); }

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.metric-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 10px;
}

.metric-trend.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--neon-green);
}

/* ==================== STATS ==================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 14px;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-icon {
    width: 28px;
    height: 28px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-blue);
    font-size: 11px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

/* ==================== WELCOME ==================== */

.welcome-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.welcome-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.welcome-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
}

.welcome-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--neon-blue);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
}

.welcome-action:hover {
    color: var(--neon-purple);
}

.welcome-image {
    font-size: 32px;
    opacity: 0.4;
    color: var(--neon-blue);
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--border-glow);
    color: var(--text-primary);
}

.btn-success { background: var(--neon-green); color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-warning { background: #f59e0b; color: white; }

.btn-sm {
    padding: 5px 10px;
    font-size: 10px;
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ==================== ALERTS ==================== */

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==================== TABLES ==================== */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
}

td {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ==================== PROFILE ==================== */

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.profile-avatar-large {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.profile-info h2 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 11px;
}

.profile-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0, 212, 255, 0.15);
    color: var(--neon-blue);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 4px;
}

.profile-credits {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 11px;
}

/* ==================== MOBILE ==================== */

.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

.mobile-menu-overlay.active {
    display: block;
}

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

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .main-content {
        width: 100%;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .welcome-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .content {
        padding: 12px;
    }
    .header {
        padding: 0 12px;
    }
}

/* ==================== UTILITIES ==================== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--neon-green); }
.text-danger { color: #f87171; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; }

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

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