:root {
    /* TEST palette — coolors.co/50514f-cbd4c2-fffcff-247ba0-c3b299
       charcoal #50514F · ash-grey #CBD4C2 · snow #FFFCFF · cerulean #247BA0 · khaki-beige #C3B299 */
    --bg: #eff2e9;              /* ash-grey washed toward snow */
    --card: #fffcff;            /* snow */
    --ink: #50514f;             /* charcoal */
    --muted: #7b7d77;           /* charcoal, lightened */
    --line: #cbd4c2;            /* ash-grey */
    --brand: #247ba0;           /* cerulean */
    --brand-dark: #1a5c78;      /* cerulean, darkened */
    --mark: #e9dcc5;            /* khaki-beige, lightened (search highlight) */
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ── Login ───────────────────────────────────────────── */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-card {
    background: var(--card); padding: 32px; border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08); width: min(360px, 90vw);
}
.login-card h1 { margin: 0 0 4px; color: var(--brand-dark); }
.login-card label { display: block; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.login-card input {
    width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 16px;
    border: 1px solid var(--line); border-radius: 8px;
}
/* Primary buttons only — deliberately NOT `.searchbar button`, which would
   swallow every nested control (.ms-btn, .btn-link, .person-clear, .ms-none). */
.login-card button, .searchbar > button {
    margin-top: 20px; padding: 11px 18px; font-size: 16px; cursor: pointer;
    background: var(--brand); color: #fff; border: 0; border-radius: 8px;
}
.login-card button { width: 100%; }
.login-card button:hover, .searchbar > button:hover { background: var(--brand-dark); }
.error { background: #fdecec; color: #b3261e; padding: 10px 12px; border-radius: 8px; margin-top: 16px; font-size: 14px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; gap: 14px;
    background: var(--brand); color: #fff; padding: 12px 20px;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; }
.topbar .brand svg { display: block; }
.topbar .brand:hover { color: #d3e6ef; }
.topbar .muted { color: #d3e6ef; }
.topbar .spacer { flex: 1; }
.topbar .logout { color: #fff; border: 1px solid rgba(255,255,255,.5); padding: 5px 12px; border-radius: 6px; font-size: 14px; }

main { max-width: 820px; margin: 0 auto; padding: 24px 16px 64px; }

/* ── Search bar ──────────────────────────────────────── */
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.searchbar .q {
    flex: 1 1 320px; padding: 12px 16px; font-size: 17px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.searchbar button { margin-top: 0; }
.filters { flex-basis: 100%; }
.filters summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.filter-row label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.filter-row select, .filter-row input {
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff;
}
.filter-row select[multiple] { padding: 4px; min-width: 200px; }
.filter-src, .filter-countries { display: flex; flex-direction: column; gap: 4px; }
.fc-label { font-size: 13px; color: var(--muted); }
.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 360px; }
.fc-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; background: #fff; }
.fc-chip.on, .fc-chip:has(input:checked) { border-color: var(--brand); background: #e3eef4; color: var(--brand-dark); font-weight: 600; }
.fc-chip input { display: none; }
.src-clear { align-self: flex-start; }
.filter-actions { display: flex; align-items: center; gap: 10px; align-self: flex-end; }
.filter-actions button[type="submit"] { padding: 9px 16px; font-size: 14px; cursor: pointer; background: var(--brand); color: #fff; border: 0; border-radius: 8px; }
.filter-actions button[type="submit"]:hover { background: var(--brand-dark); }
/* Quiet secondary actions (Obriši / Poništi) */
.filter-actions .btn-link {
    display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
    font-size: 14px; cursor: pointer; background: #fff; color: var(--muted);
    border: 1px solid var(--line); border-radius: 8px;
}
.filter-actions .btn-link:hover { color: var(--ink); border-color: #b6c0ad; background: #fff; }

/* ── Results ─────────────────────────────────────────── */
.stats { color: var(--muted); margin: 20px 2px; font-size: 14px; }

/* ── Keyword-over-time chart ─────────────────────────── */
.timechart {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 16px 10px; margin: 0 0 22px;
}
.tc-head { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.tc-head .tc-status { font-weight: 400; margin-left: 6px; }
.tc-plot {
    display: flex; align-items: flex-end; gap: 1px;
    height: 90px; border-bottom: 1px solid var(--line);
}
.tc-bar {
    flex: 1 1 0; min-width: 0; background: var(--brand);
    border-radius: 1px 1px 0 0; transition: background .12s;
}
.tc-bar:hover { background: var(--brand-dark); }
.tc-bar.empty { background: transparent; pointer-events: none; }
.tc-axis { display: flex; gap: 1px; margin-top: 4px; }
.tc-tick { font-size: 10px; color: var(--muted); text-align: left; overflow: visible; white-space: nowrap; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.results li {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: 16px 18px;
}
.results .title { font-size: 18px; font-weight: 600; line-height: 1.35; }
.results .meta { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.results .meta .source { color: var(--brand-dark); font-weight: 600; }
.lstat { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 7px; vertical-align: 0; background: #cbd0d6; }
.lstat.green { background: #2ecc71; animation: lstat-blink 1.4s ease-in-out infinite; }
.lstat.orange { background: #f39c12; } .lstat.red { background: #e74c3c; }
@keyframes lstat-blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46,204,113,.6); } 50% { opacity: .35; box-shadow: 0 0 0 3px rgba(46,204,113,0); } }
@media (prefers-reduced-motion: reduce) { .lstat.green { animation: none; } }
.favi { width: 16px; height: 16px; border-radius: 3px; object-fit: contain; vertical-align: -3px; margin-right: 5px; }
.flag { width: 20px; height: 13px; object-fit: cover; border-radius: 2px; vertical-align: -2px; margin-right: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: 0 0 auto; }
.results .snippet { margin: 0 0 8px; color: #33363b; }
.results .snippet-full { display: block; white-space: pre-wrap; }
.more-btn {
    display: inline-block; margin-top: 6px; padding: 0;
    background: none; border: 0; cursor: pointer;
    color: var(--brand); font-size: 13px; font-weight: 600;
}
.more-btn:hover { text-decoration: underline; }
.results .url { font-size: 12px; color: #1a7f37; }
mark { background: var(--mark); padding: 0 1px; border-radius: 2px; }

/* ── Pager ───────────────────────────────────────────── */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0 0; }
.pager a, .pager .current, .pager .gap {
    min-width: 38px; text-align: center; padding: 8px 10px; border-radius: 8px; font-size: 14px;
}
.pager a { background: #fff; border: 1px solid var(--line); }
.pager .current { background: var(--brand); color: #fff; }
.pager .gap { color: var(--muted); }

.hint { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-top: 28px; }
.hint p { margin: 0 0 8px; }

/* ── Admin ───────────────────────────────────────────── */
.adminnav { background: var(--card); border-bottom: 1px solid var(--line); padding: 0 16px; display: flex; gap: 4px; }
.adminnav a { padding: 12px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.adminnav a:hover { text-decoration: none; color: var(--ink); }
.adminnav a.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.adminmain { max-width: 1400px; margin: 0 auto; padding: 20px 16px 64px; }
.adminmain h2 { font-size: 16px; margin: 28px 0 12px; }
.adminmain h2:first-of-type { margin-top: 8px; }

.notice { background: #e3eef4; border: 1px solid #b6d4fb; color: var(--brand-dark); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }

.cards { display: flex; flex-wrap: wrap; gap: 14px; }
.card { flex: 1 1 150px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card-n { font-size: 26px; font-weight: 700; color: var(--brand-dark); }
.card-l { font-size: 13px; color: var(--muted); margin-top: 4px; }

.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; }
.grid th, .grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { background: #f0f2f5; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.grid tr:last-child td { border-bottom: 0; }
.grid tr.row-edit { background: #fffbe6; }
.grid .nowrap { white-space: nowrap; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .src { white-space: nowrap; }

.adminform { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.adminform label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.adminform input, .adminform select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.adminform button { padding: 9px 16px; font-size: 14px; cursor: pointer; background: var(--brand); color: #fff; border: 0; border-radius: 8px; }
.adminform button:hover { background: var(--brand-dark); }

.btn-link { font-size: 13px; padding: 6px 8px; }
.btn-danger { background: #fdecec; color: #b3261e; border: 1px solid #f3c6c2; border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.btn-danger:hover { background: #f9d7d4; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.badge-admin { background: #e7f0ff; color: var(--brand-dark); }
.badge-user { background: #eef0f2; color: var(--muted); }
.kv { font-size: 14px; }

/* ── Admin activity charts ───────────────────────────── */
.actbars { display: flex; gap: 14px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.actbar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.actbar-n { font-size: 18px; font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.actbar-track { width: 100%; max-width: 90px; height: 120px; display: flex; align-items: flex-end; }
.actbar-fill { width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; transition: height .2s; }
.actbar-l { font-size: 12px; color: var(--muted); }

/* ── News occurrences chart (hover for top sources) ──── */
#occwrap { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.occbars { display: flex; align-items: flex-end; gap: 2px; height: 140px; }
.occbar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.occbar-fill { width: 100%; max-width: 34px; background: var(--brand); border-radius: 3px 3px 0 0; transition: background .12s; }
.occbar:hover .occbar-fill { background: var(--brand-dark); }
.occbar-fill.empty { background: #eef1e9; height: 2px !important; }
.occaxis { display: flex; gap: 2px; margin-top: 5px; }
.occtick { flex: 1 1 0; min-width: 0; font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; }
.occtip { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.14); border-radius: 10px; padding: 10px 12px; min-width: 190px; pointer-events: none; font-size: 13px; }
.occtip-h { margin-bottom: 6px; color: var(--ink); }
.occtip-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.occtip-l li { display: flex; justify-content: space-between; gap: 16px; }
.occtip-l li span { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.occtip-l li b { color: var(--brand-dark); }
.occtip-empty { color: var(--muted); }

.srctoggle { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.srctoggle button { padding: 6px 12px; font-size: 13px; cursor: pointer; background: var(--card); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.srctoggle button:hover { color: var(--ink); }
.srctoggle button.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.srclist { list-style: none; margin: 0; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 9px; }
.srcrow { display: grid; grid-template-columns: 130px 1fr 54px; align-items: center; gap: 10px; font-size: 13px; }
.srcrow .srcname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.srcrow .srctrack { background: #eef1e9; border-radius: 6px; height: 16px; overflow: hidden; }
.srcrow .srcfill { height: 100%; background: var(--brand); border-radius: 6px; transition: width .2s; }
.srcrow .srcn { text-align: right; font-variant-numeric: tabular-nums; color: var(--brand-dark); font-weight: 600; }
.srcempty { color: var(--muted); font-size: 13px; padding: 8px 2px; }

/* ── Source freshness dot ────────────────────────────── */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-green  { background: #1faa4d; animation: dot-blink 1.2s ease-in-out infinite; }
.dot-orange { background: #e8a317; }
.dot-red    { background: #d3342b; }
@keyframes dot-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.legend { font-size: 13px; margin: -4px 0 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend .dot { margin: 0 2px 0 8px; }

/* ── Inline editing (admin sources) ──────────────────── */
.inline-sel { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; max-width: 160px; cursor: pointer; }
.inline-sel:hover { border-color: var(--brand); }
.inline-sel:disabled { opacity: .6; }
.urlcell { display: inline-flex; align-items: center; gap: 6px; width: 100%; }
.urlcell .urllink { white-space: nowrap; }
.url-edit { flex: none; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.url-edit:hover { color: var(--brand); background: #eef3ff; }
.url-input { width: 100%; min-width: 240px; padding: 4px 6px; border: 1px solid var(--brand); border-radius: 6px; font-size: 13px; }
.save-ok  { animation: save-ok 1s ease; }
.save-err { animation: save-err 1s ease; }
@keyframes save-ok  { 0% { background: #d7f5dd; } 100% { background: transparent; } }
@keyframes save-err { 0% { background: #fbd7d4; } 100% { background: transparent; } }

.filterbar { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 12px; }
.filterbar label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.filterbar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.grid th .sorth, a.sorth { color: var(--muted); }
a.sorth:hover { color: var(--brand-dark); text-decoration: none; }

/* ---- Provider status popup (homepage topbar) ---- */
.pstat { position: relative; }
.pstat-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: transparent; color: #fff; cursor: pointer;
    border: 1px solid rgba(255,255,255,.5); border-radius: 6px;
    padding: 5px 10px; font-size: 14px; line-height: 1;
}
.pstat-btn b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pstat-btn .g, .pstat-list .g, .pstat-head .g { color: #2ecc71; }
.pstat-btn .o, .pstat-list .o, .pstat-head .o { color: #f39c12; }
.pstat-btn .r, .pstat-list .r, .pstat-head .r { color: #e74c3c; }
.pstat-led { width: 10px; height: 10px; border-radius: 50%; background: #95a5a6; display: inline-block; }
.pstat-led.g { background: #2ecc71; } .pstat-led.o { background: #f39c12; } .pstat-led.r { background: #e74c3c; }

.pstat-pop {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
    width: 320px; max-height: 70vh; overflow: auto;
    background: #fff; color: #222; border: 1px solid #d8dee6;
    border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
    font-size: 13px;
}
.pstat-head { padding: 9px 12px; border-bottom: 1px solid #eef1e9; font-weight: 600; position: sticky; top: 0; background: #fff; }
.pstat-head span { font-size: 11px; }
.pstat-list { list-style: none; margin: 0; padding: 4px 0; }
.pstat-list li { padding: 0; }
.pstat-row { display: flex; align-items: center; gap: 7px; padding: 4px 12px; color: inherit; text-decoration: none; }
.pstat-row:hover { background: #f6f8fb; }
.pstat-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.pstat-dot.green { background: #2ecc71; } .pstat-dot.orange { background: #f39c12; } .pstat-dot.red { background: #e74c3c; }
.pstat-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstat-age { color: #82847d; font-variant-numeric: tabular-nums; }
.pstat-foot { padding: 7px 12px; border-top: 1px solid #eef1e9; color: #82847d; font-size: 11px; }
@media (max-width: 480px) { .pstat-pop { width: 86vw; } }

/* ── 7-day publish-volume area chart (homepage browse) ───────────────────── */
.vchart {
    margin: 6px 0 14px; padding: 10px 12px 4px;
    border: 1px solid #e3e8ef; border-radius: 10px; background: #fbfcfe;
}
.vc-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    font-size: 13px; margin-bottom: 6px;
}
.vc-title { font-weight: 600; }
.vc-legend { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-left: auto; }
.vc-key { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #55606e; }
.vc-key i { width: 13px; height: 10px; border-radius: 2px; display: inline-block; }
.vc-key.all i { background: rgba(36,123,160,.85); }
.vc-key.sel i { background: rgba(195,178,153,.85); }
.vc-person-ico { font-size: 12px; line-height: 1; filter: grayscale(1); opacity: .8; }
.vc-person { max-width: 200px; }
.vc-reset { font-size: 12px; text-decoration: none; color: #3478dc; }
.vc-reset:hover { text-decoration: underline; }
.vc-status { font-variant-numeric: tabular-nums; }

.vc-plot { position: relative; height: 140px; cursor: crosshair; user-select: none; }
.vc-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.vc-area-all { fill: rgba(36,123,160,.20); stroke: rgba(36,123,160,.9);  stroke-width: 1; vector-effect: non-scaling-stroke; }
.vc-area-sel { fill: rgba(195,178,153,.28);  stroke: rgba(195,178,153,.95);  stroke-width: 1; vector-effect: non-scaling-stroke; }
.vc-cursor  { stroke: #99a3b0; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.vc-sel {
    position: absolute; top: 0; height: 100%;
    background: rgba(36,123,160,.14); border-left: 1px solid rgba(36,123,160,.6);
    border-right: 1px solid rgba(36,123,160,.6); pointer-events: none;
}
.vc-tip {
    position: absolute; top: 4px; z-index: 5; pointer-events: none;
    background: rgba(80,81,79,.94); color: #fff; font-size: 11.5px; line-height: 1.35;
    padding: 5px 8px; border-radius: 6px; white-space: nowrap;
}
.vc-tip .s { color: #ff9f96; }
.vc-axis { position: relative; height: 16px; margin-top: 2px; }
.vc-tick {
    position: absolute; transform: translateX(-50%); font-size: 10.5px;
    color: #82847d; white-space: nowrap; font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) { .vc-legend { margin-left: 0; } }
.vc-warn {
    font-size: 11px; font-weight: 600; color: #8a5a00;
    background: #fff4d6; border: 1px solid #f0d089; border-radius: 5px;
    padding: 2px 7px; white-space: nowrap; cursor: help;
}
.vc-warn { display: inline-flex; align-items: center; gap: 3px; }
.vc-warn-ico { line-height: 1; }
.vc-scale {
    font-size: 11px; font-weight: 700; color: #8a5a00;
    background: #fbf8f1; border: 1px solid #c3b299; border-radius: 4px;
    padding: 1px 2px; margin-left: 1px; cursor: pointer;
}
.filter-dates { display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; }

/* Person filter combobox (freeform input + top-30/search dropdown) */
.filter-person { display: flex; flex-direction: column; gap: 4px; }
.person-box { position: relative; }
.person-box::after {                    /* combobox caret; clear × replaces it when filled */
    content: ''; position: absolute; right: 12px; top: 50%; pointer-events: none;
    width: 7px; height: 7px; margin-top: -6px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
}
.person-box.has-val::after { display: none; }
.person-list .person-head {
    cursor: default; color: var(--muted); font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px 4px;
}
.person-list .person-head:hover { background: none; }
.person-input {
    width: 220px; padding: 8px 28px 8px 10px;
    border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff;
}
.person-input:focus { outline: none; border-color: var(--brand); }
.person-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; line-height: 18px; text-align: center;
    border: 0; border-radius: 50%; background: #eef0f3; color: var(--muted);
    font-size: 15px; cursor: pointer; padding: 0;
}
.person-clear:hover { background: #e0e3e8; color: var(--ink); }
.person-list {
    position: absolute; z-index: 30; left: 0; right: auto; min-width: 280px; top: calc(100% + 4px);
    margin: 0; padding: 4px; list-style: none; max-height: 300px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.person-list li {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.person-list li:hover { background: #eaf2f6; }
.person-list .pn { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-list .pc { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Always-visible compact filter bar — panel with two grouped rows:
   row 1 = WHAT (Izvori, Države, Osoba), row 2 = HOW (Period | Sortiranje | Linkovi) + akcije */
.filters-bar {
    flex-basis: 100%; display: flex; flex-direction: column; margin-top: 10px;
    background: #f7f9f3; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
}
.filters-bar .f-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; }
.filters-bar .f-row + .f-row { border-top: 1px solid var(--line); }
.filters-bar .f-group { display: inline-flex; align-items: center; gap: 8px; }
.filters-bar .f-vr { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
@media (max-width: 640px) { .filters-bar .f-vr { display: none; } }
.filters-bar .filter-actions { margin-left: auto; align-self: center; gap: 8px; }
.filters-bar .filter-actions button[type="submit"] { min-height: 36px; padding: 7px 16px; }
.filters-bar .f-sel, .filters-bar .f-date {
    min-height: 36px; padding: 6px 9px; border: 1px solid var(--line);
    border-radius: 8px; background: #fff; font-size: 14px; color: var(--ink);
}
.filters-bar .f-dash { color: var(--muted); margin: 0 -3px; }
.filters-bar .person-box .person-input { min-height: 36px; width: 170px; }

/* Custom multiselect dropdown (Izvori / Države) */
.ms { position: relative; }
.ms-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 36px; min-width: 150px;
    max-width: 240px; padding: 5px 11px; background: #fff; cursor: pointer;
    border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink);
}
.ms-btn:hover { border-color: #b6c0ad; }
.ms.open .ms-btn { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36,123,160,.14); }
.ms.has .ms-btn { border-color: var(--brand); background: #e3eef4; color: var(--brand-dark); font-weight: 600; }
.ms-ico { display: inline-flex; flex: 0 0 auto; color: var(--muted); }
.ms.has .ms-ico { color: var(--brand); }
.ms-summary { display: inline-flex; align-items: center; gap: 4px; max-width: 175px; overflow: hidden; white-space: nowrap; }
.ms-summary .flag { margin-right: 0; }
.ms-ph { color: var(--muted); font-weight: 400; }
.ms-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px;
    height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand);
    color: #fff; font-size: 12px; font-weight: 700;
}
.ms-caret {
    margin-left: auto; flex: 0 0 auto; width: 7px; height: 7px; margin-top: -3px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg); transition: transform .15s;
}
.ms.open .ms-caret { transform: rotate(225deg); margin-top: 3px; border-color: var(--brand); }
.ms.has .ms-caret { border-color: var(--brand); }
.ms-panel {
    position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; width: 296px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15,30,60,.16); padding: 8px;
}
.ms-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.ms-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ms-none { background: none; border: 0; padding: 2px 5px; border-radius: 6px; color: var(--brand); font-size: 12px; cursor: pointer; }
.ms-none:hover { background: #eaf2f6; }
.ms-search { width: 100%; padding: 7px 9px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.ms-search:focus { outline: none; border-color: var(--brand); }
.ms-options { list-style: none; margin: 0; padding: 0; max-height: 288px; overflow-y: auto; }
.ms-opt label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.ms-opt label:hover { background: #eaf2f6; }
.ms-opt input { margin: 0; flex: 0 0 auto; width: 15px; height: 15px; accent-color: var(--brand); }
.ms-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Countries: flag-chip grid instead of a checkbox list */
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; max-height: none; }
.ms-chips .ms-opt label {
    border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; gap: 6px; background: #fff;
}
.ms-chips .ms-opt label:hover { border-color: #b6c0ad; background: #fff; }
.ms-chips .ms-opt input { display: none; }
.ms-chips .ms-opt label:has(input:checked) {
    border-color: var(--brand); background: #e3eef4; color: var(--brand-dark); font-weight: 600;
}
.ms-chips .ms-count { margin-left: 0; }

/* Admin › Analytics (admin_stats.php) */
.anbars {
    display: flex; align-items: flex-end; gap: 3px; height: 130px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px 12px 0 0; padding: 14px 14px 0;
}
.anbar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.anbar-fill { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; opacity: .92; }
.anbar:hover .anbar-fill { background: var(--brand-dark); opacity: 1; }
.anbar-fill.empty { background: var(--line); height: 2px !important; }
.anaxis {
    display: flex; gap: 3px; background: var(--card); border: 1px solid var(--line);
    border-top: 0; border-radius: 0 0 12px 12px; padding: 4px 14px 8px; margin-bottom: 24px;
}
.anaxis span { flex: 1 1 0; min-width: 0; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible; }
.antbl { border-collapse: collapse; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; font-size: 13px; }
.antbl th, .antbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.antbl th { color: var(--muted); font-weight: 600; }
.antbl tr:last-child td { border-bottom: 0; }
.antbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.antbl .ua { max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Analytics line charts (replaced the bar variant) */
.anline {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px 12px 0 0; padding: 12px 14px 0;
}
.anline svg { display: block; width: 100%; height: 140px; }
.anl-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 4; }
.anl-area { fill: rgba(36,123,160,.16); stroke: none; }
.anl-line { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.anl-vis  { fill: none; stroke: #50514f; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 4 4; opacity: .75; }
.anl-hot  { fill: transparent; }
.anl-hot:hover { fill: rgba(36,123,160,.08); }
.anleg { float: right; font-size: 12px; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.anleg i { width: 16px; height: 0; border-top: 2px solid var(--brand); display: inline-block; }
.anleg i.anleg-v { border-top: 2px dashed #50514f; opacity: .75; }
