/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #282828;
  --bg-secondary: #282828;
  --bg-card: #282828;
  --bg-hover: #2e2e2e;
  --bg-active: #3d3d3d;
  --surface: #383838;
  --border: #3d3d3d;
  --border-light: #4d4d4d;
  --text-primary: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  --accent-red: #ff0000;
  --accent-blue: #5abaff;
  --accent-green: #2ba640;
  --sidebar-width: 256px;
  --topnav-height: 60px;
  --font: 'YouTube Sans', 'Roboto', sans-serif;
}

/* Ensure font faces can fall back gracefully */
@import url('https://fonts.cdnfonts.com/css/youtube-sans');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
}

input,
textarea,
select {
  font-family: var(--font);
}

/* ===== TOP NAV ===== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  padding: 0 12px 0 16px;
  z-index: 1000;
  gap: 16px;
  border-bottom: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: var(--sidebar-width);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-full-img {
  height: 46px;
  display: block;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  padding: 0 16px;
  width: 480px;
  height: 36px;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  /* Inset 3D depth */
}

.search-bar:focus-within {
  border-color: var(--accent-blue);
}

.search-icon {
  color: var(--text-muted);
  font-size: 20px;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
  padding-right: 16px;
}



.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  margin-left: 4px;
  background: #333;
  /* Fallback */
}

.nav-right .icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
}

.nav-right .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-right .material-icons {
  font-size: 24px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--bg-hover);
}

.icon-btn .material-icons {
  font-size: 26px;
}

.create-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 15px;
  /* Slightly larger */
  font-weight: 500;
  transition: background 0.15s;
  cursor: pointer;
  margin: 0 4px;
}

.create-btn:hover {
  background: var(--bg-hover);
}

.create-btn .material-icons {
  font-size: 22px;
  /* Slightly larger icon */
  color: #ffffff;
  /* White icon */
}

.avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-waves-svg {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* ===== APP BODY ===== */
.app-body {
  display: flex;
  margin-top: var(--topnav-height);
  min-height: calc(100vh - var(--topnav-height));
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topnav-height);
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 14px;
  text-align: center;
}

.channel-avatar-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.channel-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.channel-avatar-wrap:hover .avatar-upload-overlay {
  opacity: 1;
}

.avatar-upload-overlay .material-icons {
  color: #fff;
  font-size: 20px;
}

.channel-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.channel-name {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: text;
  outline: none;
  min-height: 18px;
  padding: 1px 4px;
  border-radius: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.channel-name:focus,
#dateRangeLabel:focus {
  background: #000;
  border: 2px solid #555;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 10;
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 48px;
  padding: 0 16px;
  margin: 0 12px;
  border-radius: 8px;
  color: #aaaaaa;
  transition: background 0.15s;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-hover);
}

.nav-item.active {
  background: #1b1b1b;
  /* Match stat cards in the middle section */
}

.nav-item.active span {
  color: #ffffff !important;
  font-weight: 500;
}

.nav-item .material-icons {
  font-size: 24px;
}

.nav-item.active .material-icons {
  color: #ff4e45;
  /* YouTube Red for active icon */
}

.sidebar-bottom {
  margin-top: auto;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100%;
  background: var(--bg-primary);
}

.tab-panel {
  display: none;
}

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

/* ===== ANALYTICS LAYOUT ===== */
.analytics-layout {
  display: flex;
  min-height: calc(100vh - var(--topnav-height));
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.stat-card {
  flex: 1;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.2s;
  position: relative;
  cursor: pointer;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.stat-card.active-card {
  background: rgba(62, 166, 255, 0.05);
}

.stat-card.active-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #5abaff;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.analytics-main {
  flex: 1;
  padding: 0 24px 40px;
  border-right: none;
  min-width: 0;
}

.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.analytics-full-header {
  padding: 0;
  background: var(--bg-primary);
}

/* Title + controls combined in one flex row */
.analytics-title-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px 0px;
}

.analytics-tabs-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 24px;
  margin-top: -12px;
}

