* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: #0f0d15;
  color: #e8e6f0;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #1e1b2e;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
  transition: transform 0.2s;
}
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1e1b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8e6f0;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9;
}
.sidebar-overlay.open {
  display: block;
}
/* Mobile bottom nav */
.mobile-nav {
  display: none;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .main-content {
    margin-left: 0 !important;
    padding-top: 60px !important;
    padding-bottom: 72px !important;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #1e1b2e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: #5a5670;
    font-size: 11px;
    padding: 4px 0;
    transition: color 0.15s;
    position: relative;
  }
  .mobile-nav a:hover,
  .mobile-nav a.active {
    color: #7c8cf8;
  }
  .mobile-nav .mn-icon {
    font-size: 19px;
    line-height: 1;
  }
  .mobile-nav .mn-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(14px);
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }
}
.sidebar-header {
  padding: 24px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand {
  font-size: 16px;
  font-weight: 700;
  color: #e8e6f0;
}
.sidebar-search {
  padding: 12px;
}
.sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e8e6f0;
  font-size: 13px;
}
.sidebar-search input:focus {
  outline: none;
  border-color: #7c8cf8;
}
.sidebar-search input::placeholder {
  color: #5a5670;
}
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #c5c0d8;
  margin-bottom: 2px;
  transition: background 0.15s;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.sidebar-item.active {
  background: rgba(124, 140, 248, 0.15);
  border-left: 3px solid #7c8cf8;
  color: #e8e6f0;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  opacity: 0.85;
}
.sidebar-item-text {
  min-width: 0;
  overflow: hidden;
}
.sidebar-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-meta {
  font-size: 11px;
  color: #5a5670;
  margin-top: 2px;
}
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #8b85a0;
  font-size: 13px;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.sidebar-footer-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8e6f0;
}
.sidebar-footer-link .sf-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
  opacity: 0.7;
}
.sidebar-footer-link.logout:hover {
  color: #f87171;
}
.sf-badge {
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}

