:root {
  /* BẢNG MÀU PHONG THỦY MỆNH KIM TỐI GIẢN (BẠCH KIM · VÀNG HOÀNG KIM · TITAN ÁNH BẠC) */
  --bg-ground: #F6F5F0;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EFECE4;
  --bg-dark: #18191D;

  --ink-primary: #18191D;
  --ink-secondary: #52555E;
  --ink-muted: #7C7F88;

  --border-subtle: #E4E0D5;
  --border-strong: #CCC6B8;

  /* Vàng Hoàng Kim 24K & Đồng Ánh Kim */
  --accent-brand: #B8860B;
  --accent-gold: #D4AF37;
  --accent-soft: #FCF6E3;
  --metal-gold-gradient: linear-gradient(135deg, #D4AF37 0%, #A6780E 100%);

  --status-emerald: #0D7A5F;
  --status-emerald-bg: #EDF8F4;
  --status-amber: #B47809;
  --status-amber-bg: #FDF6E2;
  --status-blue: #2B5B84;
  --status-blue-bg: #EEF4F9;
  --status-slate: #4E525B;
  --status-slate-bg: #EFECE6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(24, 25, 29, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
}

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

::selection {
  background-color: #F5E6B3;
  color: #4D3602;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-ground);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: #C7C1B2;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-brand);
}

.num,
.num-col {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   CHẾ ĐỘ XEM MOBILE APP PREVIEW
   ========================================================================== */
.platform-wrapper.mode-app {
  min-height: 100vh;
  background: #16171B;
  padding: 20px 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.platform-wrapper.mode-app .app-shell {
  width: 420px;
  max-width: 100%;
  min-height: 820px;
  max-height: 92vh;
  background: var(--bg-ground);
  border-radius: 26px;
  border: 5px solid #3A3832;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.35);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.platform-wrapper.mode-app .top-nav,
.platform-wrapper.mode-app .mini-kpi-bar {
  display: none;
}

.platform-wrapper.mode-app .mobile-bottom-nav {
  display: grid;
}

.platform-wrapper.mode-app .minimal-command-bar,
.platform-wrapper.mode-app .quick-channel-form,
.platform-wrapper.mode-app .quick-filter-cluster,
.platform-wrapper.mode-app .content-vault-split {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ==========================================================================
   APP SHELL & MINIMALIST LEFT SIDEBAR (MỆNH KIM)
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
}

.left-sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-strong);
  border-top: 3px solid var(--accent-gold);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.workspace-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--metal-gold-gradient);
  color: #16171B;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 18px;
  height: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.6875rem;
  color: var(--accent-brand);
  font-weight: 600;
}

.left-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-folder-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 140ms ease;
}