.section-title {
  font-family: "YouTube Sans", "Roboto", sans-serif;
  font-size: 25px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.2px;
  margin-bottom: 0;
  transform: translateY(-4px);
}

/* Advanced mode pill button - matches screenshot exactly */
.advanced-mode-pill {
  display: block;
  background: #3a3a3a;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 20px;
  padding: 9px 18px;
  cursor: pointer;
  letter-spacing: 0;
  transition: background 0.15s;
}

.advanced-mode-pill:hover {
  background: #484848;
}

/* rt-header-controls column */
.rt-header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 0;
}

.rt-header-controls .advanced-mode-pill {
  align-self: flex-end;
}

/* Date range block */
.date-range-block-rt {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 260px;
  margin-bottom: 4px;
  /* Restored original box margin to prevent height collapse */
  transform: translateY(18px);
  /* Visually push date closer to the line below */
}

.date-range-label-rt {
  font-size: 13px;
  /* Bumped +1 */

  color: var(--text-secondary);
  margin-bottom: 0;
  letter-spacing: 0;
  line-height: 1.2;
}

/* See live count button - grey pill */
.see-live-count-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
  padding: 8px 18px;
  cursor: pointer;
  display: inline-block;
  transition: background 0.15s;
}

.see-live-count-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Legacy link style (kept for other uses) */
.advanced-mode-link {
  color: #5abaff;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.advanced-mode-link:hover {
  text-decoration: none;
  opacity: 0.9;
}

/* Sub Tabs */
.sub-tabs {
  display: flex;
  margin-bottom: 0;
  gap: 32px;
}

.sub-tab {
  padding: 4px 0 14px 0;
  /* Expanded bottom padding to push the lines further down */
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.sub-tab:hover {
  color: var(--text-primary);
}

.sub-tab.active {
  color: var(--text-primary);
  border-bottom-color: #ffffff;
}

/* Sub Panels */
.sub-panel {
  display: none;
  padding-top: 16px;
}

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

/* Date Range — right-aligned block with date + dropdown */
.date-range-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.date-range-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 8px 12px;
  cursor: pointer;
  min-width: 200px;
}

.date-range-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.date-range-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.styled-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  /* Bumped out to 16px */
  font-weight: 400;

  outline: none;
  cursor: pointer;
  padding-right: 0;
  appearance: none;
  -webkit-appearance: none;
}

.styled-select option {
  background: var(--bg-secondary);
}

.date-chevron {
  font-size: 20px;
  color: var(--text-primary);
}

/* Headline */
.headline-stat {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 12px 0 28px;
  text-align: center;
  line-height: 1.3;
}

.headline-editable {
  display: inline;
  border-bottom: 2px solid transparent;
  outline: none;
  cursor: text;
  outline: none;
}

.overview-unified-card {
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* Stat Cards Row */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-primary);
}

.stat-card {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  background: #1b1b1b;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-card:last-child {
  border-right: none;
}




.stat-card.active-card {
  background: var(--bg-primary);
  /* Match the chart area below */
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

.info-icon {
  font-size: 14px;
  color: var(--text-muted);
}

/* Value + indicator on the same row */
.stat-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.stat-value {
  font-size: 24px;
  font-weight: 400;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  cursor: text;
  line-height: 1.1;
  letter-spacing: -0.5px;
}


.stat-value:focus {
  background: #000;
  border: 2px solid #555;
  padding: 4px 8px;
  border-radius: 4px;
  margin: -6px -10px;
  /* Offset padding to prevent layout shift if possible, or just accept the shift for clarity */
  z-index: 10;
}

/* Circular Indicators */
.stat-indicator-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-green);
}

.stat-indicator-circle.green-check {
  background: var(--accent-green);
}

.stat-indicator-hollow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-indicator-circle .ind-icon {
  font-size: 14px;
  font-weight: bold;
}

.stat-card .stat-indicator-circle .ind-icon {
  color: #282828;
}

.stat-card.active-card .stat-indicator-circle .ind-icon {
  color: #1f1f1f;
}


