/**
 * style.css — TikTok BC Manager · Priority Gold-Black theme
 */
:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --bg-3: #1a1a1d;
  --border: #2a2a2e;
  --gold: #d4af37;
  --gold-2: #f4cf5f;
  --gold-dim: #8a7020;
  --text: #e8e8e8;
  --muted: #8a8a8f;
  --green: #2ecc71;
  --red: #e74c3c;
  --yellow: #f1c40f;
  --blue: #3498db;
  --primary: #d4af37;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.green { color: var(--green); }
.red { color: var(--red); }
code { font-family: "SF Mono", Consolas, monospace; font-size: 11px; color: var(--gold-2); background: rgba(212,175,55,0.08); padding: 1px 5px; border-radius: 3px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--border);
  background: var(--bg-3); color: var(--text);
  border-radius: 6px; cursor: pointer; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-dim); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-gold { background: linear-gradient(180deg, #f4cf5f 0%, #d4af37 100%); color: #1a1300; border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-primary { background: #2c2c30; border-color: var(--gold-dim); color: var(--gold-2); }
.btn-success { background: rgba(46,204,113,0.15); border-color: var(--green); color: var(--green); }
.btn-danger { background: rgba(231,76,60,0.12); border-color: var(--red); color: var(--red); }
.btn-blue { background: rgba(52,152,219,0.12); border-color: var(--blue); color: var(--blue); }
.btn-green { background: rgba(46,204,113,0.12); border-color: var(--green); color: var(--green); }
.btn-orange { background: rgba(230,126,34,0.12); border-color: #e67e22; color: #e67e22; }
.btn-warning { background: rgba(241,196,15,0.12); border-color: var(--yellow); color: var(--yellow); }
.btn-ghost { background: transparent; }

/* ===== Badges ===== */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
}
.badge-green { background: rgba(46,204,113,0.15); color: var(--green); }
.badge-red { background: rgba(231,76,60,0.15); color: var(--red); }
.badge-yellow { background: rgba(241,196,15,0.15); color: var(--yellow); }
.badge-blue { background: rgba(52,152,219,0.15); color: var(--blue); }
.badge-gray { background: rgba(138,138,143,0.15); color: var(--muted); }

/* ===== Copy ID ===== */
.copy-id {
  cursor: pointer; color: var(--gold); user-select: all;
  transition: color 0.15s;
}
.copy-id:hover { color: var(--gold-2); text-decoration: underline; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 0%, #1a1500 0%, #0a0a0b 60%);
}
.login-card {
  width: 360px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.1);
}
.login-logo { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-logo span { color: var(--gold); }
.login-sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.login-card input {
  width: 100%; padding: 11px 14px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--gold); }

/* ===== App layout ===== */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 60px; background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 16px 0;
  flex-shrink: 0;
}
.sidebar .logo {
  font-size: 11px; font-weight: 700; margin-bottom: 20px; text-align: center; line-height: 1.2;
}
.sidebar .logo span { color: var(--gold); }
.nav-item {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; font-size: 18px; margin-bottom: 6px;
  color: var(--muted); transition: all .15s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: rgba(212,175,55,0.12); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(212,175,55,0.25); }

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg-2);
  flex-shrink: 0;
}
.brand-pill {
  background: linear-gradient(180deg, rgba(244,207,95,0.12), rgba(212,175,55,0.05));
  border: 1px solid rgba(212,175,55,0.3); color: var(--gold-2);
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.subnav {
  display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-2); flex-shrink: 0;
}
.subnav-item {
  padding: 12px 16px; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; transition: all .15s;
  letter-spacing: 0.5px;
}
.subnav-item:hover { color: var(--text); }
.subnav-item.active { color: var(--gold); border-bottom-color: var(--gold); }

.main { flex: 1; overflow-y: auto; padding: 20px; }

/* ===== Hero ===== */
.hero {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, rgba(212,175,55,0.06), rgba(212,175,55,0.01));
  border: 1px solid rgba(212,175,55,0.2); border-radius: 10px;
  padding: 24px 28px; margin-bottom: 20px;
}
.hero h1 { font-size: 22px; margin-bottom: 6px; }
.hero p { font-size: 13px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 14px; margin-bottom: 14px; font-weight: 600; }

