.btn {
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; border: 1px solid var(--border2);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; text-decoration: none;
}
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #6b4fe8; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(34,211,160,0.12); color: var(--success); border-color: rgba(34,211,160,0.25); }
.btn-success:hover { background: rgba(34,211,160,0.2); }

.badge {
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px;
}
.badge-processing { background: rgba(245,158,11,0.12); color: var(--warn); border: 1px solid rgba(245,158,11,0.25); }
.badge-scheduled  { background: rgba(124,92,252,0.12); color: var(--accent2); border: 1px solid rgba(124,92,252,0.25); }
.badge-posted     { background: rgba(34,211,160,0.10); color: var(--success); border: 1px solid rgba(34,211,160,0.2); }
.badge-failed     { background: rgba(239,68,68,0.12); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.badge-draft      { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }

.progress-track { background: var(--bg3); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}

.form-group { margin-bottom: 18px; }
.form-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; letter-spacing: 0.3px; }
.form-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; color: var(--text); font-size: 14px;
  font-family: inherit; transition: border .15s; outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--dim); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%23555568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
textarea.form-input { resize: vertical; min-height: 80px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-title { font-size: 14px; font-weight: 500; }
.toggle-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 99px; transition: all .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); top: 2px; left: 2px; transition: all .2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(124,92,252,0.25); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { background: var(--accent2); transform: translateX(18px); }

.tabs { display: flex; gap: 2px; background: var(--bg3); border-radius: var(--radius); padding: 4px; width: fit-content; margin-bottom: 20px; }
.tab { padding: 7px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .15s; color: var(--muted); }
.tab.active { background: var(--bg2); color: var(--text); border: 1px solid var(--border); }
.tab:hover:not(.active) { color: var(--text); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-xl);
  padding: 60px 40px; text-align: center;
  cursor: pointer; transition: all .2s;
  position: relative; overflow: hidden; background: var(--bg2);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: rgba(124,92,252,0.05); }
.upload-icon {
  width: 64px; height: 64px;
  background: rgba(124,92,252,0.12); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; border: 1px solid rgba(124,92,252,0.25);
}
.upload-title { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.upload-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.upload-formats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.fmt-tag {
  padding: 4px 10px; border-radius: 99px;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted); letter-spacing: 0.5px;
}

.video-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.video-item:last-child { border-bottom: none; }
.video-thumb {
  width: 72px; height: 40px; border-radius: 6px;
  background: var(--bg3); flex-shrink: 0;
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.video-info { flex: 1; min-width: 0; }
.video-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

.clip-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border .15s, transform .15s;
}
.clip-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.clip-preview {
  background: var(--bg3); aspect-ratio: 9/16;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; position: relative; overflow: hidden;
}
.clip-timeline {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}
.clip-time { font-size: 10px; color: rgba(255,255,255,0.7); }
.clip-meta { padding: 12px; }
.clip-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.clip-score { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.score-bar { flex: 1; height: 4px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--success), #06d6a0); }

.account-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg3); margin-bottom: 10px;
  transition: border .15s;
}
.account-card:hover { border-color: var(--border2); }
.platform-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.pi-tt { background: rgba(255,45,85,0.12); color: var(--tiktok); }
.pi-ig { background: rgba(225,48,108,0.12); color: var(--insta); }
.pi-yt { background: rgba(255,0,0,0.08); color: var(--youtube); }
.account-info { flex: 1; }
.account-name { font-size: 14px; font-weight: 500; }
.account-handle { font-size: 12px; color: var(--muted); }
.conn-status { font-size: 11px; padding: 4px 10px; border-radius: 99px; font-weight: 500; }
.conn-ok { background: rgba(34,211,160,0.1); color: var(--success); }
.conn-no { background: var(--bg4); color: var(--dim); }

.platform-toggle {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg3);
  cursor: pointer; transition: all .15s; font-size: 13px; color: var(--muted); user-select: none;
}
.platform-toggle:hover { border-color: var(--border2); color: var(--text); }
.platform-toggle.active-tt { background: rgba(255,45,85,0.1); border-color: rgba(255,45,85,0.35); color: #ff6b8a; }
.platform-toggle.active-ig { background: rgba(225,48,108,0.1); border-color: rgba(225,48,108,0.35); color: #f06292; }
.platform-toggle.active-yt { background: rgba(255,0,0,0.08); border-color: rgba(255,0,0,0.3); color: #ff6b6b; }

input[type=range] { width: 100%; accent-color: var(--accent); background: transparent; cursor: pointer; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-val { font-size: 13px; font-weight: 600; color: var(--accent2); min-width: 32px; text-align: right; }

.cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day-label { text-align: center; font-size: 11px; color: var(--dim); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-day {
  aspect-ratio: 1; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px 4px; font-size: 12px; cursor: pointer; transition: background .1s; position: relative;
  background: var(--bg3); color: var(--muted);
}
.cal-day:hover { background: var(--bg4); color: var(--text); }
.cal-day.today { color: var(--accent2); font-weight: 600; border: 1px solid rgba(124,92,252,0.3); }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.has-posts { color: var(--text); }
.cal-dots { display: flex; gap: 2px; margin-top: auto; flex-wrap: wrap; justify-content: center; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; }

.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.spark-bar { flex: 1; border-radius: 3px 3px 0 0; background: rgba(124,92,252,0.25); transition: background .15s; cursor: pointer; min-width: 0; }
.spark-bar:hover { background: var(--accent); }
.spark-bar.peak { background: rgba(124,92,252,0.5); }

.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: auto; }

.processing-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  z-index: 1000; align-items: center; justify-content: center;
}
.processing-modal.show { display: flex; }
.processing-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-xl); padding: 40px; width: 440px; text-align: center;
}
.proc-spinner {
  width: 56px; height: 56px; border: 3px solid var(--bg3);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 1s linear infinite; margin: 0 auto 20px;
}
.proc-step { font-size: 13px; color: var(--muted); margin-top: 8px; }
.proc-steps-list { margin-top: 20px; text-align: left; }
.proc-step-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--dim); }
.proc-step-item.done { color: var(--success); }
.proc-step-item.active { color: var(--text); }
.step-icon { width: 18px; height: 18px; flex-shrink: 0; }

.overlay-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(6px);
  z-index: 1001; align-items: center; justify-content: center;
}
.overlay-modal.show { display: flex; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-xl); padding: 28px; width: 480px; max-width: 95vw;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }
