
[data-cloak] { display: none; }

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

/* Theme */
:root {
    --bg-primary: #f0f2f5; --bg-secondary: #ffffff; --bg-tertiary: #f8f9fa;
    --text-primary: #1a1a2e; --text-secondary: #6c757d; --text-muted: #adb5bd;
    --border-color: #e9ecef;
    --accent-primary: #4361ee; --accent-success: #10b981; --accent-warning: #f59e0b; --accent-danger: #ef4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}
.dark-theme {
    --bg-primary: #0f0f23; --bg-secondary: #1a1a2e; --bg-tertiary: #16213e;
    --text-primary: #e9ecef; --text-secondary: #adb5bd; --text-muted: #6c757d;
    --border-color: #2d3748;
    --accent-primary: #6366f1; --accent-success: #34d399; --accent-warning: #fbbf24; --accent-danger: #f87171;
    --shadow: 0 1px 3px rgba(0,0,0,0.3); --shadow-lg: 0 4px 6px rgba(0,0,0,0.4);
}

/* Layout */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; transition: background 0.3s, color 0.3s; padding-top: 68px; }
.dashboard { max-width: 1400px; margin: 0 auto; padding: 20px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.dashboard-title { display: flex; align-items: center; gap: 12px; }
.dashboard-title h1 { font-size: 24px; font-weight: 600; }
.dashboard-title .subtitle { color: var(--text-secondary); font-size: 14px; }
.header-controls { display: flex; gap: 12px; align-items: center; }
.last-updated { font-size: 12px; color: var(--text-muted); }
.status-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; animation: pulse 2s infinite; }
.status-indicator.live { background: var(--accent-success); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Buttons */
.btn { padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

/* Grid rows */
.dashboard-row { display: grid; gap: 20px; margin-bottom: 20px; }
.dashboard-row:last-child { margin-bottom: 0; }
.dashboard-row-6 { grid-template-columns: repeat(6, 1fr); }
.dashboard-row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1200px) { .dashboard-row-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .dashboard-row-6, .dashboard-row-3 { grid-template-columns: 1fr; } }

/* Widget base */
.widget { background: var(--bg-secondary); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; transition: box-shadow 0.2s; }
.widget:hover { box-shadow: var(--shadow-lg); }
.widget-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.widget-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.widget-content { padding: 20px; }

/* KPI */
.widget.kpi .widget-content, .widget.sparkline .widget-content { min-height: 100px; }
.kpi-value { font-size: 32px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.kpi-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.kpi-trend { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.kpi-trend.up { color: var(--accent-success); }
.kpi-trend.down { color: var(--accent-danger); }
.kpi-trend.neutral { color: var(--text-muted); }

/* Sparkline */
.sparkline-container { display: flex; flex-direction: column; gap: 8px; }
.sparkline-info { order: 2; }
.sparkline-value { font-size: 24px; font-weight: 700; }
.sparkline-change { font-size: 12px; margin-top: 4px; }
.sparkline-svg { order: 1; width: 100%; height: 50px; }
.sparkline-svg path { fill: none; stroke: var(--accent-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline-svg .area { fill: var(--accent-primary); opacity: 0.1; stroke: none; }

/* Chart */
.chart-container { height: 250px; position: relative; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border-color); background: var(--bg-tertiary); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border-color); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-tertiary); }
.status-badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.status-badge.success { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.status-badge.warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.status-badge.danger { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); }

/* Server metrics */
.server-metrics { display: flex; flex-direction: column; gap: 16px; }
.metric-row { display: flex; justify-content: space-between; align-items: center; }
.metric-label { font-size: 13px; color: var(--text-secondary); }
.metric-value { font-size: 14px; font-weight: 600; }
.progress-bar { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress-fill.normal { background: var(--accent-success); }
.progress-fill.warning { background: var(--accent-warning); }
.progress-fill.danger { background: var(--accent-danger); }

/* Activity feed */
.activity-list { display: flex; flex-direction: column; gap: 12px; max-height: 280px; overflow-y: auto; }
.activity-item { display: flex; gap: 12px; padding: 8px; border-radius: 6px; transition: background 0.2s; }
.activity-item:hover { background: var(--bg-tertiary); }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-icon.sale { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.activity-icon.user { background: rgba(67, 97, 238, 0.1); color: var(--accent-primary); }
.activity-icon.alert { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-primary); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Toolbar */
.demo-toolbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; background: #1a1a2e; font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; border-bottom: 1px solid rgba(255,255,255,0.1); }
.demo-toolbar a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #5fa6a6; font-size: 1.25rem; }
.demo-toolbar .logo { height: 40px; }
.demo-toolbar .brand-wf { font-weight: 520; }
.demo-toolbar .brand-js { font-weight: 700; }
.demo-toolbar .demo-info { font-size: 12px; color: rgba(255,255,255,0.7); text-align: right; }
.demo-toolbar .demo-info strong { color: #fff; }