.section-title {
  display: flex; justify-content: space-between; align-items: center;
  margin: 4px 2px 12px; font-size: 13px; font-weight: 600; color: var(--gold-2);
}

/* ===== Stats grid ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
  border-left: 3px solid var(--gold);
}
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 11px; margin-top: 4px; }

/* ===== Dashboard grid (chart + issues) ===== */
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* ===== Chart ===== */
.chart { min-height: 180px; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px; overflow-x: auto; }
.bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 14px; }
.bar { width: 100%; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-radius: 2px 2px 0 0; min-height: 2px; transition: height .3s; }
.bar-label { font-size: 9px; color: var(--muted); margin-top: 4px; transform: rotate(-45deg); white-space: nowrap; }

/* ===== Issue list ===== */
.issue-list { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; }
.issue-item {
  background: var(--bg-3); border: 1px solid var(--border);
  border-left: 3px solid var(--red); border-radius: 6px; padding: 10px 12px;
}
.issue-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.issue-body { font-size: 11px; line-height: 1.4; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px;
}
.filter-bar select, .filter-bar input {
  padding: 7px 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12px;
}
.filter-bar input { min-width: 180px; }
.filter-stat { font-size: 12px; color: var(--gold-2); font-weight: 600; margin-right: auto; }

/* ===== Bulk action bar ===== */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
  border: 1px solid rgba(212,175,55,0.3); border-radius: 8px;
}
.bulk-bar strong { color: var(--gold); }
.bulk-bar .muted { font-size: 12px; }

/* ===== Quick filter chips ===== */
.quick-filters {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px;
}
.chip {
  padding: 6px 14px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); font-size: 12px; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.chip:hover { border-color: var(--gold-2); }
.chip.active {
  background: var(--gold); color: #000; border-color: var(--gold); font-weight: 600;
}
.chip-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.chip-adv { display: flex; align-items: center; gap: 6px; }
.chip-caret { font-size: 10px; opacity: 0.7; }
.chip .count {
  background: rgba(0,0,0,0.25); padding: 1px 7px; border-radius: 10px;
  font-size: 11px; margin-left: 4px;
}
.chip.active .count { background: rgba(0,0,0,0.2); }

