/* ============================================================
   VideoManager — Premium Dark UI  v2.0
   Design system: Inter font · Purple-Blue gradient accent
   ============================================================ */

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

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg-app:        #0d1117;
  --bg-sidebar:    #0a0c12;
  --bg-secondary:  #111827;
  --bg-tertiary:   #161b27;
  --bg-input:      #0d1117;
  --bg-hover:      #1a2035;

  /* Borders */
  --border-color:  #1e2130;
  --border-hover:  #2d3555;

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  /* Accent — Purple → Blue gradient */
  --accent-start:  #6366f1;
  --accent-end:    #3b82f6;
  --accent-mid:    #818cf8;
  --gradient:      linear-gradient(135deg, #6366f1, #3b82f6);
  --gradient-glow: linear-gradient(135deg, rgba(99,102,241,.3), rgba(59,130,246,.15));

  /* Semantic colors */
  --green:   #22c55e;
  --amber:   #f59e0b;
  --red:     #ef4444;
  --teal:    #14b8a6;
  --purple:  #a78bfa;

  /* Layout */
  --sidebar-width:    230px;
  --sidebar-col:      60px;
  --header-height:    0px;

  /* Misc */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow:    0 8px 32px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.4);
  --transition: all 0.18s ease;

  font-family: 'Inter', -apple-system, sans-serif;
}

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

body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-end); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.22s ease;
  overflow: hidden;
}

/* Collapsed */
.sidebar.collapsed { width: var(--sidebar-col); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .user-info { justify-content: center; padding: 1rem 0; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 1.2rem 0 1rem; }
.sidebar.collapsed .logo { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem 0; }
.sidebar.collapsed .sidebar-footer .nav-item { justify-content: center; padding: 0.75rem 0; }
.main-content.sidebar-collapsed { margin-left: var(--sidebar-col); }

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.1rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.logo-icon { font-size: 1.3rem; }

.logo-text {
  font-size: 1rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.3px;
}

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}
.sidebar-toggle:hover { border-color: var(--border-hover); color: var(--text-secondary); }

/* User info */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(99,102,241,.4);
}

.user-name { font-weight: 600; font-size: 0.82rem; }
.user-role { font-size: 0.68rem; margin-top: 1px; }
.badge-administrator { color: #fbbf24; }
.badge-uploader { color: var(--accent-end); }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 0.6rem 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 1.1rem;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none !important;
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-left-color: var(--border-hover);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.12), transparent);
  color: var(--accent-mid);
  border-left-color: var(--accent-start);
  font-weight: 600;
}

.nav-icon { font-size: 1rem; min-width: 18px; text-align: center; line-height: 1; }
.nav-label { white-space: nowrap; }

/* Nav group label */
.nav-group-label {
  padding: 1rem 1.1rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 0.4rem 0;
}

.logout-btn:hover { color: var(--red) !important; border-left-color: var(--red) !important; }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-app);
  transition: margin-left 0.22s ease;
}

.page-wrapper {
  padding: 1.75rem 2rem;
  max-width: 1500px;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-secondary);
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.2px;
}

.card-body { padding: 1.2rem; }
.card-body.p-0 { padding: 0; }

/* ══════════════════════════════════════
   STATS GRID
══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .2s;
  background: var(--gradient-glow);
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 1.9rem; }

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.5px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.stat-blue   { border-left: 2px solid var(--accent-end); }
.stat-purple { border-left: 2px solid var(--accent-start); }
.stat-green  { border-left: 2px solid var(--green); }
.stat-orange { border-left: 2px solid #f97316; }
.stat-teal   { border-left: 2px solid var(--teal); }
.stat-red    { border-left: 2px solid var(--red); }

/* ══════════════════════════════════════
   CONTENT GRIDS
══════════════════════════════════════ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .content-grid, .content-grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; }
}

/* ══════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════ */
.progress-bar-container {
  background: var(--bg-tertiary);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
  margin: 0.3rem 0;
}

.progress-bar-container.mini { height: 4px; margin: 0.15rem 0; }

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 0.5s ease;
}

