/* ═══════════════════════════════════════════════════════════
   REEL MANAGER — Design System 2026
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #03030d;
  --bg2:          #06061a;
  --panel:        rgba(14, 12, 35, 0.85);
  --card:         rgba(18, 16, 42, 0.9);
  --card2:        rgba(24, 22, 55, 0.7);
  --border:       rgba(255, 255, 255, 0.06);
  --border2:      rgba(255, 255, 255, 0.12);
  --border-glow:  rgba(139, 92, 246, 0.4);

  --text:         #f0efff;
  --text2:        #8b8ab8;
  --muted:        #4a4872;

  --purple:       #8b5cf6;
  --purple-l:     #a78bfa;
  --purple-d:     #7c3aed;
  --pink:         #ec4899;
  --blue:         #3b82f6;
  --cyan:         #22d3ee;
  --green:        #10b981;
  --green-l:      #34d399;
  --red:          #f43f5e;
  --red-l:        #fb7185;
  --yellow:       #f59e0b;
  --yellow-l:     #fbbf24;

  --grad-main:    linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --grad-blue:    linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --grad-warm:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

  --radius-xl:    20px;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-xs:    7px;

  --shadow:       0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow:  0 0 40px rgba(139, 92, 246, 0.2);
  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255,255,255,.04) inset;
}

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

/* ── Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background blobs */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(139,92,246,.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: drift 20s ease-in-out infinite alternate;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(236,72,153,.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: drift 25s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3%, 4%) scale(1.05); }
}

/* ── Layout ────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  background: rgba(6, 5, 20, 0.95);
  border-right: 1px solid var(--border);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 28px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.8px;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  padding: 16px 14px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}
.nav-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(139,92,246,.08), transparent);
  opacity: 0;
  transition: opacity .18s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-link:hover::after { opacity: 1; }

.nav-link.active {
  color: var(--purple-l);
  background: rgba(139,92,246,.1);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 3px;
  background: var(--grad-main);
  border-radius: 0 3px 3px 0;
}

.sidebar-spacer  { flex: 1; min-height: 20px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 10px 4px; }
.nav-user { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main {
  padding: 40px 44px;
  overflow-y: auto;
  position: relative;
}

.page-header { margin-bottom: 36px; }
.page-title  { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.2; }
.page-sub    { color: var(--text2); margin-top: 6px; font-size: 14px; line-height: 1.5; }

/* Section */
.section { margin-bottom: 30px; }
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .count {
  background: rgba(139,92,246,.15);
  color: var(--purple-l);
  font-size: 11px; padding: 1px 8px;
  border-radius: 99px; font-weight: 700;
  letter-spacing: 0; text-transform: none;
}

/* ══════════════════════════════════════════════════════════════
   CARDS — Model cards
   ══════════════════════════════════════════════════════════════ */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.model-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), border-color 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}
.model-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(139,92,246,.5);
  box-shadow: var(--shadow-card), 0 20px 60px rgba(139,92,246,.2);
}

.model-card-image {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
  font-weight: 900;
  color: rgba(255,255,255,.9);
  overflow: hidden;
  position: relative;
}
.model-card-image::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(14,12,35,1), transparent);
}
.model-card-image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.model-card-initial {
  position: relative; z-index: 1;
  text-shadow: 0 8px 30px rgba(0,0,0,.6);
  user-select: none;
  letter-spacing: -4px;
}

.model-card-body {
  padding: 20px 22px 22px;
}
.model-card-name {
  font-size: 18px; font-weight: 700;
  margin-bottom: 14px; letter-spacing: -0.3px;
}
.model-card-stats { display: flex; gap: 20px; }
.stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text2);
}
.stat strong { color: var(--text); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   DROPZONE
   ══════════════════════════════════════════════════════════════ */
.dropzone {
  border: 2px dashed rgba(139,92,246,.3);
  border-radius: var(--radius);
  padding: 50px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(139,92,246,.03);
  position: relative;
  overflow: hidden;
}
.dropzone::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(139,92,246,.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .25s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--purple);
  background: rgba(139,92,246,.07);
  box-shadow: 0 0 40px rgba(139,92,246,.15), inset 0 0 40px rgba(139,92,246,.04);
}
.dropzone:hover::before, .dropzone.dragover::before { opacity: 1; }
.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dropzone-icon {
  font-size: 48px; margin-bottom: 14px;
  filter: drop-shadow(0 0 16px rgba(139,92,246,.5));
  display: block; animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.dropzone-title { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.dropzone-sub   { color: var(--text2); font-size: 13px; }

/* ══════════════════════════════════════════════════════════════
   FILE LIST
   ══════════════════════════════════════════════════════════════ */
.file-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }

.file-item {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  transition: all .2s;
}
.file-item:hover {
  background: rgba(255,255,255,.05);
  border-color: var(--border2);
}
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.1px;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background .15s;
}
.btn:hover::after { background: rgba(255,255,255,.06); }
.btn:active::after { background: rgba(0,0,0,.1); }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn:disabled::after { display: none; }