/* ===== Ad account multi-select dropdown ===== */
.adv-dropdown { position: relative; }
.adv-dropdown-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 100;
  width: 420px; max-width: 90vw; background: var(--bg-2);
  border: 1px solid var(--gold); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6); overflow: hidden;
}
.adv-dropdown-panel.hidden { display: none; }
.adv-dropdown-header {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px; border-bottom: 1px solid var(--border);
}
.adv-dropdown-header input {
  flex: 1; min-width: 160px; padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12px;
}
.adv-check-inline {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.adv-check-inline input { cursor: pointer; }
.adv-dropdown-list {
  max-height: 320px; overflow-y: auto; padding: 6px 0;
}
.adv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer; transition: background 0.1s;
}
.adv-item:hover { background: rgba(212,175,55,0.08); }
.adv-item input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; }
.adv-item-name { flex: 1; font-size: 12px; color: var(--text); }
.adv-item-id { font-size: 11px; color: var(--muted); font-family: monospace; }
.badge-live {
  background: #e74c3c; color: #fff; padding: 1px 6px;
  border-radius: 8px; font-size: 10px; font-weight: 600;
}
.adv-dropdown-footer {
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--bg-3);
}
.adv-info { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.adv-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.data-table th, .data-table td {
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  background: var(--bg-3); color: var(--muted); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
  position: sticky; top: 0;
}
.data-table tbody tr:hover { background: rgba(212,175,55,0.04); }
.data-table tfoot td { font-weight: 600; background: var(--bg-3); border-top: 2px solid var(--gold); }
.camp-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ===== Toggle switch ===== */
.switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #3a3a40; border-radius: 20px; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; height: 14px; width: 14px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* ===== Forms ===== */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row > div { flex: 1; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select {
  width: 100%; padding: 8px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px;
}
.flex { display: flex; }
.gap-8 { gap: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; min-width: 360px; max-width: 90vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal h3 { margin-bottom: 16px; font-size: 16px; color: var(--gold-2); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-wide { min-width: 720px; max-width: 95vw; }

/* ===== Bulk Create Form ===== */
.bulk-create-form { max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.bulk-create-form h4 {
  margin: 0 0 10px; font-size: 13px; color: var(--gold-2);
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.bulk-section { margin-bottom: 18px; }
.form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
}
.form-row-2 > div { display: flex; flex-direction: column; }
.form-row-2 label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-row-2 input, .form-row-2 select, .form-row-2 textarea {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  padding: 7px 10px; border-radius: 5px; font-size: 12px; outline: none;
}
.form-row-2 input:focus, .form-row-2 select:focus, .form-row-2 textarea:focus {
  border-color: var(--gold);
}
.bulk-acc-toolbar {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
}
.bulk-acc-toolbar input { flex: 1; }
.bulk-acc-list {
  max-height: 200px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 5px; padding: 4px; background: var(--bg-3);
}
.bulk-acc-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 4px; cursor: pointer; font-size: 12px;
}
.bulk-acc-item:hover { background: rgba(212,175,55,0.08); }
.bulk-acc-item input[type="checkbox"] { margin: 0; }
.bulk-acc-item span { color: var(--text); }
.bulk-acc-item code { color: var(--gold); font-size: 11px; }
.bulk-acc-footer {
  margin-top: 8px; font-size: 12px; color: var(--muted); text-align: right;
}

/* Checkbox group (age, network type) */
.chk-group {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 4px;
}
.chk-group .chk-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 12px; background: rgba(255,255,255,0.03);
  user-select: none;
}
.chk-group .chk-item:hover { border-color: var(--gold); }
.chk-group .chk-item input { margin: 0; }
.chk-group .chk-item:has(input:checked) { border-color: var(--gold); background: rgba(255,200,0,0.12); color: var(--gold); }
.chk-group .btn-xs { padding: 5px 10px; font-size: 11px; }

/* ===== Toast ===== */
#toastContainer {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--gold); color: var(--text);
  padding: 10px 16px; border-radius: 6px; font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideIn .2s ease;
}
.toast.error { border-color: var(--red); }
.toast.success { border-color: var(--green); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal width variants */
.modal-narrow { max-width: 420px; }
.modal-wide { max-width: 800px; }

/* Bulk create right-side panel */
.bulk-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 90vw;
  background: #1a1a1a; border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.6); z-index: 10000;
  display: flex; flex-direction: column;
  animation: slideInRight 0.25s ease;
  opacity: 1 !important;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.bulk-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.bulk-panel-header h4 { margin: 0; font-size: 15px; }
.bulk-panel-close {
  background: none; border: none; color: var(--muted); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.bulk-panel-close:hover { color: var(--text); }
.bulk-panel-body { padding: 16px 18px; flex: 1; overflow-y: auto; }
.bulk-panel-footer { padding: 14px 18px; border-top: 1px solid var(--border); }

/* ===== Bulk progress (chi tiết theo từng giai đoạn) ===== */
.bulk-progress-head { margin-bottom: 14px; }
.bulk-progress-stats {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px;
}
.bp-stat { display: inline-flex; align-items: center; gap: 4px; }
.bp-stat .bp-num { font-weight: 700; font-size: 14px; }
.bp-stat .bp-total { color: var(--muted); }
.bp-done .bp-num { color: var(--gold); }
.bp-ok .bp-num { color: var(--green); }
.bp-fail .bp-num { color: var(--red); }
.bulk-progress-bar {
  height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden;
}
.bulk-progress-fill {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transition: width 0.3s ease; border-radius: 3px;
}

.bulk-stages-wrap { overflow-x: auto; }
.bulk-stages-table {
  width: 100%; border-collapse: collapse; font-size: 11.5px;
}
.bulk-stages-table th {
  position: sticky; top: 0; background: var(--bg-2); z-index: 1;
  padding: 6px 4px; text-align: left; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.bulk-stages-table th.th-stage { text-align: center; width: 32px; }
.bulk-stages-table td { padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.bulk-stages-table .bs-adv { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.bulk-stages-table .bs-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bulk-stages-table .bs-stage { text-align: center; width: 32px; }
.bulk-stages-table .bs-status { text-align: center; }
.bs-row.bs-running { background: rgba(212,175,55,0.05); }
.bs-row.bs-error { background: rgba(231,76,60,0.06); }

/* Stage icons */
.st { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; }
.st-pend { color: var(--muted); border: 1.5px solid var(--border); }
.st-ok { color: #fff; background: var(--green); }
.st-err { color: #fff; background: var(--red); }
.st-run { background: rgba(212,175,55,0.15); border: 1.5px solid var(--gold); }
.st-spinner {
  width: 10px; height: 10px; border: 2px solid rgba(212,175,55,0.3); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

.bulk-final-summary { font-size: 13px; }
.bulk-errors {
  margin-top: 12px; padding: 10px 12px; background: rgba(231,76,60,0.06);
  border: 1px solid rgba(231,76,60,0.25); border-radius: 6px;
}
.bulk-errors-title { font-weight: 600; color: var(--red); margin-bottom: 6px; font-size: 12px; }
.bulk-errors ul { margin: 0; padding-left: 18px; font-size: 11px; line-height: 1.55; max-height: 200px; overflow-y: auto; }
.bulk-errors li { margin-bottom: 4px; word-break: break-word; }


/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ===== Post Picker (Spark Ads video grid) ===== */
.post-picker {
  position: relative; flex: 1; min-width: 0;
}
.pp-toggle {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; cursor: pointer; transition: border-color 0.15s;
  min-height: 44px;
}
.pp-toggle:hover { border-color: var(--gold-dim); }
.post-picker:focus .pp-toggle { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,0.2); }
.pp-selected-preview {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.pp-selected-placeholder {
  font-size: 13px; color: var(--muted);
}
.pp-selected-thumb {
  position: relative; width: 40px; height: 64px; border-radius: 4px; overflow: hidden;
  background: #000; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.pp-selected-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pp-selected-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.pp-selected-caption {
  font-size: 12px; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pp-selected-id {
  font-size: 10px; color: var(--muted); font-family: monospace;
}
.pp-clear-btn {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 4px 6px; border-radius: 4px; flex-shrink: 0;
}
.pp-clear-btn:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }
.pp-caret { color: var(--muted); margin-left: 8px; font-size: 10px; flex-shrink: 0; }
.pp-dropdown {
  display: none; position: absolute; z-index: 100; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); max-height: 440px; overflow: hidden;
}
.pp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; padding: 10px; max-height: 360px; overflow-y: auto;
}
.pp-item {
  background: var(--bg-3); border: 1.5px solid transparent; border-radius: 8px;
  cursor: pointer; overflow: hidden; transition: transform 0.12s, border-color 0.12s;
  display: flex; flex-direction: column;
}
.pp-item:hover { transform: translateY(-2px); border-color: var(--gold-dim); }
.pp-item.pp-selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,0.25); }
.pp-thumb {
  position: relative; aspect-ratio: 9/16; background: #000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pp-no-thumb-inner { color: var(--muted); font-size: 28px; }
.pp-badge {
  position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,0.75); color: var(--gold);
  font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 3px; letter-spacing: 0.3px;
}
.pp-duration {
  position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.75); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
}
.pp-meta { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.pp-caption {
  font-size: 11px; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pp-id { font-size: 10px; color: var(--muted); font-family: monospace; }
.pp-empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }
.pp-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-top: 1px solid var(--border); background: rgba(0,0,0,0.25);
  font-size: 11px;
}

/* ===== Admin page ===== */
.admin-header { margin-bottom: 16px; }
.admin-header h2 { margin: 0 0 4px; }
.admin-stats {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.stat-card {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 20px; min-width: 120px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.role-select {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; font-size: 12px;
}
.perms-cell { max-width: 420px; }
.perms-cell .chk-item.small {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; font-size: 11px; background: rgba(255,255,255,0.03);
  user-select: none; margin: 2px; transition: all .15s;
}
.perms-cell .chk-item.small:hover { border-color: var(--gold); }
.perms-cell .chk-item.small.active {
  border-color: var(--gold); background: rgba(212,175,55,0.15); color: var(--gold);
}

