:root {
  color-scheme: dark;
  --bg: #060708;
  --bg-soft: #0b1012;
  --surface: #111719;
  --surface-2: #182124;
  --surface-3: #202b2f;
  --border: rgba(190, 205, 210, 0.14);
  --text: #eef3f4;
  --muted: #9ca9ad;
  --muted-2: #6f7d82;
  --primary: #0f5f6f;
  --primary-2: #1b7f91;
  --accent: #b7c4c9;
  --accent-2: #e2e8ea;
  --success: #58c58a;
  --warning: #d8a84d;
  --danger: #df5c63;
  --color-bg: var(--bg);
  --color-bg-soft: var(--bg-soft);
  --color-surface: var(--surface);
  --color-surface-raised: var(--surface-2);
  --color-surface-muted: rgba(255, 255, 255, 0.045);
  --color-border: var(--border);
  --color-border-strong: rgba(183, 196, 201, 0.34);
  --color-text: var(--text);
  --color-muted: var(--muted);
  --color-primary: var(--primary);
  --color-primary-soft: rgba(15, 95, 111, 0.18);
  --color-success: var(--success);
  --color-danger: var(--danger);
  --color-warning: var(--warning);
  --color-violet: var(--accent);
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.32);
  --shadow-panel: 0 16px 44px rgba(0, 0, 0, 0.24);
  --radius-panel: 16px;
  --radius-control: 9px;
  --panel: var(--color-surface);
  --panel-strong: var(--color-surface-raised);
  --cyan: var(--primary-2);
  --green: var(--color-success);
  --violet: var(--accent);
  --pink: var(--color-danger);
  --yellow: var(--color-warning);
  --line: var(--color-border);
}

/* Clean master-panel shell: overrides legacy layout so the dashboard is one app surface. */
.shell:has(.app-shell:not(.is-hidden)) {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  align-items: stretch;
}

body:has(.app-shell:not(.is-hidden)) {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(168, 121, 255, 0.14), transparent 30rem),
    linear-gradient(135deg, var(--bg) 0%, #111018 52%, #09080c 100%);
}

.dashboard-view.app-shell {
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.dashboard-view.app-shell.is-hidden {
  display: none;
}

.dashboard-view.app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 60px auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 180px),
    var(--bg);
  overflow: hidden;
}

.dashboard-header.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-column: auto;
  min-height: 60px;
  height: 60px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: rgba(23, 21, 29, 0.92);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.dashboard-header.app-topbar .eyebrow {
  display: none;
}

.dashboard-header.app-topbar h2 {
  margin: 0;
  font-size: 1.02rem;
}

.dashboard-header.app-topbar .brand-logo.compact {
  width: 78px;
  height: 36px;
}

.app-sidebar {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  top: auto;
  width: 100%;
  max-height: none;
  height: 100vh;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 14px 12px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(168, 121, 255, 0.10), transparent 180px),
    var(--surface);
  box-shadow: none;
  scrollbar-width: thin;
}

.app-workspace {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px clamp(16px, 2.5vw, 34px) 34px;
}

.app-workspace > .panel-view {
  grid-column: auto;
  width: min(100%, 1360px);
  max-width: 1360px;
  margin: 0 auto;
}

.panel-message {
  justify-self: end;
  max-width: min(460px, calc(100% - 32px));
  margin: 10px 18px 0;
}

.nav-group {
  margin: 14px 10px 5px;
  color: var(--primary-2);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  justify-content: flex-start;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-button:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.045);
}

.nav-button.is-active {
  color: #120f18;
  border-color: rgba(240, 195, 106, 0.42);
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

.dashboard-view.sidebar-collapsed .app-sidebar {
  padding: 12px 8px;
}

.dashboard-view.sidebar-collapsed .nav-group {
  height: 20px;
  margin: 10px 0 2px;
  color: transparent;
  text-align: center;
}

.dashboard-view.sidebar-collapsed .nav-group::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: rgba(240, 195, 106, 0.52);
}

.dashboard-view.sidebar-collapsed .nav-button {
  width: 56px;
  min-width: 56px;
  min-height: 42px;
  justify-content: center;
  padding: 0;
  color: transparent;
  text-align: center;
}

.dashboard-view.sidebar-collapsed .nav-button::before {
  content: attr(data-short);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
}

.dashboard-view.sidebar-collapsed .nav-button.is-active::before {
  color: #120f18;
}

.section-heading {
  min-height: auto;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(23, 21, 29, 0.78);
  box-shadow: none;
}

.section-heading h3 {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.metrics-grid,
.panel-row,
.content-center-metrics,
.import-summary-grid {
  gap: 12px;
}

.metric-card,
.status-panel,
.top10-panel,
.table-wrap,
.filters-row,
.panel-form,
.grid-form,
.inline-form,
.split-layout,
.content-center-shell,
.content-center-toolbar,
.content-center-main {
  border-color: var(--border);
  border-radius: 14px;
  background: rgba(23, 21, 29, 0.78);
  box-shadow: none;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
}

table {
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
}

.filters-row {
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.workspace-editor.is-editor-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 120;
  width: min(1120px, 92vw);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.dashboard-view.editor-modal-active::after {
  position: fixed;
  inset: 0;
  z-index: 110;
  content: "";
  background: rgba(4, 3, 7, 0.68);
  backdrop-filter: blur(8px);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.editor-header span {
  display: block;
  color: var(--primary-2);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-header strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 1.05rem;
}

.editor-tabs {
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.editor-tab {
  min-height: 36px;
  color: var(--muted);
  background: transparent;
}

.editor-tab.is-active {
  color: #120f18;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

.editor-panels {
  min-height: 0;
  overflow: auto;
}

.editor-tab-panel.is-active,
.compact-create-panel.is-editor-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.editor-tab-panel[hidden] {
  display: none !important;
}

.editor-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(33, 30, 42, 0.96);
  box-shadow: 0 -16px 38px rgba(0, 0, 0, 0.22);
}

.workspace-editor.is-editor-collapsed {
  display: none !important;
}

.modal-card {
  border-color: var(--border);
  background: var(--surface);
}

.btn,
button {
  border-radius: 10px;
}

.btn-primary,
button:not(.ghost-button):not(.nav-button):not(.editor-tab):not(.table-action):not(.channel-filter-chip) {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

@media (max-width: 1180px) {
  .dashboard-view.app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .app-workspace {
    padding-inline: 16px;
  }
}

/* Easy create forms override: final rules win over legacy editor/drawer styles. */
#createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
#createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
#createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
#createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open {
  position: relative;
  inset: auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
  margin: 0 0 16px;
  padding: 14px;
  overflow: visible;
  transform: none;
  border: 1px solid rgba(190, 205, 210, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 24, 27, 0.92), rgba(8, 13, 15, 0.96));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#createChannelForm.simple-create-editor .editor-header,
#createChannelForm.simple-create-editor .editor-tabs,
#createChannelForm.simple-create-editor .editor-panels,
#createMovieForm.simple-create-editor .editor-header,
#createMovieForm.simple-create-editor .editor-tabs,
#createMovieForm.simple-create-editor .editor-panels,
#createSeriesForm.simple-create-editor .editor-header,
#createSeriesForm.simple-create-editor .editor-tabs,
#createSeriesForm.simple-create-editor .editor-panels,
#createEpisodeForm.simple-create-editor .editor-header,
#createEpisodeForm.simple-create-editor .editor-tabs,
#createEpisodeForm.simple-create-editor .editor-panels {
  display: none;
}

.simple-create-editor .content-form-intro,
.simple-create-editor .quick-source-field,
.simple-create-editor .source-inline-actions,
.simple-create-editor .modal-preview,
.simple-create-editor .advanced-panel,
.simple-create-editor .vod-create-hint,
.simple-create-editor .quick-actions {
  grid-column: 1 / -1;
}

.simple-create-editor .content-form-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.simple-create-editor .content-form-intro strong {
  color: var(--text);
  font-size: 1.05rem;
}

.simple-create-editor .content-form-intro span {
  color: var(--muted);
  font-size: 0.82rem;
}

.simple-create-editor label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.simple-create-editor input,
.simple-create-editor select,
.simple-create-editor textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
}

.simple-create-editor textarea {
  min-height: 76px;
}

.age-rating-field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.age-rating-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.age-rating-presets button {
  width: auto;
  min-width: 44px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(88, 197, 138, 0.38);
  border-radius: 999px;
  background: rgba(88, 197, 138, 0.10);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: none;
}

.age-rating-presets button:hover,
.age-rating-presets button:focus-visible {
  border-color: rgba(88, 197, 138, 0.78);
  background: rgba(88, 197, 138, 0.22);
  color: #ffffff;
}

.simple-create-editor .vod-create-hint {
  display: none;
}

.simple-create-editor .advanced-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.simple-create-editor .advanced-panel > summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(190, 205, 210, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
}

.simple-create-editor .advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.simple-create-editor .advanced-grid .wide-field,
.simple-create-editor .advanced-grid .editor-section-title {
  grid-column: 1 / -1;
}

.simple-create-editor .quick-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.simple-create-editor .quick-actions button {
  width: auto;
  min-width: 118px;
  min-height: 36px;
}

.simple-create-editor .quick-actions button[data-save-mode="publish"] {
  min-width: 148px;
}

.simple-create-editor .quick-actions button[data-save-mode="test"],
.simple-create-editor .source-inline-actions button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.vod-metadata-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(70, 188, 205, 0.22);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(18, 47, 54, 0.78), rgba(8, 14, 16, 0.74));
}

.vod-metadata-heading,
.vod-metadata-search-row {
  display: flex;
  align-items: end;
  gap: 10px;
}

.vod-metadata-heading {
  justify-content: space-between;
}

.vod-metadata-heading strong,
.vod-metadata-preview-card strong {
  display: block;
  color: var(--text);
}

.vod-metadata-heading span,
.vod-metadata-status,
.vod-metadata-preview-card span,
.vod-metadata-preview-card small,
.vod-metadata-result small,
.vod-metadata-result em {
  color: var(--muted);
}

.vod-metadata-search-row label {
  flex: 1 1 220px;
}

.vod-metadata-search-row label:last-child {
  flex: 0 0 120px;
}

.vod-metadata-status {
  min-height: 16px;
  margin: 0;
  font-size: 0.82rem;
}

.vod-metadata-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.vod-metadata-result {
  min-height: 92px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(190, 205, 210, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.vod-metadata-result img,
.vod-metadata-poster-fallback {
  width: 54px;
  height: 78px;
  object-fit: cover;
  border-radius: 7px;
  background: rgba(20, 95, 105, 0.35);
}

.vod-metadata-poster-fallback {
  display: grid;
  place-items: center;
  font-weight: 900;
}

.vod-metadata-result span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.vod-metadata-result strong,
.vod-metadata-result small,
.vod-metadata-result em {
  overflow: hidden;
  text-overflow: ellipsis;
}

.vod-metadata-result strong,
.vod-metadata-result small {
  white-space: nowrap;
}

.vod-metadata-result em {
  display: -webkit-box;
  font-style: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vod-metadata-preview-card {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(190, 205, 210, 0.13);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
}

.vod-metadata-preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.vod-metadata-preview-card p {
  display: -webkit-box;
  margin: 6px 0;
  overflow: hidden;
  color: var(--text);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vod-metadata-preview-card button {
  width: max-content;
  min-height: 32px;
  margin-top: 8px;
}

@media (max-width: 980px) {
  #createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
  #createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
  #createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
  #createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
  #createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
  #createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
  #createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: 1fr;
  }

  .simple-create-editor .content-form-intro {
    display: grid;
  }
}

/* VOD local cleanup base rules. */
#view-movies .content-center-hub,
#view-series .content-center-hub {
  margin-bottom: 8px;
  padding: 10px 12px;
}

#view-movies .content-center-main .muted-text,
#view-series .content-center-main .muted-text,
#view-movies .content-center-toolbar,
#view-series .content-center-toolbar {
  display: none;
}

#view-movies .content-center-main h3,
#view-series .content-center-main h3 {
  font-size: 1.18rem;
}

#view-movies .content-center-metrics,
#view-series .content-center-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 8px;
}

#view-movies .content-center-metrics article,
#view-series .content-center-metrics article {
  min-height: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools,
#view-series > .vod-tools-panel.vod-advanced-tools,
.series-workbench > .vod-tools-panel.vod-advanced-tools {
  width: max-content;
  max-width: 100%;
  margin: 4px 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary),
#view-series > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary),
.series-workbench > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary) {
  display: none !important;
}

#view-movies > .vod-tools-panel.vod-advanced-tools summary,
#view-series > .vod-tools-panel.vod-advanced-tools summary,
.series-workbench > .vod-tools-panel.vod-advanced-tools summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(190, 205, 210, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  list-style: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools[open],
#view-series > .vod-tools-panel.vod-advanced-tools[open],
.series-workbench > .vod-tools-panel.vod-advanced-tools[open] {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(190, 205, 210, 0.12);
  border-radius: 10px;
  background: rgba(12, 18, 20, 0.74);
}

.inline-upload-action {
  width: max-content;
  min-height: 28px;
  margin-top: 2px;
  padding: 0 9px;
  border-color: rgba(60, 139, 154, 0.45);
  background: rgba(15, 95, 111, 0.22);
  color: var(--text);
}

.modal-backdrop.vod-editor-modal {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(5px);
}

.vod-editor-modal .modal-card {
  width: min(1040px, calc(100vw - 72px));
  max-height: min(82vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 12px;
}

.vod-editor-modal .modal-card h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 1rem;
}

.vod-editor-modal #modalBody {
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.vod-editor-modal .editor-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: rgba(12, 18, 20, 0.96);
}

.vod-editor-modal .editor-tab {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.vod-editor-modal .editor-tab-panel.is-active {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 10px;
  padding: 12px;
}

.vod-editor-modal .vod-local-editor {
  grid-column: 1 / -1;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
}

.vod-editor-modal .vod-upload-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(60, 139, 154, 0.22);
  border-radius: 9px;
  background: rgba(15, 95, 111, 0.08);
}

.vod-editor-modal .modal-actions {
  min-height: 0;
  padding: 10px 12px;
  gap: 8px;
}

/* Support diagnostics: scoped late overrides for the operational support view. */
.metric-card.amber {
  box-shadow: inset 0 2px 0 #d8a84d, 0 0 34px rgba(216, 168, 77, 0.08);
}

.support-filters {
  align-items: end;
}

.support-list-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.support-list-button:focus-visible {
  outline: none;
}

.support-list-button:focus-visible .report-list-item,
.support-list-button:hover .report-list-item {
  border-color: rgba(70, 188, 205, 0.45);
  background: rgba(27, 127, 145, 0.12);
}

.support-code {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.support-code.token {
  border-color: rgba(216, 168, 77, 0.55);
  background: rgba(216, 168, 77, 0.14);
  color: #f0d18b;
}

.support-code.device {
  border-color: rgba(223, 92, 99, 0.55);
  background: rgba(223, 92, 99, 0.14);
  color: #ff9aa0;
}

.support-code.warn {
  border-color: rgba(88, 197, 138, 0.45);
  background: rgba(88, 197, 138, 0.12);
  color: #a7e7c2;
}

.support-code.info {
  border-color: rgba(183, 196, 201, 0.35);
  background: rgba(183, 196, 201, 0.09);
  color: var(--accent-2);
}

.support-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.support-detail-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.support-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.support-detail-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-detail-list .report-list-item span {
  overflow-wrap: anywhere;
}

.live-event-warning-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.live-event-warning-strip span {
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.1);
  color: #f8d98a;
  padding: 8px 12px;
  font-weight: 800;
}