/* Main */
.main-content {
  margin-left: 220px;
  flex: 1;
  padding: 24px;
  min-height: 100vh;
  max-width: 1600px;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.page-header h2 {
  font-size: 23px;
  color: #e8e6f0;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.header-actions {
  display: flex;
  gap: 8px;
}

/* Page nav tabs */
.page-nav {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.page-nav-tab {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  color: #5a5670;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px 8px 0 0;
}
.page-nav-tab:hover {
  color: #e8e6f0;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}
.page-nav-tab.active {
  color: #7c8cf8;
  border-bottom-color: #7c8cf8;
  background: rgba(124, 140, 248, 0.08);
  font-weight: 600;
}

/* Sortable columns */
th.sortable a {
  color: #8b85a0;
  text-decoration: none;
  white-space: nowrap;
}
th.sortable a:hover {
  color: #7c8cf8;
  text-decoration: none;
}
th.sortable.active a {
  color: #7c8cf8;
  font-weight: 600;
}

/* Sort bar */
.sort-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sort-label {
  font-size: 13px;
  color: #5a5670;
  margin-right: 4px;
}
.sort-pill {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  color: #8b85a0;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.15s;
}
.sort-pill:hover {
  color: #e8e6f0;
  border-color: #7c8cf8;
  text-decoration: none;
}
.sort-pill.active {
  background: #7c8cf8;
  color: #fff;
  border-color: #7c8cf8;
}

/* Filter bar */
.filter-sort-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-sort-row .filter-bar {
  margin-bottom: 0;
}
.filter-sort-row .sort-bar {
  margin-bottom: 0;
  margin-left: auto;
}
.filter-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: #8b85a0;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.15s;
}
.filter-tab:hover {
  color: #e8e6f0;
  border-color: #7c8cf8;
  text-decoration: none;
}
.filter-tab.active {
  background: #7c8cf8;
  color: #fff;
  border-color: #7c8cf8;
}

/* Card */
.card {
  background: #1e1b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow-x: auto;
}
.card-padded {
  padding: 20px;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: rgba(255, 255, 255, 0.04);
  color: #8b85a0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  vertical-align: top;
  color: #c5c0d8;
}
tr:last-child td {
  border-bottom: none;
}
tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}
tr:hover {
  background: rgba(124, 140, 248, 0.06);
  box-shadow: inset 3px 0 0 #7c8cf8;
}
.rank-cell {
  font-weight: 700;
  color: #8b85a0;
  text-align: center;
  width: 40px;
}
.caption-cell {
  max-width: 250px;
}
.caption-preview {
  font-size: 13px;
  color: #c5c0d8;
  margin-bottom: 4px;
}
.empty-cell {
  text-align: center;
  color: #5a5670;
  padding: 48px 12px !important;
}
.empty-cell .empty-icon {
  font-size: 28px;
  opacity: 0.4;
  margin-bottom: 8px;
  display: block;
}
.empty-cell .empty-hint {
  font-size: 11px;
  color: #5a5670;
  margin-top: 4px;
  display: block;
}

/* Badges */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.type-badge.video {
  background: rgba(167, 139, 250, 0.15);
  color: #7c8cf8;
}
.type-badge.short_video {
  background: rgba(192, 132, 252, 0.15);
  color: #a594f9;
}
.type-badge.photo {
  background: rgba(96, 165, 250, 0.15);
  color: #3b82f6;
}
.type-badge.mixed {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.segment-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.segment-badge.whale {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.segment-badge.high {
  background: rgba(124, 140, 248, 0.12);
  color: #7c8cf8;
}
.segment-badge.mid {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.segment-badge.low {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}
.segment-badge.new {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
}
.segment-badge.inactive {
  background: rgba(155, 151, 173, 0.12);
  color: #9b97ad;
}
.segment-badge.never_buyer {
  background: rgba(107, 104, 128, 0.1);
  color: #6b6880;
}

/* Buttons — 3-tier hierarchy */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  transition: all 0.15s;
}
.btn:hover {
  text-decoration: none !important;
}

/* Tier 1: Primary — THE main action per screen */
.btn-primary {
  background: linear-gradient(135deg, #7c8cf8, #a594f9);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(124, 140, 248, 0.3);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 140, 248, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 140, 248, 0.2);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

/* Tier 2: Secondary — important but not primary */
.btn-secondary {
  background: rgba(124, 140, 248, 0.12);
  color: #a594f9;
  border: 1px solid rgba(124, 140, 248, 0.2);
  font-weight: 500;
}
.btn-secondary:hover {
  background: rgba(124, 140, 248, 0.2);
  color: #c5bfff;
  border-color: rgba(124, 140, 248, 0.35);
}
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Tier 3: Ghost — tertiary actions (cancel, dismiss, filter) */
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #8b85a0;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: #c5c0d8;
}

/* Semantic: Success */
.btn-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 500;
}
.btn-success:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Semantic: Danger */
.btn-danger {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
  font-weight: 500;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}

/* Size: Small — for table actions, inline controls */
.btn-sm {
  padding: 4px 12px;
  font-size: 11px;
  border-radius: 8px;
}
.bounty-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}
.bounty-alert.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}
.bounty-alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}
.bounty-link {
  color: #7c8cf8;
  word-break: break-all;
}
.btn-copy {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #8b85a0;
  cursor: pointer;
  font-size: 13px;
  margin-left: 8px;
  transition: all 0.15s;
}
.btn-copy:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  color: #c5c0d8;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  padding: 16px 0;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #c5c0d8;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
}
.page-btn:hover {
  border-color: #7c8cf8;
  color: #7c8cf8;
  text-decoration: none;
}
.page-btn.active {
  background: #7c8cf8;
  border-color: #7c8cf8;
  color: #fff;
}
.page-dots {
  color: #5a5670;
  padding: 0 4px;
  line-height: 36px;
}

.meta {
  color: #5a5670;
  font-size: 13px;
}

