:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #1c2128;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --blue: #58a6ff;
  --sidebar-w: 220px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif; background:var(--bg-primary); color:var(--text-primary); min-height:100vh; }
a { color:var(--accent); text-decoration:none; }

/* Login */
.login-container { display:flex; align-items:center; justify-content:center; min-height:100vh; background:var(--bg-primary); }
.login-box { background:var(--bg-secondary); border:1px solid var(--border); border-radius:12px; padding:48px 40px; width:380px; text-align:center; }
.login-box h1 { font-size:28px; margin-bottom:8px; }
.login-sub { color:var(--text-secondary); margin-bottom:32px; font-size:14px; }
.login-box input { width:100%; padding:12px 16px; margin-bottom:12px; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; color:var(--text-primary); font-size:14px; outline:none; }
.login-box input:focus { border-color:var(--accent); }
.login-box button { width:100%; padding:12px; background:var(--accent); color:#fff; border:none; border-radius:8px; font-size:15px; cursor:pointer; font-weight:600; margin-top:8px; }
.login-box button:hover { background:var(--accent-hover); }
.error { color:var(--red); font-size:13px; margin-top:12px; }

/* Layout */
#sidebar { position:fixed; left:0; top:0; bottom:0; width:var(--sidebar-w); background:var(--bg-secondary); border-right:1px solid var(--border); display:flex; flex-direction:column; z-index:100; }
.sidebar-brand { padding:20px 16px; font-size:18px; font-weight:700; border-bottom:1px solid var(--border); }
.nav-item { display:block; padding:10px 16px; color:var(--text-secondary); font-size:14px; border-left:3px solid transparent; transition:all .15s; }
.nav-item:hover { background:var(--bg-tertiary); color:var(--text-primary); }
.nav-item.active { color:var(--text-primary); border-left-color:var(--accent); background:var(--bg-tertiary); }
.sidebar-footer { margin-top:auto; padding:16px; border-top:1px solid var(--border); font-size:12px; color:var(--text-muted); display:flex; justify-content:space-between; align-items:center; }
.btn-sm { padding:4px 12px; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:6px; color:var(--text-secondary); cursor:pointer; font-size:12px; }
.btn-sm:hover { color:var(--text-primary); border-color:var(--text-secondary); }

#content-area { margin-left:var(--sidebar-w); padding:24px 32px; min-height:100vh; }

/* Cards */
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:24px; }
.card { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:20px; }
.card-value { font-size:32px; font-weight:700; margin-top:4px; }
.card-label { font-size:13px; color:var(--text-secondary); }
.card-green .card-value { color:var(--green); }
.card-orange .card-value { color:var(--orange); }
.card-blue .card-value { color:var(--blue); }
.card-purple .card-value { color:var(--purple); }

/* Page header */
.page-header { margin-bottom:24px; }
.page-header h2 { font-size:24px; margin-bottom:4px; }
.page-header p { color:var(--text-secondary); font-size:14px; }

/* Tables */
table { width:100%; border-collapse:collapse; background:var(--bg-card); border-radius:12px; overflow:hidden; border:1px solid var(--border); }
th, td { padding:10px 14px; text-align:left; border-bottom:1px solid var(--border); font-size:13px; }
th { background:var(--bg-tertiary); color:var(--text-secondary); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.5px; }
tr:hover { background:var(--bg-tertiary); }
tr:last-child td { border-bottom:none; }

