/* ==========================================================================
   Rebirth Clips — Stylesheet
   ========================================================================== */

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

:root {
  --bg-0: #06070b;
  --bg-1: #0c0e15;
  --bg-2: #12151e;
  --bg-3: #1a1e2e;
  --bg-hover: #1e2336;
  --border: #1e2336;
  --text-0: #e8eaef;
  --text-1: #9aa1b4;
  --text-2: #5e6580;
  --accent: #ff7621;
  --accent-glow: rgba(255, 118, 33, 0.12);
  --accent-hover: #e66a1d;
  --gradient-brand: linear-gradient(135deg, #ff7621 0%, #ff9a55 100%);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-0);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Layout */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr 32px;
  height: 100vh;
}

/* Top Bar */

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.topbar-logo .icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-sans);
  letter-spacing: -0.05em;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px 8px 34px;
  color: var(--text-0);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border var(--transition);
}

.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-search input::placeholder { color: var(--text-2); }

.topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 13px;
  pointer-events: none;
}

.topbar-search .shortcut-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover { background: var(--bg-hover); color: var(--text-0); }

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

.btn-ghost { border: none; background: transparent; }
.btn-ghost:hover { background: var(--bg-3); }

.btn-danger { border-color: #a05050; color: #a05050; background: transparent; }
.btn-danger:hover { background: rgba(160, 80, 80, 0.12); }

/* Sidebar */

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  grid-row: 2;
  grid-column: 1;
}

.sidebar-section { padding: 0 12px; margin-bottom: 24px; }

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-item:hover { background: var(--bg-hover); color: var(--text-0); }

.sidebar-item.active { background: var(--accent-glow); color: var(--accent); font-weight: 500; }

.sidebar-item .item-icon { width: 18px; text-align: center; font-size: 14px; opacity: 0.7; }
.sidebar-item.active .item-icon { opacity: 1; }

.sidebar-item .item-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-3);
  padding: 1px 7px;
  border-radius: 10px;
}

.sidebar-item.active .item-count { background: rgba(255, 118, 33, 0.2); color: var(--accent); }

.sidebar-bottom {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* User Pill */

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.user-pill:hover { background: var(--bg-hover); }

.user-info { font-size: 13px; font-weight: 500; }

.user-plan { font-size: 11px; color: var(--text-2); }

.user-credits-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(80, 170, 110, 0.12);
  color: #50aa6e;
  white-space: nowrap;
  flex-shrink: 0;
}

.user-plan.plan-hobby { color: #7a9ec4; }
.user-plan.plan-pro { color: var(--accent); }
.user-plan.plan-pro-plus { color: #9a8bbf; }
.user-plan.plan-free { color: var(--text-2); }

.user-admin-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 118, 33, 0.2);
  color: var(--accent);
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-only { display: none !important; }
.admin-only.visible { display: block !important; }

/* User Dropdown */

.user-dropdown {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: none;
  z-index: 200;
}

.user-dropdown.open { display: block; }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-sans);
  text-align: left;
}

.user-dropdown-item:hover { background: var(--bg-hover); color: var(--text-0); }
.user-dropdown-item.danger { color: #a05050; }
.user-dropdown-item.danger:hover { background: rgba(160, 80, 80, 0.1); }

.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

.user-dropdown-item .item-icon { width: 18px; text-align: center; font-size: 14px; }

/* Main Content */

.main {
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

#mainContent { grid-row: 2; grid-column: 2; }

/* Hero */

.hero { text-align: center; padding: 32px 20px 28px; }

.hero-title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 4px; }
.hero-title span { background: var(--gradient-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }

.paste-box { max-width: 600px; margin: 0 auto; display: flex; gap: 8px; }

.paste-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-0);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border var(--transition);
}

.paste-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.paste-input::placeholder { color: var(--text-2); }