.btn-primary {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139,92,246,.35), 0 1px 0 rgba(255,255,255,.1) inset;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 30px rgba(139,92,246,.5), 0 1px 0 rgba(255,255,255,.1) inset;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--border2);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,.09);
  border-color: rgba(139,92,246,.4);
}

.btn-danger {
  background: rgba(244,63,94,.12);
  color: var(--red-l);
  border: 1px solid rgba(244,63,94,.25);
}
.btn-danger:hover:not(:disabled) {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 4px 20px rgba(244,63,94,.35);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 11px; font-size: 11px; }

.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px;
  padding: 6px 8px; border-radius: var(--radius-xs);
  transition: all .15s; display: inline-flex; align-items: center;
}
.btn-icon:hover { color: var(--red-l); background: rgba(244,63,94,.1); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
.badge-success { background: rgba(16,185,129,.1); color: var(--green-l); border: 1px solid rgba(16,185,129,.2); }
.badge-error   { background: rgba(244,63,94,.1);  color: var(--red-l);   border: 1px solid rgba(244,63,94,.2); }
.badge-warn    { background: rgba(245,158,11,.1); color: var(--yellow-l);border: 1px solid rgba(245,158,11,.2); }
.badge-accent  { background: rgba(139,92,246,.1); color: var(--purple-l);border: 1px solid rgba(139,92,246,.2); }
.badge-muted   { background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   STATUS BAR
   ══════════════════════════════════════════════════════════════ */
.status-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text2);
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-dot.idle    { background: var(--muted); }
.status-dot.running { background: var(--purple-l); animation: pulse-ring 1.5s ease infinite; }
.status-dot.done    { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.error   { background: var(--red); box-shadow: 0 0 8px var(--red); }

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(167,139,250,.7); }
  70%  { box-shadow: 0 0 0 8px rgba(167,139,250,.0); }
  100% { box-shadow: 0 0 0 0 rgba(167,139,250,.0); }
}

/* ══════════════════════════════════════════════════════════════
   TWO COLUMNS
   ══════════════════════════════════════════════════════════════ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }

/* ══════════════════════════════════════════════════════════════
   LOG TERMINAL
   ══════════════════════════════════════════════════════════════ */
.log-wrap {
  background: rgba(2, 2, 10, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.log-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 8, 28, 0.95);
  display: flex; align-items: center; gap: 10px;
}
.log-dots { display: flex; gap: 6px; }
.log-dot  { width: 11px; height: 11px; border-radius: 50%; }
.log-dot:nth-child(1) { background: #ff5f57; box-shadow: 0 0 6px rgba(255,95,87,.5); }
.log-dot:nth-child(2) { background: #ffbd2e; box-shadow: 0 0 6px rgba(255,189,46,.5); }
.log-dot:nth-child(3) { background: #28ca41; box-shadow: 0 0 6px rgba(40,202,65,.5); }

.log-container {
  padding: 16px 18px;
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12.5px;
  height: 380px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
  background: linear-gradient(to bottom, rgba(2,2,10,.98), rgba(4,3,15,.98));
}
.log-entry { display: flex; gap: 12px; line-height: 1.7; }
.log-time  { color: #2a2a5a; flex-shrink: 0; font-size: 11px; margin-top: 2px; }
.log-model { flex-shrink: 0; min-width: 48px; font-weight: 700; font-size: 11px; margin-top: 2px; }
.log-msg   { color: #b0b0d8; white-space: pre-wrap; word-break: break-all; }

/* ══════════════════════════════════════════════════════════════
   TOOLBAR
   ══════════════════════════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.toolbar-spacer { flex: 1; }

/* SELECT */
.select {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer;
  transition: border-color .15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b9a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.12); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 36px; color: var(--muted); font-size: 14px; }
.empty-icon  { font-size: 32px; margin-bottom: 10px; opacity: .4; display: block; }

/* PROGRESS BAR */
.progress-bar { height: 5px; background: rgba(255,255,255,.05); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--grad-main);
  transition: width .3s;
  box-shadow: 0 0 12px rgba(139,92,246,.5);
}

/* BACK LINK */
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none;
  font-size: 13px; margin-bottom: 24px;
  font-weight: 500; transition: color .15s;
}
.back-link:hover { color: var(--text); }

/* GLOW DIVIDER */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,.4), transparent);
  margin: 32px 0;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 70% at 20% 20%, rgba(139,92,246,.2) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 80% 80%, rgba(236,72,153,.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(59,130,246,.08) 0%, transparent 60%),
    #03030d;
  position: relative;
}
.login-body::before {
  content: ''; position: fixed;
  top: 10%; left: 10%; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,.1), transparent 70%);
  border-radius: 50%; animation: blob1 8s ease-in-out infinite alternate;
  pointer-events: none;
}
.login-body::after {
  content: ''; position: fixed;
  bottom: 10%; right: 10%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(236,72,153,.08), transparent 70%);
  border-radius: 50%; animation: blob1 12s ease-in-out infinite alternate-reverse;
  pointer-events: none;
}
@keyframes blob1 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(5%,8%) scale(1.2); }
}

