:root {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary-blue: #0284c7;
  --primary-blue-hover: #0369a1;
  --primary-blue-light: #e0f2fe;
  --nav-blue: #0284c7;
  --green-btn: #10b981;
  --green-btn-hover: #059669;
  --orange-btn: #f59e0b;
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --header-bg: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== APP MAIN LAYOUT ==================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-app);
}

/* ==================== FIXED LEFT SIDEBAR ==================== */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-sizing: border-box;
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0;
  margin-bottom: 8px;
}

.sidebar-logo .brand-spiral-logo {
  width: 130px;
  height: 48px;
  background-color: var(--primary-blue);
  -webkit-mask: url(/logo-spiral.png) no-repeat center center / contain;
  mask: url(/logo-spiral.png) no-repeat center center / contain;
  display: block;
  margin: 0 auto;
  cursor: pointer;
}

.brand-spiral-logo {
  width: 110px;
  height: 48px;
  background-color: var(--primary-blue);
  -webkit-mask: url(/logo-spiral.png) no-repeat center center / contain;
  mask: url(/logo-spiral.png) no-repeat center center / contain;
  display: inline-block;
  cursor: pointer;
}

.top-breadcrumb,
.sidebar-help-link,
.breadcrumb {
  display: none !important;
}

/* Workspace selector card */
.workspace-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.workspace-card:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}
.workspace-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.workspace-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}
.workspace-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.workspace-plan {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}
.workspace-arrow {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

/* Sidebar navigation */
.sidebar-section {
  margin-top: 24px;
  flex-grow: 1;
}
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 12px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav .nav-btn,
.sidebar-nav .nav-link-apk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.sidebar-nav .nav-btn:hover,
.sidebar-nav .nav-link-apk:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}
.sidebar-nav .nav-btn.active {
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
}
.sidebar-nav .nav-icon {
  flex-shrink: 0;
  stroke: currentColor;
}
.sidebar-badge {
  margin-left: auto;
  background-color: var(--border-subtle);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.sidebar-nav .nav-btn.active .sidebar-badge {
  background-color: #bae6fd;
  color: #0369a1;
}

/* Sidebar Bottom */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.sidebar-storage-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
}
.storage-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.storage-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
}
.storage-pct {
  font-weight: 700;
  color: var(--primary-blue);
}
.sidebar-progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--border-light);
  border-radius: 999px;
  margin: 8px 0;
  overflow: hidden;
}
.sidebar-progress-fill {
  height: 100%;
  background-color: var(--primary-blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.storage-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-help-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 6px;
  transition: color 0.15s;
}
.sidebar-help-link:hover {
  color: var(--primary-blue);
}
.help-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 0 4px;
}
.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-meta {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}
.user-fullname {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role-label {
  font-size: 11px;
  color: var(--text-muted);
}
.sidebar-logout-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sidebar-logout-btn:hover {
  background-color: #fee2e2;
  color: #ef4444;
}

/* ==================== MAIN CONTENT WRAPPER ==================== */
.app-main-wrapper {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
}

/* ==================== TOP COMPACT NAVBAR ==================== */
.top-navbar,
.main-header {
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: none;
}
.top-navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 4px;
}
.top-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.top-breadcrumb .separator {
  color: #cbd5e1;
}
#nav-breadcrumb-text {
  font-weight: 600;
  color: #1e293b;
}

.top-navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  background-color: #f8fafc;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 999px;
}
.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--green-btn);
}
.nav-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s;
}
.nav-icon-action:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}
.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== LAYOUT CONTAINER ==================== */
.app-container {
  flex-grow: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0;
  padding: 28px 32px;
  box-sizing: border-box;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ==================== VIEW 1: OVERVIEW / DASHBOARD ==================== */
.overview-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.overview-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.overview-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.overview-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.btn-refresh-pill {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.btn-refresh-pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* 4 Overview KPIs Grid */
.overview-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.overview-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.overview-kpi-card:hover {
  transform: translateY(-2px);
  border-color: #bae6fd;
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.08);
}
.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-card-header .kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.kpi-card-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
}
.kpi-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 12px 0 6px 0;
}
.kpi-card-footer {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-dot.green {
  color: var(--primary-blue);
}
.kpi-storage-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.kpi-mini-bar-track {
  width: 100%;
  height: 4px;
  background-color: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.kpi-mini-bar-fill {
  height: 100%;
  background-color: var(--primary-blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.page-title-row h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary { background: var(--primary-blue); color: #fff; }
.btn-primary:hover { background: var(--primary-blue-hover); }

.btn-success { background: var(--green-btn); color: #fff; }
.btn-success:hover { background: var(--green-btn-hover); }

.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-large { padding: 10px 22px; font-size: 14px; }

/* ==================== VIEW 1: DASHBOARD KPIS ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.kpi-icon.blue { background: #e0f2fe; color: #0284c7; }
.kpi-icon.green { background: #d1fae5; color: #059669; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }
.kpi-icon.orange { background: #ffedd5; color: #ea580c; }

.kpi-data .kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.kpi-data h3 { font-size: 24px; font-weight: 800; color: #0f172a; margin-top: 2px; }

.dash-quick-actions h3 { font-size: 16px; font-weight: 700; color: #1e293b; }
.quick-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.quick-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-card:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.quick-card .qc-icon { font-size: 28px; margin-bottom: 8px; }
.quick-card h4 { font-size: 15px; font-weight: 700; color: #1e293b; }
.quick-card p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ==================== VIEW 2: MÍDIAS (IMAGEM 01) ==================== */
.media-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.media-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-widget {
  display: flex;
  align-items: center;
  gap: 16px;
}

.storage-text {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
}

.storage-text strong {
  font-size: 13px;
  color: #1e293b;
}

.storage-gauge .gauge-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 6px solid #e2e8f0;
  border-top-color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #0284c7;
}

/* Recommendations Banner (Image 01) */
.recommendations-box {
  background: #fff;
  border-left: 4px solid var(--primary-blue);
  border-radius: 4px;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.recommendations-box strong {
  font-size: 13px;
  color: #1e293b;
  display: block;
  margin-bottom: 4px;
}

.recommendations-box .warning-text {
  color: #dc2626;
  font-weight: 700;
  display: block;
  margin-top: 4px;
}

.media-explorer-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.explorer-toolbar {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb-folder {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.explorer-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 4px;
  width: 240px;
}

.explorer-filter input {
  border: none;
  outline: none;
  font-size: 12px;
  width: 100%;
}

.media-items-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.media-item-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.media-item-box:hover {
  border-color: var(--primary-blue);
  background: #f0f9ff;
  transform: translateY(-2px);
}

.media-item-box .thumb-icon {
  font-size: 40px;
  margin-bottom: 6px;
}

.media-item-box .thumb-video {
  width: 100%;
  height: 70px;
  background: #0f172a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  margin-bottom: 6px;
}

.media-item-box .item-title {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-item-box .item-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.media-item-box.selected {
  border: 2px solid var(--primary-blue);
  background: #e0f2fe;
}

.media-item-box .item-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  z-index: 5;
  accent-color: var(--primary-blue);
}

.media-item-box .item-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  z-index: 5;
  opacity: 0.85;
  transition: all 0.15s;
}

.media-item-box:hover .item-delete-btn {
  opacity: 1;
}

.media-item-box .item-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.15);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

/* ==================== VIEW 3: CRIAR GRADE (IMAGEM 02 & 03) ==================== */
.grade-types-bar {
  background: #0284c7;
  padding: 10px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.grade-types-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-grade-type {
  background: #0369a1;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: all 0.15s;
}

.btn-grade-type:hover {
  background: #075985;
}

.btn-grade-type:active {
  cursor: grabbing;
}

.btn-grade-type.btn-dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.btn-save-grade {
  background: #0f172a !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  padding: 8px 20px !important;
  font-size: 13px !important;
}

/* Timeline & Preview Bar (Image 02) */
.grade-composition-container {
  background: #111827;
  border-radius: 6px;
  overflow: hidden;
  color: #fff;
}

.composition-header {
  padding: 10px 16px;
  background: #1f2937;
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.composition-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9ca3af;
}

.composition-status .drag-icon {
  font-size: 16px;
}

.composition-timeline-box {
  min-height: 180px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
}

.timeline-empty-hint {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

.play-circle-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}

.timeline-items-list {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Draggable Timeline Item */
.timeline-card-item {
  width: 160px;
  background: #1f2937;
  border: 2px solid #374151;
  border-radius: 6px;
  padding: 8px;
  cursor: grab;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}

.timeline-card-item:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.timeline-card-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.timeline-card-item.drop-target-before::before {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: -8px;
  width: 5px;
  background: #38bdf8;
  border-radius: 4px;
  box-shadow: 0 0 12px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.8);
  animation: pulseDropLine 0.7s infinite alternate;
  z-index: 50;
}

.timeline-card-item.drop-target-after::after {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  right: -8px;
  width: 5px;
  background: #38bdf8;
  border-radius: 4px;
  box-shadow: 0 0 12px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.8);
  animation: pulseDropLine 0.7s infinite alternate;
  z-index: 50;
}

@keyframes pulseDropLine {
  from { opacity: 0.7; transform: scaleY(0.95); }
  to { opacity: 1; transform: scaleY(1.05); }
}

.composition-timeline-box.timeline-drag-active {
  outline: 2px dashed #0284c7;
  background: rgba(2, 132, 199, 0.08);
}

.timeline-card-thumb {
  height: 80px;
  background: #000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #38bdf8;
  margin-bottom: 6px;
}

.timeline-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.duration-input-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #9ca3af;
}

.duration-input-box input {
  width: 45px;
  padding: 2px 4px;
  background: #111827;
  border: 1px solid #4b5563;
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.btn-remove-timeline-item {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
}

/* Form and Analytics Section (Image 03) */
.grade-details-section {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
}

.shift-hint {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

.grade-form-and-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grade-form-fields input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

.grade-form-fields input:focus {
  border-color: var(--primary-blue);
}

.grade-charts-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 14px;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.donut-chart-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-svg {
  width: 100px;
  height: 100px;
}

.donut-legend {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
}

.legend-color.pub { background: #2dd4bf; }
.legend-color.util { background: #f97316; }

.type-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 6px;
}

.bar-track {
  flex-grow: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #2dd4bf;
}

.grade-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

/* ==================== VIEW 4: MEUS PLAYERS (IMAGEM 04) ==================== */
.players-toolbar {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 18px;
}

.toolbar-row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: #0284c7;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-filter select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 12px;
  background: #f8fafc;
  color: #334155;
  outline: none;
  cursor: pointer;
}

.pagination-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.page-indicator {
  font-size: 12px;
  color: #475569;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 6px 14px;
  max-width: 240px;
}

.search-input-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  width: 100%;
}

/* ==================== PLAYERS GRID & CARDS (MATCHING REFERENCE) ==================== */
.players-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 150px));
  gap: 12px;
  justify-content: start;
  padding: 8px 0;
}

.player-tv-card {
  background: #ededed;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  padding: 8px 8px 10px 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  user-select: none;
  width: 100%;
  max-width: 152px;
  box-sizing: border-box;
}

.player-tv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #0284c7;
}

.player-tv-card.selected {
  border-color: #0284c7;
  background: #e0f2fe;
  box-shadow: 0 0 0 2px #0284c7;
}

.tv-card-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 4px;
}