.live-event-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}

.live-event-form {
  position: sticky;
  top: 92px;
}

.live-event-column {
  display: grid;
  gap: 14px;
}

.live-event-list {
  display: grid;
  gap: 10px;
}

.live-event-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.11), rgba(15, 23, 42, 0.86)),
    rgba(15, 23, 42, 0.72);
  padding: 14px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.live-event-card.active {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 18px 40px rgba(16, 185, 129, 0.16);
}

.live-event-card-title,
.live-event-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.live-event-card-title strong {
  color: #f8fafc;
  font-size: 1rem;
}

.live-event-card-meta {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.live-event-card p {
  color: var(--text-muted);
  margin: 10px 0 12px;
}

.live-event-checklist {
  display: grid;
  gap: 10px;
}

.live-event-check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  padding: 10px;
}

.live-event-check-item input {
  margin-top: 4px;
}

.live-event-check-item strong {
  display: block;
  color: #f8fafc;
}

.live-event-check-item small {
  color: var(--text-muted);
}

.live-event-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.live-event-kpis article {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  padding: 10px;
}

.live-event-kpis span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-event-kpis strong {
  display: block;
  color: #f8fafc;
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .live-event-layout {
    grid-template-columns: 1fr;
  }

  .live-event-form {
    position: static;
  }
}

.dashboard-view.topnav-open .panel-nav.topbar-nav {
  z-index: 140;
}

.dashboard-header.app-topbar,
.dashboard-header.master-topbar {
  z-index: 150;
}

/* VOD local workflow cleanup: compact top hub, real collapsed tools, direct upload path. */
#view-movies .content-center-hub,
#view-series .content-center-hub {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
}

#view-movies .content-center-main,
#view-series .content-center-main {
  gap: 8px;
}

#view-movies .content-center-main h3,
#view-series .content-center-main h3 {
  font-size: 1.18rem;
  line-height: 1.12;
}

#view-movies .content-center-main .muted-text,
#view-series .content-center-main .muted-text,
#view-movies .content-center-toolbar,
#view-series .content-center-toolbar {
  display: none;
}

#view-movies .content-center-actions button,
#view-series .content-center-actions button {
  min-width: 118px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.78rem;
}

#view-movies .content-center-tabs,
#view-series .content-center-tabs {
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

#view-movies .content-center-tabs button,
#view-series .content-center-tabs button {
  min-height: 28px;
  flex: 0 0 auto;
  padding: 0 9px;
  font-size: 0.7rem;
}

#view-movies .content-center-metrics,
#view-series .content-center-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(190, 205, 210, 0.10);
}

#view-movies .content-center-metrics article,
#view-series .content-center-metrics article {
  min-height: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-movies .content-center-metrics article + article::before,
#view-series .content-center-metrics article + article::before {
  content: ".";
  color: rgba(226, 232, 234, 0.38);
  font-weight: 900;
}

#view-movies .content-center-metrics strong,
#view-series .content-center-metrics strong {
  order: -1;
  font-size: 0.9rem;
  line-height: 1;
}

#view-movies .content-center-metrics span,
#view-series .content-center-metrics span,
#view-movies .content-center-metrics small,
#view-series .content-center-metrics small {
  font-size: 0.74rem;
  line-height: 1;
}

#view-movies .filters-row,
#view-series .filters-row {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 8px;
}

#view-movies > .vod-tools-panel.vod-advanced-tools,
#view-series > .vod-tools-panel.vod-advanced-tools,
.series-workbench > .vod-tools-panel.vod-advanced-tools {
  width: max-content;
  max-width: 100%;
  margin: 4px 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary),
#view-series > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary),
.series-workbench > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary) {
  display: none !important;
}

#view-movies > .vod-tools-panel.vod-advanced-tools summary,
#view-series > .vod-tools-panel.vod-advanced-tools summary,
.series-workbench > .vod-tools-panel.vod-advanced-tools summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(190, 205, 210, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

#view-movies > .vod-tools-panel.vod-advanced-tools summary::-webkit-details-marker,
#view-series > .vod-tools-panel.vod-advanced-tools summary::-webkit-details-marker,
.series-workbench > .vod-tools-panel.vod-advanced-tools summary::-webkit-details-marker {
  display: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools[open],
#view-series > .vod-tools-panel.vod-advanced-tools[open],
.series-workbench > .vod-tools-panel.vod-advanced-tools[open] {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(190, 205, 210, 0.12);
  border-radius: 10px;
  background: rgba(12, 18, 20, 0.74);
}

#view-movies > .vod-tools-panel.vod-advanced-tools[open] summary,
#view-series > .vod-tools-panel.vod-advanced-tools[open] summary,
.series-workbench > .vod-tools-panel.vod-advanced-tools[open] summary {
  margin-bottom: 10px;
  border-color: rgba(60, 139, 154, 0.35);
  color: var(--text);
}

.inline-upload-action {
  width: max-content;
  min-height: 28px;
  margin-top: 2px;
  padding: 0 9px;
  border-color: rgba(60, 139, 154, 0.45);
  background: rgba(15, 95, 111, 0.22);
  color: var(--text);
}

.vod-status .status.ignored + small {
  color: rgba(226, 232, 234, 0.62);
}

.modal-backdrop.vod-editor-modal {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(5px);
}

.vod-editor-modal .modal-card {
  width: min(1040px, calc(100vw - 72px));
  max-height: min(82vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 12px;
}

.vod-editor-modal .modal-card h3 {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(190, 205, 210, 0.10);
  font-size: 1rem;
}

.vod-editor-modal #modalBody {
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.vod-editor-modal .vod-editor-shell {
  min-height: 0;
}

.vod-editor-modal .editor-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: rgba(12, 18, 20, 0.96);
}

.vod-editor-modal .editor-tab {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.vod-editor-modal .editor-panels {
  min-height: 0;
}

.vod-editor-modal .editor-tab-panel.is-active {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 10px;
  padding: 12px;
}

.vod-editor-modal .vod-local-editor {
  grid-column: 1 / -1;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
}

.vod-editor-modal .vod-upload-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(60, 139, 154, 0.22);
  border-radius: 9px;
  background: rgba(15, 95, 111, 0.08);
}

.vod-editor-modal .vod-upload-box label {
  margin: 0;
}

.vod-editor-modal .vod-upload-box .muted-text {
  margin: 0;
  font-size: 0.76rem;
}

.vod-editor-modal .vod-local-details {
  gap: 8px;
}

.vod-editor-modal .vod-local-details div {
  min-height: 54px;
  padding: 9px;
}

.vod-editor-actions-compact {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px;
}

.vod-editor-modal .modal-actions {
  min-height: 0;
  padding: 10px 12px;
  gap: 8px;
  border-top: 1px solid rgba(190, 205, 210, 0.12);
}

.vod-editor-modal .modal-actions button,
.modal-extra-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .vod-editor-modal .modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 28px);
  }

  .vod-editor-modal .editor-tab-panel.is-active {
    grid-template-columns: 1fr;
  }
}

/* Content workflow cleanup: fast create, clean lists, no bulk tools in main VOD views. */
#view-channels .content-center-hub + .section-heading,
#view-movies .content-center-hub + .section-heading,
#view-series .content-center-hub + .section-heading,
#view-channel-imports .content-center-hub + .section-heading,
#view-vod-processing .content-center-hub + .section-heading,
#view-report-content .content-center-hub + .section-heading {
  display: none;
}

#channelToolbarNewButton {
  display: none !important;
}

.content-center-hub {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 12px;
  border-color: rgba(190, 205, 210, 0.14);
  background:
    linear-gradient(135deg, rgba(15, 95, 111, 0.10), transparent 44%),
    linear-gradient(180deg, rgba(18, 25, 28, 0.94), rgba(8, 12, 14, 0.92));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.content-center-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.content-center-main h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.content-center-main .muted-text {
  max-width: 720px;
  margin-top: 4px;
}

.content-center-actions {
  display: flex;
  justify-content: flex-end;
}

.content-center-actions button {
  width: auto;
  min-width: 132px;
  min-height: 38px;
  border-color: rgba(60, 139, 154, 0.52) !important;
  background: linear-gradient(135deg, #1b7f91, #0f5f6f) !important;
  color: #eef3f4 !important;
}

.content-center-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.content-center-tabs button {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(190, 205, 210, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.content-center-tabs button.is-active,
.content-center-tabs button:hover,
.content-center-tabs button:focus-visible {
  border-color: rgba(60, 139, 154, 0.46);
  background: rgba(15, 95, 111, 0.20);
  color: var(--text);
}

.content-center-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(240px, auto);
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(190, 205, 210, 0.10);
  background: rgba(255, 255, 255, 0.025);
}

.content-center-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.content-center-metrics article {
  min-height: 72px;
  border-color: rgba(190, 205, 210, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

#createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
#createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
#createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
#createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border-color: rgba(190, 205, 210, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 95, 111, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(17, 23, 25, 0.96), rgba(7, 11, 13, 0.96));
}

.simple-create-editor .content-form-intro {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(190, 205, 210, 0.10);
}

.simple-create-editor .content-form-intro span {
  max-width: 520px;
}

.simple-create-editor .quick-source-field textarea {
  min-height: 88px;
}

.simple-create-editor .quick-actions {
  gap: 8px;
  justify-content: flex-start;
  padding-top: 0;
}

.simple-create-editor .quick-actions button {
  min-width: 116px;
}

.simple-create-editor .quick-actions [data-editor-close] {
  margin-left: auto;
  border-color: rgba(190, 205, 210, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.simple-create-editor .advanced-panel > summary {
  width: max-content;
  min-width: 152px;
}

.filters-row {
  border-color: rgba(190, 205, 210, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.table-actions,
.channel-row-actions,
.vod-row-actions,
.import-row-actions {
  max-width: none;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

.import-row-actions {
  position: relative;
  display: flex;
  gap: 7px;
}

.channel-more-actions summary,
.vod-more-actions summary,
.table-action {
  min-height: 30px;
  border-radius: 8px;
}

.channel-more-menu,
.vod-more-menu {
  min-width: 190px;
}

.channel-more-menu .table-action,
.vod-more-menu .table-action {
  width: 100%;
  justify-content: flex-start;
}

.vod-source-stack small,
.vod-meta-stack small,
.vod-status small {
  color: rgba(226, 232, 234, 0.66);
}

.series-workbench {
  margin-top: 14px;
  border-color: rgba(190, 205, 210, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 95, 111, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(17, 23, 25, 0.92), rgba(7, 11, 13, 0.92));
}

.series-workbench > h4 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.modal-backdrop.vod-editor-modal,
.channel-drawer-modal {
  background: rgba(3, 5, 6, 0.58);
}

.channel-drawer-modal .modal-card,
.vod-editor-modal .modal-card {
  border-color: rgba(190, 205, 210, 0.18);
  background: linear-gradient(180deg, rgba(18, 25, 28, 0.98), rgba(7, 11, 13, 0.99));
}

@media (max-width: 1180px) {
  .content-center-main,
  .content-center-toolbar {
    grid-template-columns: 1fr;
  }

  .content-center-actions {
    justify-content: flex-start;
  }

  .content-center-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
  #createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
  #createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
  #createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .content-center-metrics,
  #createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
  #createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
  #createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
  #createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: 1fr;
  }

  .table-actions,
  .channel-row-actions,
  .vod-row-actions,
  .import-row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Simple create flow for channels, movies and series. No modal, no drawer, no tab columns. */
.simple-create-editor.workspace-editor.is-editor-open {
  position: relative;
  inset: auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: start;
  margin: 0 0 16px;
  padding: 14px;
  overflow: visible;
  transform: none;
  border: 1px solid rgba(190, 205, 210, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 25, 28, 0.90), rgba(9, 14, 16, 0.95));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.simple-create-editor .editor-header,
.simple-create-editor .editor-tabs,
.simple-create-editor .editor-panels {
  display: none;
}

.simple-create-editor .content-form-intro,
.simple-create-editor .wide-field,
.simple-create-editor .modal-preview,
.simple-create-editor .advanced-panel,
.simple-create-editor .vod-create-hint,
.simple-create-editor .quick-actions {
  grid-column: 1 / -1;
}

.simple-create-editor .content-form-intro {
  display: grid;
  gap: 4px;
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.simple-create-editor .content-form-intro strong {
  color: var(--text);
  font-size: 1.05rem;
}

.simple-create-editor label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.simple-create-editor input,
.simple-create-editor select,
.simple-create-editor textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
}

.simple-create-editor textarea {
  min-height: 86px;
}

.simple-create-editor .advanced-panel {
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(190, 205, 210, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.simple-create-editor .advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.simple-create-editor .advanced-grid .wide-field,
.simple-create-editor .advanced-grid .editor-section-title {
  grid-column: 1 / -1;
}

.simple-create-editor .quick-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 10px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.simple-create-editor .quick-actions button {
  width: auto;
  min-width: 132px;
  min-height: 36px;
}

@media (max-width: 980px) {
  .simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-main {
    grid-template-rows: 56px auto minmax(0, 1fr);
  }

  .dashboard-header.app-topbar {
    height: 56px;
    min-height: 56px;
    padding-inline: 12px;
  }

  .dashboard-header.app-topbar .brand-logo.compact {
    display: none;
  }

  .session-actions {
    gap: 6px;
  }

  .user-pill {
    max-width: 116px;
  }

  .editor-tab-panel.is-active,
  .compact-create-panel.is-editor-open {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body:has(.app-shell:not(.is-hidden)) {
    overflow: hidden;
  }

  .dashboard-view.app-shell,
  .dashboard-view.app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(280px, 82vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .dashboard-view.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .dashboard-view.sidebar-open::before {
    position: fixed;
    inset: 0;
    z-index: 80;
    content: "";
    background: rgba(4, 3, 7, 0.58);
  }

  .dashboard-view.sidebar-collapsed .nav-group {
    height: auto;
    margin: 14px 10px 5px;
    color: var(--primary-2);
    text-align: left;
  }

  .dashboard-view.sidebar-collapsed .nav-group::before {
    display: none;
  }

  .dashboard-view.sidebar-collapsed .nav-button {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 12px;
    color: var(--muted);
    text-align: left;
  }

  .dashboard-view.sidebar-collapsed .nav-button::before {
    content: none;
  }

  .app-workspace {
    padding: 12px;
  }

  .workspace-editor.is-editor-open {
    width: min(100vw - 18px, 1120px);
    max-height: calc(100vh - 18px);
  }

  .editor-actionbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .editor-actionbar button {
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.08), transparent 30%),
    linear-gradient(135deg, #070707 0%, #111112 48%, #181719 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(232, 226, 213, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 226, 213, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 80%);
}

body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), transparent 24%, transparent 78%, rgba(0, 0, 0, 0.32)),
    radial-gradient(circle at 76% 10%, rgba(215, 181, 109, 0.08), transparent 24rem);
}

button,
input,
select,
textarea {
  font: inherit;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 22px 0;
}

.login-view,
.dashboard-view {
  width: 100%;
}

.is-hidden {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-logo {
  width: 132px;
  height: 104px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 26px rgba(25, 230, 255, 0.2));
}

.brand-logo.compact {
  width: 86px;
  height: 42px;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 181, 109, 0.55);
  border-radius: 8px;
  color: var(--primary-2);
  background: rgba(215, 181, 109, 0.08);
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.16);
  font-size: 1.5rem;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 0.95;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 32, 0.82);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(142, 161, 181, 0.28);
  border-radius: var(--radius-control);
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

input,
select {
  min-height: 46px;
}

textarea {
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(25, 230, 255, 0.14);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-control);
  color: #120f18;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  cursor: pointer;
  font-weight: 900;
}

.ghost-button {
  width: 90px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.error-message {
  margin: -2px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 79, 216, 0.42);
  border-radius: 6px;
  color: #ffd7f6;
  background: rgba(255, 79, 216, 0.1);
}

.dashboard-header {
  grid-column: 1 / -1;
  position: sticky;
  top: 8px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
  margin-bottom: 4px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.94), rgba(36, 35, 39, 0.82));
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(18px);
}

.sidebar-toggle {
  width: 42px;
  min-width: 42px;
  min-height: 40px;
  padding: 0;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  min-height: 36px;
  display: inline-grid;
  align-items: center;
  max-width: min(320px, 52vw);
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgba(215, 181, 109, 0.32);
  border-radius: 6px;
  color: var(--primary-2);
  background: rgba(215, 181, 109, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-nav {
  grid-column: 1;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 150px);
  display: grid;
  gap: 6px;
  align-self: start;
  overflow: auto;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.12), transparent 26%),
    rgba(21, 21, 24, 0.9);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.45) transparent;
}

.nav-button {
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 11px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  box-shadow: none;
}

.nav-group {
  margin: 11px 6px 2px;
  color: var(--primary-2);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.9;
}

.nav-group:first-child {
  margin-top: 0;
}

.nav-button.is-active {
  color: #100d15;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.2);
}

.panel-message {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 13px 16px;
  border: 1px solid rgba(77, 255, 157, 0.42);
  border-radius: 14px;
  color: #caffdf;
  background: rgba(8, 24, 39, 0.94);
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.36), 0 0 28px rgba(77, 255, 157, 0.1);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.panel-message[data-type="error"] {
  border-color: rgba(255, 79, 216, 0.42);
  color: #ffd7f6;
  background: rgba(39, 10, 32, 0.94);
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.36), 0 0 28px rgba(255, 79, 216, 0.1);
}

.dashboard-header h2 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.dashboard-view {
  width: 100%;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  transition: grid-template-columns 180ms ease;
}

.dashboard-view.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.dashboard-view.sidebar-collapsed .panel-nav {
  padding: 8px;
}

.dashboard-view.sidebar-collapsed .nav-group {
  width: 100%;
  margin: 10px 0 3px;
  overflow: hidden;
  color: transparent;
  text-align: center;
}

.dashboard-view.sidebar-collapsed .nav-group::before {
  color: var(--primary-2);
  content: "•";
}

.dashboard-view.sidebar-collapsed .nav-button {
  width: 50px;
  min-width: 50px;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  color: transparent;
}

.dashboard-view.sidebar-collapsed .nav-button::before {
  color: var(--text);
  content: attr(data-short);
  font-size: 0.72rem;
  font-weight: 950;
}

.dashboard-view.sidebar-collapsed .nav-button.is-active::before {
  color: #100d15;
}

.login-view {
  justify-self: center;
  max-width: 760px;
}

.panel-view {
  grid-column: 2;
  width: 100%;
  max-width: 1180px;
  min-width: 0;
  margin: 0 auto;
}

.login-view.is-hidden,
.dashboard-view.is-hidden,
.panel-view.is-hidden {
  display: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metrics-grid.compact .metric-card {
  min-height: 132px;
}

.metrics-grid.compact .metric-card strong {
  font-size: clamp(1.35rem, 2.2vw, 2.1rem);
}

.metric-card,
.status-panel {
  border: 1px solid rgba(151, 204, 255, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 24% 0%, rgba(0, 174, 239, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(16, 36, 58, 0.94), rgba(11, 27, 46, 0.86));
}

.metric-card {
  min-height: 156px;
  display: grid;
  align-content: space-between;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 174, 239, 0.38);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22), 0 0 28px rgba(0, 174, 239, 0.08);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.metric-card.cyan {
  box-shadow: inset 0 2px 0 var(--cyan), 0 0 34px rgba(25, 230, 255, 0.08);
}

.metric-card.green {
  box-shadow: inset 0 2px 0 var(--green), 0 0 34px rgba(77, 255, 157, 0.08);
}

.metric-card.violet {
  box-shadow: inset 0 2px 0 var(--violet), 0 0 34px rgba(155, 108, 255, 0.08);
}

.metric-card.pink {
  box-shadow: inset 0 2px 0 var(--pink), 0 0 34px rgba(255, 79, 216, 0.08);
}

.panel-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.report-block {
  margin: 16px 0;
}

.status-panel {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(151, 204, 255, 0.16);
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, rgba(28, 28, 31, 0.86), rgba(39, 39, 44, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.section-heading h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.section-actions button {
  width: auto;
  min-width: 128px;
}

.content-center-hub {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(151, 204, 255, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 174, 239, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(5, 18, 33, 0.96), rgba(11, 27, 46, 0.78));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.content-center-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.content-center-main h3 {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
}

.content-center-actions,
.content-center-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-center-actions {
  justify-content: flex-end;
}

.content-center-actions button,
.content-center-tabs button {
  width: auto;
  min-width: 118px;
  min-height: 38px;
  padding: 0 12px;
}

.content-center-tabs {
  padding: 6px;
  border: 1px solid rgba(151, 204, 255, 0.13);
  border-radius: 14px;
  background: rgba(2, 8, 18, 0.42);
}

.content-center-tabs button {
  color: var(--text);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.045);
}

.content-center-tabs button.is-active {
  color: #031016;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 0 22px rgba(0, 174, 239, 0.18);
}

.content-center-toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
}

.content-center-search {
  min-width: min(420px, 100%);
  flex: 1 1 320px;
}

.content-center-note {
  max-width: 520px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.content-center-metrics,
.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.content-center-metrics article,
.import-summary-grid article {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  padding: 12px;
  border: 1px solid rgba(151, 204, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.content-center-metrics span,
.content-center-metrics small,
.import-summary-grid span,
.import-summary-grid small {
  color: var(--muted);
  font-size: 0.78rem;
}

.content-center-metrics strong,
.import-summary-grid strong {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(39, 39, 44, 0.86), rgba(25, 25, 28, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.workspace-editor {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  margin-bottom: 16px;
  scroll-margin-top: 86px;
  padding: 0;
  border-color: rgba(215, 181, 109, 0.2);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.workspace-editor.is-editor-collapsed {
  display: none;
}

.editor-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 12px 0;
  background: rgba(12, 12, 14, 0.35);
}

.editor-tab {
  width: auto;
  min-width: max-content;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.editor-tab.is-active {
  color: #16120a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

.editor-panels {
  max-height: min(62vh, 640px);
  overflow: auto;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 181, 109, 0.45) transparent;
}

.editor-tab-panel {
  display: none;
}

.editor-tab-panel.is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.editor-tab-panel .wide-field,
.editor-tab-panel .content-form-intro,
.editor-tab-panel .modal-preview,
.editor-tab-panel .image-field-preview,
.editor-tab-panel .image-tools {
  grid-column: span 2;
}

.editor-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(16, 16, 18, 0.92);
  backdrop-filter: blur(16px);
}

.editor-actionbar button {
  width: auto;
  min-width: 128px;
}

.compact-create-panel {
  padding: 14px;
}

.compact-create-panel .editor-actionbar {
  grid-column: 1 / -1;
  margin: 2px -14px -14px;
}

.episode-editor-launcher {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
}

.episode-editor-launcher button {
  width: auto;
  min-width: 128px;
}

.inline-form button {
  min-width: 132px;
}

.channel-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.content-editor {
  position: relative;
  overflow: hidden;
}

.content-editor::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--cyan), var(--green), transparent);
  opacity: 0.74;
}

.content-editor.has-pending-changes {
  border-color: rgba(255, 205, 86, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 205, 86, 0.08), 0 0 32px rgba(255, 205, 86, 0.05);
}

.content-editor.has-pending-changes::after {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(231, 183, 86, 0.34);
  border-radius: 999px;
  color: #fff0c2;
  background: rgba(231, 183, 86, 0.1);
  content: "Cambios pendientes";
  font-size: 0.7rem;
  font-weight: 900;
}

.content-form-intro,
.editor-section-title {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(151, 204, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.content-form-intro strong,
.editor-section-title strong {
  color: var(--text);
}

.content-form-intro span,
.editor-section-title span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

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

.field-hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.password-field-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.password-field-row .ghost-button {
  width: auto;
  min-width: 82px;
  min-height: 42px;
  padding: 0 10px;
}

.credential-card {
  display: grid;
  gap: 14px;
}

.credential-card textarea {
  min-height: 168px;
  line-height: 1.45;
}

.credential-warning {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 10px;
  color: #ffe8ae;
  background: rgba(255, 209, 102, 0.08);
}

.credential-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.credential-actions button {
  width: auto;
  min-width: 132px;
}

.quick-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quick-actions button {
  width: auto;
  min-width: 150px;
}

.content-editor .quick-actions,
.channel-form .quick-actions {
  position: sticky;
  bottom: 10px;
  z-index: 7;
  padding: 10px;
  border: 1px solid rgba(151, 204, 255, 0.14);
  border-radius: 12px;
  background: rgba(10, 17, 27, 0.88);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(14px);
}

.advanced-panel {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(25, 230, 255, 0.22);
  border-radius: 12px;
  background: rgba(16, 36, 58, 0.56);
}

.advanced-panel summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 700;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.dash-template-box {
  display: grid;
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(70, 214, 238, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 26, 33, 0.86), rgba(13, 21, 27, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.16);
}

.dash-template-box .editor-section-title {
  margin: 0;
}

.advanced-grid.compact-grid {
  gap: 10px;
  margin: 0;
}

.dash-template-box .inline-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.image-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.image-tools .ghost-button {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.image-tools.is-loading .ghost-button {
  opacity: 0.58;
  pointer-events: none;
}

.image-field-preview {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px dashed rgba(151, 204, 255, 0.28);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.image-field-preview.is-dragging {
  border-color: var(--cyan);
  background: rgba(0, 174, 239, 0.1);
}

.image-field-preview > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-empty {
  font-size: 0.82rem;
}

.entity-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.entity-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.entity-copy strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-copy small {
  color: var(--muted);
  line-height: 1.35;
}

.entity-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(151, 204, 255, 0.22);
  border-radius: 12px;
  color: var(--cyan);
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 212, 255, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(0, 174, 239, 0.12), rgba(16, 36, 58, 0.88));
  font-size: 0.8rem;
  font-weight: 900;
}

.entity-thumb.small {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 10px;
  font-size: 0.68rem;
}

.entity-thumb.large {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.entity-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  background: rgba(0, 0, 0, 0.28);
}

.source-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.86rem;
}

.source-preview-table th,
.source-preview-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.m3u-import-workspace {
  gap: 14px;
  padding: 16px;
  overflow: visible;
}

.import-topbar,
.import-job-header,
.import-preview-heading,
.import-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-topbar {
  padding: 12px 14px;
  border: 1px solid rgba(244, 200, 90, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(244, 200, 90, 0.10), transparent 42%),
    rgba(12, 12, 14, 0.52);
}

.import-topbar strong,
.import-preview-heading strong,
.import-job-header strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.import-topbar span,
.import-preview-heading span,
.import-job-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.import-controls-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.import-hidden-toggle {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(244, 200, 90, 0.18);
  border-radius: 9px;
  background: rgba(244, 200, 90, 0.06);
  color: var(--text);
  font-weight: 850;
}

.import-hidden-toggle input {
  width: auto;
}

.import-summary-grid.compact {
  grid-template-columns: repeat(5, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.import-summary-grid.compact article {
  min-height: 68px;
  padding: 10px;
  border-radius: 9px;
  border-color: rgba(244, 200, 90, 0.15);
  background: rgba(255, 255, 255, 0.035);
}

.import-summary-grid.compact strong {
  font-size: 1.2rem;
}

.import-preview-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 210px);
  gap: 10px;
  align-items: end;
  margin: 14px 0 10px;
}

.import-preview-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-selection-bar {
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.import-selection-bar strong {
  color: var(--primary-2);
  margin-right: auto;
}

.import-actions {
  align-items: center;
  margin: 10px 0;
}

.import-job-tray {
  border-color: rgba(244, 200, 90, 0.18);
  background:
    linear-gradient(180deg, rgba(27, 25, 21, 0.92), rgba(15, 15, 17, 0.94));
}

.import-row-actions {
  gap: 6px;
}

#view-channel-imports .source-preview-table {
  min-width: 980px;
}

#view-channel-imports .source-preview-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

#view-channel-imports .source-preview-table td small {
  display: block;
  max-width: 220px;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.import-result-actions {
  margin-top: 12px;
}

.source-warning {
  color: var(--yellow);
}

.checkbox-line {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.checkbox-line input[type="checkbox"] {
  width: auto;
}

.inline-help {
  color: var(--muted);
  display: inline-block;
  font-size: 0.85rem;
  margin-left: 8px;
}

.source-error {
  color: #ff8fc7;
}

.import-target-hint {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 12px;
  background: rgba(11, 59, 66, 0.34);
}

.bulk-preview-summary {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.source-preview-table tr.has-import-errors {
  background: rgba(255, 86, 145, 0.06);
}

.apk-release-help,
.apk-metadata-card {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 205, 86, 0.22);
  border-radius: 10px;
  background: rgba(255, 205, 86, 0.07);
  color: #f3f7ff;
  font-size: 0.88rem;
  line-height: 1.45;
}

.apk-release-help strong,
.apk-metadata-card strong {
  color: #fff3bc;
}

.apk-metadata-card {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.top10-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(25, 230, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 16, 32, 0.72);
}

.top10-panel h4 {
  margin: 0 0 6px;
  color: var(--text);
}

.muted-text {
  color: var(--muted);
  margin: 0 0 14px;
}

select[multiple] {
  min-height: 180px;
}

.import-form {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 16, 32, 0.72);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(151, 204, 255, 0.12);
  border-radius: 16px;
  background: rgba(8, 24, 39, 0.46);
}

.filters-row label {
  min-width: 180px;
}

.filters-row .search-filter {
  min-width: min(340px, 100%);
  flex: 1 1 260px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-clear-button {
  width: auto;
  min-width: 86px;
  min-height: 42px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(151, 204, 255, 0.16);
  border-radius: var(--radius-panel);
  background: rgba(12, 19, 30, 0.78);
  box-shadow: var(--shadow-panel);
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 211, 255, 0.48) transparent;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(360px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.template-variables {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.preview-box {
  min-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(25, 230, 255, 0.22);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  white-space: pre-wrap;
}

.report-list {
  display: grid;
  gap: 10px;
}

.report-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.report-list-item span {
  color: var(--muted);
  text-align: right;
}

.alert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.alert-card {
  display: grid;
  gap: 12px;
}

.alert-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
  line-height: 1.38;
}

th {
  color: var(--cyan);
  font-size: 0.74rem;
  text-transform: uppercase;
  background: rgba(9, 15, 24, 0.78);
}

td {
  color: var(--text);
  font-size: 0.9rem;
}

tr.is-selected td {
  background: rgba(25, 230, 255, 0.07);
}

tbody tr:hover td {
  background: rgba(0, 174, 239, 0.055);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 430px;
}

.compact-table {
  margin: 12px 0 18px;
}

.table-action {
  min-height: 28px;
  padding: 0 8px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.table-action:hover,
.ghost-button:hover {
  border-color: rgba(0, 174, 239, 0.58);
  background: rgba(0, 174, 239, 0.1);
}

.table-action.warn {
  border-color: rgba(255, 205, 86, 0.4);
  color: #ffe6a8;
}

.table-action.danger {
  border-color: rgba(255, 79, 216, 0.4);
  color: #ffd7f6;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button.danger {
  border-color: rgba(255, 79, 216, 0.4);
  color: #ffd7f6;
}

.vod-status {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.vod-status small {
  color: var(--muted);
}

.vod-tools-panel {
  margin: 12px 0 16px;
  border: 1px solid rgba(151, 204, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 18, 31, 0.5);
}

.vod-tools-panel summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.vod-tools-panel summary::-webkit-details-marker {
  display: none;
}

.vod-tools-panel summary::after {
  margin-left: auto;
  color: var(--muted);
  content: "+";
}

.vod-tools-panel[open] summary::after {
  content: "-";
}

.vod-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 12px 12px;
}

.vod-tools-panel .top10-panel {
  margin: 0;
}

.series-workbench {
  border-color: rgba(151, 204, 255, 0.14);
  background: rgba(8, 20, 34, 0.54);
}

.vod-create-hint {
  padding: 12px;
  border: 1px solid rgba(151, 204, 255, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.88rem;
  line-height: 1.45;
}

.vod-source-stack,
.vod-meta-stack {
  display: grid;
  gap: 6px;
}

.vod-row-actions {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  justify-content: flex-end;
}

.vod-row-actions > .table-action {
  min-height: 31px;
  white-space: nowrap;
}

.vod-more-actions {
  position: relative;
}

.vod-more-actions summary {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(151, 204, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}

.vod-more-actions summary::-webkit-details-marker {
  display: none;
}

.vod-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 95;
  min-width: 210px;
  max-height: min(340px, calc(100vh - 180px));
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(151, 204, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 19, 30, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

.vod-more-actions.open-up .vod-more-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.vod-more-menu .table-action {
  width: 100%;
  justify-content: flex-start;
}

.vod-editor-shell {
  grid-column: 1 / -1;
  display: grid;
  gap: 0;
  margin-top: -4px;
}

.vod-editor-shell .editor-tabs {
  padding: 8px 0;
  background: transparent;
}

.vod-editor-shell .editor-panels {
  max-height: none;
  padding: 0;
}

.vod-editor-shell .editor-tab-panel.is-active {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vod-local-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(151, 204, 255, 0.16);
  border-radius: 10px;
  background: rgba(5, 15, 26, 0.48);
}

.vod-local-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.vod-local-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.vod-local-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.vod-local-badges,
.vod-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.vod-local-badges {
  justify-content: flex-end;
}

.vod-local-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.vod-local-details div {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid rgba(151, 204, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.vod-local-details span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.vod-local-details strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vod-upload-box {
  display: grid;
  gap: 8px;
}

.vod-upload-box .muted-text {
  margin: 0;
  font-size: 0.82rem;
}

.vod-upload-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.vod-editor-actions {
  justify-content: flex-start;
}

/* Content redesign: graphite + petrol + silver, with wide VOD editors. */
body,
body:has(.app-shell:not(.is-hidden)) {
  background:
    linear-gradient(180deg, rgba(27, 127, 145, 0.08), transparent 30%),
    linear-gradient(135deg, #060708 0%, #0b1012 54%, #111719 100%);
}

body::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 26%, transparent 78%, rgba(0, 0, 0, 0.36)),
    radial-gradient(circle at 78% 8%, rgba(27, 127, 145, 0.10), transparent 28rem);
}

.app-main,
.dashboard-header.app-topbar,
.app-sidebar,
.panel-nav,
.section-heading,
.content-center-hub,
.content-center-main,
.content-center-toolbar,
.metric-card,
.status-panel,
.top10-panel,
.table-wrap,
.filters-row,
.panel-form,
.grid-form,
.inline-form,
.split-layout,
.content-editor,
.import-form,
.modal-card {
  border-color: var(--border);
  background-color: var(--surface);
}

.dashboard-header.app-topbar,
.section-heading,
.content-center-main,
.content-center-toolbar,
.inline-form,
.import-form,
.workspace-editor,
.modal-card {
  background:
    linear-gradient(180deg, rgba(226, 232, 234, 0.035), transparent 120px),
    rgba(17, 23, 25, 0.94);
}

.topbar-nav,
.panel-nav,
.app-sidebar {
  background:
    linear-gradient(180deg, rgba(15, 95, 111, 0.12), transparent 220px),
    var(--bg-soft);
}

.nav-button.is-active,
.content-center-tabs button.is-active,
.editor-tab.is-active,
button:not(.ghost-button):not(.nav-button):not(.editor-tab):not(.table-action):not(.channel-filter-chip):not(.topbar-menu-toggle) {
  color: var(--accent-2);
  border-color: rgba(183, 196, 201, 0.18);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 26px rgba(15, 95, 111, 0.20);
}

.ghost-button,
.table-action,
.vod-more-actions summary,
.content-center-tabs button,
.editor-tab,
.channel-filter-chip {
  color: var(--accent-2);
  border-color: rgba(190, 205, 210, 0.18);
  background: rgba(226, 232, 234, 0.045);
}

.ghost-button:hover,
.table-action:hover,
.vod-more-actions summary:hover,
.content-center-tabs button:hover,
.editor-tab:hover,
.channel-filter-chip:hover {
  border-color: rgba(183, 196, 201, 0.34);
  background: rgba(27, 127, 145, 0.12);
}

input,
select,
textarea {
  border-color: rgba(190, 205, 210, 0.22);
  background: rgba(226, 232, 234, 0.045);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(27, 127, 145, 0.16);
}

.eyebrow,
.nav-group,
th,
.import-selection-bar strong,
.editor-header span {
  color: var(--accent);
}

.content-editor::before {
  background: linear-gradient(90deg, var(--primary), var(--primary-2), transparent);
}

.advanced-panel,
.vod-tools-panel,
.vod-local-editor,
.modal-preview,
.debug-grid,
.diagnostic-output,
.preview-stage,
.image-field-preview {
  border-color: rgba(190, 205, 210, 0.16);
  background: rgba(24, 33, 36, 0.62);
}

.vod-advanced-tools {
  margin: 8px 0 12px;
  background: rgba(11, 16, 18, 0.70);
}

.vod-advanced-tools summary {
  min-height: 38px;
  color: var(--accent);
}

.vod-tools-grid .top10-panel,
.vod-tools-panel .top10-panel {
  border-radius: 10px;
  background: rgba(17, 23, 25, 0.72);
}

.table-wrap {
  background: rgba(11, 16, 18, 0.74);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  scrollbar-color: rgba(183, 196, 201, 0.42) transparent;
}

th {
  background: rgba(24, 33, 36, 0.86);
}

tbody tr:hover td,
tr.is-selected td {
  background: rgba(15, 95, 111, 0.10);
}

.status.pending,
.status.running,
.status.reviewing,
.status.medium,
.status.warning,
.status.expiring,
.table-action.warn,
.source-warning {
  color: #f1d99d;
}

.status.info,
.status.acknowledged {
  color: #cfe9ee;
  background: rgba(27, 127, 145, 0.18);
}

.status.expired,
.status.suspended,
.status.deleted,
.status.blocked,
.status.failed,
.status.error,
.status.possible_down,
.status.critical,
.status.high,
.table-action.danger,
.ghost-button.danger,
.source-error,
.preview-error {
  color: #ffced2;
}

.status.solved,
.status.resolved,
.status.low,
.status.completed,
.status.success,
.status.ok {
  color: #c9f2da;
  background: rgba(88, 197, 138, 0.14);
}

.upload-progress progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.modal-backdrop.vod-editor-modal {
  place-items: stretch end;
  padding: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
}

.vod-editor-modal .modal-card {
  width: min(1120px, calc(100vw - 28px));
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(226, 232, 234, 0.04), transparent 160px),
    var(--surface);
  box-shadow: -26px 0 70px rgba(0, 0, 0, 0.46);
}

.vod-editor-modal .modal-card h3 {
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 1.12rem;
  background: var(--surface-2);
}

.vod-editor-modal #modalBody {
  min-height: 0;
  overflow: hidden;
}

.vod-editor-modal .vod-editor-shell {
  height: 100%;
  margin: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.vod-editor-modal .editor-tabs {
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.vod-editor-modal .editor-panels {
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.vod-editor-modal .editor-tab-panel.is-active {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.vod-editor-modal .modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: rgba(24, 33, 36, 0.96);
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.28);
}

.modal-extra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: auto;
}

.vod-editor-modal .modal-actions button,
.modal-extra-actions button {
  width: auto;
  min-width: 128px;
}

.vod-editor-modal .vod-local-editor {
  background:
    linear-gradient(135deg, rgba(15, 95, 111, 0.14), transparent 44%),
    rgba(11, 16, 18, 0.74);
}

.vod-editor-modal .vod-local-details div {
  background: rgba(226, 232, 234, 0.035);
}

.status {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.status.active {
  color: #caffdf;
  background: rgba(77, 255, 157, 0.12);
}

.status.completed,
.status.success {
  color: #caffdf;
  background: rgba(77, 255, 157, 0.12);
}

.status.permitted {
  color: #caffdf;
  background: rgba(77, 255, 157, 0.12);
}

.status.expiring {
  color: #fff3bc;
  background: rgba(255, 205, 86, 0.14);
}

.status.pending,
.status.running,
.status.reviewing,
.status.medium {
  color: #fff3bc;
  background: rgba(255, 205, 86, 0.14);
}

.status.warning {
  color: #fff3bc;
  background: rgba(255, 205, 86, 0.14);
}

.status.info,
.status.acknowledged {
  color: #c7f7ff;
  background: rgba(25, 230, 255, 0.12);
}

.status.expired,
.status.suspended,
.status.deleted,
.status.blocked,
.status.failed,
.status.error,
.status.possible_down,
.status.critical,
.status.high {
  color: #ffd7f6;
  background: rgba(255, 79, 216, 0.12);
}

.status.solved,
.status.resolved,
.status.low {
  color: #caffdf;
  background: rgba(77, 255, 157, 0.12);
}

.status.ignored {
  color: #cfd8e3;
  background: rgba(142, 161, 181, 0.12);
}

.diagnostic-output {
  max-height: 320px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid rgba(0, 174, 239, 0.18);
  border-radius: 8px;
  background: rgba(2, 8, 18, 0.72);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal-card {
  width: min(960px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(20, 31, 45, 0.96), rgba(10, 17, 27, 0.98));
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.modal-card h3 {
  margin-bottom: 16px;
}

.modal-preview {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(25, 230, 255, 0.22);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(25, 230, 255, 0.07);
}

.local-movie-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.local-movie-upload-form .wide-field {
  grid-column: 1 / -1;
}

.upload-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
}

.upload-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.upload-progress progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.08);
}

.upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #00aeef, #00d4ff);
}

.debug-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) 1fr;
  gap: 8px 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.debug-grid span {
  color: var(--muted);
}

.preview-player {
  display: grid;
  gap: 12px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.preview-toolbar .ghost-button {
  width: auto;
  min-width: 118px;
}

.preview-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(25, 230, 255, 0.22);
  border-radius: 8px;
  background: #000;
}

.preview-video,
.preview-iframe-wrap,
.preview-iframe-wrap iframe {
  width: 100%;
  height: 100%;
}

.preview-video {
  display: block;
  background: #000;
}

.preview-iframe-wrap iframe {
  display: block;
  border: 0;
}

.preview-loading,
.preview-error {
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.preview-error {
  color: #ffd7f6;
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, transparent, rgba(10, 17, 27, 0.98) 28%);
}

.status-panel h3 {
  margin-bottom: 14px;
}

code {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--green);
  background: rgba(0, 0, 0, 0.26);
}

@media (max-width: 1080px) {
  .dashboard-view {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .dashboard-header,
  .panel-message {
    grid-column: 1 / -1;
  }

  .panel-nav {
    grid-column: 1;
  }

  .panel-view {
    grid-column: 2;
  }

  .panel-nav {
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 120px);
    display: grid;
    padding: 8px;
  }

  .nav-button {
    width: 50px;
    min-width: 50px;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  .nav-group {
    width: 100%;
    margin: 10px 0 3px;
    overflow: hidden;
    color: transparent;
    text-align: center;
  }

  .nav-group::before {
    color: var(--primary-2);
    content: "•";
  }

  .nav-button::before {
    color: var(--text);
    content: attr(data-short);
    font-size: 0.72rem;
    font-weight: 950;
  }

  .nav-button.is-active::before {
    color: #100d15;
  }

  .panel-view {
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .metrics-grid,
  .panel-row,
  .content-center-metrics,
  .import-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-center-main,
  .content-center-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .content-center-actions {
    justify-content: flex-start;
  }

  .inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-controls-grid,
  .import-preview-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-summary-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editor-tab-panel.is-active {
    grid-template-columns: 1fr;
  }

  .editor-tab-panel .wide-field,
  .editor-tab-panel .content-form-intro,
  .editor-tab-panel .modal-preview,
  .editor-tab-panel .image-field-preview,
  .editor-tab-panel .image-tools {
    grid-column: span 1;
  }

  .password-field-row {
    grid-template-columns: 1fr;
  }

  .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  #view-channel-imports .source-preview-table {
    min-width: 0;
  }

  #view-channel-imports .source-preview-table thead {
    display: none;
  }

  #view-channel-imports .source-preview-table,
  #view-channel-imports .source-preview-table tbody,
  #view-channel-imports .source-preview-table tr,
  #view-channel-imports .source-preview-table td {
    display: block;
    width: 100%;
  }

  #view-channel-imports .source-preview-table tr {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
  }

  #view-channel-imports .source-preview-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 7px 0;
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  #view-channel-imports .source-preview-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  #view-channel-imports .source-preview-table td:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-header {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    min-height: 58px;
    padding: 7px 8px;
  }

  .dashboard-brand {
    align-items: center;
    flex-direction: row;
  }

  .brand-logo.compact {
    width: 78px;
    height: 38px;
  }

  .session-actions {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .dashboard-brand .eyebrow,
  .dashboard-brand h2 {
    display: none;
  }

  .user-pill {
    max-width: 118px;
    min-height: 34px;
    padding: 0 8px;
  }

  #logoutButton {
    width: auto;
    min-width: 66px;
  }

  .metrics-grid,
  .panel-row,
  .content-center-metrics,
  .import-summary-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .m3u-import-workspace {
    padding: 12px;
  }

  .import-topbar,
  .import-job-header,
  .import-preview-heading,
  .import-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .import-controls-grid,
  .import-preview-toolbar,
  .import-summary-grid.compact {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: span 1;
  }

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

  .password-field-row {
    grid-template-columns: 1fr;
  }

  .credential-actions {
    display: grid;
  }

  .section-actions,
  .editor-actionbar,
  .quick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-actions button,
  .editor-actionbar button,
  .quick-actions button {
    width: 100%;
    min-width: 0;
  }

  .report-list-item {
    display: grid;
  }

  .report-list-item span {
    text-align: left;
  }
}

/* Final app-shell layer. Kept last on purpose so legacy section styles cannot win. */
.shell:has(.app-shell:not(.is-hidden)) {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body:has(.app-shell:not(.is-hidden)) {
  overflow: hidden;
}

.dashboard-view.app-shell {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.dashboard-view.app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.dashboard-view.app-shell.is-hidden {
  display: none;
}

.app-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 60px auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.dashboard-header.app-topbar {
  grid-column: auto;
  top: 0;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: rgba(23, 21, 29, 0.94);
  box-shadow: none;
}

.dashboard-header.app-topbar .eyebrow {
  display: none;
}

.dashboard-header.app-topbar .brand-logo.compact {
  width: 78px;
  height: 36px;
}

.app-sidebar {
  position: relative;
  top: auto;
  width: 100%;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 14px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.app-workspace {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px clamp(16px, 2.5vw, 34px) 34px;
}

.app-workspace > .panel-view {
  grid-column: auto;
  width: min(100%, 1360px);
  max-width: 1360px;
  margin: 0 auto;
}

.dashboard-view.sidebar-collapsed .app-sidebar {
  padding: 12px 8px;
}

.dashboard-view.sidebar-collapsed .nav-button {
  width: 56px;
  min-width: 56px;
  min-height: 42px;
  justify-content: center;
  padding: 0;
  color: transparent;
}

.dashboard-view.sidebar-collapsed .nav-button::before {
  content: attr(data-short);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 950;
}

.workspace-editor.is-editor-open {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 120;
  width: min(1120px, 92vw);
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  transform: translate(-50%, -50%);
  margin: 0;
  overflow: hidden;
}

.dashboard-view.editor-modal-active::after {
  position: fixed;
  inset: 0;
  z-index: 110;
  content: "";
  background: rgba(4, 3, 7, 0.68);
  backdrop-filter: blur(8px);
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.editor-panels {
  min-height: 0;
  overflow: auto;
}

.editor-tab-panel.is-active,
.compact-create-panel.is-editor-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.editor-tab-panel[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .dashboard-view.app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .app-main {
    grid-template-rows: 56px auto minmax(0, 1fr);
  }

  .dashboard-header.app-topbar {
    height: 56px;
    min-height: 56px;
  }

  .editor-tab-panel.is-active,
  .compact-create-panel.is-editor-open {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .dashboard-view.app-shell,
  .dashboard-view.app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(280px, 82vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .dashboard-view.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .dashboard-view.sidebar-collapsed .nav-button {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 12px;
    color: var(--muted);
  }

  .dashboard-view.sidebar-collapsed .nav-button::before {
    content: none;
  }

  .workspace-editor.is-editor-open {
    width: min(100vw - 18px, 1120px);
    max-height: calc(100vh - 18px);
  }
}

/* Master dashboard */
#view-dashboard {
  min-width: 0;
}

.dashboard-studio {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.dashboard-hero-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(168, 121, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    var(--surface);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

.dashboard-hero-panel h3 {
  margin: 2px 0 4px;
  font-size: clamp(1.35rem, 2.3vw, 2.25rem);
  line-height: 1.05;
}

.dashboard-hero-panel p {
  margin: 0;
  color: var(--muted);
}

.dashboard-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: end;
  gap: 10px;
}

.dashboard-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-controls select,
.dashboard-controls button {
  min-height: 38px;
  border-radius: 8px;
}

.dashboard-controls button {
  padding: 0 14px;
  border: 1px solid rgba(240, 195, 106, 0.55);
  background: rgba(240, 195, 106, 0.12);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-kpi {
  min-width: 0;
  min-height: 124px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)), var(--surface);
  overflow: hidden;
}

.dashboard-kpi span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-kpi strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi small {
  color: rgba(246, 240, 232, 0.66);
  font-weight: 750;
}

.dashboard-kpi.primary { border-color: rgba(168, 121, 255, 0.30); }
.dashboard-kpi.danger { border-color: rgba(239, 95, 108, 0.34); }
.dashboard-kpi.success { border-color: rgba(83, 214, 162, 0.32); }
.dashboard-kpi.gold,
.dashboard-kpi.money { border-color: rgba(240, 195, 106, 0.36); }
.dashboard-kpi.warning { border-color: rgba(245, 168, 75, 0.36); }
.dashboard-kpi.muted { border-color: rgba(190, 205, 210, 0.18); }

.dashboard-kpi-clickable {
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-kpi-clickable:hover,
.dashboard-kpi-clickable:focus-visible {
  outline: 0;
  border-color: rgba(226, 232, 234, 0.42);
  transform: translateY(-1px);
  box-shadow: inset 0 2px 0 rgba(60, 139, 154, 0.54), 0 18px 38px rgba(0, 0, 0, 0.28);
}

.dashboard-grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 12px;
}

.dashboard-business-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(23, 21, 29, 0.92);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
}

.dashboard-card.span-2 {
  grid-row: span 2;
}

.dashboard-list-card {
  align-content: start;
}

.dashboard-card-head {
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-card-head div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dashboard-card-head span,
.dashboard-card-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-card-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-mini-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.dashboard-mini-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dashboard-mini-item div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-mini-item strong,
.dashboard-mini-item b,
.dashboard-mini-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-mini-item strong {
  color: var(--text);
  font-size: 0.92rem;
}

.dashboard-mini-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.dashboard-mini-item b {
  color: var(--accent-2);
  font-size: 0.82rem;
}

.dashboard-mini-empty {
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 760;
}

.dashboard-bars {
  min-height: 248px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.dashboard-bar-item {
  min-width: 0;
  height: 248px;
  display: grid;
  grid-template-rows: 26px 1fr 20px;
  gap: 8px;
  text-align: center;
}

.dashboard-bar-value {
  overflow: hidden;
  color: rgba(246, 240, 232, 0.72);
  font-size: 0.74rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-track {
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.dashboard-bar-track span {
  width: 100%;
  min-height: 8px;
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
}

.dashboard-bar-item small {
  overflow: hidden;
  color: var(--muted);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-donut-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.dashboard-donut {
  width: 144px;
  height: 144px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
}

.dashboard-donut::after {
  position: absolute;
  inset: 22px;
  content: "";
  border-radius: 50%;
  background: var(--surface);
}

.dashboard-donut strong,
.dashboard-donut span {
  position: relative;
  z-index: 1;
}

.dashboard-donut strong {
  align-self: end;
  font-size: 1.55rem;
  line-height: 1;
}

.dashboard-donut span {
  align-self: start;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-legend,
.dashboard-hbars,
.dashboard-status-list,
.dashboard-actions-list {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.dashboard-legend-row,
.dashboard-hbar-row,
.dashboard-status-row {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.dashboard-legend-row {
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
}

.dashboard-legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dashboard-legend-row span,
.dashboard-hbar-row span,
.dashboard-status-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-legend-row strong,
.dashboard-status-row strong {
  color: var(--text);
  font-weight: 900;
}

.dashboard-hbar-row > div:first-child,
.dashboard-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-hbar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.dashboard-hbar-track span {
  height: 100%;
  min-width: 3px;
  display: block;
  border-radius: inherit;
}

.dashboard-system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-system-pill {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.dashboard-system-pill.ok {
  border-color: rgba(83, 214, 162, 0.32);
}

.dashboard-system-pill.bad {
  border-color: rgba(239, 95, 108, 0.36);
}

.dashboard-system-pill span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-system-pill strong {
  color: var(--text);
  font-size: 1.02rem;
}

.dashboard-status-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.dashboard-status-row:last-child {
  border-bottom: 0;
}

.dashboard-action {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.dashboard-action span,
.dashboard-action small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-action span {
  font-weight: 900;
}

.dashboard-action small {
  color: var(--muted);
  font-weight: 750;
}

.dashboard-action.warning {
  border-color: rgba(245, 168, 75, 0.36);
}

.dashboard-action.danger {
  border-color: rgba(239, 95, 108, 0.36);
}

.dashboard-action.info {
  border-color: rgba(168, 121, 255, 0.32);
}

.dashboard-action:hover,
.dashboard-action:focus-visible,
.dashboard-controls button:hover,
.dashboard-controls button:focus-visible {
  outline: 0;
  border-color: rgba(240, 195, 106, 0.78);
  background: rgba(240, 195, 106, 0.12);
}

.dashboard-empty-state {
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 760;
}

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

  .dashboard-business-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .dashboard-grid-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-card.span-2 {
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .dashboard-hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-controls {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-business-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-donut-wrap {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
}

@media (max-width: 560px) {
  .dashboard-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-bars {
    gap: 6px;
  }

  .dashboard-bar-item {
    grid-template-rows: 20px 1fr 18px;
  }
}

/* Ullum26 premium top navigation. This final layer removes the legacy sidebar visually. */
body:has(.app-shell:not(.is-hidden)) {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% -10%, rgba(244, 200, 90, 0.16), transparent 28rem),
    radial-gradient(circle at 84% 12%, rgba(255, 241, 168, 0.08), transparent 22rem),
    linear-gradient(135deg, #070706 0%, #0d0c09 48%, #040403 100%);
}

.dashboard-view.app-shell,
.dashboard-view.app-shell.sidebar-collapsed,
.dashboard-view.app-shell.no-sidebar {
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: transparent;
}

.dashboard-view.app-shell.is-hidden {
  display: none;
}

.app-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px auto minmax(0, 1fr);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 230, 160, 0.055), transparent 190px),
    transparent;
}

.dashboard-header.master-topbar,
.dashboard-header.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px;
  height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand nav actions";
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0 clamp(14px, 2vw, 26px);
  border: 0;
  border-bottom: 1px solid rgba(255, 230, 160, 0.12);
  border-radius: 0;
  background: rgba(10, 10, 8, 0.86);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.dashboard-brand {
  grid-area: brand;
  width: max-content;
  max-width: 260px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-header.app-topbar .brand-logo.compact,
.dashboard-brand .brand-logo.compact {
  width: 86px;
  height: 38px;
  object-fit: contain;
}

.topbar-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.topbar-title span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.topbar-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-nav.topbar-nav {
  grid-area: nav;
  grid-column: auto;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  min-width: 0;
  height: 100%;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  align-self: center;
  justify-self: center;
}

.app-sidebar,
.panel-nav.app-sidebar {
  display: none !important;
}

.topbar-nav .nav-group {
  display: none;
}

.topbar-nav .nav-button,
.top-nav-group > summary {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-nav .nav-button:hover,
.topbar-nav .nav-button:focus-visible,
.top-nav-group > summary:hover,
.top-nav-group > summary:focus-visible,
.top-nav-group[open] > summary,
.top-nav-group.is-active > summary,
.topbar-nav .nav-button.is-active {
  outline: 0;
  border-color: rgba(244, 200, 90, 0.42);
  background: rgba(244, 200, 90, 0.12);
  color: var(--text);
}

.topbar-nav .nav-button.is-active {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #17130a;
}

.top-nav-group {
  position: relative;
}

.top-nav-group > summary {
  list-style: none;
}

.top-nav-group > summary::-webkit-details-marker {
  display: none;
}

.top-nav-group > summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.72;
}

.top-nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 80;
  width: max-content;
  min-width: 220px;
  max-width: min(320px, 90vw);
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 8px;
  background: rgba(16, 16, 13, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
}

.top-nav-menu .nav-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.session-actions {
  grid-area: actions;
  grid-column: auto;
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.user-pill {
  max-width: 180px;
  overflow: hidden;
  border-color: rgba(244, 200, 90, 0.28);
  background: rgba(244, 200, 90, 0.08);
  color: var(--primary-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button,
.topbar-menu-toggle {
  min-height: 38px;
  border: 1px solid rgba(255, 230, 160, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 850;
}

.topbar-menu-toggle {
  display: none;
  padding: 0 12px;
}

.app-workspace {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px clamp(16px, 3vw, 42px) 40px;
}

.app-workspace > .panel-view {
  width: min(100%, 1440px);
  max-width: 1440px;
  margin: 0 auto;
}

.panel-message {
  justify-self: center;
  width: min(100% - 32px, 1440px);
  max-width: 1440px;
  margin: 10px auto 0;
  border-color: rgba(244, 200, 90, 0.22);
  background: rgba(244, 200, 90, 0.10);
  color: var(--primary-2);
}

.section-heading,
.dashboard-card,
.dashboard-kpi,
.metric-card,
.status-panel,
.content-center-hub,
.workspace-editor,
.login-card {
  border-color: rgba(255, 230, 160, 0.12);
  background: rgba(23, 23, 19, 0.88);
}

.metric-card {
  background:
    radial-gradient(circle at 24% 0%, rgba(244, 200, 90, 0.11), transparent 42%),
    linear-gradient(180deg, rgba(28, 28, 23, 0.94), rgba(15, 15, 12, 0.88));
}

.metric-card:hover {
  border-color: rgba(244, 200, 90, 0.34);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22), 0 0 28px rgba(244, 200, 90, 0.07);
}

.metric-card.cyan,
.metric-card.violet {
  box-shadow: inset 0 2px 0 var(--primary), 0 0 34px rgba(244, 200, 90, 0.08);
}

.metric-card.green {
  box-shadow: inset 0 2px 0 var(--success), 0 0 34px rgba(101, 217, 143, 0.08);
}

.metric-card.pink {
  box-shadow: inset 0 2px 0 var(--danger), 0 0 34px rgba(239, 95, 95, 0.08);
}

.section-heading {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

button:not(.ghost-button):not(.nav-button):not(.editor-tab):not(.topbar-menu-toggle):not(.dashboard-action):not(.table-action):not(.channel-filter-chip) {
  border-color: rgba(244, 200, 90, 0.42);
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #17130a;
}

button:not(.ghost-button):not(.nav-button):not(.editor-tab):not(.topbar-menu-toggle):not(.dashboard-action):not(.table-action):not(.channel-filter-chip):hover,
button:not(.ghost-button):not(.nav-button):not(.editor-tab):not(.topbar-menu-toggle):not(.dashboard-action):not(.table-action):not(.channel-filter-chip):focus-visible {
  border-color: rgba(255, 241, 168, 0.76);
  background: linear-gradient(135deg, #fff6bf, #f4c85a);
  color: #17130a;
}

.editor-tab.is-active,
.content-hub-tab.is-active {
  border-color: rgba(244, 200, 90, 0.50);
  background: rgba(244, 200, 90, 0.14);
  color: var(--primary-2);
}

.dashboard-hero-panel {
  border-color: rgba(255, 230, 160, 0.13);
  background:
    linear-gradient(135deg, rgba(244, 200, 90, 0.13), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    var(--surface);
}

.dashboard-kpi.primary,
.dashboard-action.info {
  border-color: rgba(244, 200, 90, 0.34);
}

.dashboard-bar-track span {
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
}

.dashboard-action:hover,
.dashboard-action:focus-visible,
.dashboard-controls button:hover,
.dashboard-controls button:focus-visible {
  border-color: rgba(244, 200, 90, 0.72);
  background: rgba(244, 200, 90, 0.12);
}

.dashboard-system-pill.ok,
.dashboard-kpi.success {
  border-color: rgba(101, 217, 143, 0.34);
}

.dashboard-system-pill.bad,
.dashboard-kpi.danger,
.dashboard-action.danger {
  border-color: rgba(239, 95, 95, 0.36);
}

.dashboard-kpi.warning,
.dashboard-action.warning {
  border-color: rgba(231, 168, 63, 0.36);
}

@media (max-width: 1180px) {
  .dashboard-header.master-topbar,
  .dashboard-header.app-topbar {
    grid-template-columns: auto auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
  }

  .topbar-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 3;
  }

  .session-actions {
    grid-column: 2;
  }

  .panel-nav.topbar-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: clamp(12px, 2vw, 24px);
    right: clamp(12px, 2vw, 24px);
    height: auto;
    max-height: min(68vh, 560px);
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 230, 160, 0.14);
    border-radius: 8px;
    background: rgba(12, 12, 10, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
  }

  .dashboard-view.topnav-open .panel-nav.topbar-nav {
    display: grid;
  }

  .topbar-nav .nav-button,
  .top-nav-group > summary {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .top-nav-group {
    min-width: 0;
  }

  .top-nav-menu {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 6px;
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .app-main {
    grid-template-rows: 56px auto minmax(0, 1fr);
  }

  .dashboard-header.master-topbar,
  .dashboard-header.app-topbar {
    height: 56px;
    min-height: 56px;
    gap: 10px;
  }

  .dashboard-header.app-topbar .brand-logo.compact,
  .dashboard-brand .brand-logo.compact {
    width: 72px;
    height: 32px;
  }

  .topbar-title span {
    display: none;
  }

  .user-pill {
    display: none;
  }

  .panel-nav.topbar-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-workspace {
    padding: 16px 12px 28px;
  }
}

/* Clients screen */
.clients-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.clients-summary-card {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 230, 160, 0.13);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(244, 200, 90, 0.10), transparent 48%),
    rgba(23, 23, 19, 0.90);
}

.clients-summary-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.clients-summary-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-summary-card small {
  color: rgba(255, 248, 232, 0.66);
  font-weight: 750;
}

.clients-summary-card.success {
  border-color: rgba(101, 217, 143, 0.34);
}

.clients-summary-card.warning {
  border-color: rgba(231, 168, 63, 0.38);
}

.clients-summary-card.danger {
  border-color: rgba(239, 95, 95, 0.38);
}

.clients-summary-card.info {
  border-color: rgba(244, 200, 90, 0.34);
}

.sellers-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.clients-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(150px, 0.7fr) minmax(140px, 0.7fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(255, 230, 160, 0.12);
  border-radius: 8px;
  background: rgba(23, 23, 19, 0.78);
}

.clients-toolbar label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.clients-toolbar input,
.clients-toolbar select {
  min-height: 38px;
}

.clients-search-field {
  min-width: 260px;
}

.client-quick-filter {
  min-height: 38px;
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  padding: 0 12px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text) !important;
  white-space: nowrap;
}

.client-quick-filter input {
  min-height: 0;
}

.clients-table-wrap {
  overflow: visible;
}

.clients-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.clients-table thead th {
  padding: 0 10px 6px;
  border: 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.clients-table tbody tr {
  background: rgba(23, 23, 19, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 230, 160, 0.10);
}

.clients-table tbody td {
  padding: 13px 10px;
  border: 0;
  vertical-align: middle;
}

.clients-table tbody td:first-child {
  border-radius: 8px 0 0 8px;
}

.clients-table tbody td:last-child {
  position: relative;
  border-radius: 0 8px 8px 0;
  overflow: visible;
}

.clients-table tbody tr.clients-empty-row td {
  padding: 22px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.table-sort-button {
  width: auto;
  min-height: 28px;
  justify-content: flex-start;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  font: inherit;
  text-transform: uppercase;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
  color: var(--primary-2) !important;
  outline: 0;
}

.table-sort-button span {
  min-width: 14px;
  display: inline-block;
  color: var(--primary);
}

.client-name-cell {
  color: var(--text);
}

.seller-parent {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}

.seller-credit-cell {
  min-width: 0;
  display: inline-grid;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid rgba(101, 217, 143, 0.32);
  border-radius: 8px;
  background: rgba(101, 217, 143, 0.11);
  color: #c7f8d7;
}

.seller-credit-cell strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}

.seller-credit-cell small {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.seller-credit-cell.low {
  border-color: rgba(231, 168, 63, 0.36);
  background: rgba(231, 168, 63, 0.12);
  color: #ffdca1;
}

.seller-credit-cell.empty {
  border-color: rgba(239, 95, 95, 0.36);
  background: rgba(239, 95, 95, 0.12);
  color: #ffc4c4;
}

.client-expiration {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.client-expiration strong,
.client-expiration small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-expiration small {
  color: var(--success);
  font-weight: 850;
}

.client-expiration small.is-warning {
  color: var(--warning);
}

.client-expiration small.is-danger {
  color: var(--danger);
}

.status.premium,
.status.demo,
.status.expiring {
  border-color: rgba(244, 200, 90, 0.34);
  background: rgba(244, 200, 90, 0.12);
  color: var(--primary-2);
}

.status.active {
  border-color: rgba(101, 217, 143, 0.34);
  background: rgba(101, 217, 143, 0.12);
  color: #bdf5d0;
}

.status.expired,
.status.deleted {
  border-color: rgba(239, 95, 95, 0.36);
  background: rgba(239, 95, 95, 0.12);
  color: #ffc4c4;
}

.status.suspended {
  border-color: rgba(231, 168, 63, 0.36);
  background: rgba(231, 168, 63, 0.12);
  color: #ffdca1;
}

.client-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.client-actions > .table-action {
  border-color: rgba(244, 200, 90, 0.46);
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #17130a;
}

.client-more-actions {
  position: relative;
}

.client-more-actions summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 230, 160, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}

.client-more-actions summary::-webkit-details-marker {
  display: none;
}

.client-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 70;
  min-width: 178px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 8px;
  background: rgba(16, 16, 13, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
}

.client-more-menu .table-action {
  width: 100%;
  justify-content: flex-start;
}

.clients-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 230, 160, 0.10);
  border-radius: 8px;
  background: rgba(23, 23, 19, 0.72);
}

.clients-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.clients-pagination select {
  min-height: 36px;
}

#clientsPaginationInfo {
  color: var(--muted);
  font-weight: 800;
}

.clients-pagination-actions {
  display: flex;
  gap: 8px;
}

.clients-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.client-detail-modal .modal-card {
  width: min(1180px, calc(100vw - 44px));
  padding: 0;
  overflow: hidden;
}

.client-detail-modal #modalTitle {
  margin: 0;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 230, 160, 0.10);
}

.client-detail-modal #modalBody {
  max-height: calc(100vh - 178px);
  overflow: auto;
}

.client-detail-modal #modalCancel {
  display: none;
}

.client-detail-shell {
  display: grid;
  gap: 14px;
  padding: 18px 22px 6px;
}

.client-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255, 230, 160, 0.12);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 0%, rgba(244, 200, 90, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.client-detail-title {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.client-detail-title h2 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.8rem, 3.1vw, 3.1rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-detail-title p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.client-detail-title .status {
  width: fit-content;
}

.client-detail-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.client-detail-quick .table-action {
  min-height: 36px;
}

.client-detail-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.client-detail-strip span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 230, 160, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-detail-strip strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.94rem;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.client-detail-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.client-detail-tabs button {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 230, 160, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.client-detail-tabs button.is-active {
  border-color: rgba(244, 200, 90, 0.48);
  background: rgba(244, 200, 90, 0.14);
  color: var(--text);
}

.client-detail-panel {
  min-height: 220px;
  padding: 14px 0 8px;
}

.client-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-detail-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 180px));
  margin-bottom: 12px;
}

.client-detail-metric,
.client-detail-empty,
.client-detail-list-item {
  border: 1px solid rgba(255, 230, 160, 0.10);
  border-radius: 8px;
  background: rgba(12, 13, 13, 0.58);
}

.client-detail-metric {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 14px;
}

.client-detail-metric span,
.client-detail-metric small,
.client-detail-empty span,
.client-detail-list-item span,
.client-detail-list-item small {
  color: var(--muted);
  font-weight: 760;
}

.client-detail-metric span {
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.client-detail-metric strong {
  overflow: hidden;
  color: var(--text);
  font-size: 1.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-detail-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.client-detail-empty strong {
  color: var(--text);
}

.client-detail-list {
  display: grid;
  gap: 10px;
}

.client-detail-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.client-detail-list-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.client-detail-list-item strong,
.client-detail-list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .clients-summary-grid,
  .sellers-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .clients-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-search-field {
    grid-column: 1 / -1;
  }

  .client-detail-hero {
    grid-template-columns: 1fr;
  }

  .client-detail-quick {
    justify-content: flex-start;
  }

  .client-detail-strip,
  .client-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .clients-summary-grid,
  .sellers-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .clients-search-field {
    min-width: 0;
  }

  .clients-table-wrap {
    overflow: visible;
  }

  .clients-table,
  .clients-table tbody,
  .clients-table tr,
  .clients-table td {
    display: block;
    width: 100%;
  }

  .clients-table thead {
    display: none;
  }

  .clients-table tbody {
    display: grid;
    gap: 10px;
  }

  .clients-table tbody tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
  }

  .clients-table tbody td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
  }

  .clients-table tbody tr.clients-empty-row td {
    display: block;
    padding: 18px 12px;
  }

  .clients-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .clients-table tbody tr.clients-empty-row td::before {
    content: none;
  }

  .clients-table tbody td:first-child,
  .clients-table tbody td:last-child {
    border-radius: 0;
  }

  .client-actions {
    justify-content: flex-start;
  }

  .client-more-menu {
    position: static;
    margin-top: 6px;
  }

  .clients-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .clients-pagination-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-detail-modal .modal-card {
    width: min(100%, calc(100vw - 22px));
  }

  .client-detail-shell {
    padding: 14px 14px 4px;
  }

  .client-detail-strip,
  .client-detail-grid,
  .client-detail-grid.compact,
  .client-detail-list-item {
    grid-template-columns: 1fr;
  }
}

/* Channel operations */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

#view-channels {
  --channel-sticky-top: 72px;
}

#view-channels.is-compact-mode .section-heading {
  margin-bottom: 8px;
  padding-block: 8px;
}

#view-channels.is-compact-mode .workspace-editor.is-editor-collapsed {
  margin-bottom: 8px;
}

#view-channels.is-compact-mode .channel-workbar {
  gap: 8px;
  margin: 8px 0;
  padding: 8px;
}

#view-channels.is-compact-mode .channel-table tbody td {
  padding: 9px 8px;
}

#view-channels.is-compact-mode .entity-cell {
  min-height: 42px;
}

.channel-workbar {
  position: sticky;
  top: var(--channel-sticky-top);
  z-index: 16;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr) minmax(170px, 0.5fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(255, 230, 160, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 28, 22, 0.96), rgba(18, 17, 14, 0.94));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.channel-workbar .channel-main-search {
  min-width: 0;
}

.channel-workbar > label:nth-of-type(2) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.channel-quick-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-filter-chip {
  min-height: 30px;
  width: auto;
  padding: 0 10px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  box-shadow: none;
}

.channel-filter-chip.is-active,
.channel-filter-chip:hover,
.channel-filter-chip:focus-visible {
  border-color: rgba(244, 200, 90, 0.52);
  background: rgba(244, 200, 90, 0.14);
  color: var(--primary-2);
}

.channel-bulk-bar {
  position: sticky;
  top: calc(var(--channel-sticky-top) + 92px);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(244, 200, 90, 0.24);
  border-radius: 8px;
  background: rgba(24, 22, 18, 0.96);
}

.channel-bulk-bar.is-hidden {
  display: none;
}

.channel-bulk-bar strong {
  color: var(--primary-2);
}

.channel-bulk-bar label {
  min-width: 180px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.channel-table-wrap {
  max-height: calc(100vh - 188px);
  overflow: auto;
}

.channel-table {
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
}

.channel-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(18, 17, 14, 0.98);
  box-shadow: inset 0 -1px rgba(255, 230, 160, 0.13);
}

.channel-table tbody td {
  padding: 12px 10px;
  vertical-align: middle;
}

.channel-select-col {
  width: 42px;
  text-align: center;
}

.channel-row-actions {
  position: relative;
  justify-content: flex-end;
  gap: 7px;
}

.channel-row-actions > .table-action {
  min-height: 31px;
}

.channel-more-actions {
  position: relative;
}

.channel-more-actions summary {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 230, 160, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.channel-more-actions summary::-webkit-details-marker {
  display: none;
}

.channel-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 90;
  min-width: 180px;
  max-height: min(320px, calc(100vh - 180px));
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 8px;
  background: rgba(16, 16, 13, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
}

.channel-more-actions.open-up .channel-more-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.channel-more-menu .table-action {
  width: 100%;
  justify-content: flex-start;
}

.channel-empty-row td {
  padding: 24px !important;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.channel-drawer-modal {
  place-items: stretch end;
  padding: 0;
  background: rgba(0, 0, 0, 0.52);
}

.channel-drawer-modal .modal-card {
  width: min(720px, calc(100vw - 34px));
  max-height: 100vh;
  height: 100vh;
  border-radius: 16px 0 0 16px;
  border-color: rgba(255, 230, 160, 0.18);
  background:
    linear-gradient(180deg, rgba(29, 27, 22, 0.98), rgba(14, 14, 12, 0.99));
}

.channel-drawer-modal .modal-card h3 {
  position: sticky;
  top: -22px;
  z-index: 4;
  margin: -22px -22px 12px;
  padding: 18px 22px 12px;
  background: rgba(18, 17, 14, 0.98);
}

.channel-drawer-modal .modal-actions {
  position: sticky;
  bottom: -22px;
  z-index: 4;
  margin: 16px -22px -22px;
  padding: 12px 22px;
  background: rgba(18, 17, 14, 0.98);
}

.channel-drawer-actionbar {
  position: sticky;
  top: 34px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
  padding: 10px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 8px;
  background: rgba(21, 20, 17, 0.96);
}

.channel-drawer-tabs {
  position: sticky;
  top: 94px;
  z-index: 5;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid rgba(255, 230, 160, 0.12);
  border-radius: 8px;
  background: rgba(16, 15, 13, 0.95);
}

.channel-drawer-tabs button {
  flex: 0 0 auto;
  min-height: 30px;
  width: auto;
  padding: 0 10px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.channel-drawer-tabs button.is-active,
.channel-drawer-tabs button:hover,
.channel-drawer-tabs button:focus-visible {
  border-color: rgba(244, 200, 90, 0.50);
  background: rgba(244, 200, 90, 0.13);
  color: var(--primary-2);
}

@media (max-width: 1024px) {
  .channel-workbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .channel-quick-chips {
    grid-column: 1 / -1;
  }

  .channel-table {
    min-width: 960px;
  }
}

@media (max-width: 820px) {
  #view-channels {
    --channel-sticky-top: 56px;
  }

  .channel-workbar {
    grid-template-columns: minmax(0, 1fr);
    top: 56px;
  }

  .channel-table-wrap {
    max-height: none;
    overflow: visible;
  }

  .channel-table,
  .channel-table tbody,
  .channel-table tr,
  .channel-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .channel-table thead {
    display: none;
  }

  .channel-table tbody {
    display: grid;
    gap: 10px;
  }

  .channel-table tbody tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 230, 160, 0.10);
    border-radius: 8px;
    background: rgba(23, 23, 19, 0.82);
  }

  .channel-table tbody td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
  }

  .channel-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .channel-table tbody td:nth-child(3),
  .channel-table tbody td:nth-child(6),
  .channel-table tbody td:nth-child(8),
  .channel-table tbody td:nth-child(9) {
    display: none;
  }

  .channel-select-col {
    text-align: left;
  }

  .channel-row-actions {
    justify-content: flex-start;
  }

  .channel-more-menu {
    position: static;
    margin-top: 6px;
  }

  .channel-bulk-bar {
    top: 0;
  }

  .channel-drawer-modal .modal-card {
    width: min(100vw, 720px);
    border-radius: 0;
  }
}

@media (max-width: 430px) {
  .channel-quick-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .channel-filter-chip {
    flex: 0 0 auto;
  }

  .channel-table tbody td {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .channel-row-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Clean channel workspace */
#view-channels {
  --channel-sticky-top: 58px;
}

#view-channels .section-heading {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
}

#view-channels .section-heading h3 {
  font-size: 1.24rem;
}

.channel-heading-note {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.channel-workbar {
  grid-template-columns: minmax(260px, 1.4fr) minmax(118px, 0.55fr) minmax(118px, 0.55fr) minmax(160px, 0.7fr) auto auto auto auto;
  gap: 8px;
  align-items: end;
  margin: 8px 0 6px;
  padding: 9px;
  border-radius: 10px;
}

.channel-workbar .channel-main-search {
  order: 1;
}

.channel-workbar > label:nth-of-type(2) {
  display: none;
}

.channel-status-filter {
  order: 2;
}

.channel-type-filter {
  order: 3;
}

.channel-category-filter {
  order: 4;
}

.channel-more-filters {
  order: 5;
  position: relative;
  align-self: end;
}

.channel-more-filters summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 230, 160, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}

.channel-more-filters summary::-webkit-details-marker {
  display: none;
}

.channel-more-filters.has-active-filter summary {
  border-color: rgba(244, 200, 90, 0.45);
  color: var(--primary-2);
}

.channel-more-filters .channel-quick-chips {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(360px, 88vw);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 10px;
  background: rgba(16, 16, 13, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

.channel-more-filters:not([open]) .channel-quick-chips {
  display: none;
}

.filter-clear-button {
  order: 6;
  align-self: end;
}

.channel-compact-toggle {
  order: 7;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 230, 160, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: none;
}

.channel-compact-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary-2);
}

#channelToolbarNewButton {
  order: 8;
  align-self: end;
  min-height: 36px;
}

.channel-filter-chip {
  min-height: 26px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.channel-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.channel-summary-badges span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 230, 160, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.026);
}

.channel-table-wrap {
  max-height: calc(100vh - 174px);
  padding-bottom: 88px;
}

#view-channels.is-compact-mode .channel-workbar {
  margin: 5px 0;
  padding: 7px;
}

#view-channels.is-compact-mode .channel-summary-badges {
  margin-bottom: 4px;
}

#view-channels.is-compact-mode .channel-table tbody td {
  padding: 7px 8px;
}

#createChannelForm.workspace-editor.is-editor-open {
  top: 0;
  right: 0;
  left: auto;
  width: min(760px, calc(100vw - 28px));
  height: 100vh;
  max-height: 100vh;
  transform: none;
  border-radius: 14px 0 0 14px;
}

#view-channels #createChannelForm .editor-tabs,
.channel-drawer-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
}

#view-channels #createChannelForm .editor-tab {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.75rem;
}

#view-channels #createChannelForm .editor-panels {
  max-height: none;
}

