:root {
    --bg: #10140f;
    --card: #1b2218;
    --ink: #f4f1e6;
    --muted: #b7bba8;
    --line: rgba(236, 224, 190, 0.16);
    --red: #ff4b2e;
    --gold: #f0c14d;
    --green: #c6e6a1;
    --danger: #ffb4a8;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    --display: "Oswald", Impact, sans-serif;
    --sans: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 0% -10%, rgba(255, 75, 46, 0.18), transparent 55%),
        linear-gradient(180deg, #161b13 0%, var(--bg) 280px);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 6vw;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(16, 20, 15, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.brand { text-decoration: none; color: inherit; display: grid; }
.brand span { color: var(--muted); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.brand strong { font-family: var(--display); font-size: 22px; letter-spacing: 0.04em; }
.top nav { display: flex; gap: 8px; }
.top nav a {
    color: var(--ink);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.top nav a.on, .top nav a:hover { border-color: var(--line); background: #232a1e; }

.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 72px; }
.hero h1 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(56px, 10vw, 104px);
    line-height: 0.88;
    letter-spacing: 0.02em;
}
.hero h1 span { color: var(--red); }
.eyebrow, .hint, .sync-line, .field-note, .src { color: var(--muted); }
.lede { max-width: 62ch; font-size: 18px; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 28px 0;
}
.stats article, .panel, .hit, .empty {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.stats article { padding: 16px 18px; }
.grab { margin: 8px 0 22px; }
.grab h2 { font-family: var(--display); letter-spacing: 0.03em; margin: 0 0 12px; }
.grab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grab-grid article {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
}
.grab-grid b { display: block; font-family: var(--display); font-size: 32px; line-height: 1; }
.grab-grid p { margin: 4px 0 0; color: var(--muted); }
.stats b { display: block; font-family: var(--display); font-size: 40px; line-height: 1; }
.stats span { color: var(--muted); }

.filters, .url-row, .actions, .admin-head, .sync-form { display: flex; gap: 12px; align-items: end; }
.filters { flex-wrap: wrap; margin-bottom: 12px; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; min-width: 180px; flex: 1; }
.filters input, .filters select { width: 100%; }

input, select, textarea {
    width: 100%;
    background: #121710;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: white;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}
button.ghost, .button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: #8d2b22; }

.feed { display: grid; gap: 14px; }
.hit { padding: 18px; }
.hit header, .hit footer, .manage li, .row-actions { display: flex; gap: 12px; align-items: center; }
.hit header { justify-content: space-between; }
.hit header div, .manage li div { display: grid; min-width: 0; }
.hit header span, .manage li span { color: var(--muted); }
.hit time { color: var(--muted); white-space: nowrap; }
.mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #2a2318;
    color: var(--gold);
    font-family: var(--display);
    flex: none;
}
.hit[data-platform="instagram"] .mark { color: #ff8fab; }
.hit[data-platform="tiktok"] .mark { color: #7ef0e0; }
.hit[data-platform="facebook"] .mark { color: #8eb6ff; }
.body { white-space: pre-wrap; margin: 14px 0; }
.pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    background: #2a2318;
    color: var(--gold);
}
.pill.mention { background: #3a201c; color: #ffb1a4; }
.note { margin: 10px 0 0; color: var(--green); }
.empty, .panel { padding: 22px; }
.empty h2, .panel h1, .panel h2, .admin-head h1 { font-family: var(--display); letter-spacing: 0.03em; margin: 0 0 8px; }
.pager { display: flex; gap: 16px; align-items: center; margin-top: 18px; }

.admin-head { justify-content: space-between; align-items: start; margin-bottom: 16px; }
.admin-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.panel label, .narrow label { display: block; margin-top: 14px; font-size: 14px; }
.field-error { min-height: 0; margin: 6px 0 0; color: var(--danger); }
.field-error:empty { display: none; }
.field-note { margin: 6px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 0; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.check input { width: auto; }
.url-row input { flex: 1; }
.actions { margin-top: 16px; }
.flash { padding: 12px 14px; border-radius: 12px; background: #24321c; color: var(--green); }
.flash.bad { background: #3a201c; color: var(--danger); }
.narrow { max-width: 460px; }
.manage { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.manage li { justify-content: space-between; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.manage p { margin: 4px 0 0; color: var(--muted); }
.row-actions { align-items: start; }
.row-actions a { color: var(--ink); }
details { color: var(--muted); }
details form { margin-top: 8px; }
#sumber { margin-top: 16px; }
.sync-form { margin-top: 16px; }
[aria-invalid="true"] { border-color: var(--danger); }

@media (max-width: 800px) {
    .stats, .admin-grid, .grab-grid { grid-template-columns: 1fr; }
    .admin-grid, .filters, .url-row, .admin-head, .hit header { display: grid; }
    .hit time { white-space: normal; }
}
@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .top { padding-inline: 16px; }
}