.stat-compare {
  font-size: 11px;

  padding-top: 4px;
  color: var(--text-muted);
  font-weight: 400;
  outline: none;
  min-height: 14px;
}


.stat-compare i {
  color: var(--text-muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  outline: none;
  display: inline-block;
  margin-top: 2px;
}

/* Event icons row above axis */
.chart-event-icons {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  padding: 0 40px;
  display: flex;
  pointer-events: none;
}

.chart-events-row {
  display: flex;
  gap: 24px;
  align-items: center;
}

.yt-event-icon {
  font-size: 16px;
  color: #717171;
  background: #181818;
  border: 1px solid #333;
  border-radius: 2px;
}

.event-icon-group {
  display: flex;
  gap: 2px;
}

/* Axis Edit Overlay */
.chart-axis-overlay {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 100%;
  padding: 0 42px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #717171;
  pointer-events: auto;
  user-select: text;
  font-family: var(--font);
}

.axis-lbl-edit {
  outline: none;
  cursor: text;
  white-space: nowrap;
  min-width: 40px;
  text-align: center;
}

.axis-lbl-edit:focus {
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.05);
}

.shorts-icon-small {
  width: 16px;
  height: 16px;
  background: #717171;
  display: inline-block;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.77 10.32c-.77-.32-1.2-.5-1.2-.5L18 8.44c.67-.67.67-1.78 0-2.45-.67-.67-1.78-.67-2.45 0L6.41 15.13c-.67.67-.67 1.78 0 2.45.67.67 1.78.67 2.45 0L7.5 16.17c.77.32 1.2.5 1.2.5L7 18.06c-.67.67-.67 1.78 0 2.45.67.67 1.78.67 2.45 0l9.14-9.14c.67-.67.67-1.78 0-2.45-.67-.67-1.78-.67-2.45 0l1.37-1.4s-.43-.18-1.2-.5z'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
  background-color: #717171;
}

/* Pill Button */
.see-more-pill-row {
  padding: 12px 24px;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 18px;
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.stat-compare:focus {
  background: #000;
  border: 1px solid #555;
  padding: 2px 4px;
  border-radius: 2px;
}

.revenue-value {
  color: #a8c7fa !important;
}

.editable-stat {
  outline: none;
  cursor: text;
  transition: background 0.15s;
  border-radius: 2px;
}

.editable-stat:hover {
  background: rgba(255, 255, 255, 0.04);
}

.editable-stat:focus {
  background: #000;
  border: 1px solid #555;
  box-shadow: 0 0 0 1px #555;
  padding: 2px 4px;
}

/* Chart */
.chart-container {
  padding: 12px;
  background: var(--bg-primary);
  position: relative;
  height: 200px;
}


.blue-link {
  color: #5abaff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

/* See more link inside unified card */
.see-more-link-row {
  padding: 16px 24px;
}

/* See more pill button (matches screenshot) */
.see-more-pill-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 12px;
  transition: background 0.15s;
}

.see-more-pill-btn:hover {
  background: var(--bg-hover);
}

.see-more-row {
  padding: 8px 0;
}

/* Legacy see-more-btn (used in right panel) */
.see-more-btn {
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s;
}

.see-more-btn:hover {
  color: #f1f1f1 !important;
}

.divider-line {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 8px 0;
}

/* Top Content Table */
.top-content-section {
  margin-top: 4px;
}

.top-content-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
}

.top-content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.top-content-table th {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  text-align: right;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.top-content-table th.col-title {
  text-align: left;
}

.top-content-table th.col-num,
.top-content-table th.col-thumb {
  width: 36px;
}

.top-content-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: right;
  color: var(--text-primary);
}

.top-content-table td:first-child,
.top-content-table td.col-title-cell {
  text-align: left;
}

.top-content-table tr:hover td {
  background: var(--bg-hover);
}