#view-channels #createChannelForm .editor-tab-panel.is-active {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.channel-drawer-modal .modal-card {
  width: min(760px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.channel-drawer-modal .modal-card h3 {
  top: 0;
  margin: 0;
  padding: 14px 18px 10px;
}

.channel-drawer-modal #modalBody {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding: 10px 18px 0;
}

.channel-drawer-modal #modalBody > label,
.channel-drawer-modal #modalBody > .modal-preview,
.channel-drawer-modal #modalBody > .content-form-intro,
.channel-drawer-modal #modalBody > .channel-drawer-tabs,
.channel-drawer-modal #modalBody > .advanced-panel,
.channel-drawer-modal #modalBody > .channel-drawer-actionbar {
  min-width: 0;
}

.channel-drawer-modal #modalBody > .content-form-intro,
.channel-drawer-modal #modalBody > .channel-drawer-tabs,
.channel-drawer-modal #modalBody > .advanced-panel,
.channel-drawer-modal #modalBody > .channel-drawer-actionbar,
.channel-drawer-modal #modalBody > .modal-preview {
  grid-column: 1 / -1;
}

.channel-drawer-modal .modal-actions {
  display: none;
}

.channel-drawer-modal .advanced-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.channel-drawer-modal .advanced-panel > summary {
  display: none;
}

