:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #4f8cff;
  --green: #3dd68c;
  --red: #f07178;
  --yellow: #ffcc66;
  --gray: #6b7c93;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.header nav a { margin-left: 1rem; }
.admin-header .header-right { display: flex; align-items: center; gap: 1rem; }
.container { padding: 1.5rem; max-width: 1200px; margin: 0 auto; flex: 1; }
.site-footer { margin-top: auto; padding: 0.75rem 1.5rem; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.8rem; text-align: center; }

.tab-nav { display: flex; gap: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.5rem; }
.tab-nav a { padding: 0.75rem 1.25rem; color: var(--muted); border-bottom: 2px solid transparent; }
.tab-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

.hidden { display: none !important; }
.login-gate { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); padding: 2rem; border-radius: 8px; border: 1px solid var(--border); width: 320px; }
.login-card input { width: 100%; margin: 1rem 0; padding: 0.5rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 4px; }
.login-card button { width: 100%; }

button, .btn { padding: 0.5rem 1rem; background: var(--accent); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
button:hover { opacity: 0.9; }
button.danger { background: var(--red); }
button.secondary { background: var(--border); }
.btn-link { background: none; color: var(--muted); padding: 0; }

input, select, textarea { padding: 0.5rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 4px; }
textarea { width: 100%; min-height: 200px; font-family: monospace; font-size: 0.85rem; }
label { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.85rem; }
.form-group { margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
tr:hover { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-done, .badge-submitted { background: rgba(61,214,140,0.2); color: var(--green); }
.badge-running, .badge-queued { background: rgba(79,140,255,0.2); color: var(--accent); }
.badge-error { background: rgba(240,113,120,0.2); color: var(--red); }
.badge-no_match { background: rgba(255,204,102,0.2); color: var(--yellow); }
.badge-pending, .badge-skipped, .badge-gray { background: rgba(107,124,147,0.2); color: var(--gray); }
.badge-enabled { background: rgba(61,214,140,0.2); color: var(--green); }
.badge-disabled { background: rgba(240,113,120,0.2); color: var(--red); }

.health-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.health-ok { background: var(--green); }
.health-degraded { background: var(--yellow); }
.health-down { background: var(--red); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 0.85rem; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 400px; background: var(--surface); border-left: 1px solid var(--border); padding: 1.5rem; z-index: 50; overflow-y: auto; }
.filters { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: end; }
.error { color: var(--red); font-size: 0.85rem; }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: var(--surface); border: 1px solid var(--border); padding: 0.75rem 1rem; border-radius: 4px; z-index: 200; }
.key-reveal { background: var(--bg); padding: 1rem; border-radius: 4px; font-family: monospace; word-break: break-all; margin: 1rem 0; }
.section-title { margin: 1.5rem 0 0.5rem; color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.toggle { cursor: pointer; }
.progress { color: var(--muted); font-size: 0.9rem; }
.lead { font-size: 1.1rem; color: var(--muted); margin-bottom: 1.5rem; max-width: 720px; }
.hero { margin-bottom: 2rem; }
.guide-section { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.guide-section h3 { margin-bottom: 0.75rem; }
.guide-section h4 { margin-top: 1.25rem; }

.action-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }
.action-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; transition: border-color 0.15s; }
.action-card:hover { border-color: var(--accent); text-decoration: none; }
.action-card strong { display: block; margin-bottom: 0.25rem; color: var(--text); }
.action-card span { font-size: 0.85rem; color: var(--muted); }

.notes-list { margin: 1rem 0 0 1.25rem; color: var(--muted); font-size: 0.9rem; }
.notes-list li { margin-bottom: 0.35rem; }
.workflow-list { margin: 0.5rem 0 0 1.25rem; }
.workflow-list li { margin-bottom: 0.5rem; }

.code-block { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin: 0.75rem 0; }
.code-block pre { background: var(--bg); padding: 0.75rem; border-radius: 4px; overflow-x: auto; font-size: 0.85rem; margin: 0.5rem 0; }
code { font-family: ui-monospace, monospace; font-size: 0.9em; background: rgba(255,255,255,0.06); padding: 0.1em 0.35em; border-radius: 3px; }
pre code { background: none; padding: 0; }

.progress { color: var(--muted); font-size: 0.9rem; }