.row-num {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.thumb-placeholder-row {
  width: 76px;
  height: 44px;
  border-radius: 2px;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.video-title-cell {
  font-size: 13px;
  color: var(--text-primary);
  cursor: text;
  outline: none;
}

.video-date {
  font-size: 11px;
  color: var(--text-muted);
}

.duration-cell {
  color: var(--text-secondary);
}

.views-cell {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: text;
  outline: none;
}

/* ===== RIGHT PANEL (REALTIME) ===== */
.analytics-right {
  width: 360px;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-primary);
}

.right-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
}



.rt-title-row {
  margin-bottom: 2px;
}

.rt-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.rt-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5abaff;
}

.pulse {
  animation: realtimePulse 1.5s infinite ease-out;
}

@keyframes realtimePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(90, 186, 255, 0.7);
    opacity: 1;
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(90, 186, 255, 0);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(90, 186, 255, 0);
    opacity: 1;
  }
}

.rt-subs-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0px;
  padding-bottom: 0px;
  border-bottom: 1px solid transparent;
}

.rt-views-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  margin-bottom: 24px;
}





.rt-big-num {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 4px;
}

.rt-med-num {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 0px;
}



.rt-num-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.rt-views-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 12px;
}

.rt-divider {
  display: none;
}



/* Mini Chart */
.mini-chart {
  margin-top: 8px;
  margin-bottom: 2px;
  height: 60px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.mini-chart-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 0px;
}

.mini-bar {
  background: #5abaff;
  border-radius: 1px;
}

/* Top Content */
.rt-top-content-header {
  display: flex;
}