/* Status badges */
.badge { display:inline-block; padding:2px 10px; border-radius:20px; font-size:12px; font-weight:500; }
.badge-pending { background:#30363d; color:#8b949e; }
.badge-purchased { background:#1f3a5f; color:#58a6ff; }
.badge-assigned { background:#1a3a2a; color:#3fb950; }
.badge-deploying { background:#3d2e00; color:#d29922; }
.badge-live { background:#1a3a2a; color:#3fb950; }
.badge-growing { background:#2d1f4e; color:#bc8cff; }
.badge-master { background:#3d1f00; color:#f0883e; }
.badge-satellite { background:#1f3a5f; color:#58a6ff; }
.badge-longtail { background:#30363d; color:#8b949e; }

/* Buttons */
.btn { padding:8px 16px; border-radius:8px; border:1px solid var(--border); background:var(--bg-tertiary); color:var(--text-primary); cursor:pointer; font-size:13px; transition:all .15s; }
.btn:hover { border-color:var(--text-secondary); }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-hover); }

/* Filters */
.filters { display:flex; gap:12px; margin-bottom:16px; flex-wrap:wrap; align-items:center; }
.filters select, .filters input { padding:8px 12px; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; color:var(--text-primary); font-size:13px; outline:none; }
.filters select:focus, .filters input:focus { border-color:var(--accent); }

/* Progress bar */
.progress-bar { background:var(--bg-tertiary); border-radius:8px; height:24px; overflow:hidden; position:relative; }
.progress-fill { height:100%; border-radius:8px; transition:width .3s; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; }

/* Checklist */
.checklist-item { display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px solid var(--border); font-size:13px; }
.checklist-item:last-child { border-bottom:none; }
.checklist-item input[type=checkbox] { width:18px; height:18px; cursor:pointer; accent-color:var(--accent); }
.checklist-item.completed { text-decoration:line-through; color:var(--text-muted); }
.checklist-cat { font-size:11px; color:var(--accent); background:var(--bg-tertiary); padding:2px 8px; border-radius:4px; }

/* Bible / Markdown */
.md-content { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:24px 32px; line-height:1.7; }
.md-content h1 { font-size:24px; margin:16px 0 12px; border-bottom:1px solid var(--border); padding-bottom:8px; }
.md-content h2 { font-size:20px; margin:14px 0 10px; }
.md-content h3 { font-size:16px; margin:12px 0 8px; }
.md-content code { background:var(--bg-tertiary); padding:2px 6px; border-radius:4px; font-size:13px; }
.md-content pre { background:var(--bg-tertiary); padding:16px; border-radius:8px; overflow-x:auto; margin:12px 0; }
.md-content pre code { background:none; padding:0; }
.md-content table { margin:12px 0; }
.md-content ul, .md-content ol { padding-left:24px; margin:8px 0; }
.md-content blockquote { border-left:3px solid var(--accent); padding-left:16px; color:var(--text-secondary); margin:12px 0; }

/* Bible editor */
.bible-editor { width:100%; min-height:400px; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; color:var(--text-primary); font-family:monospace; font-size:14px; padding:16px; resize:vertical; outline:none; }
.bible-editor:focus { border-color:var(--accent); }
.bible-tabs { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.bible-tab { padding:6px 14px; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; cursor:pointer; font-size:13px; color:var(--text-secondary); }
.bible-tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* Charts */
.chart-container { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:20px; margin-bottom:16px; }
.chart-title { font-size:14px; color:var(--text-secondary); margin-bottom:12px; }

/* Phase timeline */
.phase-card { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:20px; margin-bottom:12px; }
.phase-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.phase-name { font-size:16px; font-weight:600; }
.phase-pct { font-size:24px; font-weight:700; }

/* Modal */
.modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.6); z-index:200; display:flex; align-items:center; justify-content:center; }
.modal { background:var(--bg-secondary); border:1px solid var(--border); border-radius:12px; padding:24px; width:560px; max-width:90vw; max-height:80vh; overflow-y:auto; }
.modal h3 { margin-bottom:16px; }
.modal label { display:block; font-size:13px; color:var(--text-secondary); margin:8px 0 4px; }
.modal input, .modal select, .modal textarea { width:100%; padding:8px 12px; background:var(--bg-tertiary); border:1px solid var(--border); border-radius:8px; color:var(--text-primary); font-size:13px; outline:none; }
.modal textarea { min-height:80px; resize:vertical; font-family:inherit; }
.modal-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:16px; }

/* Grid layout helper */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }

/* Activity log */
.activity-item { display:flex; gap:12px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.activity-time { color:var(--text-muted); white-space:nowrap; min-width:140px; }
.activity-action { color:var(--accent); min-width:60px; }

/* Responsive */
@media(max-width:768px) {
  #sidebar { width:60px; }
  .sidebar-brand, .nav-item span, .sidebar-footer span { display:none; }
  #content-area { margin-left:60px; padding:16px; }
  .cards { grid-template-columns:1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns:1fr; }
}

/* Activity log improvements */
.activity-item:last-child { border-bottom: none !important; }
.activity-item b { color: var(--accent); }
.activity-item .badge { font-size: 11px; padding: 1px 6px; }