.channel-drawer-modal .advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.channel-drawer-modal .advanced-grid .wide-field,
.channel-drawer-modal .advanced-grid .modal-preview,
.channel-drawer-modal .advanced-grid .editor-section-title {
  grid-column: 1 / -1;
}

.channel-drawer-actionbar {
  position: sticky;
  bottom: 0;
  top: auto;
  z-index: 8;
  margin: 8px -18px 0;
  padding: 10px 18px;
  border-radius: 0;
  border-width: 1px 0 0;
  background: rgba(18, 17, 14, 0.98);
}

.channel-drawer-actionbar button {
  width: auto;
  min-height: 34px;
  min-width: 112px;
}

.channel-source-manager {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(20, 118, 132, 0.16), rgba(255, 255, 255, 0.035));
}

.channel-source-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.channel-source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.channel-source-item strong,
.channel-source-item span,
.channel-source-item small {
  display: block;
}

.channel-source-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-source-actions,
.channel-source-add-grid {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.channel-source-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.channel-source-add-grid label {
  flex: 1 1 180px;
}

.channel-source-add-grid .wide-field {
  flex-basis: 100%;
}

.channel-xui-builder {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.channel-xui-builder summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}

.channel-sources-cell {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.channel-source-current {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(91, 255, 184, 0.2);
  background: rgba(91, 255, 184, 0.08);
  color: #d9ffe9;
  font-size: 0.7rem;
  font-weight: 900;
}

.channel-source-current em {
  color: var(--muted);
  font-style: normal;
}

.channel-source-select {
  min-height: 32px;
  padding: 0 30px 0 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.channel-sources-cell small {
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-sources-cell .table-action {
  width: fit-content;
  min-height: 28px;
}

.channel-drawer-tabs {
  position: sticky;
  top: 0;
  margin: -10px -18px 0;
  padding: 8px 18px;
  border-radius: 0;
}

@media (max-width: 1024px) {
  .channel-workbar {
    grid-template-columns: minmax(0, 1fr) minmax(116px, 0.45fr) minmax(116px, 0.45fr) minmax(150px, 0.6fr);
  }
}

@media (max-width: 820px) {
  .channel-workbar {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.45fr);
  }

  .channel-more-filters .channel-quick-chips {
    right: auto;
    left: 0;
  }

  #createChannelForm.workspace-editor.is-editor-open,
  .channel-drawer-modal .modal-card {
    width: min(100vw, 760px);
    border-radius: 0;
  }

  #view-channels #createChannelForm .editor-tab-panel.is-active,
  .channel-drawer-modal #modalBody,
  .channel-drawer-modal .advanced-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .channel-workbar {
    grid-template-columns: 1fr;
  }

  .channel-more-filters .channel-quick-chips {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .channel-compact-toggle,
  #channelToolbarNewButton,
  .filter-clear-button {
    width: 100%;
    justify-content: center;
  }
}

/* Channel table polish */
.channel-table {
  min-width: 980px;
}

.channel-table tbody td {
  padding: 9px 10px;
}

.channel-type-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.channel-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0 8px;
  border: 1px solid rgba(255, 230, 160, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.channel-badge.ok {
  border-color: rgba(101, 217, 143, 0.22);
  background: rgba(101, 217, 143, 0.10);
  color: #caffdf;
}

.channel-badge.warning,
.channel-badge.proxy {
  border-color: rgba(244, 200, 90, 0.25);
  background: rgba(244, 200, 90, 0.10);
  color: #fff1b8;
}

.channel-badge.danger {
  border-color: rgba(239, 95, 95, 0.26);
  background: rgba(239, 95, 95, 0.11);
  color: #ffd3d3;
}

.channel-badge.info {
  border-color: rgba(157, 215, 255, 0.22);
  background: rgba(157, 215, 255, 0.09);
  color: #d8efff;
}

.channel-badge.drm {
  border-color: rgba(244, 200, 90, 0.34);
  background: rgba(244, 200, 90, 0.13);
  color: var(--primary-2);
}

.channel-badge.neutral {
  color: var(--muted);
}

.channel-row-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.channel-row-actions > .table-action,
.channel-more-actions summary {
  min-height: 30px;
  border-radius: 7px;
}

.channel-more-menu {
  min-width: 168px;
  gap: 2px;
  padding: 6px;
  border-color: rgba(244, 200, 90, 0.18);
  background:
    linear-gradient(180deg, rgba(24, 23, 20, 0.99), rgba(13, 13, 11, 0.99));
}

.channel-more-menu .table-action {
  min-height: 29px;
  justify-content: flex-start;
  padding: 0 9px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  box-shadow: none;
}

.channel-more-menu .table-action.warn,
.channel-more-menu .table-action.danger {
  border-color: transparent;
  color: var(--text);
}

.channel-more-menu .table-action:hover,
.channel-more-menu .table-action:focus-visible {
  border-color: rgba(244, 200, 90, 0.18);
  background: rgba(244, 200, 90, 0.11);
  color: var(--primary-2);
}

.channel-more-menu .table-action.danger:hover,
.channel-more-menu .table-action.danger:focus-visible {
  border-color: rgba(239, 95, 95, 0.20);
  background: rgba(239, 95, 95, 0.10);
  color: #ffd3d3;
}

.channel-bulk-bar {
  min-height: 42px;
  gap: 6px;
  margin-bottom: 7px;
  padding: 8px;
}

.channel-bulk-bar .ghost-button,
.channel-bulk-bar select {
  min-height: 30px;
}

.channel-bulk-bar [disabled] {
  opacity: 0.52;
}

.vod-bulk-bar {
  position: static;
  top: auto;
  margin: 0 0 10px;
}

@media (max-width: 820px) {
  .channel-table {
    min-width: 0;
  }

  .channel-table tbody td:nth-child(6),
  .channel-table tbody td:nth-child(9) {
    display: grid;
  }

  .channel-table tbody td:nth-child(7),
  .channel-table tbody td:nth-child(8) {
    display: none;
  }

  .channel-row-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .channel-more-actions {
    max-width: 100%;
  }

  .channel-more-menu {
    max-width: min(100%, calc(100vw - 32px));
  }
}

@media (max-width: 430px) {
  .channel-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-row-actions > .table-action,
  .channel-more-actions,
  .channel-more-actions summary {
    width: 100%;
    justify-content: center;
  }

  .channel-more-menu {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  #view-movies .table-wrap,
  #view-series .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #view-movies table,
  #view-series table {
    min-width: 0;
  }

  #view-movies thead,
  #view-series thead {
    display: none;
  }

  #view-movies tbody,
  #view-series tbody {
    display: grid;
    gap: 10px;
  }

  #view-movies tbody tr,
  #view-series tbody tr {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(151, 204, 255, 0.16);
    border-radius: 10px;
    background: rgba(12, 19, 30, 0.78);
  }

  #view-movies tbody td,
  #view-series tbody td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  #view-movies tbody td::before,
  #view-series tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  #view-movies tbody td:first-child,
  #view-series tbody td:first-child {
    grid-template-columns: 1fr;
  }

  #view-movies tbody td:first-child::before,
  #view-series tbody td:first-child::before {
    display: none;
  }

  .vod-row-actions {
    justify-content: flex-start;
  }

  .vod-more-menu {
    left: 0;
    right: auto;
    max-width: min(100%, calc(100vw - 32px));
  }

  .vod-local-heading {
    display: grid;
  }

  .vod-local-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .vod-editor-shell .editor-tab-panel.is-active {
    grid-template-columns: 1fr;
  }

  .vod-tools-grid {
    grid-template-columns: 1fr;
  }

  #view-movies tbody td,
  #view-series tbody td {
    grid-template-columns: 1fr;
  }

  #view-movies tbody td::before,
  #view-series tbody td::before {
    margin-bottom: -4px;
  }

  .vod-row-actions {
    flex-wrap: wrap;
  }

  .vod-row-actions > .table-action,
  .vod-more-actions,
  .vod-more-actions summary {
    width: 100%;
    justify-content: center;
  }

  .vod-more-menu {
    width: 100%;
    min-width: 0;
  }
}

