:root {
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-hover: #1f2937;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #1e293b;
  --radius: 8px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
.navbar { display: flex; align-items: center; padding: 0 1.5rem; height: 56px; background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.logo { font-size: 1.3rem; font-weight: 800; }
.logo span { color: var(--primary); }
.nav-center { flex: 1; display: flex; justify-content: center; }
.tabs { display: flex; gap: 1.5rem; }
.tab { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.btn { padding: 0.5rem 1rem; border: none; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-full { width: 100%; padding: 0.7rem; font-size: 1rem; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.user-menu { display: flex; align-items: center; gap: 0.75rem; }
#mainContent { padding: 1.5rem; max-width: 1200px; margin: 0 auto; flex: 1 0 auto; width: 100%; }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); padding: 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; }
.stat-card .value.green { color: var(--success); }
.stat-card .value.blue { color: var(--primary); }
.stat-card .value.yellow { color: var(--warning); }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); padding: 1.25rem; margin-bottom: 1rem; }
.card h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
tr:hover td { background: var(--bg-hover); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: 0.9rem; outline: none; }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Badge */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-paused { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-pending { background: rgba(59,130,246,0.15); color: var(--primary); }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); padding: 2rem; border-radius: var(--radius); width: 100%; max-width: 500px; position: relative; max-height: 80vh; overflow-y: auto; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.modal h2 { margin-bottom: 1.5rem; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 0.6rem 0.8rem; margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: 0.9rem; outline: none; }
.auth-error { color: var(--danger); font-size: 0.85rem; margin-bottom: 0.5rem; display: none; }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--primary); cursor: pointer; }

/* Embed code */
.embed-box { background: var(--bg); padding: 1rem; border-radius: var(--radius); font-family: monospace; font-size: 0.8rem; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--border); cursor: pointer; }
.embed-box:hover { border-color: var(--primary); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }

/* Footer */
.footer { background: var(--bg-card); padding: 2rem 1.5rem; border-top: 1px solid var(--border); margin-top: 4rem; text-align: center; }
.footer h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.footer h2 span { color: var(--primary); }
.footer p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.footer .copyright { font-size: 0.8rem; margin-top: 1rem; }

.hidden { display: none; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