.gradient-animated {
  background: linear-gradient(90deg, #6366f1, #3b82f6, #6366f1);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 0% 50% }
  100% { background-position: 200% 50% }
}

/* ══════════════════════════════════════
   UPLOAD PROGRESS SECTION
══════════════════════════════════════ */
.upload-progress-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ══════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-done     { background: rgba(34,197,94,.12);  color: #4ade80;  border: 1px solid rgba(34,197,94,.2); }
.status-uploading{ background: rgba(99,102,241,.12); color: #818cf8; border: 1px solid rgba(99,102,241,.2); }
.status-pending  { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.status-error    { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.status-stopped  { background: rgba(71,85,105,.12);  color: #94a3b8; border: 1px solid rgba(71,85,105,.2); }

/* ══════════════════════════════════════
   FORMS
══════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.58rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { 
  cursor: pointer; 
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}
select.form-control option { background: var(--bg-secondary); }

/* ── Toggle Switch ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--gradient);
  border-color: transparent;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--accent-start);
}

.form-control-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; }

.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.35rem; }

code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.1em 0.45em;
  border-radius: 4px;
  font-size: 0.83em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.52rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.855rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: -.1px;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.btn-primary:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.45); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-hover); }

.btn-outline {
  background: transparent;
  border-color: var(--border-hover);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent-start); color: var(--accent-mid); background: rgba(99,102,241,.08); }

.btn-danger {
  background: transparent;
  border-color: rgba(239,68,68,.35);
  color: var(--red);
}
.btn-danger:hover { background: rgba(239,68,68,.12); border-color: var(--red); }

.btn-warning {
  background: transparent;
  border-color: rgba(245,158,11,.35);
  color: var(--amber);
}
.btn-warning:hover { background: rgba(245,158,11,.12); border-color: var(--amber); }

.btn-success {
  background: transparent;
  border-color: rgba(34,197,94,.35);
  color: var(--green);
}
.btn-success:hover { background: rgba(34,197,94,.12); border-color: var(--green); }

.btn-sm  { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-xs  { padding: 0.16rem 0.45rem; font-size: 0.7rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ══════════════════════════════════════
   TABLES
══════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; }

.table thead { position: sticky; top: 0; z-index: 1; }

.table th {
  background: var(--bg-tertiary);
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--bg-hover); }

/* ══════════════════════════════════════
   ALERTS
══════════════════════════════════════ */
.alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.855rem;
}

.alert-error   { background: rgba(239,68,68,.08);  border: 1px solid rgba(239,68,68,.25);  color: #f87171; }
.alert-success { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.25);  color: #4ade80; }
.alert-warning { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); color: #fbbf24; }
.alert-info    { background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.25); color: #818cf8; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 490px;
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.7), 0 0 0 1px rgba(99,102,241,.1);
  animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 650px; }

@keyframes modalIn {
  from { opacity:0; transform: translateY(-16px) scale(.98); }
  to   { opacity:1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }

.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.modal-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ══════════════════════════════════════
   TAB GROUP
══════════════════════════════════════ */
.tab-group {
  display: flex;
  gap: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.tab-btn {
  padding: 0.42rem 1rem;
  border-radius: calc(var(--radius-sm) - 2px);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,.35);
}

/* ══════════════════════════════════════
   UPLOAD DROPZONE
══════════════════════════════════════ */
.upload-dropzone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
  position: relative;
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--accent-start);
  background: rgba(99,102,241,.05);
}
.dropzone-icon { font-size: 2.8rem; margin-bottom: 0.6rem; opacity: .7; }
.dropzone-inner p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.7rem; }
.selected-file-name {
  margin-top: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--accent-mid);
}

/* ══════════════════════════════════════
   FILTER BAR
══════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.filter-bar .form-control { width: auto; min-width: 140px; }
.filter-bar .form-control-sm { min-width: 120px; }

/* ══════════════════════════════════════
   TEXT HELPERS
══════════════════════════════════════ */
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-primary  { color: var(--text-primary); }
.text-success  { color: var(--green); }
.text-danger   { color: var(--red); }
.text-warning  { color: var(--amber); }
.text-accent   { color: var(--accent-mid); }
.text-sm  { font-size: 0.8rem; }
.text-xs  { font-size: 0.72rem; }
.text-bold{ font-weight: 700; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══════════════════════════════════════
   SPACING HELPERS
══════════════════════════════════════ */
.mt-1 { margin-top: 0.35rem; } .mt-2 { margin-top: 0.7rem; } .mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.35rem; } .mb-2 { margin-bottom: 0.7rem; }
.gap-1 { gap: 0.35rem; } .gap-2 { gap: 0.7rem; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ══════════════════════════════════════
   DISK INFO
══════════════════════════════════════ */
.disk-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.855rem;
}

/* ══════════════════════════════════════
   RECENT VIDEOS (dashboard)
══════════════════════════════════════ */
.recent-video-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}
.recent-video-item:last-child { border-bottom: none; }
.recent-video-title { font-size: 0.855rem; font-weight: 500; }
.recent-video-meta  { font-size: 0.72rem; color: var(--text-muted); }

/* ══════════════════════════════════════
   FOLDER TREE
══════════════════════════════════════ */
.folder-tree { font-size: 0.875rem; }
.folder-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}
.folder-item:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ══════════════════════════════════════
   SERVER CARDS
══════════════════════════════════════ */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.server-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: var(--transition);
  position: relative;
}
.server-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.server-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.server-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.server-host { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; font-family: monospace; }
.server-type-badge {
  background: rgba(99,102,241,.12);
  color: var(--accent-mid);
  border: 1px solid rgba(99,102,241,.2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.server-stats { display: flex; gap: 1rem; margin-bottom: 0.9rem; }
.server-stat-item { flex: 1; }
.server-stat-val { font-size: 1.1rem; font-weight: 700; }
.server-stat-lbl { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.server-actions { display: flex; gap: 0.5rem; }

/* ══════════════════════════════════════
   TOASTS / FLASH
══════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.855rem;
  box-shadow: var(--shadow);
  animation: toastIn .25s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 240px;
  max-width: 340px;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--accent-start); }

@keyframes toastIn {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: none; }
}

/* ══════════════════════════════════════
   SCROLLBAR (global)
══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════
   MISC
══════════════════════════════════════ */
hr { border: none; border-top: 1px solid var(--border-color); margin: 1rem 0; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; opacity: .4; margin-bottom: 0.75rem; }
.empty-state-text { font-size: 0.9rem; }

.copy-btn {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 0.8rem; padding: 0.2rem 0.5rem;
  border-radius: 4px; transition: var(--transition);
}
.copy-btn:hover { color: var(--accent-mid); background: rgba(99,102,241,.1); }

/* action button group in tables */
.action-group { display: flex; gap: 6px; align-items: center; }

/* ============================================================
   UI REDESIGN v3.0 — Professional Enhancement Layer
   Appended below original styles (overrides intentional)
   ============================================================ */

/* ── Extra Design Tokens ── */
:root {
  --surface:          #111827;
  --surface-raised:   #1a2235;
  --glass-bg:         rgba(17, 24, 39, 0.85);
  --gradient-subtle:  linear-gradient(135deg, rgba(99,102,241,.07), rgba(59,130,246,.03));
  --gradient-warm:    linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #3b82f6 100%);
  --glow-purple:      0 0 24px rgba(99,102,241,.18), 0 4px 16px rgba(0,0,0,.4);
  --glow-blue:        0 0 20px rgba(59,130,246,.15);
  --glow-green:       0 0 20px rgba(34,197,94,.12);
  --glow-red:         0 0 20px rgba(239,68,68,.15);
  --border-accent:    rgba(99,102,241,.35);
  --transition-fast:  all 0.14s ease;
}

/* ══════════════════════════════════════
   SIDEBAR — Refined
══════════════════════════════════════ */
.sidebar {
  background: linear-gradient(180deg, #080c14 0%, #0a0d17 100%);
  border-right: 1px solid rgba(30, 33, 48, 0.8);
}

.sidebar-header {
  background: transparent;
  border-bottom: 1px solid transparent;
  background-image: linear-gradient(var(--bg-sidebar), var(--bg-sidebar)),
                    linear-gradient(90deg, transparent, rgba(99,102,241,.25), transparent);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  padding: 1.15rem 1.1rem 1rem;
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Nav item — pill hover */
.nav-item {
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  border-left: none;
  padding: 0.6rem 0.85rem;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--gradient);
  transition: height 0.2s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--text-secondary);
  border-left: none;
}

.nav-item:hover::before { height: 60%; }

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(59,130,246,.06));
  color: #a5b4fc;
  border-left: none;
  font-weight: 600;
}

.nav-item.active::before { height: 70%; }

.nav-icon { font-size: 1rem; min-width: 20px; }

/* Sidebar badge pulse */
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%       { box-shadow: 0 0 0 4px rgba(239,68,68,.0); }
}
.nav-item span[style*="background:#ef4444"] {
  animation: badgePulse 2s ease infinite;
}

/* ══════════════════════════════════════
   PAGE HEADER — Refined
══════════════════════════════════════ */
.page-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid transparent;
  background-image: linear-gradient(var(--bg-app), var(--bg-app)),
                    linear-gradient(90deg, rgba(99,102,241,.3), transparent 60%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  margin-bottom: 1.75rem;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #f1f5f9, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════
   STAT CARDS — Glassmorphism + Glow
══════════════════════════════════════ */
.stat-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--glow-purple);
}
.stat-card:hover::after { opacity: 1; }

/* Icon box for stat cards */
.stat-icon {
  font-size: 1.6rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--gradient-subtle);
  border: 1px solid rgba(99,102,241,.15);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #f1f5f9, var(--accent-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-blue   { border-left: 2px solid #3b82f6; }
.stat-purple { border-left: 2px solid #6366f1; }
.stat-green  { border-left: 2px solid #22c55e; }
.stat-orange { border-left: 2px solid #f97316; }
.stat-teal   { border-left: 2px solid #14b8a6; }
.stat-red    { border-left: 2px solid #ef4444; }

/* ══════════════════════════════════════
   CARDS — Depth + Hover
══════════════════════════════════════ */
.card {
  background: linear-gradient(160deg, var(--bg-secondary) 0%, #0e1520 100%);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  transition: border-color 0.2s ease;
}

.card:hover { border-color: rgba(45, 53, 85, 0.8); }

.card-header {
  background: rgba(0,0,0,.15);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

/* ══════════════════════════════════════
   TABLE — Hover accent left border
══════════════════════════════════════ */
.table th {
  background: rgba(0,0,0,.2);
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: rgba(148,163,184,.7);
  border-bottom: 1px solid rgba(255,255,255,.04);
  padding: 0.7rem 1rem;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: 0.855rem;
  transition: background 0.12s;
}

.table tbody tr {
  border-left: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.table tbody tr:hover {
  background: linear-gradient(90deg, rgba(99,102,241,.06), transparent 80%);
  border-left-color: rgba(99,102,241,.4);
}

.table tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════
   BUTTONS — Enhanced
══════════════════════════════════════ */
.btn {
  position: relative;
  overflow: hidden;
  letter-spacing: -0.1px;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,.06), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.15s;
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--gradient-warm);
  box-shadow: 0 4px 14px rgba(99,102,241,.4), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(99,102,241,.5), inset 0 1px 0 rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  border-color: rgba(239,68,68,.3);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.6);
  color: #fca5a5;
}

.btn-warning {
  background: transparent;
  border-color: rgba(245,158,11,.3);
  color: #fbbf24;
}
.btn-warning:hover {
  background: rgba(245,158,11,.15);
  border-color: rgba(245,158,11,.6);
  color: #fde68a;
}

.btn-success {
  background: transparent;
  border-color: rgba(34,197,94,.3);
  color: #4ade80;
}
.btn-success:hover {
  background: rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.6);
  color: #86efac;
}

.btn-secondary {
  background: rgba(22, 27, 39, 0.8);
  border-color: rgba(255,255,255,.06);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: rgba(30, 37, 55, 0.9);
  border-color: rgba(255,255,255,.1);
  color: var(--text-primary);
}

/* ══════════════════════════════════════
   FILTER PANEL — Videos page
══════════════════════════════════════ */
.filter-panel {
  background: linear-gradient(135deg, rgba(17,24,39,.95), rgba(11,15,26,.95));
  border: 1px solid rgba(99,102,241,.15);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  box-shadow: 0 2px 16px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.03);
}

.filter-panel .form-control,
.filter-panel .form-control-sm {
  background: rgba(13,17,23,.8);
  border-color: rgba(255,255,255,.07);
  min-width: auto;
}

.filter-panel .form-control:focus {
  border-color: rgba(99,102,241,.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ══════════════════════════════════════
   FORM CONTROLS — Polish
══════════════════════════════════════ */
.form-control {
  background: rgba(13,17,23,.9);
  border-color: rgba(255,255,255,.07);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.form-control:focus {
  background: rgba(13,17,23,1);
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-label {
  color: rgba(148,163,184,.9);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .8px;
}

/* ══════════════════════════════════════
   MODAL — Refined
══════════════════════════════════════ */
.modal {
  background: linear-gradient(160deg, #111827 0%, #0d1321 100%);
  border: 1px solid rgba(99,102,241,.2);
  box-shadow: 0 32px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(99,102,241,.08), var(--glow-purple);
}

.modal-header {
  background: rgba(0,0,0,.2);
  border-bottom: 1px solid rgba(255,255,255,.04);
  padding: 1.1rem 1.3rem;
}

.modal-title {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.2px;
}

.modal-footer {
  background: rgba(0,0,0,.1);
  border-top: 1px solid rgba(255,255,255,.04);
}

/* ══════════════════════════════════════
   STATUS BADGES — Enhanced
══════════════════════════════════════ */
.status-badge {
  letter-spacing: .5px;
  font-size: 0.65rem;
}

.status-done     { background: rgba(34,197,94,.1);  color: #86efac; border: 1px solid rgba(34,197,94,.25); }
.status-uploading{ background: rgba(99,102,241,.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }
.status-pending  { background: rgba(245,158,11,.1);  color: #fde68a; border: 1px solid rgba(245,158,11,.25); }
.status-error    { background: rgba(239,68,68,.1);   color: #fca5a5; border: 1px solid rgba(239,68,68,.25); }
.status-stopped  { background: rgba(71,85,105,.1);   color: #94a3b8; border: 1px solid rgba(71,85,105,.25); }

/* ══════════════════════════════════════
   UPLOAD PAGE — Two column layout
══════════════════════════════════════ */
.upload-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.upload-sidebar-card {
  background: linear-gradient(160deg, var(--bg-secondary), #0e1520);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
}

.upload-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 1024px) {
  .upload-layout { grid-template-columns: 1fr; }
  .upload-sidebar-card { position: static; }
}

/* ══════════════════════════════════════
   TAB GROUP — Pill style
══════════════════════════════════════ */
.tab-group {
  background: rgba(0,0,0,.25);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.05);
}

.tab-btn {
  border-radius: 7px;
  font-size: 0.8rem;
  transition: all 0.15s ease;
  color: rgba(148,163,184,.6);
}

.tab-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,.04); }

.tab-btn.active {
  background: var(--gradient-warm);
  box-shadow: 0 2px 10px rgba(99,102,241,.4), inset 0 1px 0 rgba(255,255,255,.15);
  color: #fff;
}

/* ══════════════════════════════════════
   UPLOAD DROPZONE — Enhanced
══════════════════════════════════════ */
.upload-dropzone {
  border: 2px dashed rgba(99,102,241,.25);
  background: rgba(13,17,23,.6);
  transition: all 0.2s ease;
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: rgba(99,102,241,.6);
  background: rgba(99,102,241,.04);
  box-shadow: inset 0 0 40px rgba(99,102,241,.05);
}

/* ══════════════════════════════════════
   TOAST — Enhanced
══════════════════════════════════════ */
.toast {
  background: linear-gradient(135deg, #111827, #0e1520);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  border-radius: 10px;
}

/* ══════════════════════════════════════
   RECENT VIDEO — Dashboard
══════════════════════════════════════ */
.recent-video-item {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background 0.12s;
  border-radius: var(--radius-xs);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.recent-video-item:hover { background: rgba(99,102,241,.04); }
.recent-video-item:last-child { border-bottom: none; }

.recent-video-title {
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--text-primary);
}

.recent-video-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ══════════════════════════════════════
   SERVER CARDS — Enhanced
══════════════════════════════════════ */
.server-card {
  background: linear-gradient(160deg, var(--bg-secondary), #0e1520);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.server-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--glow-purple);
}

/* ══════════════════════════════════════
   PROGRESS BAR — Shimmer
══════════════════════════════════════ */
.gradient-animated {
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #3b82f6, #6366f1);
  background-size: 300% 100%;
  animation: progressShimmer 2.5s linear infinite;
}

@keyframes progressShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ══════════════════════════════════════
   PAGE WRAPPER — Better max-width
══════════════════════════════════════ */
.page-wrapper {
  padding: 1.75rem 2rem;
  max-width: 1600px;
}

/* ══════════════════════════════════════
   LOADING SKELETON
══════════════════════════════════════ */
@keyframes skeletonPulse {
  0%, 100% { opacity: .4; }
  50%       { opacity: .7; }
}

.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  animation: skeletonPulse 1.8s ease infinite;
}

/* ══════════════════════════════════════
   SCROLLBAR — Subtle
══════════════════════════════════════ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,.4); }

/* ══════════════════════════════════════
   FILTER PANEL
══════════════════════════════════════ */
.filter-panel {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.filter-panel > * {
  flex: 0 0 auto !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
}
.filter-panel select,
.filter-panel input[type="text"],
.filter-panel input[type="search"] {
  display: inline-block !important;
  width: auto !important;
  height: 34px;
  font-size: .82rem;
  padding: 0 .65rem;
  border-radius: 8px;
  min-width: 0;
}
.filter-panel > div {
  display: inline-flex !important;
  width: auto !important;
}
.filter-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  white-space: nowrap;
}