/* Content workspace final finish: graphite, petrol blue and silver. Keep this last so legacy accent layers do not bleed into the redesigned flow. */
body:has(.app-shell:not(.is-hidden)) {
  background:
    radial-gradient(circle at 18% -12%, rgba(15, 95, 111, 0.22), transparent 30rem),
    radial-gradient(circle at 84% 10%, rgba(183, 196, 201, 0.08), transparent 24rem),
    linear-gradient(135deg, #060708 0%, #0a1114 48%, #040506 100%);
}

.app-main {
  background:
    linear-gradient(180deg, rgba(15, 95, 111, 0.12), transparent 190px),
    transparent;
}

.dashboard-header.master-topbar,
.dashboard-header.app-topbar {
  border-bottom-color: rgba(190, 205, 210, 0.13);
  background: rgba(8, 12, 14, 0.88);
}

.topbar-nav .nav-button:hover,
.topbar-nav .nav-button:focus-visible,
.top-nav-group > summary:hover,
.top-nav-group > summary:focus-visible,
.top-nav-group[open] > summary,
.top-nav-group.is-active > summary,
.topbar-nav .nav-button.is-active,
.channel-filter-chip.is-active,
.channel-filter-chip:hover,
.channel-filter-chip:focus-visible,
.client-quick-filter:hover,
.client-quick-filter:focus-visible {
  border-color: rgba(60, 139, 154, 0.44);
  background: rgba(15, 95, 111, 0.16);
  color: var(--text);
}

.topbar-nav .nav-button.is-active {
  background: linear-gradient(135deg, #1b7f91, #0f5f6f);
  color: #f2f7f8;
}

.top-nav-menu,
.channel-more-menu,
.vod-more-menu {
  border-color: rgba(190, 205, 210, 0.14);
  background: linear-gradient(180deg, rgba(18, 25, 28, 0.99), rgba(8, 12, 14, 0.99));
}

.content-center-card,
.content-center-hub,
.dashboard-card,
.table-wrap,
.clients-summary-card,
.clients-toolbar,
.channel-workbar,
.channel-bulk-bar,
.advanced-panel,
.import-topbar,
.import-job-tray,
.import-hidden-toggle,
.vod-tools-panel,
.vod-advanced-tools,
.vod-local-upload-panel,
.vod-local-editor,
.vod-editor-shell,
.vod-editor-actions,
#view-movies tbody tr,
#view-series tbody tr {
  border-color: rgba(190, 205, 210, 0.14);
  background: linear-gradient(180deg, rgba(18, 26, 30, 0.90), rgba(9, 14, 17, 0.88));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.content-center-card::before,
.content-center-hub::before {
  background: linear-gradient(90deg, transparent, rgba(60, 139, 154, 0.28), transparent);
}

.metric-card,
.dashboard-kpi,
.dashboard-kpi.gold,
.metric-card.cyan,
.metric-card.violet,
.metric-card.pink {
  border-color: rgba(190, 205, 210, 0.14);
  background:
    radial-gradient(circle at 20% 0%, rgba(15, 95, 111, 0.14), transparent 46%),
    rgba(17, 24, 27, 0.90);
  box-shadow: inset 0 2px 0 rgba(60, 139, 154, 0.42), 0 18px 34px rgba(0, 0, 0, 0.22);
}

.metric-card small,
.dashboard-kpi small,
.clients-summary-card small {
  color: rgba(226, 232, 234, 0.66);
}

.brand-mark,
.user-pill,
.content-center-featured,
.channel-summary-badge,
.channel-badge,
.metadata-status-badge,
.status,
.vod-local-badge,
.vod-local-pill {
  border-color: rgba(190, 205, 210, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.channel-badge.warning,
.channel-badge.proxy,
.channel-badge.drm,
.metadata-status-badge.warning,
.status.warning {
  border-color: rgba(216, 168, 77, 0.26);
  background: rgba(216, 168, 77, 0.10);
  color: #ead3a4;
}

.channel-badge.info,
.metadata-status-badge.info,
.status.info,
.status.processing,
.status.queued {
  border-color: rgba(60, 139, 154, 0.30);
  background: rgba(15, 95, 111, 0.12);
  color: #c5dde2;
}

.channel-badge.ok,
.metadata-status-badge.ready,
.status.ready,
.status.success,
.status.completed {
  border-color: rgba(88, 197, 138, 0.26);
  background: rgba(88, 197, 138, 0.10);
  color: #bfead0;
}

.channel-badge.danger,
.metadata-status-badge.error,
.status.error,
.status.danger,
.status.failed {
  border-color: rgba(223, 92, 99, 0.28);
  background: rgba(223, 92, 99, 0.11);
  color: #efc5c7;
}

.channel-filter-chip,
.client-quick-filter,
.channel-more-actions summary,
.vod-more-actions summary,
.table-action,
.ghost-button,
.editor-tabs button,
.chip-toggle {
  border-color: rgba(190, 205, 210, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.channel-more-menu .table-action:hover,
.channel-more-menu .table-action:focus-visible,
.vod-more-menu .table-action:hover,
.vod-more-menu .table-action:focus-visible,
.table-action:hover,
.table-action:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.editor-tabs button:hover,
.editor-tabs button:focus-visible,
.editor-tabs button.is-active {
  border-color: rgba(60, 139, 154, 0.42);
  background: rgba(15, 95, 111, 0.15);
  color: var(--text);
}

button:not(.ghost-button):not(.table-action):not(.danger):not(.warn),
.primary-button,
.modal-actions button:not(.ghost-button) {
  border-color: rgba(60, 139, 154, 0.52);
  background: linear-gradient(135deg, #1b7f91, #0f5f6f);
  color: #f2f7f8;
}

button:not(.ghost-button):not(.table-action):not(.danger):not(.warn):hover,
.primary-button:hover,
.modal-actions button:not(.ghost-button):hover {
  border-color: rgba(183, 196, 201, 0.34);
  filter: brightness(1.06);
}

input,
select,
textarea {
  border-color: rgba(190, 205, 210, 0.16);
  background: rgba(5, 9, 11, 0.76);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(60, 139, 154, 0.60);
  box-shadow: 0 0 0 3px rgba(15, 95, 111, 0.18);
}

.channel-table thead th,
table thead th {
  background: rgba(12, 18, 21, 0.98);
  box-shadow: inset 0 -1px rgba(190, 205, 210, 0.12);
}

table tbody tr:hover,
table tbody tr.is-selected,
.channel-table tbody tr:hover {
  background: rgba(15, 95, 111, 0.11);
}

.upload-progress span,
.content-center-progress span,
.vod-local-progress span {
  background: linear-gradient(90deg, #1b7f91, #5c9aaa);
}

.modal-backdrop.vod-editor-modal {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: rgba(3, 5, 6, 0.62);
}

.vod-editor-modal .modal-card {
  width: min(1180px, calc(100vw - 92px));
  max-width: none;
  height: 100vh;
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-color: rgba(190, 205, 210, 0.18);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(18, 25, 28, 0.98), rgba(7, 11, 13, 0.99));
}

.vod-editor-modal #modalBody {
  overflow: auto;
}

.vod-editor-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid rgba(190, 205, 210, 0.12);
  background: rgba(7, 11, 13, 0.94);
}

.modal-extra-actions {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

@media (max-width: 820px) {
  .vod-editor-modal .modal-card {
    width: 100vw;
  }

  #view-movies tbody tr,
  #view-series tbody tr {
    border-color: rgba(190, 205, 210, 0.14);
    background: rgba(12, 18, 21, 0.90);
  }
}

/* VOD creation editors: professional drawer, no centered modal, no blurred backdrop. */
.dashboard-view.vod-create-editor-active::after {
  display: none;
}

.vod-create-editor.workspace-editor.is-editor-open {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 120;
  width: min(920px, calc(100vw - 48px));
  min-width: min(760px, 100vw);
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transform: none;
  border: 0;
  border-left: 1px solid rgba(190, 205, 210, 0.18);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(27, 127, 145, 0.08), transparent 180px),
    #0b1012;
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.38);
}

.vod-create-editor .editor-header {
  min-height: 58px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(190, 205, 210, 0.14);
  background: rgba(17, 23, 25, 0.96);
}

.vod-create-editor .editor-header span {
  color: var(--accent);
  font-size: 0.66rem;
  letter-spacing: 0;
}

.vod-create-editor .editor-header strong {
  font-size: 1rem;
}

.vod-create-editor .editor-tabs {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(190, 205, 210, 0.12);
  background: rgba(11, 16, 18, 0.94);
  scrollbar-width: thin;
  scrollbar-color: rgba(183, 196, 201, 0.38) transparent;
}

.vod-create-editor .editor-tab {
  width: auto;
  min-width: max-content;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(190, 205, 210, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  box-shadow: none;
}

.vod-create-editor .editor-tab.is-active {
  border-color: rgba(60, 139, 154, 0.48);
  background: rgba(15, 95, 111, 0.26);
  color: var(--text);
}

.vod-create-editor .editor-panels {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 18px;
  background: transparent;
}

.vod-create-editor .editor-tab-panel.is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  padding: 0;
}

.vod-create-editor .editor-tab-panel > label,
.vod-create-editor .editor-tab-panel > .content-form-intro,
.vod-create-editor .editor-tab-panel > .modal-preview,
.vod-create-editor .editor-tab-panel > .vod-create-hint,
.vod-create-editor .editor-tab-panel > .source-inline-actions {
  min-width: 0;
}

.vod-create-editor .editor-tab-panel .wide-field,
.vod-create-editor .editor-tab-panel .content-form-intro,
.vod-create-editor .editor-tab-panel .modal-preview,
.vod-create-editor .editor-tab-panel .vod-create-hint,
.vod-create-editor .editor-tab-panel .source-inline-actions,
.vod-create-editor .editor-tab-panel .iframe-source-field.wide-field {
  grid-column: 1 / -1;
}

.vod-create-editor .content-form-intro {
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.vod-create-editor .content-form-intro strong {
  font-size: 1.15rem;
}

.vod-create-editor .content-form-intro span,
.vod-create-editor .vod-create-hint,
.vod-create-editor .muted-text {
  color: var(--muted);
}

.vod-create-editor label {
  display: grid;
  gap: 6px;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 850;
  text-transform: uppercase;
}

.vod-create-editor input,
.vod-create-editor select,
.vod-create-editor textarea {
  min-width: 0;
  min-height: 40px;
  border-radius: 8px;
  border-color: rgba(190, 205, 210, 0.16);
  background: rgba(5, 9, 11, 0.72);
  color: var(--text);
  font-size: 0.9rem;
}

.vod-create-editor textarea {
  min-height: 96px;
  resize: vertical;
}

.vod-create-editor .quick-source-field textarea {
  min-height: 112px;
}

.vod-create-editor .source-inline-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: -4px;
}

.vod-create-editor .source-inline-actions button {
  width: auto;
  min-width: 136px;
  min-height: 36px;
}

.vod-create-editor .vod-create-hint {
  padding: 12px 14px;
  border: 1px solid rgba(190, 205, 210, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.vod-create-editor .advanced-panel {
  display: contents;
}

.vod-create-editor .advanced-panel > summary {
  display: none;
}

.vod-create-editor .advanced-grid {
  display: contents;
}

.vod-create-editor .editor-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid rgba(190, 205, 210, 0.14);
  border-radius: 0;
  background: rgba(7, 11, 13, 0.96);
  box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: none;
}

.vod-create-editor .editor-actionbar button {
  width: auto;
  min-width: 118px;
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.78rem;
}

.vod-editor-modal .modal-card {
  width: min(920px, calc(100vw - 48px));
  min-width: min(760px, 100vw);
}

.vod-editor-modal .editor-tabs {
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 14px;
}

.vod-editor-modal .editor-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.76rem;
}

.vod-editor-modal .editor-panels {
  padding: 18px;
}

.vod-editor-modal .editor-tab-panel.is-active {
  gap: 14px;
  align-items: start;
}

.vod-editor-modal .modal-actions {
  min-height: 58px;
  padding: 10px 14px;
}

.vod-editor-modal .modal-actions button,
.modal-extra-actions button {
  min-width: 118px;
  min-height: 36px;
  font-size: 0.78rem;
}

@media (max-width: 1024px) {
  .vod-create-editor.workspace-editor.is-editor-open,
  .vod-editor-modal .modal-card {
    width: calc(100vw - 24px);
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .vod-create-editor.workspace-editor.is-editor-open,
  .vod-editor-modal .modal-card {
    inset: 0;
    width: 100vw;
    min-width: 0;
    border-left: 0;
  }

  .vod-create-editor .editor-tab-panel.is-active,
  .vod-editor-modal .editor-tab-panel.is-active {
    grid-template-columns: 1fr;
  }

  .vod-create-editor .editor-panels,
  .vod-editor-modal .editor-panels {
    padding: 14px;
  }
}

@media (max-width: 390px) {
  .vod-create-editor .editor-header,
  .vod-create-editor .editor-tabs,
  .vod-create-editor .editor-panels,
  .vod-create-editor .editor-actionbar,
  .vod-editor-modal .editor-tabs,
  .vod-editor-modal .editor-panels,
  .vod-editor-modal .modal-actions {
    padding-left: 10px;
    padding-right: 10px;
  }

  .vod-create-editor .editor-actionbar,
  .vod-editor-modal .modal-actions {
    justify-content: stretch;
  }

  .vod-create-editor .editor-actionbar button,
  .vod-editor-modal .modal-actions button,
  .modal-extra-actions,
  .modal-extra-actions button {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* Final easy create override: keep content creation simple and inline. */
#createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
#createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
#createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
#createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open {
  position: relative;
  inset: auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  width: 100%;
  min-width: 0;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
  margin: 0 0 16px;
  padding: 14px;
  overflow: visible;
  transform: none;
  border: 1px solid rgba(190, 205, 210, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 24, 27, 0.92), rgba(8, 13, 15, 0.96));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.simple-create-editor .editor-header,
.simple-create-editor .editor-tabs,
.simple-create-editor .editor-panels {
  display: none;
}

.simple-create-editor .content-form-intro,
.simple-create-editor .quick-source-field,
.simple-create-editor .source-inline-actions,
.simple-create-editor .modal-preview,
.simple-create-editor .advanced-panel,
.simple-create-editor .vod-create-hint,
.simple-create-editor .quick-actions {
  grid-column: 1 / -1;
}

.simple-create-editor .content-form-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.simple-create-editor .content-form-intro strong {
  color: var(--text);
  font-size: 1.05rem;
}

.simple-create-editor .content-form-intro span {
  color: var(--muted);
  font-size: 0.82rem;
}

.simple-create-editor label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.simple-create-editor input,
.simple-create-editor select,
.simple-create-editor textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
}

.simple-create-editor textarea {
  min-height: 76px;
}

.simple-create-editor .vod-create-hint {
  display: none;
}

.simple-create-editor .advanced-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.simple-create-editor .advanced-panel > summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(190, 205, 210, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
}

.simple-create-editor .advanced-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.simple-create-editor .advanced-grid .wide-field,
.simple-create-editor .advanced-grid .editor-section-title {
  grid-column: 1 / -1;
}

.simple-create-editor .quick-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.simple-create-editor .quick-actions button {
  width: auto;
  min-width: 118px;
  min-height: 36px;
}

.simple-create-editor .quick-actions button[data-save-mode="publish"] {
  min-width: 148px;
}

.simple-create-editor .quick-actions button[data-save-mode="test"],
.simple-create-editor .source-inline-actions button {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

@media (max-width: 980px) {
  #createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
  #createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
  #createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
  #createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #createChannelForm.simple-create-editor.workspace-editor.is-editor-open,
  #createMovieForm.simple-create-editor.workspace-editor.is-editor-open,
  #createSeriesForm.simple-create-editor.workspace-editor.is-editor-open,
  #createEpisodeForm.simple-create-editor.workspace-editor.is-editor-open,
  .simple-create-editor .advanced-grid {
    grid-template-columns: 1fr;
  }

  .simple-create-editor .content-form-intro {
    display: grid;
  }
}

/* Final VOD local overrides: keep this after all legacy editor rules. */
#view-movies .content-center-hub,
#view-series .content-center-hub {
  margin-bottom: 8px;
  padding: 10px 12px;
}

#view-movies .content-center-main .muted-text,
#view-series .content-center-main .muted-text,
#view-movies .content-center-toolbar,
#view-series .content-center-toolbar {
  display: none;
}

#view-movies .content-center-main h3,
#view-series .content-center-main h3 {
  font-size: 1.18rem;
}

#view-movies .content-center-metrics,
#view-series .content-center-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  padding-top: 8px;
}

#view-movies .content-center-metrics article,
#view-series .content-center-metrics article {
  min-height: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools,
#view-series > .vod-tools-panel.vod-advanced-tools,
.series-workbench > .vod-tools-panel.vod-advanced-tools {
  width: max-content;
  max-width: 100%;
  margin: 4px 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary),
#view-series > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary),
.series-workbench > .vod-tools-panel.vod-advanced-tools:not([open]) > :not(summary) {
  display: none !important;
}

#view-movies > .vod-tools-panel.vod-advanced-tools summary,
#view-series > .vod-tools-panel.vod-advanced-tools summary,
.series-workbench > .vod-tools-panel.vod-advanced-tools summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(190, 205, 210, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  list-style: none;
}

#view-movies > .vod-tools-panel.vod-advanced-tools[open],
#view-series > .vod-tools-panel.vod-advanced-tools[open],
.series-workbench > .vod-tools-panel.vod-advanced-tools[open] {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(190, 205, 210, 0.12);
  border-radius: 10px;
  background: rgba(12, 18, 20, 0.74);
}

.inline-upload-action {
  width: max-content;
  min-height: 28px;
  margin-top: 2px;
  padding: 0 9px;
  border-color: rgba(60, 139, 154, 0.45);
  background: rgba(15, 95, 111, 0.22);
  color: var(--text);
}

.modal-backdrop.vod-editor-modal {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(5px);
}

.vod-editor-modal .modal-card {
  width: min(1040px, calc(100vw - 72px));
  max-height: min(82vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 12px;
}

.vod-editor-modal .modal-card h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 1rem;
}

.vod-editor-modal #modalBody {
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.vod-editor-modal .editor-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: rgba(12, 18, 20, 0.96);
}

.vod-editor-modal .editor-tab {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.vod-editor-modal .editor-tab-panel.is-active {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 10px;
  padding: 12px;
}

.vod-editor-modal .vod-local-editor {
  grid-column: 1 / -1;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
}

.vod-editor-modal .vod-upload-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(60, 139, 154, 0.22);
  border-radius: 9px;
  background: rgba(15, 95, 111, 0.08);
}

.vod-editor-modal .modal-actions {
  min-height: 0;
  padding: 10px 12px;
  gap: 8px;
}