.rt-content-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rt-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rt-thumb {
  width: 58px;
  height: 32px;
  border-radius: 4px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.thumb-red {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.thumb-blue {
  background: linear-gradient(135deg, #2471a3, #3498db);
}

.thumb-teal {
  background: linear-gradient(135deg, #0d7377, #14a085);
}

.thumb-grey {
  background: linear-gradient(135deg, #555, #888);
}

.thumb-placeholder {
  border-radius: 4px;
}

.rt-item-title {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.rt-item-views {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
  transition: color 0.15s;
  font-variant-numeric: tabular-nums;
}

.rt-item-views.flash {
  color: #5abaff;
}

/* ===== CENTRED PANEL ===== */
.centred-panel {
  padding: 24px 28px 40px;
  max-width: 1280px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px;
}

.dash-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 9px;
}

.dash-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  cursor: text;
  outline: none;
}

.dash-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ds-val {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  cursor: text;
  outline: none;
}

.ds-label {
  font-size: 11px;
  color: var(--text-muted);
}

.news-card .news-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.news-icon {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 1px;
}

.news-item p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: text;
  outline: none;
}

/* Content / Subtitles table */
.content-filters,
.comment-filters,
.custom-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.analytics-tabs {
  display: flex;
}

.filter-btn {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.active-filter {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.content-table th {
  text-align: left;
  padding: 9px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.content-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.content-table tr:hover td {
  background: var(--bg-hover);
}

.content-table td[contenteditable]:focus {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

/* Comments */
.comments-list {
  display: flex;
  flex-direction: column;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: text;
  outline: none;
  line-height: 1.4;
}

.comment-text:focus {
  background: rgba(255, 255, 255, 0.04);
}

.comment-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.comment-actions {
  display: flex;
  gap: 2px;
  align-items: flex-start;
}

.comment-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s;
}

.comment-action-btn:hover {
  background: var(--bg-hover);
}

.comment-action-btn .material-icons {
  font-size: 16px;
}

/* Customization */
.custom-section {
  margin-bottom: 20px;
}

.custom-section h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.custom-input {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.custom-input:focus {
  border-color: var(--accent-blue);
}

.custom-textarea {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}

.custom-textarea:focus {
  border-color: var(--accent-blue);
}

.save-btn {
  background: var(--accent-blue);
  color: #0f0f0f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 9px 20px;
  border-radius: 4px;
  transition: background 0.2s;
}

.save-btn:hover {
  background: #5ab4ff;
}

/* Pill save button */
.save-btn-pill {
  background: #5abaff;
  color: #0f0f0f;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 20px;
  transition: background 0.2s;
}

.save-btn-pill:hover {
  background: #5ab4ff;
}

.cancel-btn {
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 4px;
  transition: background 0.2s;
  cursor: pointer;
}

.channel-avatar:hover .avatar-overlay-text {
  background: rgba(0, 0, 0, 0.7) !important;
}

.top-avatar {
  cursor: pointer;
}


/* Monetization / Earn */
.monetization-status {
  margin-bottom: 20px;
}

.mono-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.mono-badge.enabled {
  background: rgba(43, 166, 64, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(43, 166, 64, 0.25);
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.big-revenue {
  font-size: 32px;
  font-weight: 300;
  margin: 10px 0 5px;
  cursor: text;
  outline: none;
}

.rev-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.rev-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.rev-row span:last-child {
  color: var(--text-primary);
  cursor: text;
  outline: none;
}

/* Settings */
.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px;
  margin-bottom: 14px;
}

.settings-group h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

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

.setting-row label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 160px;
}

.inline-select {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* Badges */
.badge-green {
  background: rgba(43, 166, 64, 0.12);
  color: var(--accent-green);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Playlists */
.create-playlist-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 18px;
  transition: background 0.15s;
}

.create-playlist-btn:hover {
  background: var(--bg-hover);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 0;
  gap: 10px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 56px;
}

.muted-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}

/* Placeholder panels */
.placeholder-panel {
  padding: 16px 0;
}

.placeholder-icon {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.research-table {
  margin-top: 16px;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 500px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
}

.modal-close {
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.modal-close:hover {
  background: var(--bg-hover);
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.upload-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.upload-label:hover {
  color: #5ab4ff;
}

.upload-label .material-icons {
  font-size: 16px;
}

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

.modal-field label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Responsive */
@media (max-width: 1100px) {

  /* Allow the right panel to stay visible or adjust as needed */
  .analytics-right {
    width: 300px;
    min-width: 300px;
  }
}

@media (max-width: 900px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 56px;
  }

  .sidebar-channel,
  .sidebar .channel-label,
  .sidebar .channel-name {
    display: none;
  }

  .nav-item span:not(.material-icons) {
    display: none;
  }

  .nav-item {
    padding: 0 16px;
    gap: 0;
    justify-content: center;
  }

  .nav-item.active::before {
    display: none;
  }

  .main-content {
    margin-left: 56px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Custom Chart Tooltip */
#chart-tooltip {
  opacity: 0;
  position: absolute;
  background: #212121;
  border-radius: 8px;
  color: white;
  padding: 8px 12px;
  pointer-events: none;
  transition: opacity 0.1s ease;
  z-index: 3000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 120px;
}

.tooltip-date {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  margin-bottom: 6px;
}

.tooltip-value {
  font-size: 24px;
  font-weight: 400;
  color: var(--accent-blue);
}

.chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  display: none;
  z-index: 10;
}

.chart-point-indicator {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid white;
  pointer-events: none;
  display: none;
  z-index: 11;
  transform: translate(-50%, -50%);
}

/* Chart Edit Overlay Improvement */
.chart-edit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  /* Initially hidden */
  align-items: center;
  justify-content: center;
  z-index: 4000;
}

.chart-edit-modal {
  background: #282828;
  padding: 32px;
  border-radius: 16px;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-edit-modal h3 {
  margin-bottom: 8px;
  font-size: 20px;
  color: var(--text-primary);
}

.chart-edit-modal p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.chart-edit-modal textarea {
  width: 100%;
  height: 180px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 16px;
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  resize: none;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.chart-edit-modal textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.chart-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.chart-edit-actions button {
  padding: 10px 24px;
  border-radius: 24px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#cancelBtn {
  background: transparent;
  color: var(--text-primary);
}

#cancelBtn:hover {
  background: rgba(255, 255, 255, 0.05);
}

#saveChartBtn {
  background: var(--text-primary);
  color: #000;
}

#saveChartBtn:hover {
  background: #fff;
}