.tv-card-title-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.tv-card-grade-title {
  font-size: 10px;
  font-weight: 600;
  color: #555555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}

.tv-card-grade-title .icon-group {
  flex-shrink: 0;
  color: #64748b;
}

.tv-card-player-name {
  font-size: 11px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  line-height: 1.2;
}

.tv-card-player-name .icon-monitor {
  flex-shrink: 0;
  color: #111827;
}

.tv-card-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tv-quick-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.player-tv-card:hover .tv-quick-del-btn {
  opacity: 1;
}

.tv-checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #0284c7;
  flex-shrink: 0;
}

/* Vertical Totem Screen Mockup */
.tv-frame-bezel {
  width: 68px;
  height: 120px;
  background: #000000;
  border: 3px solid #1a1a1a;
  outline: 1px solid #404040;
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 4px auto 8px auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

/* Red power LED dot on the left edge */
.tv-frame-bezel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5px;
  height: 5px;
  background: #ef4444;
  border-radius: 1px;
  z-index: 5;
  box-shadow: 0 0 2px #ef4444;
}

.tv-custom-screen-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tv-frame-screen-online {
  width: 100%;
  height: 100%;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-frame-screen-offline {
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-offline-wifi-icon {
  width: 26px;
  height: 26px;
  opacity: 0.55;
  stroke: #d1d5db;
}

/* Bottom status row */
.tv-status-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 2px;
  margin-top: 4px;
}

.tv-bottom-wifi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.pill-badge {
  padding: 2px 14px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: inline-block;
  line-height: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pill-badge.online {
  background: #0084c7;
  color: #ffffff;
}

.pill-badge.offline {
  background: #9ca3af;
  color: #ffffff;
}

.tv-bottom-android-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-card-id-footer {
  font-size: 10px;
  font-weight: 500;
  color: #737373;
  margin-top: 4px;
  text-align: center;
  width: 100%;
}

/* ==================== VIEW 5: CONFIGURAR PLAYER (IMAGEM 05) ==================== */
.config-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.actions-group-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-config-action {
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-config-action:hover {
  background: #0369a1;
}

.btn-restart {
  background: #f59e0b;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.player-header-band {
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 1px;
}

.config-split-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.tv-mockup-large {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.tv-bezel-large {
  width: 100%;
  height: 170px;
  background: #111827;
  border: 8px solid #1f2937;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-screen-large {
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-off-icons {
  display: flex;
  gap: 12px;
  font-size: 24px;
  color: #6b7280;
}

.demo-mode-alert {
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  border: 1px solid #fecaca;
}

.diagnostics-list {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 12px 18px;
  font-size: 12px;
  color: #0369a1;
  line-height: 1.8;
  list-style-type: square;
}

.cfg-table-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
}

.cfg-table-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.cfg-table {
  width: 100%;
  border-collapse: collapse;
}

.cfg-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #334155;
}

.cfg-table tr:last-child td {
  border-bottom: none;
}

.grade-tag {
  color: #0284c7;
  font-weight: 700;
}

/* Switch Toggle (Image 05) */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #0284c7;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* ==================== MODALS / POP-UPS ==================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-dialog {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-dialog.modal-sm { max-width: 440px; }
.modal-dialog.modal-lg { max-width: 820px; }

.modal-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
}

.modal-close:hover { color: #1e293b; }

.modal-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
}

/* 2-Tab Navigation in Modal (Geral / Conteúdo) */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}

.modal-tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}