/* Clickable rows */
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: rgba(139, 92, 246, 0.06) !important;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: #262340;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: #262340;
  z-index: 1;
  border-radius: 16px 16px 0 0;
}
.modal-header h3 {
  font-size: 19px;
  color: #e8e6f0;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  color: #5a5670;
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover {
  color: #e8e6f0;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0;
}
.modal-stat {
  background: #161422;
  padding: 16px;
  text-align: center;
}
.modal-stat-label {
  font-size: 11px;
  color: #8b85a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.modal-stat-value {
  font-size: 19px;
  font-weight: 700;
  color: #e8e6f0;
}
.modal-stat-value.score {
  color: #7c8cf8;
}

.modal-section {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-section h4 {
  font-size: 13px;
  color: #8b85a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  padding-right: 16px;
}
.detail-row:nth-child(odd) {
  padding-right: 16px;
}
.detail-row:nth-child(even) {
  padding-left: 16px;
}
.detail-label {
  color: #8b85a0;
}

.modal-caption {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.modal-caption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.caption-num {
  font-size: 13px;
  font-weight: 600;
  color: #7c8cf8;
}
.modal-caption-text {
  font-size: 13px;
  color: #c5c0d8;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.media-ids {
  font-family: "SF Mono", "Cascadia Code", Menlo, monospace;
  font-size: 13px;
  color: #5a5670;
  padding: 8px 0;
  word-break: break-all;
}
.row-thumbs {
  display: flex;
  gap: 4px;
  align-items: center;
}
.row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.row-thumb-more {
  font-size: 11px;
  color: #5a5670;
  white-space: nowrap;
}
.preview-cell {
  min-width: 200px;
}

/* PPV table column toggle — hide Sends(6), Purchases(7), Future LTV(10) when collapsed */
.ppv-table.cols-compact tr > :nth-child(6),
.ppv-table.cols-compact tr > :nth-child(7),
.ppv-table.cols-compact tr > :nth-child(10) {
  display: none;
}
.col-toggle {
  padding: 4px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #8b85a0;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}
.col-toggle:hover {
  color: #c5c0d8;
  border-color: rgba(255, 255, 255, 0.16);
}
.bundle-thumbs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.bundle-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: #161422;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.bundle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bundle-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a5670;
  font-size: 18px;
  background: #161422;
}
.bundle-thumb-more {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background: #161422;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a5670;
  font-size: 16px;
  font-weight: 600;
}
.bundle-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(124, 140, 248, 0.2);
  z-index: 1;
}
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.open {
  display: flex;
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Modal scrollbar */
.modal::-webkit-scrollbar {
  width: 6px;
}
.modal::-webkit-scrollbar-track {
  background: transparent;
}
.modal::-webkit-scrollbar-thumb {
  background: rgba(124, 140, 248, 0.2);
  border-radius: 3px;
}

/* Media grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.media-card {
  background: #1e1b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  position: relative;
}
.media-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 140, 248, 0.12);
}
.media-card-pinned {
  border-color: rgba(124, 140, 248, 0.5);
  box-shadow: 0 0 0 1px rgba(124, 140, 248, 0.3);
}
.pin-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 13, 21, 0.7);
  backdrop-filter: blur(8px);
  color: #8b85a0;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  opacity: 0;
}
.media-card:hover .pin-btn,
.pin-btn.pinned {
  opacity: 1;
}
.pin-btn.pinned {
  background: rgba(124, 140, 248, 0.3);
  color: #7c8cf8;
}
.pin-btn:hover {
  background: rgba(124, 140, 248, 0.5);
  color: #fff;
}
.pin-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #1e1b2e;
  border-top: 1px solid rgba(124, 140, 248, 0.3);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
.pin-bar span {
  color: #7c8cf8;
  font-weight: 600;
  font-size: 14px;
}
.pin-bar-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pin-bar-clear {
  background: transparent;
  color: #8b85a0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.pin-bar-clear:hover {
  color: #e8e6f0;
  border-color: rgba(255, 255, 255, 0.25);
}
.media-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #161422;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.media-thumb.loaded {
  animation: none;
  background: #161422;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-placeholder {
  text-align: center;
  color: #5a5670;
  font-size: 28px;
  line-height: 1.4;
}
.play-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e8e6f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.media-card-info {
  padding: 12px 12px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.media-card-rank {
  font-weight: 700;
  color: #8b85a0;
  font-size: 13px;
}
.media-card-score {
  margin-left: auto;
  font-weight: 700;
  color: #7c8cf8;
  font-size: 16px;
  text-shadow: 0 0 12px rgba(124, 140, 248, 0.4);
}
.media-dur {
  font-size: 11px;
  color: #5a5670;
}
.media-card-stats {
  padding: 4px 12px 8px;
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #5a5670;
}

.modal-preview {
  padding: 0;
  text-align: center;
  background: #161422;
  max-height: 70vh;
  overflow: visible;
}
.modal-preview img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}
.modal-preview video {
  max-width: 100%;
  max-height: 65vh;
  display: block;
  margin: 0 auto;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
}
.empty-state .empty-icon {
  font-size: 32px;
  opacity: 0.4;
  margin-bottom: 12px;
}
.empty-state h2 {
  font-size: 16px;
  font-weight: 600;
  color: #8b85a0;
  margin-bottom: 4px;
}
.empty-state p {
  font-size: 13px;
  color: #5a5670;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: #0f0d15;
}
.login-box {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px;
  width: 400px;
  max-width: 92vw;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(124, 140, 248, 0.06);
}
.login-box h1 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 4px;
  color: #e8e6f0;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.login-box .login-subtitle {
  font-size: 13px;
  color: #5a5670;
  text-align: center;
  margin-bottom: 24px;
}
.login-box label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #8b85a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.login-box input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e8e6f0;
  font-size: 16px;
  margin-bottom: 16px;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.login-box input:focus {
  outline: none;
  border-color: #7c8cf8;
  background: rgba(124, 140, 248, 0.08);
}
.login-box input::placeholder {
  color: #5a5670;
}
.login-box button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #7c8cf8, #a594f9);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
  box-shadow: 0 4px 20px rgba(124, 140, 248, 0.25);
}
.login-box button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(124, 140, 248, 0.35);
}
.login-box button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 140, 248, 0.2);
}
.login-box button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.login-box .error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}
.login-box .success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}
.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  text-align: center;
}
.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  text-align: center;
}

/* Vault folder styles */
.vault-media-count {
  font-size: 11px;
  color: #5a5670;
  margin-left: 8px;
}
.vault-unknown {
  color: #5a5670;
  font-style: italic;
}
.vault-sync-note {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: #fbbf24;
  margin-bottom: 12px;
}

/* Vault send sequence */
.folder-row {
  cursor: pointer;
}
.folder-row:hover {
  background: rgba(124, 140, 248, 0.06);
}
.folder-row.expanded {
  background: rgba(124, 140, 248, 0.08);
}
.expand-arrow {
  display: inline-block;
  width: 16px;
  font-size: 11px;
  color: #5a5670;
  transition: transform 0.15s;
  margin-right: 4px;
}
.seq-cell {
  padding: 0 !important;
  background: #161422;
}
.seq-summary {
  padding: 8px 16px;
  font-size: 13px;
  color: #8b85a0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.seq-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.seq-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #8b85a0;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
}
.seq-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #c5c0d8;
}
.seq-num {
  color: #5a5670;
  font-size: 11px;
}
.seq-gap {
  color: #6b6580;
  font-size: 13px;
  font-style: italic;
}
.seq-gap-warn {
  color: #d97706;
  font-weight: 500;
}
.seq-empty {
  padding: 16px;
  color: #9b97ad;
  font-style: italic;
  text-align: center;
}
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.type-video {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
}
.type-short_video {
  background: rgba(147, 51, 234, 0.12);
  color: #a78bfa;
}
.type-photo {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}
.type-mixed {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

/* Scrollbar */
.sidebar-list::-webkit-scrollbar {
  width: 6px;
}
.sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.15);
  border-radius: 3px;
}

/* Focus-visible for keyboard navigation */
/* Focus — visible for keyboard, hidden for mouse */
*:focus-visible {
  outline: 2px solid #7c8cf8;
  outline-offset: 2px;
  border-radius: inherit;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* Sticky table header for long lists */
.card table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #262340;
}

/* DM Analytics */
.dm-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.dm-stat-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #1e1b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 24px;
}
.dm-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.dm-stat-body {
  flex: 1;
}
.dm-stat-label {
  font-size: 11px;
  color: #8b85a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.dm-stat-value {
  font-size: 23px;
  font-weight: 700;
  color: #e8e6f0;
}
.dm-stat-detail {
  font-size: 13px;
  color: #5a5670;
  margin-top: 4px;
}
.section-heading {
  font-size: 16px;
  color: #e8e6f0;
  font-weight: 600;
  margin: 24px 0 12px;
}
.dm-no-data {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 13px;
  color: #fbbf24;
  margin-bottom: 16px;
}
.dm-no-data code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
}
.channel-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.channel-tag.dm-star {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.channel-tag.untapped {
  background: rgba(124, 140, 248, 0.12);
  color: #7c8cf8;
}
.channel-tag.hidden-gem {
  background: rgba(192, 132, 252, 0.12);
  color: #9333ea;
}
.channel-tag.overused {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.channel-tag.mass-only {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.channel-tag.balanced {
  background: rgba(155, 151, 173, 0.12);
  color: #9b97ad;
}
.opp-group {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.opp-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.opp-group table {
  width: 100%;
}

/* Skeleton shimmer — loading placeholder for images/media */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton img {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.skeleton.loaded {
  animation: none;
  background: #161422;
}
.skeleton.loaded img {
  opacity: 1;
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #161422;
  }
  .page-loader {
    display: none !important;
  }
}

/* Page loading bar — thin animated stripe at top */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.page-loader.active {
  opacity: 1;
}
.page-loader::after {
  content: "";
  display: block;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, transparent, #7c8cf8, #a594f9);
  border-radius: 0 2px 2px 0;
  animation: pageLoad 1s ease-in-out infinite;
}
@keyframes pageLoad {
  0% {
    transform: translateX(-100%);
    width: 30%;
  }
  50% {
    width: 60%;
  }
  100% {
    transform: translateX(400%);
    width: 30%;
  }
}
