/* ─── DASHBOARD LAYOUT ─────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--black);
}

/* ─── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--black-soft);
  border-right: 1px solid var(--black-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--beige);
  border-bottom: 1px solid var(--black-border);
  display: block;
  text-decoration: none;
}
.sidebar-logo span { color: var(--gold); }

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

.sidebar-nav { padding: 0 8px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--stone);
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: none;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--beige); }
.nav-item.active { background: rgba(201,169,110,0.1); color: var(--gold); border: 1px solid rgba(201,169,110,0.15); }
.nav-item .ni { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .ni { opacity: 1; }
.nav-item .badge-count { margin-left: auto; background: var(--gold); color: var(--black); font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: var(--radius-full); }

.sidebar-upgrade {
  margin: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(201,169,110,0.1), rgba(138,96,64,0.08));
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: var(--radius-lg);
}
.sidebar-upgrade .su-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--beige); margin-bottom: 4px; }
.sidebar-upgrade .su-desc { font-size: 11px; color: var(--stone); margin-bottom: 12px; line-height: 1.5; }

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--black-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-brown), var(--stone));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--beige);
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--beige); }
.user-plan { font-size: 10px; color: var(--stone); }

/* ─── MAIN CONTENT ─────────────────────────────────────── */
.dash-main {
  margin-left: 240px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,8,7,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--black-border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  width: 280px;
  transition: var(--transition);
}
.topbar-search:focus-within { border-color: rgba(201,169,110,0.3); }
.topbar-search input { background: none; border: none; outline: none; font-size: 13px; color: var(--beige); font-family: var(--font-body); width: 100%; }
.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon-btn {
  width: 36px; height: 36px;
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--stone);
  cursor: none;
  transition: var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { border-color: rgba(201,169,110,0.3); color: var(--beige); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }

.dash-content { padding: 32px; flex: 1; }

/* ─── STATS CARDS ──────────────────────────────────────── */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }

.stat-card {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.stat-card:hover { border-color: rgba(201,169,110,0.2); transform: translateY(-2px); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.stat-card-trend { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.trend-up { background: rgba(74,158,107,0.12); color: #6bc98a; }
.trend-down { background: rgba(220,80,80,0.1); color: #e07070; }
.stat-card-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--beige); margin-bottom: 4px; }
.stat-card-label { font-size: 12px; color: var(--stone); }

/* ─── UPLOAD AREA ──────────────────────────────────────── */
.dash-upload-area {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 32px;
}
.dash-upload-area h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--beige); margin-bottom: 4px; }
.dash-upload-area p { font-size: 13px; color: var(--stone); margin-bottom: 24px; }

.upload-zone-dash {
  border: 2px dashed var(--black-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  transition: var(--transition);
  cursor: none;
  position: relative;
}
.upload-zone-dash:hover, .upload-zone-dash.drag-over {
  border-color: rgba(201,169,110,0.4);
  background: rgba(201,169,110,0.03);
}
.upload-zone-dash .uz-icon { font-size: 36px; margin-bottom: 12px; }
.upload-zone-dash .uz-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--beige); margin-bottom: 6px; }
.upload-zone-dash .uz-sub { font-size: 12px; color: var(--stone); margin-bottom: 16px; }

/* Enhancement options */
.enhance-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.enhance-opt {
  padding: 14px;
  background: var(--black-soft);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-md);
  cursor: none;
  transition: var(--transition);
  text-align: center;
}
.enhance-opt:hover { border-color: rgba(201,169,110,0.3); }
.enhance-opt.active { border-color: var(--gold); background: rgba(201,169,110,0.06); }
.enhance-opt .eo-icon { font-size: 20px; margin-bottom: 6px; }
.enhance-opt .eo-name { font-size: 12px; font-weight: 600; color: var(--beige); margin-bottom: 2px; }
.enhance-opt .eo-desc { font-size: 10px; color: var(--stone); }

/* ─── VIDEO GRID ───────────────────────────────────────── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.video-card {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.video-card:hover { border-color: rgba(201,169,110,0.2); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }

.video-thumb {
  aspect-ratio: 16/9;
  background: var(--black-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-thumb-bg { position: absolute; inset: 0; }
.video-play-btn {
  width: 44px; height: 44px;
  background: rgba(201,169,110,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: var(--transition);
}
.video-card:hover .video-play-btn { transform: scale(1.1); background: var(--gold); }
.video-status-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.status-done { background: rgba(74,158,107,0.2); color: #6bc98a; border: 1px solid rgba(74,158,107,0.3); }
.status-processing { background: rgba(201,169,110,0.15); color: var(--gold); border: 1px solid rgba(201,169,110,0.3); }
.status-queued { background: rgba(164,153,139,0.1); color: var(--stone); border: 1px solid var(--black-border); }

.video-info { padding: 14px; }
.video-name { font-size: 13px; font-weight: 600; color: var(--beige); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--stone); }
.video-res { display: flex; align-items: center; gap: 4px; }
.video-actions { display: flex; gap: 6px; margin-top: 10px; }
.video-action-btn {
  flex: 1;
  padding: 7px;
  background: var(--black-soft);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--stone);
  cursor: none;
  transition: var(--transition);
  text-align: center;
  font-family: var(--font-body);
}
.video-action-btn:hover { border-color: rgba(201,169,110,0.3); color: var(--beige); }
.video-action-btn.primary { background: rgba(201,169,110,0.1); border-color: rgba(201,169,110,0.25); color: var(--gold); }
.video-action-btn.primary:hover { background: rgba(201,169,110,0.15); }

/* Progress bar */
.progress-bar-wrap { height: 3px; background: var(--black-border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent-brown)); border-radius: 2px; transition: width 0.5s ease; }

/* ─── USAGE METER ──────────────────────────────────────── */
.usage-card {
  background: var(--black-card);
  border: 1px solid var(--black-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.usage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.usage-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--beige); }
.usage-bar-wrap { height: 6px; background: var(--black-border); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.usage-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.usage-bar-fill.low { background: linear-gradient(90deg, #6bc98a, #4a9e6b); }
.usage-bar-fill.mid { background: linear-gradient(90deg, var(--gold), var(--accent-brown)); }
.usage-bar-fill.high { background: linear-gradient(90deg, #e07070, #c05050); }
.usage-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--stone); }

/* ─── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .enhance-options { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-content { padding: 20px; }
  .dash-topbar { padding: 0 20px; }
  .topbar-search { display: none; }
}