:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f131b;
  color: #eef2ff;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #0f131b; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.panel {
  background: #171c27;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.auth-panel { width: min(420px, 100%); padding: 24px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.mark {
  width: 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center;
  background: #2563eb; color: white; font-weight: 800;
}
h1, h2, p { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 16px; margin-bottom: 16px; }
.brand p, header p, .hint { color: #94a3b8; font-size: 13px; margin-top: 4px; }
label { display: block; color: #cbd5e1; font-size: 12px; font-weight: 700; margin: 12px 0 6px; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.1);
  background: #0f131b;
  color: #f8fafc;
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
}
input:focus, textarea:focus { border-color: #3b82f6; }
button {
  border: 0;
  border-radius: 6px;
  background: #2563eb;
  color: white;
  padding: 10px 14px;
  font-weight: 700;
}
button:hover { background: #1d4ed8; }
button.ghost {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
button.ghost:hover { background: rgba(255,255,255,.1); }
.error { color: #fca5a5; font-size: 13px; margin-top: 12px; }
.layout { min-height: 100vh; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
header { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions input { width: 260px; }
.grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
#createForm { padding: 18px; align-self: start; }
.table-panel { overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.table-head span { color: #94a3b8; font-size: 13px; }
.table-wrap { overflow: auto; max-height: 560px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13px; vertical-align: top; }
th { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #141924; position: sticky; top: 0; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #bfdbfe; font-weight: 700; }
.muted { color: #94a3b8; font-size: 12px; margin-top: 3px; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-weight: 700; font-size: 11px; }
.status.active { color: #bbf7d0; background: rgba(34,197,94,.14); }
.status.blocked { color: #fecaca; background: rgba(239,68,68,.14); }
.status.expired { color: #fde68a; background: rgba(245,158,11,.14); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.actions button { padding: 7px 9px; font-size: 12px; }
.logs { padding: 12px 18px 18px; display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.log { border: 1px solid rgba(255,255,255,.07); border-radius: 6px; padding: 9px 10px; background: #111722; font-size: 12px; color: #cbd5e1; }
.log strong { color: white; }

@media (max-width: 920px) {
  header, .header-actions { align-items: stretch; flex-direction: column; }
  .header-actions input { width: 100%; }
  .grid { grid-template-columns: 1fr; }
}
