:root {
  --bg-1: #0f172a;
  --bg-2: #111827;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-border: rgba(255, 255, 255, 0.10);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --radius: 24px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.20), transparent 28%),
    radial-gradient(circle at top right, rgba(34,197,94,0.16), transparent 24%),
    radial-gradient(circle at bottom center, rgba(168,85,247,0.18), transparent 26%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}
.app { max-width: 1500px; margin: 0 auto; padding: 24px; }
.hero, .grid { display: grid; gap: 22px; }
.hero { grid-template-columns: 1.2fr 0.8fr; margin-bottom: 22px; }
.grid { grid-template-columns: 1fr 1fr; }
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card { padding: 28px; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(56,189,248,.08), transparent 45%, rgba(34,197,94,.08)); pointer-events: none; }
.badge { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.06); color: #dbeafe; border: 1px solid rgba(255,255,255,.08); font-size: 13px; margin-bottom: 18px; }
h1 { margin: 0 0 10px; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; }
.gradient { background: linear-gradient(90deg, #7dd3fc, #4ade80); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { margin: 0; color: var(--muted); line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 20px; }
.stat { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px; }
.stat h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.stat strong { font-size: 28px; }
.panel { padding: 22px; }
.panel h2, .panel h3 { margin-top: 0; }
label { display:block; font-size:13px; color:#cbd5e1; margin-bottom:8px; font-weight:600; }
input, select, textarea {
  width: 100%; border: 1px solid rgba(255,255,255,.10); background: rgba(2,6,23,.65); color: white;
  border-radius: 16px; padding: 14px 15px; outline: none; font-size: 15px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(56,189,248,.7); box-shadow: 0 0 0 4px rgba(56,189,248,.16); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
button {
  border: none; border-radius: 16px; padding: 12px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-primary { background: linear-gradient(90deg, var(--accent), #0ea5e9); color: #08111f; }
.btn-success { background: linear-gradient(90deg, var(--accent-2), #16a34a); color: white; }
.btn-secondary { background: rgba(255,255,255,.08); color: white; border: 1px solid rgba(255,255,255,.10); }
.btn-danger { background: linear-gradient(90deg, #ef4444, #dc2626); color: white; }
.status { margin-top: 14px; padding: 12px 14px; border-radius: 16px; display: none; }
.status.show { display: block; }
.status.ok { background: rgba(34,197,94,.12); color: #bbf7d0; border: 1px solid rgba(34,197,94,.25); }
.status.err { background: rgba(239,68,68,.12); color: #fecaca; border: 1px solid rgba(239,68,68,.25); }
.status.warn { background: rgba(245,158,11,.12); color: #fde68a; border: 1px solid rgba(245,158,11,.25); }
.search-grid, .admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-box { margin-top: 14px; padding: 16px; border-radius: 18px; background: rgba(2,6,23,.66); border: 1px solid rgba(255,255,255,.08); }
.result-box textarea { min-height: 84px; color: #d1fae5; background: rgba(3,7,18,.95); border: 1px solid rgba(34,197,94,.25); }
.hidden { display: none !important; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { background: rgba(255,255,255,.08); color: white; border: 1px solid rgba(255,255,255,.10); }
.tab.active { background: linear-gradient(90deg, var(--accent), #0ea5e9); color: #08111f; }
.search-panel, .admin-section { display: none; }
.search-panel.active, .admin-section.active { display: block; }
.suggest-wrap { position: relative; }
.suggest-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 230px; overflow: auto; z-index: 10;
  background: #0b1220; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; box-shadow: var(--shadow); display: none;
}
.suggest-list.show { display: block; }
.suggest-item { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.06); }
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: rgba(255,255,255,.06); }
.suggest-item small { display:block; color: var(--muted); margin-top:4px; }
.table-wrap { margin-top: 16px; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); background: rgba(2,6,23,.6); max-height: 360px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; }
th { position: sticky; top: 0; background: #0b1220; z-index: 2; }
code { word-break: break-all; }
.muted { color: var(--muted); }
.footer-note { margin-top: 18px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 1100px) { .hero, .grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .stats, .search-grid, .admin-grid { grid-template-columns: 1fr; } .app{padding:16px;} }


.is-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-gate {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-shell {
  width: min(460px, 100%);
  padding: 28px;
}
.is-guest .app {
  display: none !important;
}
