/* ─────────────────────────────────────────────
   nixia-panel.css  –  NixiaPlayer Pro Admin
   ───────────────────────────────────────────── */

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

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: #06080d;
  color: #d4d8e8;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* ════════════════════════════════════════════
   APP LAYOUT
   ════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════ */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #0d1117;
  border-right: 1px solid #1a2233;
  display: flex;
  flex-direction: column;
  padding: 20px 0 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  border-bottom: 1px solid #1a2233;
  margin-bottom: 16px;
}
.sidebar-brand-text { display: flex; flex-direction: column; gap: 1px; }
.sidebar-brand-name { font-size: 20px; font-weight: 800; letter-spacing: .01em; background: linear-gradient(150deg,rgba(0, 255, 255, 1) 0%, rgba(0, 119, 255, 1) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.sidebar-brand-sub  { font-size: .65em; font-weight: 600; color: #00e5ff; letter-spacing: .1em; opacity: .7; }

.sidebar-section-label {
  font-size: .65em;
  font-weight: 700;
  letter-spacing: .1em;
  color: #5a6b8a;
  padding: 8px 16px 4px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 0 8px; margin-bottom: 6px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: .87em;
  font-weight: 500;
  color: #8294b5;
  text-decoration: none;
  transition: background .13s, color .13s;
  cursor: pointer;
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-link:hover  { background: rgba(0,229,255,.12); color: #00e5ff; }
.sidebar-link.active { background: rgba(0,229,255,.12); color: #00e5ff; }

.sidebar-user {
  margin-top: auto;
  padding: 14px 16px 0;
  border-top: 1px solid #1a2233;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82em;
  color: rgba(255,255,255,.4);
}
.sidebar-user svg { flex-shrink: 0; opacity: .5; }
.sidebar-logout {
  margin-left: auto;
  color: rgba(255,80,80,.6);
  text-decoration: none;
  font-size: .85em;
  white-space: nowrap;
  transition: color .14s;
}
.sidebar-logout:hover { color: #ff6060; }

/* ════════════════════════════════════════════
   MAIN PANEL
   ════════════════════════════════════════════ */
.panel-main {
  flex: 1;
  padding: 28px 32px 40px;
  min-width: 0;
  overflow-y: auto;
  max-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  margin: 0;
  font-size: 1.4em;
  font-weight: 700;
  color: #dde3f0;
}
.page-header-right { display: flex; align-items: center; gap: 12px; }

/* Search box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d1117;
  border: 1px solid #1a2233;
  border-radius: 9px;
  padding: 12px 16px;
}
.search-box svg { width: 15px; height: 15px; opacity: .35; flex-shrink: 0; }
.search-box input {
  background: none; border: none; color: #5a6b8a;
  font-family: 'Inter', sans-serif;
  outline: none; width: 180px;
}
.search-box input::placeholder { color: rgba(255,255,255,.22); }

/* ════════════════════════════════════════════
   STATS GRID
   ════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #0d1117;
  border: 1px solid #1a2233;
  border-radius: 13px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 22px; height: 22px; }
.stat-card-icon--blue   { background: rgba(0,130,255,.15); color: #4db8ff; }
.stat-card-icon--teal   { background: rgba(0,212,170,.12); color: #00d4aa; }
.stat-card-icon--purple { background: rgba(160,80,255,.12); color: #c080ff; }
.stat-card-num { font-size: 1.7em; font-weight: 700; color: #dde3f0; line-height: 1; }
.stat-card-lbl { font-size: .78em; color: #5a6b8a; margin-top: 3px; }

/* ════════════════════════════════════════════
   VIDEO TABLE
   ════════════════════════════════════════════ */
.table-card {
  background: #0d1117;
  border: 1px solid #1a2233;
  border-radius: 14px;
  overflow: hidden;
}
.table-card-head {
  padding: 14px 20px;
  font-size: .83em;
  font-weight: 600;
  color: #dde3f0;
  border-bottom: 1px solid #1a2233;
}
.vtable {
  width: 100%;
  border-collapse: collapse;
}
.vtable thead tr {
  border-bottom: 1px solid #1a2233;
}
.vtable th {
  padding: 10px 16px;
  font-size: .7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #5a6b8a;
  text-align: left;
  white-space: nowrap;
}
.vtable-row {
  border-bottom: 1px solid #1a2233;
  transition: background .12s;
}
.vtable-row:last-child { border-bottom: none; }
.vtable-row:hover { background: rgba(255,255,255,.03); }
.vtable td { padding: 12px 16px; vertical-align: middle; }

.vtd-thumb { width: 72px; }
.vtable-thumb {
  width: 64px; height: 40px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.vtable-thumb-empty {
  width: 64px; height: 40px;
  background: rgba(255,255,255,.06);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.2);
}
.vtd-title { max-width: 280px; }
.vtable-title { font-weight: 600; color: #dde3f0; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.vtable-desc  { font-size: .77em; color: #5a6b8a; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.vtd-q { white-space: nowrap; }
.q-label {
  font-size: .78em; font-weight: 600;
  background: #111827;
  border-radius: 5px;
  padding: 3px 8px;
  color: #dde3f0;
}
.vtd-embed { max-width: 220px; }
.embed-pill {
  background: #111827;
  border: 1px solid #1a2233;
  border-radius: 6px;
  padding: 5px 10px;
  max-width: 220px;
}
.embed-pill-text {
  display: block;
  font-size: .74em;
  font-family: 'JetBrains Mono', monospace;
  color: #8294b5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vtd-actions { white-space: nowrap; }
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: #111827;
  border: 1px solid #1a2233;
  border-radius: 7px;
  color: #8294b5;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
  margin-left: 4px;
  flex-shrink: 0;
  padding: 0;
}
.action-btn svg { width: 14px; height: 14px; }
.action-btn:hover { background: #111827; color: #fff; }
.action-btn--danger:hover { background: rgba(255,60,60,.15); color: #ff6060; border-color: rgba(255,60,60,.25); }

/* ════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 5px;
  font-size: .72em; font-weight: 700; letter-spacing: .04em;
}
.badge--blue   { background: rgba(0,130,255,.18); color: #4db8ff; }
.badge--teal   { background: rgba(0,212,170,.15); color: #00d4aa; }
.badge--orange  { background: rgba(255,140,0,.15);  color: #ffaa44; }
.badge--purple  { background: rgba(160,80,255,.15); color: #cc88ff; }

/* ════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 56px 24px; text-align: center;
  color: rgba(255,255,255,.25);
}
.empty-state a { color: #00d4aa; text-decoration: none; }

/* ════════════════════════════════════════════
   AUTH / LOGIN
   ════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgb(0 152 212 / 8%) 0%, transparent 60%), #0a0c12;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,.04);
  border: 1px solid #1a2233;
  border-radius: 18px;
  padding: 36px 32px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo-name { font-size: 1.1em; font-weight: 700; background: linear-gradient(150deg,rgba(0, 255, 255, 1) 0%, rgba(0, 119, 255, 1) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.auth-logo-sub  { font-size: .75em; color: #6b7a99; margin-top: 1px; }

/* ════════════════════════════════════════════
   FORM FIELDS
   ════════════════════════════════════════════ */
.field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px;
}
.field-label {
  font-size: .72em; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: #6b7a99;
}
.field-optional { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .7; }
.field-input {
  background: rgba(255,255,255,.05);
  border: 1px solid #1a2233;
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.field-input::placeholder { color: rgba(255,255,255,.18); }
.field-input:focus { border-color: rgba(0,212,170,.5); background: rgba(0,212,170,.04); }
.field-textarea {
  resize: vertical; min-height: 80px; font-family: 'Inter', sans-serif;
}
.field-select {
  background: rgba(255,255,255,.05);
  border: 1px solid #1a2233;
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: .88em;
  padding: 9px 10px;
  outline: none;
  cursor: pointer;
  width: 100%;
  transition: border-color .15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.4)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.field-select:focus { border-color: rgba(0,212,170,.5); }
.field-select option { background: #1a1d28; }
.field-input--mono { font-family: 'JetBrains Mono', monospace; font-size: .82em; }

.field--sm   { min-width: 110px; max-width: 150px; }
.field--xs   { min-width: 70px;  max-width: 90px; }
.field--grow { flex: 1; min-width: 0; }
.field--check {
  min-width: 60px; max-width: 70px;
  align-items: center;
}
.field--check input[type=checkbox] {
  width: 18px; height: 18px;
  cursor: pointer; margin-top: 4px;
  accent-color: #00d4aa;
}
.mt-12 { margin-top: 12px; }

/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 16px; border: none; border-radius: 9px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: opacity .13s, transform .11s, background .13s;
}
.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn--primary {
  background: linear-gradient(150deg, #00ffff 0%, #0077ff 100%);
  color: #06080d;
}
.btn--teal {
  background: rgba(0,212,170,.15);
  border: 1px solid rgba(0,212,170,.3);
  color: #00d4aa;
}
.btn--teal:hover { background: rgba(0,212,170,.22); opacity: 1; }
.btn--ghost {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}
.btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; opacity: 1; }
.btn--full { width: 100%; }

/* ════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════ */
.alert { padding: 10px 14px; border-radius: 8px; font-size: .87em; font-weight: 500; }
.alert--error { background: rgba(255,60,60,.1); border: 1px solid rgba(255,60,60,.22); color: #ff7070; }

/* ════════════════════════════════════════════
   EDITOR SECTIONS
   ════════════════════════════════════════════ */
.section {
  background: #0d1117;
  border: 1px solid #1a2233;
  border-radius: 13px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.section-title {
  font-size: .68em; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  margin-bottom: 16px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* TMDB section */
.section--tmdb {
  border: 1px dashed #00e5ff;
  background: rgba(0, 229, 255, 0.04);
}
.section-tmdb-header {
  display: flex; align-items: center; gap: 8px;
  font-size: .72em; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: #00d4aa;
  margin-bottom: 14px;
}
.tmdb-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: flex-end;
}
@media (max-width: 640px) { .tmdb-fields { grid-template-columns: 1fr; } }
.tmdb-status { margin-top: 10px; font-size: .84em; min-height: 20px; }
.tmdb-ok    { color: #00d4aa; }
.tmdb-error { color: #ff7070; }

/* TYPE TABS */
.type-tabs {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.type-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  font-size: .85em; font-weight: 500;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  color: rgba(255,255,255,.55);
  user-select: none;
}
.type-tab input { display: none; }
.type-tab:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.type-tab.active {
  background: rgba(0,130,255,.15);
  border-color: rgba(0,130,255,.4);
  color: #66c2ff;
}
#tabStreamtape.active {
  background: rgba(160,80,255,.12);
  border-color: rgba(160,80,255,.35);
  color: #cc88ff;
}

/* QUALITY ROWS */
.quality-row { margin-bottom: 10px; }
.quality-row-inner {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}
.sub-row { margin-bottom: 10px; }
.sub-row-inner {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}

.btn-remove {
  background: rgba(255,60,60,.1);
  border: 1px solid rgba(255,60,60,.2);
  border-radius: 7px;
  color: rgba(255,100,100,.7);
  padding: 9px 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  margin-bottom: 0;
  height: 36px;
}
.btn-remove:hover { background: rgba(255,60,60,.2); color: #ff6060; }

.btn-add-row {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  background: rgba(255,255,255,.04);
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: 9px;
  color: rgba(255,255,255,.45);
  font-family: 'Inter', sans-serif;
  font-size: .83em; font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.btn-add-row:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.8);
}

/* EMBED OUTPUT */
.embed-outputs { display: flex; flex-direction: column; gap: 2px; }
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row .field-input { flex: 1; }

/* FORM FOOTER */
.form-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding-top: 4px;
}

/* ════════════════════════════════════════════
   ERROR SCREEN (embed)
   ════════════════════════════════════════════ */
.nixia-error-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #080a0f;
}
.nixia-error-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; text-align: center;
  padding: 40px 32px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; max-width: 360px;
  font-family: 'Barlow', sans-serif; color: #fff;
}
.nixia-error-title { font-size: 1.1em; font-weight: 600; margin: 0; }
.nixia-error-msg   { font-size: .85em; opacity: .55; margin: 0; line-height: 1.5; }