.login-box { width: 100%; max-width: 390px; padding: 20px; position: relative; z-index: 1; }

.login-logo { text-align: center; margin-bottom: 44px; }
.login-logo .logo-icon {
  font-size: 56px; display: block;
  filter: drop-shadow(0 0 24px rgba(139,92,246,.6));
  animation: float 4s ease-in-out infinite;
}
.login-logo h1 {
  font-size: 30px; font-weight: 900;
  letter-spacing: -1.2px; margin-top: 14px;
  background: var(--grad-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.login-form {
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  padding: 36px;
  display: flex; flex-direction: column; gap: 22px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 40px 80px rgba(0,0,0,.8);
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: 11px; color: var(--text2);
  font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
}
.form-group input {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--text); font-size: 15px;
  font-family: inherit; outline: none;
  transition: all .2s;
}
.form-group input::placeholder { color: var(--muted); }
.form-group input:focus {
  border-color: rgba(139,92,246,.5);
  background: rgba(139,92,246,.06);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

.error-msg {
  background: rgba(244,63,94,.08);
  border: 1px solid rgba(244,63,94,.2);
  color: var(--red-l); padding: 11px 15px;
  border-radius: var(--radius-xs); font-size: 13px; display: none;
}
.error-msg.show { display: block; }

.login-btn {
  background: linear-gradient(90deg, #7c3aed, #a855f7, #ec4899, #a855f7, #7c3aed);
  background-size: 300% 100%;
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 14px; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 24px rgba(139,92,246,.4), 0 1px 0 rgba(255,255,255,.1) inset;
  letter-spacing: -0.2px;
  animation: btnShimmer 3s linear infinite;
  position: relative; overflow: hidden;
}
.login-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: btnGloss 2.5s ease-in-out infinite;
}
@keyframes btnShimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}
@keyframes btnGloss {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(139,92,246,.65), 0 1px 0 rgba(255,255,255,.15) inset;
}
.login-btn:active { transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   CAPTION TABLE
   ══════════════════════════════════════════════════════════════ */
.cap-version {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color .2s, box-shadow .2s;
  backdrop-filter: blur(10px);
}
.cap-version:hover {
  border-color: rgba(139,92,246,.25);
  box-shadow: var(--shadow-card), 0 0 30px rgba(139,92,246,.06);
}

.cap-version-header {
  padding: 15px 22px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
}
.cap-version-label-input {
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.2);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  color: var(--purple-l);
  font-size: 13px; font-weight: 700; font-family: inherit;
  outline: none; width: 90px;
  transition: all .15s;
}
.cap-version-label-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

.cap-table-wrap { padding: 4px 4px 18px; overflow-x: auto; }

.cap-table { width: 100%; border-collapse: collapse; }
.cap-table th {
  text-align: left; padding: 13px 14px 11px;
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.cap-table tr + tr td { border-top: 1px solid rgba(255,255,255,.03); }
.cap-table tr:hover td { background: rgba(255,255,255,.02); }
.cap-table td { padding: 6px 8px; vertical-align: middle; }

.cap-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 8px 11px;
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; width: 100%;
  transition: all .15s;
}
.cap-input:hover  { border-color: var(--border2); background: rgba(255,255,255,.04); }
.cap-input:focus  {
  border-color: var(--purple);
  background: rgba(139,92,246,.06);
  box-shadow: 0 0 0 2px rgba(139,92,246,.12);
}
.cap-input.end-null { color: var(--muted); font-style: italic; }
.cap-input::placeholder { color: var(--muted); font-style: italic; font-size: 12px; }
.cap-input:disabled { opacity: .5; cursor: not-allowed; }

/* Sticky save bar */
.sticky-save {
  position: sticky; top: 0; z-index: 100;
  background: rgba(3,3,13,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 0 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: rgba(14,12,40,.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 15px 22px;
  font-size: 14px; font-weight: 500;
  z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  transform: translateY(90px) scale(.95);
  opacity: 0;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  max-width: 330px;
  box-shadow: 0 16px 50px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.05) inset;
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,.35); color: var(--green-l); }
.toast.error   { border-color: rgba(244,63,94,.35);  color: var(--red-l); }
.toast.info    { border-color: rgba(139,92,246,.35); color: #c4b5fd; }

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }

/* ══════════════════════════════════════════════════════════════
   MISC
   ══════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; animation: spin .7s linear infinite; }

kbd {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border2);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 12px;
  font-family: inherit;
}

/* Card base */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}

/* Cap row header (legacy compat) */
.cap-row-header {
  display: grid; grid-template-columns: 115px 115px 1fr auto;
  gap: 8px; margin-bottom: 6px; padding: 0 2px;
}
.cap-row-header span {
  font-size: 11px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