.modal-tab-btn.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  background: #fff;
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* FORMS */
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary-blue);
}

.input-code-large {
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-blue);
}

/* MEDIA PICKER GRID */
.picker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.picker-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

.picker-media-card {
  position: relative;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.18s ease;
  user-select: none;
}

.picker-media-card:hover {
  border-color: var(--primary-blue);
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.picker-media-card.selected {
  border-color: #0284c7;
  background: #e0f2fe;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.35);
}

.picker-item-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  accent-color: #0284c7;
  cursor: pointer;
  z-index: 2;
}

.picker-media-thumb {
  height: 70px;
  background: #0f172a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 24px;
  margin-bottom: 6px;
  overflow: hidden;
}

.picker-media-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TOAST */
.toast-banner {
  position: fixed;
  top: 75px;
  right: 25px;
  background: #10b981;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2000;
  transition: all 0.3s;
}

/* UTILITIES */
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.mb-15 { margin-bottom: 15px; }

/* ==================== GESTÃO DE TELAS CONTAINER ==================== */
.gestao-telas-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.gt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gt-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gt-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}
.gt-count-pill {
  background-color: var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.gt-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.gt-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-blue);
}
.pulse-dot-blue {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--primary-blue);
  box-shadow: 0 0 6px var(--primary-blue);
}
.btn-add-screen {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add-screen:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* GT Controls: Status tabs & Search */
.gt-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.gt-status-tabs {
  display: flex;
  gap: 20px;
}
.gt-tab-btn {
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.gt-tab-btn.active {
  color: var(--primary-blue);
  font-weight: 700;
  border-bottom-color: var(--primary-blue);
}
.tab-badge {
  color: inherit;
  font-size: 12px;
}
.tab-dot.green { color: var(--green-btn); }
.tab-dot.gray { color: #94a3b8; }

.gt-search-and-view {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gt-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  width: 220px;
}
.gt-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text-main);
  width: 100%;
}
.search-kbd {
  font-size: 10px;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}
.gt-view-toggles {
  display: flex;
  gap: 2px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 2px;
}
.view-toggle-btn {
  background: transparent;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.view-toggle-btn.active {
  background-color: var(--border-subtle);
  color: var(--primary-blue);
}

/* GT Subfilter: Group select & count */
.gt-subfilter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}
.gt-group-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 4px 10px;
  background: #ffffff;
  font-size: 12.5px;
  color: #475569;
}
.gt-group-dropdown select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}
.gt-found-count {
  font-size: 12px;
  color: #94a3b8;
}

