/* Analytics Pro - SaaS Dashboard CSS */

/* CSS Custom Properties */
:root {
    /* Light Mode Variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #f8fafc;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --primary-blue: #3b82f6;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --info-cyan: #06b6d4;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-in-out;
}

/* Dark Mode Variables */
.dark-mode {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #1e293b;

    --border-color: #334155;
    --border-light: #475569;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.logo-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-center i {
    font-size: 24px;
    color: var(--primary-blue);
}

.loading-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Dashboard Layout */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    color: var(--primary-blue);
    font-size: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-item {
    position: relative;
}

.nav-item button {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-menu {
    position: relative;
}

.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

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

.user-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--success-green);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-base);
    min-width: 240px;
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.dropdown-menu {
    padding: 8px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item i {
    width: 16px;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

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

.date-range-selector {
    width: 100%;
}

.date-range-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-list {
    list-style: none;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 14px;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active .nav-link {
    background: var(--primary-blue);
    color: white;
}

.nav-link i {
    width: 16px;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* API Monitor */
.api-monitor {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.monitor-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.monitor-status.online {
    background: var(--success-green);
}

.monitor-status.online::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--success-green);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

.monitor-status.warning {
    background: var(--warning-orange);
}

.monitor-status.warning::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--warning-orange);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.1; }
    100% { transform: scale(1); opacity: 0.3; }
}

.api-calls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.api-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.api-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.api-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.api-value.success {
    color: var(--success-green);
}

.api-log {
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
}

.log-header {
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.log-entries {
    max-height: 120px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    font-size: 10px;
    border-bottom: 1px solid var(--border-light);
    font-family: var(--font-mono);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    background: rgba(16, 185, 129, 0.05);
}

.log-entry.warning {
    background: rgba(245, 158, 11, 0.05);
}

.log-time {
    color: var(--text-muted);
    min-width: 50px;
}

.log-method {
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.log-method.GET {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-blue);
}

.log-method.POST {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-green);
}

.log-endpoint {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-status {
    color: var(--text-muted);
    min-width: 25px;
}

.log-duration {
    color: var(--text-secondary);
    min-width: 35px;
    text-align: right;
}

/* Server Monitor */
.server-monitor {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.server-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.metric-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.metric-fill.cpu {
    background: var(--primary-blue);
}

.metric-fill.memory {
    background: var(--warning-orange);
}

.metric-fill.disk {
    background: var(--success-green);
}

.metric-fill.network {
    background: var(--info-cyan);
}

.metric-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

/* Page Content Styles */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.page-content.hidden {
    display: none;
}

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

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    gap: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

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

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.analytics-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Revenue Summary */
.revenue-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    flex: 1;
}

.summary-card h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.summary-change {
    font-size: 13px;
    font-weight: 600;
}

.summary-change.positive {
    color: var(--success-green);
}

.summary-change.negative {
    color: var(--danger-red);
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

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

.report-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary-blue);
    font-size: 20px;
}

.report-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.report-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.report-actions {
    display: flex;
    gap: 12px;
}

/* Settings Sections */
.settings-sections {
    max-width: 800px;
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-input {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    min-width: 200px;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .sidebar-footer {
        padding: 12px;
    }

    .api-calls {
        flex-direction: column;
        gap: 8px;
    }

    .api-stat {
        flex-direction: row;
        justify-content: space-between;
    }

    .metric-item {
        flex-wrap: wrap;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .revenue-summary {
        flex-direction: column;
    }

    .report-actions {
        flex-direction: column;
    }
}

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

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

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

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

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

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.kpi-icon.revenue { background: rgba(16, 185, 129, 0.1); color: var(--success-green); }
.kpi-icon.users { background: rgba(59, 130, 246, 0.1); color: var(--primary-blue); }
.kpi-icon.conversion { background: rgba(245, 158, 11, 0.1); color: var(--warning-orange); }
.kpi-icon.session { background: rgba(6, 182, 212, 0.1); color: var(--info-cyan); }

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.kpi-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

.kpi-change.positive {
    color: var(--success-green);
}

.kpi-change.negative {
    color: var(--danger-red);
}

.change-period {
    color: var(--text-muted);
    margin-left: 4px;
}

.kpi-sparkline {
    height: 40px;
    margin-top: 8px;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-container.large {
    min-height: 400px;
}

.chart-container.small {
    min-height: 320px;
}

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

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-controls {
    display: flex;
    gap: 4px;
}

.chart-control-btn {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.chart-control-btn:hover,
.chart-control-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.chart-settings-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.chart-settings-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chart-content {
    flex: 1;
    min-height: 250px;
}

.chart-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-label {
    white-space: nowrap;
}

/* Data Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

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

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-filter {
    position: relative;
    width: 200px;
}

.search-filter i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-filter input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.search-filter input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--bg-primary);
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary-blue);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.table-wrapper {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

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

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background: var(--bg-tertiary);
}

.th-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.th-content i {
    font-size: 10px;
    color: var(--text-muted);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

.status-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.plan-badge {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.plan-badge.premium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-orange);
}

.action-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.action-btn.primary {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.action-btn.primary:hover {
    background: #2563eb;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 0;
    border-top: 1px solid var(--border-light);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.page-dots {
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.table-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Bottom Row */
.bottom-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Activity Feed */
.activity-feed {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

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

.feed-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.feed-refresh-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-refresh-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.feed-container {
    max-height: 300px;
    overflow-y: auto;
}

.feed-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.feed-icon.user { background: rgba(59, 130, 246, 0.1); color: var(--primary-blue); }
.feed-icon.revenue { background: rgba(16, 185, 129, 0.1); color: var(--success-green); }
.feed-icon.system { background: rgba(245, 158, 11, 0.1); color: var(--warning-orange); }
.feed-icon.alert { background: rgba(239, 68, 68, 0.1); color: var(--danger-red); }

.feed-content {
    flex: 1;
}

.feed-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 500;
}

.feed-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.feed-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Settings Panel */
.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.settings-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-blue);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition-base);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--success-green); color: white; }
.toast.error .toast-icon { background: var(--danger-red); color: white; }
.toast.info .toast-icon { background: var(--primary-blue); color: white; }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-base);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.user-details {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

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

.user-info-large {
    flex: 1;
}

.user-info-large h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-info-large p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.user-stats {
    display: flex;
    gap: 24px;
}

.user-stat {
    text-align: center;
}

.user-stat .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.user-stat .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .bottom-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 12px 16px;
    }

    .nav-left {
        gap: 16px;
    }

    .search-box {
        width: 200px;
    }

    .dashboard-content {
        padding: 16px;
    }

    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .table-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .table-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .search-filter {
        flex: 1;
        min-width: 200px;
    }

    .user-details {
        flex-direction: column;
        text-align: center;
    }

    .user-stats {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-right {
        gap: 8px;
    }

    .nav-item button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .logo {
        font-size: 16px;
    }

    .search-box {
        display: none;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

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

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