/* Dashboard shared styles — sidebar, topbar, cards, layout */

/* Top progress bar — shows during API loading */
.progress-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9999; pointer-events: none; }
.progress-bar-inner { height: 100%; background: var(--accent); width: 0; transition: width 0.3s ease; box-shadow: 0 0 8px rgba(204,255,0,0.4); }
.progress-bar.loading .progress-bar-inner { width: 70%; transition: width 2s cubic-bezier(0.1, 0.05, 0.1, 1); }
.progress-bar.done .progress-bar-inner { width: 100%; transition: width 0.15s ease; }
.progress-bar.hide { opacity: 0; transition: opacity 0.3s ease 0.2s; }

/* Skeleton shimmer for loading states */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%); background-size: 800px 100%; animation: shimmer 1.5s infinite ease-in-out; border-radius: 2px; }
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-text-lg { height: 28px; width: 80px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; width: 60%; }
.skeleton-card { padding: 28px; }
.skeleton-chart { height: 180px; }
.skeleton-row { height: 42px; border-bottom: 1px solid rgba(255,255,255,0.04); }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --accent: #CCFF00;
    --sidebar-bg: #0d0d0d;
    --sidebar-border: rgba(255,255,255,0.06);
    --main-bg: #111;
    --card-bg: #1a1a1a;
    --border: rgba(255,255,255,0.08);
    --text: #fff;
    --text-dim: #888;
    --text-muted: #555;
}
html, body { height: 100%; overflow: hidden; }
body { font-family: 'Space Grotesk', sans-serif; background: var(--main-bg); color: var(--text); display: flex; }

/* Sidebar */
.sidebar { width: 220px; flex-shrink: 0; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; height: 100vh; position: fixed; left: 0; top: 0; }
.sidebar-logo { padding: 22px 20px 18px; border-bottom: 1px solid var(--sidebar-border); display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-logo .logo-sq { width: 26px; height: 26px; background: var(--accent); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 0.82rem; font-weight: 500; color: var(--text-dim); text-decoration: none; transition: all 0.15s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.sidebar-nav-item:hover { color: #fff; background: rgba(255,255,255,0.04); }
.sidebar-nav-item.active { color: #fff; background: rgba(204,255,0,0.08); border-left: 2px solid var(--accent); padding-left: 18px; }
.sidebar-nav-item.active svg { color: var(--accent); }
.sidebar-nav-item svg { flex-shrink: 0; }
.sidebar-section-label { padding: 16px 20px 6px; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--sidebar-border); }
.sidebar-user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sidebar-user-dot { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: #fff; flex-shrink: 0; border-radius: 8px; background: linear-gradient(135deg, #1a1a2e, #16213e); }

/* Main */
.main { margin-left: 220px; flex: 1; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(17,17,17,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 48px; height: 52px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-dim); }
.topbar-breadcrumb a { color: var(--text-dim); text-decoration: none; }
.topbar-breadcrumb a:hover { color: #fff; }
.topbar-breadcrumb .sep { color: var(--text-muted); }
.topbar-breadcrumb .current { color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.plan-badge { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(204,255,0,0.3); background: rgba(204,255,0,0.06); padding: 4px 10px; }
.content { padding: 40px 48px; flex: 1; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--border); margin-bottom: 20px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 0.82rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.card-sub { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }
.card-body { padding: 24px; }

/* Section */
.section-title { font-size: 1.4rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; margin-bottom: 4px; }
.section-title::after { content: ''; display: block; width: 24px; height: 2px; background: var(--accent); margin-top: 6px; }
.section-sub { font-size: 0.82rem; color: var(--text-dim); }

/* Settings rows */
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 0.82rem; font-weight: 600; color: #fff; }
.settings-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.settings-input { padding: 8px 12px; background: #000; border: 1px solid var(--border); color: #fff; font-family: 'DM Mono', monospace; font-size: 0.82rem; outline: none; width: 280px; }
.settings-input:focus { border-color: rgba(204,255,0,0.3); }
.settings-btn { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 16px; cursor: pointer; transition: all 0.15s; border: none; }
.settings-btn-accent { background: var(--accent); color: #000; }
.settings-btn-accent:hover { background: #d9ff1a; }
.settings-btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.settings-btn-ghost:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.settings-btn-danger { background: transparent; border: 1px solid rgba(255,85,85,0.3); color: #ff5555; }
.settings-btn-danger:hover { background: rgba(255,85,85,0.08); }

/* Sessions */
.session-card { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.session-card:last-child { border-bottom: none; }
.session-icon { width: 36px; height: 36px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.session-device { font-size: 0.82rem; font-weight: 600; color: #fff; }
.session-meta { font-size: 0.68rem; color: #555; margin-top: 2px; }
.session-badge { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; color: var(--accent); border: 1px solid rgba(204,255,0,0.3); background: rgba(204,255,0,0.06); margin-left: 8px; }

/* Toast */
.toast { position: fixed; bottom: 32px; right: 32px; z-index: 1100; background: #1a1a1a; border: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; gap: 10px; transform: translateY(100px); opacity: 0; transition: all 0.3s ease; max-width: 360px; }
.toast.visible { transform: translateY(0); opacity: 1; }

/* Mobile */
@media (max-width: 900px) { .sidebar { display: none; } .main { margin-left: 0; } .content { padding: 20px 16px; } .topbar { padding: 0 16px; } }
@media (max-width: 600px) {
    .settings-row { padding: 16px 18px; flex-wrap: wrap; gap: 10px; }
    .settings-input { width: 100%; }
    .settings-btn, .key-btn, .run-btn, button { min-height: 40px; }
    .card-body { padding: 18px; }
    .card-header { padding: 14px 18px; }
}