.nav-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.nav-btn.active {
  background: linear-gradient(135deg, #FFFDF7 0%, #FDF8E7 100%);
  color: var(--ink-primary);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.nav-btn.active svg {
  color: var(--accent-brand);
}

.nav-count {
  background: var(--accent-soft);
  color: #6E4F04;
  border: 1px solid rgba(212, 175, 55, 0.45);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* CÂY THƯ MỤC KÊNH TRONG THANH BÊN TRÁI */
.sidebar-folder-tree {
  margin-left: 11px;
  padding-left: 9px;
  border-left: 1.5px solid rgba(212, 175, 55, 0.45);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-tree-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-tree-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.sidebar-tree-folder:hover {
  background: #FAF8F2;
  color: var(--ink-primary);
  border-color: var(--border-subtle);
}

.sidebar-tree-folder.active {
  background: #FDF8E7;
  color: #5C4300;
  border-color: #D4AF37;
  font-weight: 800;
}

.tree-item-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.tree-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.tree-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-count {
  font-size: 0.66rem;
  font-weight: 800;
  color: #64748B;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  padding: 0 5px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sidebar-tree-folder.active .tree-count {
  background: #F6E6B4;
  border-color: #D4AF37;
  color: #5C4300;
}

.sidebar-tree-children {
  margin-left: 10px;
  padding-left: 7px;
  border-left: 1px dashed #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-tree-channel {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.sidebar-tree-channel:hover {
  background: #F8FAFC;
  color: var(--ink-primary);
  border-color: #CBD5E1;
}

.sidebar-tree-channel.active {
  background: linear-gradient(135deg, #FDF8E7 0%, #F7E8B5 100%);
  color: #5C4300;
  border-color: #D4AF37;
  font-weight: 800;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-footer .hourly-sync-pill {
  width: 100%;
  justify-content: center;
}

.sidebar-settings-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #FAF8F2;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.sidebar-settings-btn:hover,
.sidebar-settings-wrap.open .sidebar-settings-btn {
  border-color: var(--accent-gold);
  background: #FDF8E7;
  color: #5C4300;
}

.settings-chevron {
  font-size: 0.75rem;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.sidebar-settings-wrap.open .settings-chevron {
  transform: rotate(180deg);
}

.sidebar-settings-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: #FFFFFF;
  border: 1px solid #D4AF37;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.sidebar-settings-menu[hidden] {
  display: none !important;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.settings-menu-item:hover {
  background: #FDF8E7;
  border-color: rgba(212, 175, 55, 0.45);
  color: #5C4300;
}

.settings-menu-danger {
  color: #991B1B;
  border-top: 1px dashed #E2E8F0;
  margin-top: 2px;
  padding-top: 8px;
}

.settings-menu-danger:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #7F1D1D;
}

/* CHỈ SỐ TỔNG HỢP TỐI GIẢN TRÊN HEADER */
.mini-kpi-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 14px;
  background: #FAF8F2;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.mini-kpi {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-right: 14px;
  border-right: 1px solid var(--border-subtle);
}

.mini-kpi:last-child {
  padding-right: 0;
  border-right: none;
}

.mini-kpi-label {
  font-size: 0.75rem;
  color: var(--ink-secondary);
  font-weight: 500;
}

.mini-kpi-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.mini-kpi-sub {
  font-size: 0.6875rem;
  color: var(--status-emerald);
  font-weight: 600;
}

.mini-kpi-delta {
  font-size: 0.6875rem;
  color: #8A6204;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.viewport-switcher {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.switch-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  padding: 4px 9px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

.switch-btn.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
}

.status-banner {
  margin: 10px 24px 0;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: #FDF8E7;
  border: 1px solid var(--accent-gold);
  color: #6B4D04;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ==========================================================================
   MAIN CONTENT & MINIMAL COMMAND BAR
   ========================================================================== */
.main-content {
  padding: 16px 24px 40px;
  flex: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.minimal-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.quick-channel-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 320px;
}

.quick-url-input {
  flex: 1;
  min-width: 240px;
}

.quick-meta-input {
  width: 155px;
  min-width: 120px;
}

.quick-filter-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-search-input {
  width: 190px;
  min-width: 150px;
}

/* ==========================================================================
   BUTTONS & INPUT CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 140ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.input-control:focus-visible,
.select-control:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 1px;
}

.btn-primary {
  background: var(--bg-dark);
  color: #F7E39C;
  border-color: #C59B27;
}

.btn-primary:hover {
  background: #282A32;
  color: #FFF6D6;
  border-color: var(--accent-gold);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--accent-brand);
}

.btn-danger-outline {
  background: transparent;
  color: var(--ink-secondary);
  border-color: var(--border-strong);
}

.btn-danger-outline:hover {
  background: #2C261E;
  color: #F7E39C;
  border-color: #966C07;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.input-control,
.select-control {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.8125rem;
}

/* ==========================================================================
   BẢNG KÊNH YOUTUBE HÀNG NGANG TỐI GIẢN (HORIZONTAL CHANNEL ROWS)
   ========================================================================== */
.channels-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.channel-row-header,
.channel-row {
  display: block;
  padding: 14px 20px;
}

.channel-row-header {
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.channel-row {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 120ms ease;
}

.channel-row:last-child {
  border-bottom: none;
}

.channel-row:hover {
  background-color: #FAF7EE;
}

.channel-col-identity {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.channel-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.channel-name-text {
  font-size: 1.03125rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.channel-handle-link {
  font-size: 0.8125rem;
  color: #966C07;
  text-decoration: none;
  font-weight: 600;
}

.channel-handle-link:hover {
  text-decoration: underline;
}

.channel-handle-muted {
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* NÚT ĐỒNG BỘ & XÓA NGAY GẦN TÊN KÊNH + Ô GROUP */
.channel-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.btn-xs {
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 7px;
}

.channel-inline-actions [data-sync-channel-id] {
  background: linear-gradient(180deg, #FFFDF5 0%, #FDF3D0 100%);
  border: 1.5px solid #D4AF37;
  color: #5C4002;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(180, 138, 30, 0.22);
  transition: all 0.15s ease;
}

.channel-inline-actions [data-sync-channel-id]:hover {
  background: linear-gradient(180deg, #FDF3D0 0%, #F7E39C 100%);
  border-color: #9A7409;
  color: #3D2A00;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(180, 138, 30, 0.28);
}

.channel-inline-actions [data-delete-channel-id] {
  background: linear-gradient(180deg, #FFF5F5 0%, #FEE2E2 100%);
  border: 1.5px solid #EF4444;
  color: #B91C1C;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.16);
  transition: all 0.15s ease;
}

.channel-inline-actions [data-delete-channel-id]:hover {
  background: linear-gradient(180deg, #FEE2E2 0%, #FECACA 100%);
  border-color: #DC2626;
  color: #7F1D1D;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.24);
}

.inline-group-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #FAF8F2;
  border: 1.5px solid var(--border-strong);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-secondary);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.inline-group-pill:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
}

.inline-group-label {
  font-weight: 800;
  opacity: 0.85;
  white-space: nowrap;
}

.inline-group-input {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.78125rem;
  font-weight: 700;
  color: inherit;
  width: 125px;
  padding: 1px 2px;
  outline: none;
}

.inline-group-input::placeholder {
  color: var(--ink-muted);
  font-weight: 500;
}


/* SUBSCRIBERS, LƯỢT XEM & NGÁCH TỰ ĐỘNG HIỂN THỊ NGAY DƯỚI TÊN KÊNH */
.channel-metrics-under-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Ô chọn BKT trực tiếp dạng Pill */
.bkt-pill-select {
  appearance: auto;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.78125rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--ink-primary);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.bkt-pill-select:hover {
  box-shadow: var(--shadow-sm);
}

.bkt-status-monetized {
  background: var(--status-emerald-bg);
  color: var(--status-emerald);
  border-color: rgba(13, 122, 95, 0.4);
}

.bkt-status-active {
  background: var(--status-blue-bg);
  color: var(--status-blue);
  border-color: rgba(43, 91, 132, 0.35);
}

.bkt-status-warning,
.bkt-status-demonetized {
  background: var(--status-amber-bg);
  color: #8A5A00;
  border-color: rgba(180, 120, 9, 0.45);
}

.bkt-status-incubating,
.bkt-status-paused {
  background: var(--status-slate-bg);
  color: var(--status-slate);
  border-color: var(--border-strong);
}

/* Ô CỬA SỔ TRỎ XUỐNG LỌC DANH MỤC (NGÁCH) & MỖI DANH MỤC 1 MÀU RIÊNG BIỆT */
.cat-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cat-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--ink-primary);
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.cat-dropdown-trigger:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-card);
}

.cat-dropdown-trigger.cat-trigger-all {
  background: #18191D;
  color: #F7E39C;
  border-color: #D4AF37;
}

.cat-chevron {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.cat-dropdown.open .cat-chevron {
  transform: rotate(180deg);
}

.cat-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(24, 25, 29, 0.16);
  display: none;
  flex-direction: column;
  gap: 5px;
}

.cat-dropdown.open .cat-dropdown-menu {
  display: flex;
}

.cat-dropdown-header {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

.cat-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: #FAF8F3;
  color: var(--ink-primary);
  text-align: left;
  transition: all 0.12s ease;
}

.cat-dropdown-item:hover {
  transform: translateX(2px);
  filter: brightness(0.97);
}

.cat-item-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cat-item-all {
  background: #F4F1EA;
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.cat-item-all.active {
  background: #18191D;
  color: #F7E39C;
  border-color: #D4AF37;
}

.cat-dot-all {
  background: #D4AF37;
}

.cat-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  background: rgba(24, 25, 29, 0.09);
  color: inherit;
}

.cat-dropdown-trigger.cat-trigger-all .cat-pill-count,
.cat-dropdown-item.active .cat-pill-count {
  background: rgba(255, 255, 255, 0.22);
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.niche-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.78125rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: #6E4E03;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.niche-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24, 25, 29, 0.08);
}

/* 1. Du lịch & Khám phá — Teal Ngọc Lam */
.niche-teal {
  background: #E6F6F4;
  color: #0D655D;
  border-color: #52B7A9;
}
.cat-dropdown-item.niche-teal.active {
  background: #0D655D;
  color: #FFFFFF;
  border-color: #0D655D;
}

/* 2. Văn hóa & Âm nhạc — Violet Tím Hoàng Gia */
.niche-violet {
  background: #F3ECFF;
  color: #5B2E91;
  border-color: #B794F4;
}
.cat-dropdown-item.niche-violet.active {
  background: #5B2E91;
  color: #FFFFFF;
  border-color: #5B2E91;
}

/* 3. Công nghệ & Đánh giá — Blue Xanh Lam Công Nghệ */
.niche-blue {
  background: #E8F1FD;
  color: #184E9E;
  border-color: #7FB0F5;
}
.cat-dropdown-item.niche-blue.active {
  background: #184E9E;
  color: #FFFFFF;
  border-color: #184E9E;
}

/* 4. Kinh doanh & Tự động hóa / Tài chính — Gold Hoàng Kim */
.niche-gold {
  background: #FDF5DC;
  color: #785300;
  border-color: #D4AF37;
}
.cat-dropdown-item.niche-gold.active {
  background: #8C6200;
  color: #FFFFFF;
  border-color: #8C6200;
}

/* 5. Gaming & Esports — Indigo Chàm Điện Tử */
.niche-indigo {
  background: #EAEBFF;
  color: #31369B;
  border-color: #8E94F2;
}
.cat-dropdown-item.niche-indigo.active {
  background: #31369B;
  color: #FFFFFF;
  border-color: #31369B;
}

/* 6. Ẩm thực & Đời sống — Amber Cam Hổ Phách */
.niche-amber {
  background: #FFF1E2;
  color: #9C420E;
  border-color: #F2A365;
}
.cat-dropdown-item.niche-amber.active {
  background: #9C420E;
  color: #FFFFFF;
  border-color: #9C420E;
}

/* 7. Giáo dục & Kiến thức — Emerald Xanh Lục Bảo */
.niche-emerald {
  background: #E7F7EE;
  color: #196B42;
  border-color: #6CC896;
}
.cat-dropdown-item.niche-emerald.active {
  background: #196B42;
  color: #FFFFFF;
  border-color: #196B42;
}

/* 8. Sức khỏe & Thể thao — Cyan Xanh Đại Dương */
.niche-cyan {
  background: #E5F6FD;
  color: #0B6082;
  border-color: #68C1E3;
}
.cat-dropdown-item.niche-cyan.active {
  background: #0B6082;
  color: #FFFFFF;
  border-color: #0B6082;
}

/* 9. Phim ảnh & Giải trí / Nội dung số — Rose Đỏ Hồng Ngọc */
.niche-rose {
  background: #FDECEF;
  color: #9E2445;
  border-color: #EE8DA5;
}
.cat-dropdown-item.niche-rose.active {
  background: #9E2445;
  color: #FFFFFF;
  border-color: #9E2445;
}

/* KHỐI SUB & TỔNG VIEWS CỠ LỚN NỔI BẬT CHUẨN MỆNH KIM */
.hero-stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #FAF8F2;
}

.hero-stat-subs {
  background: #18191D;
  border-color: #D4AF37;
  color: #FFFFFF;
}

.hero-stat-subs .hero-stat-num {
  color: #F7E39C;
}

.hero-stat-subs .hero-stat-label {
  color: #D8D5CC;
}

.hero-stat-views {
  background: #FDF8E7;
  border-color: #D4AF37;
}

.hero-stat-videos {
  background: #FFFFFF;
  border-color: #B8860B;
}

.hero-stat-num {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.hero-stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7A5905;
}

/* HÀNG NGÀY ĐẦU ĐĂNG VIDEO & NGƯỜI / MAIL QUẢN LÝ (TỰ NHẬP) */
.channel-extra-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.inline-meta-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
}

.inline-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.inline-meta-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-primary);
  padding: 2px 4px;
}

.inline-meta-mail .inline-meta-input {
  min-width: 240px;
}

.delta-pill {
  color: var(--status-emerald);
  background: var(--status-emerald-bg);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78125rem;
  font-weight: 700;
}

.channel-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   KHO LƯU TRỮ NỘI DUNG (CONTENT VAULT) & COMMON PANELS
   ========================================================================== */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

.panel-desc {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--ink-secondary);
}

.inline-drawer {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.btn-close-drawer {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field.span-2 {
  grid-column: span 2;
}

.field.span-full {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field input,
.field select,
.field textarea {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--ink-primary);
  background: #FFFFFF;
}

.drawer-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-emerald {
  background: var(--status-emerald-bg);
  color: var(--status-emerald);
}

.badge-amber {
  background: var(--status-amber-bg);
  color: var(--status-amber);
}

.badge-blue {
  background: var(--status-blue-bg);
  color: var(--status-blue);
}

.badge-slate {
  background: var(--status-slate-bg);
  color: var(--status-slate);
}

.badge-crimson {
  background: var(--accent-soft);
  color: #6E4E03;
  border: 1px solid var(--accent-gold);
}

.content-vault-split {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  align-items: start;
}

.vault-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vault-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color 140ms ease;
}

.vault-card:hover {
  border-color: var(--accent-gold);
}

.vault-card.active {
  border-color: var(--accent-brand);
  background: #FFFDF7;
}

.vault-card-title {
  margin: 6px 0 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tag-chip {
  font-size: 0.6875rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.script-editor-area {
  width: 100%;
  min-height: 280px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #FFFEFA;
  color: var(--ink-primary);
  resize: vertical;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-dark);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}

.m-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: #A6A39B;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 5px 2px;
  cursor: pointer;
}

.m-nav-btn svg {
  width: 17px;
  height: 17px;
}

.m-nav-btn.active {
  color: #E6C35C;
  font-weight: 700;
}

@media (max-width: 960px) {
  .content-vault-split {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }
  .left-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-strong);
  }
  .mobile-bottom-nav {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
  }
  .main-content {
    padding: 12px 12px 76px;
  }
  .minimal-command-bar,
  .quick-channel-form,
  .quick-filter-cluster {
    flex-direction: column;
    align-items: stretch;
  }
  .quick-meta-input,
  .quick-search-input {
    width: 100%;
  }
}

/* ============================================================================
   MÀN HÌNH KHÓA MẬT KHẨU BẢO MẬT & MODAL CÀI ĐẶT (MỆNH KIM)
   ============================================================================ */
.platform-wrapper[hidden] {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(24, 25, 29, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-login-page {
  background: radial-gradient(circle at 50% 24%, #FDF8E7 0%, #F3F5F8 65%, #E6E9EF 100%);
  backdrop-filter: none;
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border: 2px solid #D4AF37;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #18191D;
  border: 1.5px solid #D4AF37;
  color: #F7E39C;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin: 0 0 2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-error-msg {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 0;
}

/* ============================================================================
   THIẾT KẾ 1 DÒNG CHO KÊNH & TOP 3 VIDEO NHIỀU VIEW NHẤT (MỆNH KIM)
   ============================================================================ */
.channel-single-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 2px 0;
}

.channel-single-line > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.channel-single-line .channel-name-text {
  font-size: 0.94rem;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-single-line .channel-handle-link,
.channel-single-line .channel-handle-muted {
  font-size: 0.76rem;
}

.channel-single-line .btn-xs {
  padding: 3px 9px;
  font-size: 0.74rem;
}

.channel-single-line .inline-group-pill {
  padding: 2px 8px;
  font-size: 0.73rem;
}

.channel-single-line .inline-group-input {
  width: 92px;
  font-size: 0.74rem;
}

.channel-single-line .bkt-pill-select {
  padding: 3px 8px;
  font-size: 0.74rem;
}

.channel-single-line .niche-chip {
  padding: 3px 9px;
  font-size: 0.74rem;
}

.channel-single-line .hero-stat-pill {
  padding: 2px 8px;
  gap: 4px;
}

.channel-single-line .hero-stat-num {
  font-size: 0.94rem;
}

.channel-single-line .hero-stat-label {
  font-size: 0.64rem;
}

.channel-single-line .inline-meta-field {
  padding: 2px 7px;
  gap: 4px;
}

.channel-single-line .inline-meta-label {
  font-size: 0.71rem;
}

.channel-single-line .inline-meta-input {
  font-size: 0.75rem;
  padding: 1px 2px;
}

.channel-single-line .inline-meta-input[type="date"] {
  width: 108px;
}

.channel-single-line .inline-meta-mail .inline-meta-input {
  min-width: 115px;
  width: 125px;
}

.channel-top-videos-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #FCFDFE 0%, #F6F8FB 100%);
  border: 1px solid #DCE1EA;
  border-left: 3px solid #D4AF37;
  border-radius: var(--radius-sm);
}

.channel-top-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.top-videos-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #6B4D04;
  background: #FDF8E7;
  border: 1px solid #E6C65B;
  padding: 2px 8px;
  border-radius: 999px;
}

.top-videos-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.channel-top-videos-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-video-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid #E4E8F0;
  border-radius: 6px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.top-video-item:hover {
  border-color: #B48A1E;
}

.top-video-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  background: #F1F4F9;
  color: #334155;
  border: 1px solid #CBD5E1;
}

.top-video-rank-1 .top-video-rank {
  background: linear-gradient(135deg, #FDF8E7 0%, #F7E39C 100%);
  color: #5C4002;
  border-color: #D4AF37;
}

.top-video-rank-2 .top-video-rank {
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
  color: #1E293B;
  border-color: #94A3B8;
}

.top-video-rank-3 .top-video-rank {
  background: linear-gradient(135deg, #FFF7ED 0%, #FED7AA 100%);
  color: #7C2D12;
  border-color: #D97706;
}

.top-video-title {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-video-title:hover {
  color: var(--accent-gold-strong);
  text-decoration: underline;
}

.top-video-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: #F3F5F8;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.top-video-views {
  font-size: 0.76rem;
  font-weight: 800;
  color: #1E293B;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.top-video-rank-1 .top-video-views {
  background: #FDF8E7;
  border-color: #E6C65B;
  color: #6B4D04;
}

.channel-top-videos-empty {
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding: 4px 2px;
}

@media (max-width: 960px) {
  .channel-single-line {
    flex-wrap: wrap;
  }
}

/* ============================================================================
   THỐNG KÊ TỔNG HỢP THEO NHÃN & BẢNG VIDEO NỔ VIEW CẢ DÀN KÊNH (YOUTUBELABS INSIGHTS)
   ============================================================================ */
.yt-insights-hub {
  margin-bottom: 12px;
}

.insights-hub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(90deg, #FDF8E7 0%, #FFFFFF 100%);
  border: 1px solid #E6C65B;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.insights-hub-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.insights-hub-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #5C4002;
}

.insights-hub-hint {
  font-size: 0.74rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.insights-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: start;
}

.insights-card {
  background: var(--surface-card);
  border: 1px solid var(--border-platinum);
  border-top: 2px solid #D4AF37;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-card);
}

.insights-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.insights-card-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin: 0;
}

.insights-card-sub {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin: 2px 0 0;
}

.insights-mode-tabs {
  display: inline-flex;
  background: #F1F4F9;
  border: 1px solid #D8DEE9;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.insights-tab-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.insights-tab-btn.active {
  background: #141923;
  color: #F3D066;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.label-stats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-stat-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 10px 10px;
  background: #FCFDFE;
  border: 1px solid #E2E7F0;
  border-radius: 7px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.label-stat-row:hover {
  border-color: #D4AF37;
  background: #FFFDF7;
}

.label-stat-row.active {
  border-color: #B48A1E;
  background: #FDF8E7;
  box-shadow: 0 0 0 1px #D4AF37 inset;
}

.label-stat-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.label-stat-chip {
  pointer-events: none;
}

.label-stat-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.label-stat-metrics {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.label-stat-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: #F3F5F8;
  border: 1px solid #DCE1EA;
  padding: 2px 7px;
  border-radius: 999px;
}

.label-stat-pill strong {
  color: var(--ink-primary);
  font-weight: 800;
}

.label-stat-pill-views {
  background: #FDF8E7;
  border-color: #E6C65B;
  color: #6B4D04;
}

.label-stat-pill-views strong {
  color: #5C4002;
}

.label-stat-pill-views small {
  font-weight: 700;
  opacity: 0.85;
}

.label-stat-bar-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #EDF1F7;
}

.label-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #D4AF37 0%, #B48A1E 100%);
}

.burst-video-row {
  padding: 6px 9px;
}

.burst-video-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.burst-video-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.burst-channel-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #1E293B;
  background: #EEF2F6;
  border: 1px solid #CBD5E1;
  padding: 1px 6px;
  border-radius: 4px;
}

.burst-channel-group {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6B4D04;
  background: #FDF8E7;
  border: 1px solid #E6C65B;
  padding: 1px 6px;
  border-radius: 4px;
}

.outlier-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #475569;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.outlier-badge.outlier-hot {
  color: #9A3412;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border-color: #F97316;
}

.btn-save-key {
  padding: 2px 8px !important;
  font-size: 0.7rem !important;
  flex-shrink: 0;
}

.insights-card-footer {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

@media (max-width: 1100px) {
  .insights-hub-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   CẤU TRÚC 3 TẦNG: TRANG CHỦ TÓM TẮT -> THƯ MỤC CON NHÓM -> QUẢN LÝ SÂU 1 KÊNH
   ============================================================================ */
.home-exec-grid,
.deep-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.deep-kpi-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
  border: 1px solid #CBD5E1;
  border-top: 3px solid var(--kim-gold, #D4AF37);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.deep-kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.deep-kpi-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.2;
}

.deep-kpi-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thư mục con (Subfolder Explorer) trên Trang chủ */
.subfolders-section-card {
  margin-bottom: 12px;
  border-top: 3px solid #D4AF37 !important;
}

.subfolders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.subfolder-card {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.subfolder-card:hover {
  border-color: #D4AF37;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.12);
}

.subfolder-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subfolder-title-btn {
  background: none;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.subfolder-icon {
  font-size: 1.15rem;
}

.subfolder-name {
  font-size: 0.9rem;
  font-weight: 900;
  color: #0F172A;
}

.subfolder-title-btn:hover .subfolder-name {
  color: #9A6B00;
  text-decoration: underline;
}

.subfolder-open-btn {
  padding: 3px 9px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
}

.subfolder-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  padding-bottom: 6px;
  border-bottom: 1px dashed #CBD5E1;
}

.subfolder-channels-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.subfolder-channel-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  font-size: 0.74rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  transition: all 0.14s ease;
}

.subfolder-channel-item:hover {
  border-color: #D4AF37;
  background: #FDF8E7;
  color: #785200;
}

.subfolder-ch-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subfolder-ch-views {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748B;
  background: #F1F5F9;
  padding: 0 4px;
  border-radius: 4px;
}

/* Thanh điều hướng đường dẫn Thư mục (Breadcrumb Bar) */
.folder-breadcrumb-wrap {
  margin-bottom: 10px;
}

.folder-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid #CBD5E1;
  border-left: 4px solid #D4AF37;
  border-radius: 10px;
  padding: 8px 12px;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.crumb-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
}

.crumb-btn:hover {
  border-color: #D4AF37;
  background: #FDF8E7;
}

.crumb-sep {
  color: #94A3B8;
  font-weight: 900;
}

.crumb-current {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0F172A;
  padding: 2px 6px;
}

.folder-pill-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.folder-pill {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
}

.folder-pill:hover {
  border-color: #D4AF37;
}

.folder-pill.active {
  background: linear-gradient(135deg, #FDF8E7 0%, #F6E6B4 100%);
  border-color: #C99700;
  color: #5C4300;
}

/* Nút bấm tên kênh & nút Quản lý sâu trên dòng kênh */
.channel-name-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 900;
  color: #0F172A;
  cursor: pointer;
  text-align: left;
}

.channel-name-btn:hover {
  color: #9A6B00;
  text-decoration: underline;
}

.btn-deep-channel {
  background: linear-gradient(135deg, #FDF8E7 0%, #F7E8B5 100%) !important;
  border-color: #D4AF37 !important;
  color: #5C4300 !important;
  font-weight: 800 !important;
}

/* Không gian Quản lý sâu 1 Kênh riêng lẻ (Tầng 3) */
.deep-channel-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deep-channel-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid #CBD5E1;
  border-top: 3px solid #D4AF37;
  border-radius: 10px;
  padding: 12px 14px;
}

.deep-channel-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deep-channel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FDF8E7 0%, #E2E8F0 100%);
  border: 2px solid #D4AF37;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: #5C4300;
}

.deep-channel-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.deep-channel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0F172A;
}

