/* Admin console: graphite + teal/coral, Manrope. Deliberately not a beige/serif look. */
:root {
  --bg: #0f1115; --panel: #171a21; --panel-2: #1d212b; --line: #262b36; --line-2: #313847;
  --fg: #e8ecf3; --muted: #8b94a7; --faint: #5d6678;
  --teal: #12b5a5; --teal-2: #0e8f83; --coral: #ff6b5b; --amber: #f5b94a; --green: #3ecf8e; --blue: #5b8cff; --violet: #9b7bff;
  --radius: 10px; --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
.admin-body { background: var(--bg); color: var(--fg); font-family: Manrope, Inter, system-ui, sans-serif; font-size: 14px; line-height: 1.45; min-height: 100vh; }
a { color: var(--teal); }
.boot { padding: 40px; color: var(--muted); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), var(--blue)); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #06201d; letter-spacing: .02em; }
.brand b { font-size: 15px; display: block; }
.brand small { color: var(--muted); font-size: 11px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--panel-2); color: var(--fg); }
.nav a.active { background: var(--panel-2); color: var(--fg); box-shadow: inset 3px 0 0 var(--teal); }
.nav .pill { background: var(--coral); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 800; }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.side-foot { margin-top: auto; padding: 10px 8px 0; color: var(--faint); font-size: 12px; }
.side-foot a { color: var(--muted); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(15,17,21,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.topbar .event-switch { display: flex; align-items: center; gap: 8px; }
.topbar .spacer { flex: 1; }
.topbar .status { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(62,207,142,.18); }
.dot.off { background: var(--faint); box-shadow: none; }
.content { padding: 22px 24px 60px; max-width: 1380px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

/* panels & grid */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h3 .hint { color: var(--muted); font-weight: 500; font-size: 12px; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.cols-3 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1000px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.field .help { color: var(--faint); font-size: 12px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); color: var(--fg); border-radius: 8px; padding: 9px 11px; outline: none; font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18,181,165,.18); }
textarea { min-height: 84px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 140px; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--teal); }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type=text] { font-family: var(--mono); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.check small { color: var(--muted); display: block; font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); font-weight: 700; cursor: pointer; text-decoration: none; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--teal); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #06201d; }
.btn-primary:hover { background: #19c9b7; }
.btn-danger { background: transparent; border-color: rgba(255,107,91,.5); color: var(--coral); }
.btn-danger:hover { background: rgba(255,107,91,.12); border-color: var(--coral); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn-xs { padding: 3px 7px; font-size: 11px; border-radius: 6px; }
.btn svg { width: 14px; height: 14px; }
.btn-file { position: relative; overflow: hidden; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* chips, tags, stats */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); }
.chip.ok { color: var(--green); border-color: rgba(62,207,142,.4); }
.chip.warn { color: var(--amber); border-color: rgba(245,185,74,.4); }
.chip.bad { color: var(--coral); border-color: rgba(255,107,91,.4); }
.chip.info { color: var(--blue); border-color: rgba(91,140,255,.4); }
.chip.violet { color: var(--violet); border-color: rgba(155,123,255,.4); }
.chip svg { width: 12px; height: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.bar-row .track { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); border-radius: 99px; }
.bar-row b { color: var(--fg); text-align: right; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

/* moderation cards */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters .tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 10px; }
.filters .tabs button { background: transparent; border: 0; color: var(--muted); padding: 7px 12px; border-radius: 7px; font-weight: 700; cursor: pointer; }
.filters .tabs button.active { background: var(--panel-2); color: var(--fg); }
.filters .tabs button .n { color: var(--faint); margin-left: 5px; font-weight: 600; }
.filters .tabs button.active .n { color: var(--teal); }
.filters input[type=search] { width: 220px; }
.bulk { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: border-color .15s; }
.card.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(18,181,165,.25); }
.card.is-new { animation: popIn .4s ease; }
@keyframes popIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.card .thumb { position: relative; aspect-ratio: 4/3; background: #000; overflow: hidden; }
.card .thumb img, .card .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .text-thumb { height: 100%; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; background: var(--panel-2); }
.card .thumb .kind { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.card .sel { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; accent-color: var(--teal); z-index: 2; }
.card .badge { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 8px; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; }
.card .badge svg { width: 16px; height: 16px; }
.card .spot { position: absolute; right: 8px; bottom: 8px; background: var(--amber); color: #2a1d00; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .06em; }
.card .body { padding: 10px 12px 6px; flex: 1; }
.card .who { display: flex; align-items: center; gap: 8px; }
.card .ava { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: 11px; font-weight: 800; overflow: hidden; flex: none; }
.card .ava img { width: 100%; height: 100%; object-fit: cover; }
.card .who b { font-size: 13px; }
.card .who small { color: var(--muted); display: block; font-size: 11px; }
.card .txt { margin: 8px 0 6px; font-size: 13px; color: #cfd5e1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .txt .tag, .card .text-thumb .tag { color: var(--teal); font-weight: 700; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.card .ai { font-size: 12px; color: var(--muted); margin: 4px 0; border-left: 2px solid var(--line-2); padding-left: 8px; }
.card .ai b { color: var(--fg); }
.card .actions { display: flex; gap: 6px; padding: 8px 12px 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.card .actions .btn { flex: 1; justify-content: center; padding: 7px 8px; }
.card .actions .btn-icon { flex: 0; padding: 7px 9px; }
.empty-state { color: var(--muted); padding: 40px; text-align: center; background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* sources */
.source { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.source:last-child { border-bottom: 0; }
.source .ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.source .ico svg { width: 22px; height: 22px; }
.source .notes { color: var(--muted); font-size: 12.5px; margin: 4px 0 8px; max-width: 760px; }
.source .state { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.source .extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: .15s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(18px); }

/* branding */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.preset { border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg); }
.preset.active { border-color: var(--teal); }
.preset .sw { height: 42px; display: flex; }
.preset .sw i { flex: 1; }
.preset span { display: block; font-size: 11px; font-weight: 700; padding: 6px 8px; color: var(--muted); }
.asset { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.asset img { height: 44px; max-width: 120px; object-fit: contain; background: repeating-conic-gradient(#2a2f3a 0 25%, #1d212b 0 50%) 0 0 / 12px 12px; border-radius: 6px; padding: 3px; }
.asset .grow { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-frame { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: 8px; background: #000; }
.rule { display: grid; grid-template-columns: 1fr 160px 36px; gap: 8px; margin-bottom: 8px; align-items: center; }

/* misc */
.qr-box { background: #fff; padding: 8px; border-radius: 8px; width: 150px; height: 150px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.url-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.url-row code { flex: 1; background: var(--bg); border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--fg); padding: 10px 14px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: popIn .25s; }
.toast.err { border-color: var(--coral); color: #ffb4a8; }
.toast.ok { border-color: var(--teal); }
.notice { background: rgba(245,185,74,.1); border: 1px solid rgba(245,185,74,.4); color: #ffd98a; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.notice.info { background: rgba(91,140,255,.1); border-color: rgba(91,140,255,.4); color: #b9ccff; }
.kbd { font-family: var(--mono); background: var(--bg); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; font-size: 11px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* auth / home */
.auth { grid-column: 1 / -1; min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(70% 60% at 50% 0%, #15202b, var(--bg) 70%); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card p { color: var(--muted); margin-bottom: 18px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.home-body { display: grid; place-items: center; padding: 24px; }
.home { max-width: 640px; width: 100%; text-align: center; }
.home h1 { font-size: 30px; margin: 10px 0 6px; }
.home p { color: var(--muted); margin-bottom: 20px; }
.home-mark { width: 56px; height: 56px; margin: 0 auto; border-radius: 14px; background: linear-gradient(135deg, var(--teal), var(--blue)); display: grid; place-items: center; font-weight: 800; color: #06201d; font-size: 18px; }
.home-links { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; text-align: left; }
.home-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: inherit; text-decoration: none; }
.home-card:hover { border-color: var(--teal); }
.home-card b { display: block; margin-bottom: 4px; font-size: 15px; }
.home-card span { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .home-links { grid-template-columns: 1fr; } }
