:root {
  --bg: #09090b;
  --surface: #121215;
  --surface-2: #18181c;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #fe2c55;
  --accent-hover: #e62248;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* AUTH LOGIN SCREEN */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: radial-gradient(circle at 50% 0%, rgba(254, 44, 85, 0.12), transparent 55%), var(--bg);
}

.auth-public-footer {
  max-width: 560px;
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-public-open-card {
  background: rgba(24, 24, 27, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-public-title {
  font-size: 13px;
  font-weight: 600;
  color: #e4e4e7;
}

.auth-public-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: #d4d4d8;
}

.auth-public-pillars span {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 99px;
}

.auth-public-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: #a1a1aa;
}

.auth-public-details {
  margin-top: 6px;
}

.auth-public-details summary {
  cursor: pointer;
  color: #a1a1aa;
  font-size: 11.5px;
  user-select: none;
}

.auth-public-details summary:hover {
  color: #e4e4e7;
}

.auth-public-box {
  margin-top: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 11.5px;
  color: #a1a1aa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 22px;
}

.auth-card h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 10px;
}

.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.step-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

/* NAVBAR */
.navbar {
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.tab-count {
  font-size: 11px;
  background: var(--border);
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--text);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-account {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
}

/* QUEUE BAR */
.queue-bar {
  background: rgba(254, 44, 85, 0.1);
  border-bottom: 1px solid rgba(254, 44, 85, 0.3);
  padding: 9px 0;
}

.queue-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.queue-btns {
  display: flex;
  gap: 6px;
}

/* MAIN CONTENT */
.main-content {
  padding-top: 32px;
  padding-bottom: 64px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.page-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}

/* EMPTY HERO */
.empty-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 28px;
}

.empty-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(254, 44, 85, 0.15);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.empty-hero h2 {
  font-size: 18px;
  font-weight: 600;
}

.empty-hero p {
  color: var(--muted);
  max-width: 480px;
  margin: 6px auto 18px;
  font-size: 13.5px;
}

/* GRID & PANELS */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.panel h2 {
  font-size: 15px;
  font-weight: 600;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.balance-pill {
  font-size: 12px;
  font-weight: 600;
  color: #e4e4e7;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 99px;
}

/* VIDEO LIST */
.add-video-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.video-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.video-card:hover {
  border-color: var(--border-hover);
}

.video-card.selected {
  border-color: var(--accent);
  background: rgba(254, 44, 85, 0.06);
}

.video-thumb {
  width: 38px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.video-thumb-placeholder {
  width: 38px;
  height: 50px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.video-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.video-card-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.video-ext-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.video-ext-link:hover {
  text-decoration: underline;
}

.panel-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* FIELDS & INPUTS */
.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #e4e4e7;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.url-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-inline {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.input:focus {
  border-color: var(--accent);
}

.input-num-sm {
  width: 78px;
  text-align: center;
}

.select-sm {
  min-width: 210px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* SEGMENTED CONTROLS */
.segmented {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.sub-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px;
  margin-top: 10px;
}

.age-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.age-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

/* CHIPS */
.toolbar-pills,
.quick-chips,
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover,
.chip-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(254, 44, 85, 0.1);
}

.chip-btn.accent {
  color: var(--text);
  border-color: var(--border-hover);
}

/* SUMMARY BOX */
.summary-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  padding: 3px 0;
}

.summary-row strong {
  color: var(--text);
}

.summary-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text);
}

.summary-total strong {
  color: var(--accent);
}

/* UPLOAD & SWITCHES */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border-hover);
  border-radius: 10px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s;
}

.upload-area:hover {
  border-color: var(--accent);
}

.upload-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 10px;
}

.upload-title {
  font-weight: 600;
  font-size: 13.5px;
}

.upload-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

.highlight-row {
  border-color: rgba(254, 44, 85, 0.35);
}

.switch-title {
  font-size: 13.5px;
  font-weight: 500;
}

.switch-desc {
  font-size: 12px;
  color: var(--muted);
}

.toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.range {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 4px;
}

/* STATUS STATS & TABLE */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.status-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-creative-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 170px;
}

.status-creative-thumb {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clean-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.clean-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}

.st-running {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
}
.st-review {
  background: rgba(234, 179, 8, 0.14);
  color: #facc15;
}
.st-error {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}
.st-done {
  background: rgba(161, 161, 170, 0.14);
  color: #d4d4d8;
}

/* ACCOUNTS CARDS */
.accounts-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.acc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.acc-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.acc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.acc-user {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.mini-tag.ok {
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
}

.mini-tag.bc {
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.acc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.acc-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}

.acc-meta span {
  color: var(--muted);
  font-size: 11.5px;
}

.acc-meta strong {
  font-size: 14px;
  color: var(--text);
}

.acc-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.acc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 530px;
  padding: 22px;
}

.merge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  background: rgba(254, 44, 85, 0.14);
  color: #fda4af;
}

.hint-accent {
  color: #fda4af;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-top h3 {
  font-size: 16px;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.qr-box {
  margin-top: 14px;
  min-height: 290px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.qr-box img {
  width: 256px;
  height: 256px;
  object-fit: contain;
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.qr-status {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11.5px;
}

.btn-lg {
  padding: 11px 22px;
  font-size: 14px;
}

.btn-full {
  width: 100%;
}

.footer-btns {
  display: flex;
  gap: 10px;
}

.flex-1 {
  flex: 1;
}

/* HELPERS */
.hidden {
  display: none !important;
}
.label-sm {
  font-size: 13px;
  font-weight: 500;
}
.label-xs {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.hint-xs,
.text-muted-sm {
  font-size: 12.5px;
  color: var(--muted);
}
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }
