:root {
  --bg: #f5f6f8;
  --bg2: #ffffff;
  --bg3: #edf0f4;
  --bg4: #e4e8ee;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --accent: #f59e0b;
  --accent-dim: rgba(245,158,11,0.1);
  --accent-hover: #d97706;
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.1);
  --blue: #3b82f6;
  --blue-dim: rgba(59,130,246,0.1);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.1);
  --text: #1a1a2e;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #e2e5ea;
  --border-light: #f0f1f3;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Nav (Hub-style TitanWorks banner) ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 2rem;
  background: #1a1d27;
  border-bottom: 1px solid #2a2d3a;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand a {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e8eaf0;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.nav-brand a:hover { color: #e8eaf0; text-decoration: none; }
.brand-logo { height: 24px; display: block; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: #9ca3b4; font-size: 0.9rem; text-decoration: none; }
.nav-link:hover { color: #e8eaf0; text-decoration: none; }
.nav-user {
  color: #e8eaf0;
  font-size: 0.85rem;
  padding-left: 1rem;
  border-left: 1px solid #2a2d3a;
}
.logout { color: #6b7280 !important; font-size: 0.82rem !important; }

/* ── Impersonation Banner ── */
.impersonation-bar {
  background: var(--accent);
  color: #000;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}
.impersonation-bar a { color: #000; text-decoration: underline; font-weight: 700; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 32px 24px; }

/* ── Hero ── */
.hero {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  box-shadow: var(--shadow);
}
.hero-content { flex: 1; }
.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.1;
  color: var(--text);
}
.hero-title span { color: var(--accent); }
.hero-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.5;
}
.hero-stats {
  display: flex;
  gap: 24px;
}
.hero-stat { text-align: center; }
.hero-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}
.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-link { font-size: 13px; color: var(--accent); }

/* ── Recently Watched Carousel ── */
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
  margin-bottom: 40px;
}
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-track { background: transparent; }
.carousel::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

.carousel-card {
  flex: 0 0 220px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.carousel-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--text);
}
.carousel-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-muted);
  position: relative;
}
.carousel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.carousel-watched-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--green);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.carousel-info { padding: 12px; }
.carousel-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.carousel-meta { font-size: 11px; color: var(--text-muted); }

/* ── Category Grid ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.category-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--text);
}
.category-banner {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.category-icon { font-size: 36px; opacity: 0.9; }
.category-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.category-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.category-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.category-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.category-meta-item { display: flex; align-items: center; gap: 4px; }

/* Progress Ring */
.progress-ring {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-bg { stroke: var(--bg3); }
.progress-ring-fill { stroke: var(--accent); transition: stroke-dashoffset 0.5s ease; }
.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
}

/* ── Category Detail Page ── */
.category-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.category-header-ring { flex-shrink: 0; }
.category-header-info { flex: 1; }
.category-header-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.category-header-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── Video List (with thumbnails) ── */
.video-list { display: flex; flex-direction: column; gap: 12px; }
.video-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.video-item:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.video-item.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.video-item-thumb {
  width: 160px;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  color: var(--text-muted);
  font-size: 24px;
}
.video-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-item-thumb .thumb-play {
  position: absolute;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}
.video-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.video-item.watched .video-num {
  background: var(--green-dim);
  color: var(--green);
}
.video-info { flex: 1; min-width: 0; }
.video-title-text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
}
.video-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Video Player Page ── */
.video-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}
.video-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.video-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.video-player-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 16px;
  background: #1a1d27;
}
.video-detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.video-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.video-detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.video-links {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
}
.video-links-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.video-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.video-links a:last-child { border-bottom: none; }

.video-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.video-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.video-nav-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

/* Sidebar playlist */
.sidebar-playlist {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sidebar-playlist-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.sidebar-playlist-list {
  max-height: 600px;
  overflow-y: auto;
}
.sidebar-video {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar-video:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.sidebar-video.active { background: var(--accent-dim); color: var(--accent-hover); }
.sidebar-video.watched { color: var(--text-muted); }
.sidebar-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.sidebar-video.watched .sidebar-num { background: var(--green-dim); color: var(--green); }
.sidebar-video.active .sidebar-num { background: var(--accent); color: #000; }
.sidebar-video-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-video-dur { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent-hover);
  transition: all var(--transition);
  text-decoration: none;
}
.tag:hover { background: var(--accent); color: #000; text-decoration: none; }

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-card {
  padding: 12px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.tag-card:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.tag-card-name { font-weight: 600; font-size: 14px; }
.tag-card-count { font-size: 12px; color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #000; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg4); text-decoration: none; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.9; text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-watched {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-watched:hover { border-color: var(--green); color: var(--green); }
.btn-watched.is-watched { background: var(--green-dim); color: var(--green); border-color: var(--green); }

/* ── Search Results ── */
.search-hero {
  text-align: center;
  padding: 40px 0;
  margin-bottom: 32px;
}
.search-hero-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 16px; }
.search-form-big {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 40px;
  padding: 4px 4px 4px 24px;
  max-width: 600px;
  margin: 0 auto;
  transition: border-color var(--transition);
  box-shadow: var(--shadow);
}
.search-form-big:focus-within { border-color: var(--accent); }
.search-form-big input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  padding: 10px 0;
  outline: none;
}
.search-form-big input::placeholder { color: var(--text-muted); }
.search-form-big button {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 40px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.search-form-big button:hover { background: var(--accent-hover); }
.search-count { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* ── Video Grid (search / tag results) ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.video-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--text);
}
.video-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
  position: relative;
}
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card-body { padding: 16px; }
.video-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-cat { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.video-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.video-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.login-brand span { color: var(--accent); }
.login-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.5;
}
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.login-btn:hover { background: var(--accent-hover); text-decoration: none; color: #000; }
.login-features {
  margin-top: 32px;
  text-align: left;
}
.login-feature {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.login-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-text { font-size: 16px; margin-bottom: 8px; }
.empty-sub { font-size: 13px; color: var(--text-muted); }

/* ── Admin ── */
.admin-nav {
  background: #1a1d27;
  border-bottom: 1px solid #2a2d3a;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.admin-nav-brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
}
.admin-nav-links { display: flex; gap: 4px; }
.admin-nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #9ca3b4;
  text-decoration: none;
  transition: all var(--transition);
}
.admin-nav-link:hover, .admin-nav-link.active {
  background: #2a2d3a;
  color: #e8edf2;
  text-decoration: none;
}
.admin-nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.admin-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg3); }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-check input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}
.form-check label { margin-bottom: 0; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.tag-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tag-select label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg3);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.tag-select label:has(input:checked) {
  background: var(--accent-dim);
  color: var(--accent-hover);
}
.tag-select input[type="checkbox"] { display: none; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.flash-error { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.flash-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-published { background: var(--green-dim); color: var(--green); }
.badge-draft { background: rgba(156,163,175,0.15); color: var(--text-muted); }

/* ── Admin form card ── */
.admin-form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .video-layout { grid-template-columns: 1fr; }
  .sidebar-playlist { display: none; }
  .hero { flex-direction: column; padding: 24px; }
  .category-grid { grid-template-columns: 1fr; }
  .video-item-thumb { width: 120px; }
}
@media (max-width: 640px) {
  .nav { padding: 0 12px; }
  .nav-search { margin: 0 12px; }
  .container { padding: 20px 16px; }
  .category-header { flex-direction: column; text-align: center; }
  .video-nav { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .video-item-thumb { width: 100px; }
}
