@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --black: #050506;
  --near-black: #0d0d10;
  --panel: #13131a;
  --line: #26262e;
  --gray: #8f8d99;
  --white: #f2f1f6;
  --dim-white: #c9c9c6;
  --green: #7ec8ff;
  --green-dim: #4a9edb;
  --green-glow: rgba(126,200,255,0.45);
  --display: 'Playfair Display', serif;
  --body: 'Inter', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --radius: 6px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--body);
  background: var(--black);
  color: var(--white);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--green); color: var(--black); }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 190px;
  flex-shrink: 0;
  background: var(--near-black);
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--white);
  padding: 0 0.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .brand img { width: 30px; height: 30px; }
.sidebar a {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--gray);
  padding: 9px 10px;
  border-radius: var(--radius);
  text-transform: uppercase;
  transition: color .2s, background .2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar a.active {
  background: var(--panel);
  color: var(--green);
}
.sidebar a.disabled {
  color: #4a4a4a;
  cursor: default;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar a.disabled .soon {
  font-size: 9px;
  color: #4a4a4a;
  border: 1px solid #2a2a2a;
  padding: 1px 5px;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
}
.channel-link { color: var(--white); text-decoration: none; }
.channel-link:hover { color: var(--green); text-decoration: underline; }

.last-post-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}
.last-post-pill.level-0 { color: var(--gray); border-color: var(--line); }
.last-post-pill.level-1 { color: #ffe66d; border-color: #4d3f0a; background: rgba(255,230,109,0.06); }
.last-post-pill.level-2 { color: #ffa94d; border-color: #4d2f0a; background: rgba(255,169,77,0.06); }
.last-post-pill.level-3 { color: #ff5c5c; border-color: #4d1414; background: rgba(255,92,92,0.06); }

.last-post-note.level-0 { color: var(--gray); }
.last-post-note.level-1 { color: #ffe66d; }
.last-post-note.level-2 { color: #ffa94d; }
.last-post-note.level-3 { color: #ff5c5c; }

.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--white);
  min-width: 16px;
  text-align: center;
}
.nav-badge.level-0 { background: var(--panel); color: var(--dim-white); }
.nav-badge.level-1 { background: #4d3f0a; color: #ffe66d; }
.nav-badge.level-2 { background: #4d2f0a; color: #ffa94d; }
.nav-badge.level-3 { background: #4d1414; color: #ff5c5c; }

.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.sidebar-footer a:hover { color: var(--white); }

.content { flex: 1; min-width: 0; padding: 2rem 2.5rem; max-width: 920px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }

.status-pill { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.dot.off { background: #ff5c5c; }
.tag {
  font-family: var(--mono); font-size: 11px; color: var(--dim-white);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.banner {
  font-family: var(--mono); font-size: 12.5px; color: var(--green);
  border: 1px solid var(--green-dim); background: rgba(126,200,255,0.06);
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 1.5rem;
}

.stat-grid { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2rem; }
.stat-grid .stat-card { flex: 1 1 150px; }
.stat-card { background: var(--black); padding: 1.1rem 1.2rem; }
.stat-label { font-family: var(--mono); font-size: 10.5px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; line-height: 1.35; }
.stat-value { font-family: var(--mono); font-size: 26px; font-weight: 600; margin: 0; color: var(--white); text-shadow: 0 0 24px rgba(247,247,245,0.25); }
.stat-sub { font-size: 14px; color: var(--gray); font-weight: 400; }

.channels-forms-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.channels-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

.dashboard-columns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: start; }
.dashboard-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2rem; align-items: stretch; }
.dashboard-two-col > div { background: var(--black); padding: 1.5rem; }
.latin-col { border-left: none; }
.dash-col { min-width: 0; }
.list-scroll { max-height: 420px; overflow-y: auto; }
.list-scroll-restrictions { max-height: 180px; overflow-y: auto; }
.list-scroll-sm { max-height: 160px; overflow-y: auto; }
.list-scroll::-webkit-scrollbar, .list-scroll-sm::-webkit-scrollbar, .list-scroll-restrictions::-webkit-scrollbar { width: 6px; }
.list-scroll::-webkit-scrollbar-thumb, .list-scroll-sm::-webkit-scrollbar-thumb, .list-scroll-restrictions::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.restriction-row { padding: 0; }
.restriction-edit-link {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; color: var(--white); font-family: var(--body); font-size: 14px;
}
.restriction-edit-link:hover { background: var(--near-black); }
.restriction-edit-link:hover span:first-child { color: var(--green); }
.remove-x {
  background: transparent; border: none; color: var(--gray); font-size: 18px; line-height: 1;
  width: 42px; height: 100%; cursor: pointer; transition: color .2s;
}
.remove-x:hover { color: #ff5c5c; }

.chart-card { background: var(--black); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; height: 320px; position: relative; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.account-restrict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2rem; }
.acct-restrict-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.tuning-field { display: flex; flex-direction: column; gap: 3px; }

.settings-subhead {
  font-family: var(--mono); font-size: 11px; color: var(--gray); text-transform: uppercase;
  letter-spacing: 0.06em; margin: 1.75rem 0 0.6rem;
}
.settings-subhead:first-of-type { margin-top: 0; }
.restrict-card { background: var(--black); padding: 1.1rem 14px; display: flex; flex-direction: column; gap: 8px; }
.restrict-card summary { list-style: none; }
.restrict-card summary::-webkit-details-marker { display: none; }
.restrict-card summary::before { content: '▸ '; color: var(--gray); font-size: 11px; }
.restrict-card[open] summary::before { content: '▾ '; }
.restrict-title { font-family: var(--display); font-weight: 700; font-size: 15px; margin: 0; }
.restrict-row { display: flex; gap: 8px; }
.clear-toggle {
  display: flex; align-items: center; justify-content: center;
  padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--mono); font-size: 11px; color: var(--gray);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: all .15s ease; flex-shrink: 0;
}
.clear-toggle input { display: none; }
.clear-toggle:hover { border-color: #ff5c5c; color: #ff8080; }
.clear-toggle:has(input:checked) {
  background: rgba(255,92,92,0.12); border-color: #ff5c5c; color: #ff8080;
}
.clear-toggle:has(input:checked) span::before { content: "✕ "; }
.restrict-row input, .restrict-row select, .tuning-field input, .restrict-card > input, .restrict-card > form > select {
  background: var(--near-black); border: 1px solid var(--line); color: var(--white);
  padding: 9px 10px; border-radius: var(--radius); font-family: var(--mono); font-size: 12.5px; flex: 1; min-width: 0;
}
.restrict-row input:focus, .restrict-row select:focus, .tuning-field input:focus, .restrict-card > input:focus { outline: none; border-color: var(--green); }
.restrict-card .ctrl-btn { align-self: flex-start; margin-top: 4px; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .account-restrict-grid { grid-template-columns: 1fr; }
  .restrict-row { flex-direction: column; }
}

.priority-list { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); max-width: 340px; }
.priority-row { display: flex; align-items: center; gap: 10px; background: var(--black); padding: 8px 12px; }
.priority-num {
  font-family: var(--mono); font-size: 11px; color: var(--gray); width: 16px; text-align: center;
  border: 1px solid var(--line); border-radius: 50%; height: 16px; line-height: 16px; flex-shrink: 0;
}
.priority-name { font-family: var(--mono); font-size: 12.5px; color: var(--white); flex: 1; }
.priority-arrows { display: flex; gap: 2px; }
.priority-arrow-btn {
  background: transparent; border: 1px solid var(--line); color: var(--gray); cursor: pointer;
  width: 22px; height: 22px; border-radius: var(--radius); font-size: 9px; line-height: 1;
}
.priority-arrow-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.priority-arrow-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.mode-row { display: flex; gap: 6px; margin-bottom: 0.6rem; }
.mode-row:last-of-type { margin-bottom: 1.5rem; }
.mode-btn {
  font-family: var(--mono); font-size: 11.5px; padding: 6px 14px; border-radius: var(--radius);
  color: var(--gray); border: 1px solid var(--line); background: transparent; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.03em; transition: border-color .2s, color .2s;
}
.mode-btn:hover { border-color: var(--dim-white); color: var(--dim-white); }
.mode-btn.active { border-color: var(--green); color: var(--green); }
.pair-btn.active { border-color: #5eb8ff; color: #5eb8ff; }

.service-controls { display: flex; align-items: center; gap: 8px; }
.pause-form { display: flex; align-items: center; gap: 6px; }
.pause-form input {
  width: 64px; background: var(--black); border: 1px solid var(--line); color: var(--white);
  padding: 8px 10px; border-radius: var(--radius); font-family: var(--mono); font-size: 12px;
}
.pause-form input:focus { outline: none; border-color: var(--green); }
.ctrl-btn {
  font-family: var(--mono); font-size: 12.5px; background: var(--white); color: var(--black);
  border: none; padding: 8px 14px; border-radius: var(--radius); cursor: pointer;
  transition: transform .15s, box-shadow .2s; white-space: nowrap;
}
.ctrl-btn:hover { transform: translateY(-1px); box-shadow: 0 0 16px var(--green-glow); }
.ctrl-btn.danger { background: transparent; color: var(--dim-white); border: 1px solid var(--line); }
.ctrl-btn.danger:hover { border-color: #ff5c5c; color: #ff5c5c; box-shadow: none; transform: none; }

#toast-stack {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--near-black); border: 1px solid var(--green-dim);
  color: var(--white); font-family: var(--mono); font-size: 12.5px;
  padding: 10px 16px; border-radius: var(--radius);
  box-shadow: 0 0 20px var(--green-glow);
  transform: translateX(120%); opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}
.toast-in { transform: translateX(0); opacity: 1; }

.mobile-menu-btn {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 38px; height: 38px; background: var(--near-black); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--white); font-size: 16px; cursor: pointer;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 45;
}

@media (max-width: 760px) {
  .mobile-menu-btn { display: block; }
  .shell { flex-direction: column; }
  .dashboard-two-col { grid-template-columns: 1fr; gap: 1px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: 220px; transform: translateX(-100%); transition: transform .25s ease;
    padding-top: 4rem;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .content { padding: 4.5rem 1rem 2rem; max-width: 100%; }
  .stat-grid .stat-card { flex-basis: 45%; }
  .section-title { flex-wrap: wrap; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar[style*="border-left"] { border-left: none !important; border-top: 2px solid #ffd24d; padding-left: 0 !important; padding-top: 12px; }
  .dashboard-columns { grid-template-columns: 1fr; gap: 1rem; }
  .channels-forms-row { grid-template-columns: 1fr; gap: 1rem; }
  .channels-columns { grid-template-columns: 1fr; gap: 1rem; }
  .list-scroll { max-height: 320px; }
  .service-controls { width: 100%; flex-wrap: wrap; }
  .pause-form { flex: 1; min-width: 140px; }
  .pause-form input { flex: 1; width: auto; }
  .thumb-row input[type="checkbox"] { width: 20px; height: 20px; }
  .thumb { width: 52px; height: 74px; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .submit-btn { width: 100%; }
  .pager { justify-content: center; }
  .login-card { width: 88%; max-width: 300px; }
}

.stat-value.level-0 { color: var(--white); }
.stat-value.level-1 { color: #ffe66d; }
.stat-value.level-2 { color: #ffa94d; }
.stat-value.level-3 { color: #ff5c5c; }

.section-title {
  font-family: var(--display); font-weight: 700; font-size: 18px;
  margin: 2rem 0 1rem; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 10px;
}
.section-title .sec-num { font-family: var(--mono); font-size: 11px; color: var(--gray); letter-spacing: 0.08em; }
.muted { color: var(--gray); }
.small { font-size: 12px; }

.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--black); padding: 12px 14px; transition: background .2s; min-width: 0;
}
.list-row .row-title { overflow-wrap: anywhere; min-width: 0; }
.list-row:hover { background: var(--near-black); }
.list-row.overdue { border-left: 2px solid #ff5c5c; }
.list-row a { color: var(--green); font-family: var(--mono); font-size: 12px; }
.row-title { margin: 0; font-size: 13px; font-family: var(--mono); }

.filter-row { display: flex; gap: 6px; }
.filter-row a {
  font-family: var(--mono); font-size: 11px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em;
}
.filter-row a.active { border-color: var(--green); color: var(--green); }

.phase-note {
  margin-top: 2.5rem; font-family: var(--mono); font-size: 11px; color: var(--gray);
  border-top: 1px solid var(--line); padding-top: 1rem; text-transform: uppercase; letter-spacing: 0.04em;
}

.link-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.link-stack .ig-link { color: var(--green); font-family: var(--mono); font-size: 12px; }
.link-stack .tiktok-link { color: var(--gray); font-family: var(--mono); font-size: 11px; }
.link-stack .tiktok-link:hover { color: var(--dim-white); }

.thumb-row { cursor: pointer; }
.thumb-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; cursor: pointer;
}
.thumb {
  width: 42px; height: 60px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--line); flex-shrink: 0; background: var(--near-black);
}
.thumb-empty { display: flex; }

.submit-btn {
  margin-top: 1rem; font-family: var(--mono); font-size: 13px;
  background: var(--white); color: var(--black); border: none;
  padding: 12px 22px; border-radius: var(--radius); cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 0 20px var(--green-glow); }
.submit-btn.secondary { background: transparent; color: var(--white); border: 1px solid var(--line); }
.submit-btn.secondary:hover { border-color: var(--green); color: var(--green); box-shadow: none; }

.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

.pager { display: flex; align-items: center; gap: 10px; }
.pager-label { font-family: var(--mono); font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; }
.pager-btn {
  font-family: var(--mono); font-size: 13px; color: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
}
.pager-btn:hover { border-color: var(--green); color: var(--green); }
.pager-btn.disabled { color: #3a3a3a; border-color: #222222; pointer-events: none; }

.list-row.inline-divider {
  padding: 6px 14px; background: var(--near-black); justify-content: flex-start;
}
.list-row.inline-divider span { letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }

.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.88); align-items: center; justify-content: center;
  cursor: zoom-out; padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(90vw, 480px); max-height: 85vh; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 0 40px rgba(126,200,255,0.15);
}

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.85); align-items: center; justify-content: center; padding: 2rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--near-black); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; width: 100%; max-width: 480px; box-shadow: 0 0 40px rgba(126,200,255,0.1);
}

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); position: relative; overflow: hidden; }
.login-wrap::before {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  top: -220px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, var(--green-glow) 0%, rgba(126,200,255,0) 70%);
  filter: blur(10px); opacity: 0.28; pointer-events: none;
}
.login-card {
  position: relative; background: var(--near-black); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.5rem 2.25rem; width: 300px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-title {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray); margin: 0 0 0.5rem; text-align: center;
}
.login-card input {
  background: var(--black); border: 1px solid var(--line); color: var(--white);
  padding: 12px 14px; border-radius: var(--radius); font-size: 14px; font-family: var(--body);
}
.login-card input:focus { outline: none; border-color: var(--green); }
.login-card button {
  font-family: var(--mono); font-size: 13px; padding: 12px; border: none;
  border-radius: var(--radius); background: var(--white); color: var(--black); cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 0 20px var(--green-glow); }

