:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --border: #243049;
  --text: #e8eef8;
  --muted: #93a0b8;
  --accent: #3ee0b8;
  --warn: #f0b429;
  --danger: #f07178;
  --font: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #16324a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: .9em; background: #0a101c; padding: .1rem .35rem; border-radius: 4px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 220px;
  background: rgba(10, 16, 28, .92); border-right: 1px solid var(--border);
  padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem;
}
.brand strong { display: block; font-size: 1.05rem; }
.brand span { color: var(--muted); font-size: .8rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .35rem; }
.sidebar nav a {
  color: var(--muted); padding: .45rem .65rem; border-radius: 8px;
}
.sidebar nav a.active, .sidebar nav a:hover {
  background: #1a2438; color: var(--text); text-decoration: none;
}
.content { margin-left: 220px; padding: 1.5rem 1.75rem 3rem; }
.top h1 { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 650; }
.grid.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .85rem; margin-bottom: 1.25rem;
}
.stat, .panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem;
}
.stat-label { display: block; color: var(--muted); font-size: .75rem; margin-bottom: .35rem; }
.stat-value { font-size: 1.35rem; }
.panel { margin-bottom: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.panel h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.panel-head h2 { margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.actions { white-space: nowrap; }
.actions a { margin-right: .65rem; }
.muted { color: var(--muted); }
.badge { display: inline-block; font-size: .7rem; padding: .1rem .4rem; border-radius: 999px; margin-left: .35rem; }
.badge-warn { background: rgba(240,180,41,.15); color: var(--warn); }
.btn, button.btn {
  display: inline-block; background: var(--accent); color: #042218; border: 0;
  border-radius: 999px; padding: .55rem 1.1rem; font-weight: 650; cursor: pointer; font: inherit;
}
.btn-sm { padding: .35rem .8rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
label { display: block; font-size: .8rem; color: var(--muted); margin: .75rem 0 .3rem; }
input, select, textarea {
  width: 100%; max-width: 520px; background: #0a101c; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: .55rem .7rem; font: inherit;
}
textarea { min-height: 90px; max-width: 100%; }
.check { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; color: var(--text); }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .85rem; max-width: 720px; }
.alert { padding: .7rem .9rem; border-radius: 8px; margin: .75rem 0; }
.alert-error { background: rgba(240,113,120,.12); color: #ffb4b8; }
.alert-ok { background: rgba(62,224,184,.12); color: var(--accent); }
.alert-warn { background: rgba(240,180,41,.12); color: var(--warn); }
.login-page { display: grid; place-items: center; padding: 2rem; }
.login-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem;
}
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; margin: 0 0 .5rem; }
.login-card h1 { margin: 0 0 .35rem; font-size: 1.4rem; }
.chat { display: flex; flex-direction: column; gap: .65rem; }
.chat-line { padding: .65rem .8rem; border-radius: 10px; background: #0a101c; border: 1px solid var(--border); }
.chat-line .who { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.link-list { margin: 0; padding-left: 1.1rem; line-height: 1.8; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.filters label { margin-top: 0; }
.filters select, .filters input { max-width: 220px; }
@media (max-width: 800px) {
  .sidebar { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}