/* Screens Grid */
.gt-screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.gt-screens-grid.list-view {
  grid-template-columns: 1fr;
}

/* TV Screen Item Card */
.gt-screen-item-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.gt-screen-item-card:hover {
  transform: translateY(-2px);
  border-color: #bae6fd;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.08);
}
.screen-preview-area {
  height: 180px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}
.preview-watermark-logo {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 46px;
  height: 22px;
  background-color: var(--primary-blue);
  -webkit-mask: url(/logo-spiral.png) no-repeat left center / contain;
  mask: url(/logo-spiral.png) no-repeat left center / contain;
  opacity: 0.85;
}
.preview-headline {
  font-size: 17px;
  font-weight: 800;
  color: #0369a1;
  text-align: left;
  line-height: 1.3;
  width: 78%;
}
.preview-status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.preview-status-pill.online {
  color: var(--primary-blue);
}
.preview-status-pill.offline {
  color: #ef4444;
}
.preview-res-badge {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 10.5px;
  font-weight: 600;
  color: #0369a1;
  opacity: 0.8;
}

.screen-info-area {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.screen-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.screen-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}
.screen-ext-icon {
  color: #94a3b8;
}
.screen-location {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.screen-footer-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.screen-group-tag {
  display: flex;
  align-items: center;
  gap: 4px;
}
.screen-ping-status {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-blue);
}
.screen-ping-status.offline {
  color: #94a3b8;
}

/* Add New Screen Dotted Card */
.gt-card-add-new {
  border: 1.5px dashed #bae6fd;
  background-color: #f8fafc;
  border-radius: 12px;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.gt-card-add-new:hover {
  background-color: #f0f9ff;
  border-color: var(--primary-blue);
  transform: translateY(-2px);
}
.add-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.gt-card-add-new h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}
.gt-card-add-new p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.add-player-link-text {
  color: var(--primary-blue);
  font-size: 13px;
  font-weight: 700;
  margin-top: 14px;
}

/* Card Footer Bar */
.gt-card-footer {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.gt-footer-health {
  display: flex;
  align-items: center;
  gap: 6px;
}
.health-dot.green {
  color: var(--green-btn);
}
.gt-footer-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .overview-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    left: -270px;
    transition: left 0.3s ease;
  }
  .app-sidebar.open {
    left: 0;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .top-navbar {
    padding: 0 16px;
  }
  .app-container {
    padding: 16px;
  }
  .overview-kpis-grid {
    grid-template-columns: 1fr;
  }
  .gt-controls-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .gt-search-and-view {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==================== VIEW 6: APIS & INTEGRAÇÕES ==================== */
.integrations-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.widget-config-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.widget-card-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-card-header .w-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.widget-card-header .w-icon {
  font-size: 26px;
}

.widget-card-header .w-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

.widget-card-header .w-cat-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 8px;
  border-radius: 4px;
}

.widget-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.widget-card-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Modal Totem (Vertical Signage Preview) */
.modal-dialog.modal-totem {
  max-width: 520px;
  background: #0f172a;
  color: #fff;
}

.modal-dialog.modal-totem .modal-header {
  background: #1e293b;
  border-color: #334155;
  color: #fff;
}

.modal-dialog.modal-totem .modal-header h3 {
  color: #f8fafc;
}

.totem-frame-vertical {
  width: 340px;
  height: 604px; /* 9:16 aspect ratio */
  margin: 0 auto;
  border: 12px solid #1e293b;
  border-radius: 28px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.5);
  background: #000;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.totem-frame-horizontal {
  width: 100%;
  max-width: 680px;
  height: 382px; /* 16:9 aspect ratio */
  margin: 0 auto;
  border: 12px solid #1e293b;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  background: #000;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.totem-frame-vertical iframe,
.totem-frame-horizontal iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Timeline Widget Card Item Styling */
.timeline-card-item.widget-item {
  border-left: 4px solid #0284c7;
  background: #f0f9ff;
}

.timeline-card-item .btn-preview-timeline {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 6px;
}

.timeline-card-item .btn-preview-timeline:hover {
  background: #0284c7;
  color: #fff;
}

.widget-live-badge {
  font-size: 11px;
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 4px;
}

/* User Badge Button in Header */
.user-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-badge-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--primary-blue);
  transform: translateY(-1px);
}

