:root {
    --bg: #0f1115;
    --panel: #171a21;
    --panel-alt: #1e222b;
    --border: #2a2f3a;
    --text: #e6e9ef;
    --text-dim: #9aa3b2;
    --accent: #4f8cff;
    --green: #35c46f;
    --yellow: #e6b400;
    --red: #ef5350;
    --purple: #a78bfa;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ---------- Auth ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 340px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.subtitle { color: var(--text-dim); margin-bottom: 20px; font-size: 14px; }
.auth-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--text-dim); }
.auth-card input {
    width: 100%; padding: 10px 12px; background: var(--panel-alt);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px;
}

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: var(--panel); border-right: 1px solid var(--border);
    padding: 20px 0; flex-shrink: 0;
}
.sidebar .brand { padding: 0 20px 20px; font-weight: 700; font-size: 18px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.sidebar a {
    display: block; padding: 10px 20px; color: var(--text-dim); text-decoration: none; font-size: 14px;
}
.sidebar a:hover, .sidebar a.active { background: var(--panel-alt); color: var(--text); }
.main { flex: 1; padding: 24px 28px; max-width: 100%; overflow-x: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar h1 { font-size: 20px; margin: 0; }
.user-chip { font-size: 13px; color: var(--text-dim); }
.user-chip a { color: var(--red); text-decoration: none; margin-left: 10px; }

/* ---------- Cards / Grid ---------- */
.stat-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 18px; min-width: 140px; flex: 1;
}
.stat-card .num { font-size: 26px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input {
    background: var(--panel-alt); border: 1px solid var(--border); color: var(--text);
    padding: 8px 10px; border-radius: 8px; font-size: 13px;
}

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; background: var(--panel-alt); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--panel-alt); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-not_started { background: #3a3f4b; color: var(--text-dim); }
.badge-in_progress { background: rgba(79,140,255,0.15); color: var(--accent); }
.badge-paused { background: rgba(230,180,0,0.15); color: var(--yellow); }
.badge-review { background: rgba(167,139,250,0.15); color: var(--purple); }
.badge-completed { background: rgba(53,196,111,0.15); color: var(--green); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-live { background: var(--green); box-shadow: 0 0 0 3px rgba(53,196,111,0.2); }
.dot-idle { background: var(--yellow); }
.dot-off { background: var(--text-dim); }

.progress-bar { background: var(--panel-alt); border-radius: 6px; height: 8px; width: 100px; overflow: hidden; }
.progress-fill { background: var(--accent); height: 100%; }

.btn {
    display: inline-block; padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-green { background: var(--green); color: white; }
.btn-yellow { background: var(--yellow); color: #222; }
.btn-red { background: var(--red); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 20px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.alert-error { background: rgba(239,83,80,0.15); color: var(--red); }
.alert-success { background: rgba(53,196,111,0.15); color: var(--green); }

.task-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
}
.task-card .task-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.task-card .task-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.task-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.timer { font-family: 'SF Mono', Consolas, monospace; font-size: 13px; color: var(--accent); }

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 420px; max-width: 90vw; }
.modal h3 { margin-top: 0; }
.modal label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--text-dim); }
.modal input, .modal textarea, .modal select {
    width: 100%; padding: 8px 10px; background: var(--panel-alt); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 13px;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.chat-box { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: var(--panel-alt); }
.chat-msg { font-size: 13px; margin-bottom: 8px; }
.chat-msg .sender { font-weight: 600; color: var(--accent); }
.chat-msg .time { font-size: 11px; color: var(--text-dim); margin-left: 6px; }

.section-title { font-size: 15px; font-weight: 600; margin: 24px 0 12px; }