.deep-channel-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.deep-channel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.deep-config-card,
.deep-videos-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 12px 14px;
}

.deep-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.deep-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deep-field span {
  font-size: 0.73rem;
  font-weight: 800;
  color: #475569;
}

.deep-field input,
.deep-field select,
.deep-note-field textarea {
  padding: 6px 9px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0F172A;
  background: #F8FAFC;
}

.deep-note-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.deep-note-field span {
  font-size: 0.74rem;
  font-weight: 800;
  color: #475569;
}

@media (max-width: 900px) {
  .home-exec-grid,
  .deep-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================================
   Ô "GÀ KẾT NỐI" (GOOGLE ADSENSE) — ẨN MẶC ĐỊNH, BẤM XEM CẦN MẬT KHẨU
   ============================================================================ */
.inline-meta-ga {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle, #F1EFEA);
  border: 1px solid var(--border-strong, #D5D0C5);
  border-radius: var(--radius-sm, 6px);
  padding: 2px 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.inline-meta-ga.locked {
  cursor: pointer;
}

.inline-meta-ga.locked:hover {
  border-color: #D4AF37;
  background: #FAF6E8;
}

.inline-meta-ga.unlocked {
  background: #FFFDF7;
  border-color: #D4AF37;
}

.ga-masked-dots {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #64748B;
  padding: 1px 4px;
  user-select: none;
}

.ga-input-unlocked {
  min-width: 145px;
}

.ga-eye-btn {
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.ga-eye-btn:hover {
  border-color: #D4AF37;
  background: #FDF8E7;
  color: #6B4D04;
}

.ga-eye-btn.unlocked {
  background: #F1F5F9;
  color: #475569;
}

/* ============================================================================
   HUY HIỆU AUTO RESET & CẬP NHẬT 1 TIẾNG 1 LẦN (HOURLY AUTO-SYNC PILL)
   ============================================================================ */
.hourly-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #D4AF37;
  background: linear-gradient(135deg, #FFFDF7 0%, #FDF8E7 100%);
  color: #5C4300;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.hourly-sync-pill:hover {
  background: linear-gradient(135deg, #FDF8E7 0%, #F6E4A6 100%);
  border-color: #B8860B;
  transform: translateY(-1px);
}

.hourly-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

/* ============================================================================
   BẢNG DOANH THU 12 THÁNG (THÁNG 1 -> THÁNG 12) & TỰ ĐỘNG CỘNG TỔNG (MỆNH KIM)
   ============================================================================ */
.deep-kpi-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .deep-kpi-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .deep-kpi-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.monthly-revenue-card {
  border-top: 3px solid #D4AF37 !important;
}

.monthly-rev-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.monthly-rev-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #18191D 0%, #262930 100%);
  border: 1px solid #D4AF37;
  color: #D8D5CC;
  font-size: 0.76rem;
  font-weight: 700;
}

.monthly-rev-total-pill strong {
  color: #F7E39C;
  font-size: 0.9rem;
  font-weight: 900;
}

.monthly-revenue-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

@media (max-width: 1100px) {
  .monthly-revenue-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .monthly-revenue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.monthly-rev-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  transition: all 0.14s ease;
}

.monthly-rev-cell:focus-within {
  border-color: #D4AF37;
  background: #FFFDF7;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.monthly-rev-cell.has-rev {
  background: linear-gradient(180deg, #FFFDF7 0%, #FDF8E7 100%);
  border-color: #D4AF37;
}

.monthly-rev-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.monthly-rev-cell.has-rev .monthly-rev-label {
  color: #6B4D04;
}

.monthly-rev-input {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  padding: 5px 8px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #0F172A;
  outline: none;
}

.monthly-rev-input:focus {
  border-color: #B48A1E;
}

.monthly-rev-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #FDF8E7 0%, #FFFDF7 100%);
  border: 1px solid #D4AF37;
  font-size: 0.78rem;
  color: #475569;
}

.monthly-rev-summary-left,
.monthly-rev-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.monthly-rev-grand-total {
  font-size: 1.08rem;
  font-weight: 900;
  color: #5C4002;
  background: #F6E6B4;
  border: 1px solid #C99700;
  padding: 2px 10px;
  border-radius: 6px;
}