.paste-btn {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.paste-hint {
  max-width: 600px;
  margin: 10px auto 0;
  font-size: 11px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.paste-hint kbd {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-1);
}

.supported-platforms { display: flex; justify-content: center; gap: 16px; margin-top: 14px; }

.platform-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.platform-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.platform-badge .dot.yt { background: #c44040; }
.platform-badge .dot.tt { background: #5ac4c4; }
.platform-badge .dot.ig { background: linear-gradient(45deg, #c49040, #c47040, #be4060, #a84080, #9440a0); }
.platform-badge .dot.tw { background: #7868c0; }
.platform-badge .dot.ot { background: #c48040; }

/* Stats */

.stats-row { display: flex; gap: 12px; }

.stat-card {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: border var(--transition);
}

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

.stat-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }
.stat-value.gradient { color: var(--accent); }

/* Review & Payment */

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

.review-panel, .payment-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.panel-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px; }

/* Pipeline */

.review-pipeline { display: flex; gap: 8px; margin-bottom: 16px; }

.pipeline-step {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  background: var(--bg-3);
  border-radius: var(--radius);
  position: relative;
  transition: all var(--transition);
}

.pipeline-step .step-count { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 2px; }
.pipeline-step .step-label { font-size: 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }

.pipeline-step.pending   { border: 1px solid rgba(198, 175, 90, 0.25); }
.pipeline-step.pending .step-count { color: #c6af5a; }
.pipeline-step.reviewing { border: 1px solid rgba(255, 118, 33, 0.25); }
.pipeline-step.reviewing .step-count { color: var(--accent); }
.pipeline-step.approved  { border: 1px solid rgba(80, 170, 110, 0.25); }
.pipeline-step.approved .step-count { color: #50aa6e; }
.pipeline-step.rejected  { border: 1px solid rgba(190, 80, 80, 0.25); }
.pipeline-step.rejected .step-count { color: #be5050; }
.pipeline-step.paid      { border: 1px solid rgba(140, 120, 195, 0.25); }
.pipeline-step.paid .step-count { color: #8c78c3; }

.review-list { display: flex; flex-direction: column; gap: 6px; max-height: 140px; overflow-y: auto; }

.review-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-3);
  border-radius: 6px;
  font-size: 12px;
}

.review-item-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-1); }

/* Status Badges */

.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge.pending   { background: rgba(198, 175, 90, 0.12); color: #c6af5a; }
.status-badge.reviewing { background: rgba(255, 118, 33, 0.12); color: var(--accent); }
.status-badge.approved  { background: rgba(80, 170, 110, 0.12); color: #50aa6e; }
.status-badge.rejected  { background: rgba(190, 80, 80, 0.12); color: #be5050; }
.status-badge.paid      { background: rgba(140, 120, 195, 0.12); color: #8c78c3; }

/* Payment Panel */

.payment-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

.payment-block { padding: 12px; background: var(--bg-3); border-radius: var(--radius); }

.payment-block-label { font-size: 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-bottom: 4px; }

.payment-block-value { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.payment-block-value.green  { color: #50aa6e; }
.payment-block-value.yellow { color: #c6af5a; }
.payment-block-value.purple { color: #8c78c3; }
.payment-block-value.blue   { color: var(--accent); }

.payment-breakdown { display: flex; flex-direction: column; gap: 6px; }

.payment-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.payment-row:last-child { border-bottom: none; }

.payment-row-label { color: var(--text-1); display: flex; align-items: center; gap: 6px; }

.payment-row-amount { font-weight: 600; font-family: var(--font-mono); font-size: 12px; }

/* Clips Table */

.clips-section-header { display: flex; align-items: center; justify-content: space-between; }

.clips-section-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.clips-section-title span { color: var(--text-2); font-weight: 400; }

.filter-row { display: flex; gap: 6px; }

.filter-chip {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip:hover { border-color: var(--accent); color: var(--text-0); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.clips-list { display: flex; flex-direction: column; gap: 8px; }

.clips-list-header {
  display: grid;
  grid-template-columns: 56px 1fr 32px 120px 140px 100px 90px 40px;
  gap: 12px;
  padding: 0 14px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

.clip-row {
  display: grid;
  grid-template-columns: 56px 1fr 32px 120px 140px 100px 90px 40px;
  gap: 12px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeIn 0.15s ease both;
}

.clip-row:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.clip-row.selected { border-color: var(--accent); background: rgba(255, 118, 33, 0.06); }

.clip-thumb {
  width: 56px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg-3);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 18px;
  position: relative;
}

.clip-thumb img { width: 100%; height: 100%; object-fit: cover; }

.clip-thumb .play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity var(--transition);
  font-size: 14px;
  color: #fff;
}

.clip-row:hover .play-icon { opacity: 1; }

.clip-info { overflow: hidden; }

.clip-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.clip-url { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); }

.clip-note { font-size: 12px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

.clip-platform { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.clip-platform .dot { width: 6px; height: 6px; border-radius: 50%; }

.clip-duration { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }

.clip-star { display: flex; align-items: center; justify-content: center; }

.star-btn { cursor: pointer; font-size: 14px; opacity: 0.3; transition: all var(--transition); user-select: none; }
.star-btn:hover { opacity: 0.7; transform: scale(1.2); }
.star-btn.starred { opacity: 1; }

.clip-delete {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
  opacity: 0;
}

.clip-row:hover .clip-delete { opacity: 1; }
.clip-delete:hover { background: rgba(160, 80, 80, 0.15); color: #a05050; }

/* Detail Panel */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 1000;
}

.detail-overlay.open { display: grid; }

.detail-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.detail-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.detail-panel-title { font-size: 16px; font-weight: 600; }

.detail-panel-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
}

.detail-panel-close:hover { background: var(--bg-3); color: var(--text-0); }

.detail-panel-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }

.detail-section-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin-bottom: 8px; }

.detail-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--bg-0);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.detail-embed .placeholder-icon { font-size: 40px; opacity: 0.3; }
.detail-embed iframe { width: 100%; height: 100%; border: none; }

.detail-note-area {
  width: 100%;
  min-height: 100px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text-0);
  font-size: 13px;
  font-family: var(--font-sans);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border var(--transition);
}

.detail-note-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.detail-note-area::placeholder { color: var(--text-2); }

.detail-meta-row { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); }
.detail-meta-row span { display: flex; align-items: center; gap: 5px; }

.detail-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Toast */

.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-0);
  opacity: 0;
  pointer-events: none;
  transition: all 300ms ease;
  z-index: 2000;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Shortcuts Bar */

.shortcuts-bar {
  grid-column: 1 / -1;
  height: 32px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  font-size: 11px;
  color: var(--text-2);
}

.shortcuts-bar kbd {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-1);
}

/* Empty State */

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state .empty-title { font-size: 14px; color: var(--text-1); margin-bottom: 4px; }
.empty-state .empty-desc { font-size: 12px; }

/* Login Page */

.login-page { position: fixed; inset: 0; background: var(--bg-0); display: grid; place-items: center; z-index: 5000; }
.login-page.hidden { display: none; }

.login-card {
  width: 400px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 24px;
  font-family: var(--font-sans);
  letter-spacing: -0.05em;
}

.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-2); margin-bottom: 32px; line-height: 1.5; }

.login-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; font-size: 12px; color: var(--text-2); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.login-email-row { display: flex; gap: 8px; }

.login-email-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-0);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border var(--transition);
}

.login-email-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-email-input::placeholder { color: var(--text-2); }

.login-email-btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.login-footer { margin-top: 24px; font-size: 11px; color: var(--text-2); line-height: 1.5; }
.login-footer a { color: var(--accent); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* Admin Panel */

.admin-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

.admin-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

.admin-search input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text-0);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  width: 280px;
  transition: border var(--transition);
}

.admin-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

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

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.admin-user-row:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 14px; font-weight: 600; color: var(--text-0); }
.admin-user-email { font-size: 12px; color: var(--text-2); }

.admin-user-meta { display: flex; gap: 10px; align-items: center; }

.admin-user-plan { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgba(255, 118, 33, 0.12); color: var(--accent); }
.admin-user-clips { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }
.admin-user-arrow { font-size: 18px; color: var(--text-2); }

.admin-user-detail { margin-bottom: 24px; }

.admin-detail-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }

.admin-detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-1); }
.admin-detail-row:last-child { border-bottom: none; }
.admin-detail-label { color: var(--text-2); font-weight: 500; }

.admin-status-summary { display: flex; gap: 8px; margin-bottom: 16px; }

.admin-status-pill { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 12px; }
.admin-status-pill.pending   { background: rgba(198, 175, 90, 0.12); color: #c6af5a; }
.admin-status-pill.reviewing { background: rgba(255, 118, 33, 0.12); color: var(--accent); }
.admin-status-pill.approved  { background: rgba(80, 170, 110, 0.12); color: #50aa6e; }
.admin-status-pill.rejected  { background: rgba(190, 80, 80, 0.12); color: #be5050; }
.admin-status-pill.paid      { background: rgba(140, 120, 195, 0.12); color: #8c78c3; }

.admin-clips-section { margin-top: 16px; }
.admin-clips-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.admin-clips-list { display: flex; flex-direction: column; gap: 6px; }

.admin-clip-row {
  display: grid;
  grid-template-columns: 1fr 120px 32px 100px 36px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border var(--transition);
}

.admin-clip-row:hover { border-color: var(--accent); }

.admin-clip-title { font-size: 13px; font-weight: 500; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-clip-url { font-size: 11px; color: var(--text-2); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-status-select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-0);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}

.admin-status-select:focus { border-color: var(--accent); }

.admin-clip-star { text-align: center; font-size: 14px; }
.admin-clip-date { font-size: 12px; color: var(--text-2); }

.admin-clip-delete {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
  opacity: 0;
}

.admin-clip-row:hover .admin-clip-delete { opacity: 1; }
.admin-clip-delete:hover { background: rgba(160, 80, 80, 0.15); color: #a05050; }

/* Scrollbar */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

/* Animations */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ──────────────────────────────────────────────── */

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 300;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: all var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 149;
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 0px;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 56px;
    bottom: 0;
    width: 260px;
    z-index: 150;
    transition: left 200ms ease;
    grid-column: 1;
    grid-row: 2;
    visibility: hidden;
  }

  .app.sidebar-open .sidebar { left: 0; visibility: visible; }
  .app.sidebar-open .sidebar-overlay { display: block; }

  #mainContent {
    grid-column: 1;
    grid-row: 2;
  }

  .topbar-search { max-width: none; flex: 1; min-width: 0; }
  .topbar-search input { font-size: 14px; }
  .topbar-logo span { display: none; }

  .topbar-search .shortcut-hint { display: none; }

  .main {
    padding: 16px;
    gap: 16px;
  }

  .hero { padding: 20px 10px; }
  .hero-title { font-size: 18px; }
  .hero-sub { font-size: 12px; }

  .paste-box { flex-direction: column; }
  .paste-btn { width: 100%; }

  .supported-platforms { flex-wrap: wrap; gap: 8px; }

  .stats-row { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - 6px); flex: none; }

  .review-payment-row { grid-template-columns: 1fr; }

  .clips-list-header { display: none; }

  .clip-row {
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .clip-star { display: none; }

  .clip-row > div:nth-child(4),
  .clip-row > div:nth-child(5),
  .clip-row > div:nth-child(7) { display: none; }

  .clip-note { display: none; }

  .clip-delete { opacity: 1; }

  .detail-panel {
    width: calc(100% - 16px);
    max-height: 90vh;
    margin: 8px;
  }

  .detail-meta-row { flex-wrap: wrap; gap: 8px; }

  .detail-actions { flex-wrap: wrap; }
  .detail-actions .btn { flex: 1; justify-content: center; }

  .shortcuts-bar { display: none; }

  .login-card {
    width: calc(100% - 32px);
    padding: 32px 24px;
  }

  .login-email-row { flex-direction: column; }

  .admin-clip-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .admin-clip-row > div:nth-child(2),
  .admin-clip-row > div:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .stat-card { min-width: 100%; }

  .platform-badge { font-size: 10px; padding: 3px 8px; }

  .panel-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  .payment-amounts { grid-template-columns: 1fr; }
}
