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

:root {
  --sidebar-bg: #1c1040;
  --sidebar-w: 270px;
  --primary: #3b35d4;
  --primary-h: #2d28c4;
  --green: #27ae60;
  --orange: #f39c12;
  --red: #e74c3c;
  --text: #2c2c2c;
  --muted: #888;
  --border: #e5e7eb;
  --bg: #f4f6fa;
  --white: #fff;
  --badge-bg: #e8eaf0;
  --badge-text: #4a4a6a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}

.sidebar-status-btn {
  margin: 4px 12px 8px;
  padding: 10px 14px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 24px);
  transition: background .3s;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: rgba(255,255,255,.13); color: white; font-weight: 600; }

.sidebar-bottom {
  padding: 12px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.sidebar-avatar {
  width: 28px; height: 28px;
  background: #4a4a9a;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view { display: flex; flex-direction: column; flex: 1; }
.view.hidden { display: none; }

/* ── View header ── */
.view-header {
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.view-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.view-title svg { width: 20px; height: 20px; }

/* ── Buttons ── */
.btn-primary {
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-h); }

.btn-green {
  padding: 9px 18px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost {
  padding: 9px 18px;
  background: #e0e0e0;
  color: #555;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-danger {
  padding: 9px 18px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-orange {
  padding: 9px 18px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-split { display: inline-flex; }
.btn-split .btn-main {
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px 0 0 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-split .btn-arrow {
  padding: 9px 11px;
  background: #2a25b8;
  color: white;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  border-left: 1px solid rgba(255,255,255,.25);
}

.btn-screenshot {
  width: 34px; height: 34px;
  background: #6d28d9;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-screenshot:hover { background: #5b21b6; }

/* ── View body ── */
.view-body { padding: 22px 28px; flex: 1; }

.section-block { margin-bottom: 18px; }

.section-label {
  display: flex; align-items: center; gap: 8px;
  color: #999;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.section-label::before, .section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.search-row { display: flex; gap: 8px; }

.search-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: white;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: #bbb; }

.search-hint { font-size: 12px; color: #bbb; margin-top: 6px; }

.controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #777;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.controls-row select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

/* ── Table ── */
.table-wrap {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

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

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
thead th:first-child { width: 40px; text-align: center; }

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f5f6ff; }

tbody td {
  padding: 11px 16px;
  font-size: 14px;
  vertical-align: middle;
}
tbody td:first-child { text-align: center; }

.empty-cell {
  text-align: center !important;
  color: #bbb;
  padding: 40px 16px !important;
  font-size: 14px;
}

.table-footer {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--primary);
  border-top: 1px solid var(--border);
  background: white;
}

/* ── Device row ── */
.device-cell { display: flex; align-items: center; gap: 10px; }

.device-play-icon {
  width: 28px; height: 28px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.device-play-icon svg { width: 11px; height: 11px; color: white; margin-left: 2px; }

.row-with-bar { display: flex; align-items: center; gap: 10px; }

.status-bar-v {
  width: 4px; height: 36px;
  border-radius: 2px; flex-shrink: 0;
}
.bar-green  { background: #27ae60; }
.bar-orange { background: #f39c12; }
.bar-red    { background: #e74c3c; }
.bar-gray   { background: #ccc; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--badge-bg);
  color: var(--badge-text);
}
.badge-blue    { background: #dde5ff; color: #3b35d4; }
.badge-mono    { font-family: monospace; }
.badge-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.badge-warning:hover { background: #ffe082; border-color: #e65100; color: #e65100; }

/* ── No-playlist alert banner ── */
.no-playlist-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8e1;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #5d4037;
}
.no-playlist-banner svg { flex-shrink: 0; color: #f59e0b; }
.no-playlist-banner strong { color: #e65100; }
.no-playlist-banner a {
  margin-left: auto;
  font-size: 12px;
  color: #e65100;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

/* ── Warning icon inline ── */
.warn-icon {
  display: inline-flex;
  align-items: center;
  color: #f59e0b;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Status legend ── */
.status-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px; color: #666;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot  { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

/* ── File info bar ── */
.file-info-bar {
  margin-bottom: 18px;
  font-size: 13px; color: #555; line-height: 1.8;
}
.file-info-bar strong { color: #222; }

/* ── Detail header ── */
.detail-header {
  padding: 18px 28px 0;
  background: white;
  border-bottom: 1px solid var(--border);
}

.detail-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}

.detail-main-title {
  font-size: 15px; font-weight: 700;
  color: var(--primary);
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px;
}
.detail-main-title svg { width: 18px; height: 18px; }

.detail-sub-title {
  font-size: 13px; color: #aaa;
  font-weight: 400; text-transform: none; letter-spacing: 0;
}

.back-link {
  font-size: 12px; color: #aaa; cursor: pointer;
  margin-bottom: 4px; display: inline-block;
}
.back-link:hover { color: var(--primary); }

/* ── Tabs ── */
.tabs { display: flex; margin-top: 14px; }

.tab-btn {
  padding: 10px 18px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px; color: #888; cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

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

/* ── Detail body ── */
.detail-body { padding: 24px 28px; flex: 1; }

.detail-section { margin-bottom: 32px; }

.detail-section-title {
  font-size: 15px; font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 14px;
  align-items: flex-start;
}
.detail-row:last-child { border-bottom: none; }

.detail-label { width: 180px; flex-shrink: 0; color: #888; font-size: 13px; padding-top: 1px; }
.detail-value { color: var(--primary); font-weight: 500; }
.detail-value.muted { color: #aaa; font-weight: 400; font-style: italic; }

/* ── Preview ── */
.preview-container {
  display: flex; justify-content: center; align-items: center;
  padding: 32px; background: #f9f9f9;
  border-radius: 8px; min-height: 300px;
}
.preview-container video,
.preview-container img {
  max-width: 100%; max-height: 500px;
  border-radius: 6px;
  box-shadow: 0 2px 16px rgba(0,0,0,.12);
}

/* ── Stats ── */
.stats-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; align-items: center;
}
.stats-filters select,
.stats-filters input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px; background: white;
}
.stats-filters span { font-size: 13px; color: #888; }

.stats-empty {
  text-align: center; padding: 60px 20px;
  color: #aaa; font-size: 14px;
}

/* ── Dual panel ── */
.dual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 12px;
}

.panel-left, .panel-right {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden; background: white;
}
.panel-right { border-color: #a8e6c3; background: #f7fef9; }

.panel-header-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.panel-tab {
  padding: 9px 14px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px; color: #888; cursor: pointer;
}
.panel-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.panel-label {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid #c8f0d8;
  text-align: center;
  color: #27ae60; font-weight: 600;
  background: #f0fdf4;
}

.panel-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.panel-search input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px; outline: none;
}
.panel-search input:focus { border-color: var(--primary); }

.panel-items { max-height: 320px; overflow-y: auto; }

.panel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background .1s;
  font-size: 13px;
}
.panel-item:hover { background: #f5f5ff; }
.panel-item:last-child { border-bottom: none; }

.panel-item-icon {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.panel-item-icon svg { width: 11px; height: 11px; color: white; margin-left: 2px; }

/* ── Thumbnail nos itens do painel ── */
.panel-item-thumb {
  width: 54px; height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1a1c26;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e0e0e8;
}
.panel-item-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.panel-item-thumb.thumb-video {
  background: linear-gradient(135deg, #1a1c36 0%, #2d2050 100%);
  border-color: #3b35d4;
}
.panel-item-thumb.thumb-video svg { opacity: .85; }

.panel-tool-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px; color: #555;
}
.panel-tool-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}

/* ── Edit mode ── */
.hidden { display: none !important; }

.panel-item.edit-left { cursor: pointer; }
.panel-item.edit-left:hover { background: #eef0ff; }

.drag-handle {
  cursor: grab;
  color: #ccc;
  font-size: 18px;
  padding-right: 2px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

.panel-item.edit-right { cursor: default; }

/* ── Select de duração de imagem ── */
.duration-select {
  appearance: none;
  -webkit-appearance: none;
  background: #f0f1ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233b35d4'/%3E%3C/svg%3E") no-repeat right 6px center;
  background-size: 8px;
  border: 1.5px solid #c7c4f0;
  border-radius: 6px;
  color: #3b35d4;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 22px 3px 8px;
  flex-shrink: 0;
  transition: border-color .15s, background-color .15s;
}
.duration-select:hover  { border-color: #3b35d4; background-color: #e8e6ff; }
.duration-select:focus  { outline: none; border-color: #3b35d4; }
.duration-select:disabled {
  background-color: #f4f4f4;
  background-image: none;
  border-color: #e0e0e0;
  color: #999;
  cursor: default;
  padding-right: 8px;
}

.duration-badge {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
}

.remove-item-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 18px;
  padding: 0 2px;
  opacity: 0;
  transition: opacity .15s;
  line-height: 1;
  flex-shrink: 0;
}
.panel-item:hover .remove-item-btn { opacity: 1; }

.panel-item.dragging { opacity: .35; background: #f5f5ff; }
.panel-item.drag-over-top    { border-top: 2px solid var(--primary); }
.panel-item.drag-over-bottom { border-bottom: 2px solid var(--primary); }

.playlist-controls-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap; gap: 8px;
}

/* ── Action bar ── */
.action-bar {
  padding: 16px 28px;
  background: white; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.danger-zone {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 20px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: white;
  border-radius: 12px;
  padding: 36px;
  width: 100%; max-width: 460px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: #aaa; line-height: 1;
}
.modal-close-btn:hover { color: #555; }

.modal-title {
  font-size: 16px; font-weight: 600;
  color: #222; margin-bottom: 22px;
  text-align: center; line-height: 1.5;
}

.modal-note {
  margin: -10px 0 16px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
}

.modal-note span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #1f2937;
}

.modal-code-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 22px;
  text-align: center;
  letter-spacing: 6px;
  font-weight: 700;
  outline: none;
  margin-bottom: 22px;
  text-transform: uppercase;
}
.modal-code-input:focus { border-color: var(--primary); }

.modal-text-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  font-weight: 500;
  outline: none;
  margin-bottom: 22px;
}
.modal-text-input:focus { border-color: var(--primary); }

.modal-url-input {
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions-wrap { flex-wrap: wrap; }

/* ── Toast ── */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}

.toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.success { background: #1e7e34; color: white; }
.toast.error   { background: #c0392b; color: white; }
.toast.info    { background: #2980b9; color: white; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Screen detail ── */
.screen-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.status-col, .info-col {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
}

.status-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #999;
  margin-bottom: 12px;
}

.status-with-bar {
  display: flex;
  gap: 14px;
}

.status-bar-side {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 60px;
}

.status-col-content {
  flex: 1;
}

.cmd-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-cmd-purple {
  padding: 9px 16px;
  background: #6d28d9;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-cmd-purple:hover { background: #5b21b6; }

.btn-cmd-teal {
  padding: 9px 16px;
  background: #2d7a6e;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-cmd-teal:hover { background: #22615a; }
.btn-cmd-teal:disabled {
  background: #d0d0d0;
  color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-cmd-cyan {
  padding: 9px 16px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-cmd-cyan:hover { background: #0772a0; }
.btn-cmd-cyan:disabled {
  background: #d0d0d0;
  color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

.info-link {
  color: #4a90d9;
  cursor: pointer;
}
.info-link:hover { text-decoration: underline; }

.badge-link {
  background: none;
  border: 1.5px dashed #aaa;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.badge-link:hover {
  border-color: #4a90d9;
  color: #4a90d9;
}

/* ── Screen detail — campos de edição ── */
.sd-field-input {
  padding: 7px 10px;
  border: 1.5px dashed #4a90d9;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  max-width: 400px;
  background: #fff;
  color: #222;
}
.sd-field-select {
  padding: 7px 10px;
  border: 1.5px dashed #4a90d9;
  border-radius: 6px;
  font-size: 13px;
  min-width: 180px;
  background: #fff;
  color: #222;
}
.sd-field-textarea {
  padding: 8px 10px;
  border: 1.5px dashed #4a90d9;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  max-width: 500px;
  min-height: 90px;
  background: #fff;
  color: #222;
  resize: vertical;
}
.sd-info-box {
  background: #f0f4f8;
  border: 1px solid #c9d8e8;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #4a5568;
  margin-top: 10px;
}
.sd-hint {
  font-size: 12px;
  color: #666;
  margin: 6px 0 0 0;
}
.sd-group {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 6px !important;
}

/* ── Botões amber/gold (agendamento/horário) ── */
.btn-amber {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #b7791f;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-amber:hover { background: #975a16; }

.btn-icon-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4a5568;
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Schedule entries ── */
.schedule-entry {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.schedule-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.schedule-remove-btn {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.schedule-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.schedule-field-row label {
  font-size: 13px;
  color: #555;
  min-width: 130px;
}

/* ══════════════════════════════════════════════
   MODAL DE PRÉ-VISUALIZAÇÃO — TV
══════════════════════════════════════════════ */
.preview-modal {
  position: fixed; inset: 0;
  background: rgba(6,8,20,.85);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.preview-modal.hidden { display: none; }

.preview-modal-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; width: 100%; max-width: 820px;
}

/* Cabeçalho */
.preview-modal-header {
  display: flex; align-items: center; gap: 12px;
  width: 100%; color: #fff;
}
.preview-modal-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; flex: 1;
}
.preview-modal-meta {
  font-size: 12px; color: #8e9aa9;
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.preview-dot { opacity: .4; }
.preview-rotation-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}
.preview-rotation-control label {
  font-size: 11px;
  color: #aeb9c8;
  white-space: nowrap;
}
.preview-rotation-control select {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(14,18,32,.85);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}
.preview-rotation-control select:focus {
  border-color: rgba(127,225,255,.45);
  box-shadow: 0 0 0 2px rgba(127,225,255,.08);
}
.preview-close-btn {
  background: rgba(255,255,255,.08); border: none; border-radius: 6px;
  color: #ccc; cursor: pointer; padding: 6px 12px; font-size: 16px;
  transition: background .15s;
}
.preview-close-btn:hover { background: rgba(255,255,255,.18); }

/* ── Wrapper TV ── */
.tv-wrap {
  display: flex; flex-direction: column; align-items: center;
  transition: all .3s;
}

/* Corpo principal */
.tv-body {
  display: flex; align-items: center; gap: 0;
  background: linear-gradient(160deg, #2a2d3a 0%, #1a1c26 100%);
  border-radius: 18px;
  padding: 14px 14px 14px 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.07);
  position: relative;
}

/* Moldura interna (bezel) */
.tv-bezel {
  background: #0a0b10;
  border-radius: 8px;
  padding: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.8);
}

/* Tela */
.tv-screen {
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  /* tamanho definido via JS conforme orientação */
}

/* Barra de progresso na parte de baixo da tela */
.tv-progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,.15);
}
.tv-progress-fill {
  height: 100%; background: #7fe1ff;
  width: 0%; transition: width .2s linear;
}

/* Botões laterais decorativos */
.tv-side-buttons {
  display: flex; flex-direction: column; gap: 6px; margin-left: 10px;
}
.tv-btn {
  width: 8px; height: 22px;
  background: linear-gradient(180deg, #3a3d4e, #222430);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

/* Base */
.tv-neck {
  width: 60px; height: 18px;
  background: linear-gradient(180deg, #1e2030, #161824);
  clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
}
.tv-stand {
  width: 140px; height: 10px;
  background: linear-gradient(180deg, #22243a, #181a26);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}

/* ── Slot de mídia dentro da tela ── */
.preview-media-slot {
  width: 100%; height: 100%; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.preview-media-slot img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.preview-media-slot video {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: #000;
}
.preview-media-slot .preview-empty {
  color: #555; font-size: 13px; text-align: center;
}

/* ── Controles ── */
.preview-nav {
  display: flex; gap: 10px;
}
.preview-nav-btn {
  padding: 8px 20px; border-radius: 8px; border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #ccc; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: background .15s, border-color .15s;
}
.preview-nav-btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.preview-nav-pause { color: #7fe1ff; border-color: rgba(127,225,255,.3); }

/* ══════════════════════════════════════════════
   MODAL CAPTURA DE TELA
══════════════════════════════════════════════ */
.screenshot-modal {
  position: fixed; inset: 0;
  background: rgba(6,8,20,.88);
  backdrop-filter: blur(6px);
  z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.screenshot-modal.hidden { display: none; }

.screenshot-modal-inner {
  background: #12141f;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 24px;
  width: 100%; max-width: 720px;
  display: flex; flex-direction: column; gap: 18px;
}

.screenshot-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
}
.screenshot-modal-title {
  font-size: 16px; font-weight: 700; color: #fff;
}
.screenshot-modal-sub {
  font-size: 12px; color: #7fe1ff; margin-top: 4px;
}

.screenshot-img-wrap {
  border-radius: 10px; overflow: hidden;
  background: #000;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.screenshot-img-wrap img {
  width: 100%; display: block; border-radius: 10px;
}
.screenshot-waiting {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: #8e9aa9; font-size: 14px; padding: 40px;
}
.screenshot-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(127,225,255,.2);
  border-top-color: #7fe1ff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Disabled state para btn-cmd-purple */
.btn-cmd-purple:disabled {
  background: #d0d0d0; color: #999;
  cursor: not-allowed; opacity: 0.7;
}