.badge-edit-pill {
  font-size: 11px;
  background: #0284c7;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Saved Grades (Playlists) Container in View Grade */
.saved-grades-container {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.saved-grades-header .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.saved-grades-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.saved-grades-header .badge-count {
  font-size: 11px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.saved-grades-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.saved-grade-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.saved-grade-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.saved-grade-info .grade-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.saved-grade-info .grade-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.saved-grade-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-load-grade {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-load-grade:hover {
  background: #0284c7;
  color: #fff;
}

.btn-delete-grade {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-delete-grade:hover {
  background: #ef4444;
  color: #fff;
}

/* Floating Custom Context Menu */
.custom-context-menu {
  position: fixed;
  z-index: 2000;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  min-width: 270px;
  padding: 6px 0;
  font-size: 13px;
}

.ctx-header {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  border-bottom: 1px solid #f1f5f9;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ctx-item:hover {
  background: #f1f5f9;
  color: #0284c7;
}

.ctx-item.danger:hover {
  background: #fee2e2;
  color: #ef4444;
}

.ctx-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

/* Style Editor Grid in Modal */
.style-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.style-preview-frame-container {
  width: 100%;
  height: 480px;
  background: #000;
  border-radius: 12px;
  border: 4px solid #1e293b;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.style-preview-frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Customizer Fieldsets */
.customizer-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.customizer-fieldset legend {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  padding: 0 8px;
}

/* Media Card Thumbnail Image */
.media-item-box .thumb-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

/* TV Card Thumbnail in Meus Players */
.tv-custom-screen-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

/* ==================== LOGIN SCREEN (REDESIGN) ==================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  z-index: 99999;
  padding: 24px;
  overflow: hidden;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -260px;
  transform: translateY(-50%);
  width: 900px;
  height: 900px;
  border-radius: 50%;
  border: 1px solid rgba(2, 132, 199, 0.08);
  box-shadow: 
    0 0 0 90px rgba(2, 132, 199, 0.035),
    0 0 0 200px rgba(2, 132, 199, 0.025),
    0 0 0 330px rgba(2, 132, 199, 0.015);
  pointer-events: none;
  z-index: 1;
}

.login-wrapper.hidden {
  display: none !important;
}

/* Logo original da RODA no canto superior esquerdo */
.login-top-logo {
  position: absolute;
  top: 36px;
  left: 44px;
  z-index: 10;
}

.login-center-box {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 10;
}

.login-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: #f0f9ff;
  border: 1px solid #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}

.badge-dot-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 15px;
  height: 15px;
  background-color: #0284c7;
  color: #ffffff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.login-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.login-brand-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.login-brand-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin-top: 4px;
  margin-bottom: 24px;
}

.login-alert {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  text-align: left;
  box-sizing: border-box;
}

.login-alert.hidden {
  display: none !important;
}

.login-form {
  width: 100%;
}

.login-form .form-group {
  margin-bottom: 16px;
  text-align: left;
}

.login-form .form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
  text-align: left;
}

.login-form input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.login-form input:focus {
  background: #ffffff;
  border-color: #0284c7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-login-submit {
  width: 100%;
  height: 44px;
  background-color: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.15);
}

.btn-login-submit:hover {
  background-color: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-bottom-footer {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  z-index: 10;
}

@media (max-width: 640px) {
  .login-top-logo {
    top: 20px;
    left: 20px;
  }
  .login-center-box {
    max-width: 100%;
    padding: 0 8px;
  }
  .login-bottom-footer {
    bottom: 12px;
  }
}
