/* ============================================================
   PANTALLAS DIGITALES — Admin UI · Light Theme
   ============================================================ */

:root {
  --bg:          #f5f6fa;
  --bg2:         #ffffff;
  --bg3:         #f0f2f8;
  --border:      #e2e6f0;
  --border-strong: #c8cfe0;
  --text:        #1a1d2e;
  --text-muted:  #6b7194;
  --text-light:  #9ba3c4;

  --primary:     #4361ee;
  --primary-h:   #3451d1;
  --primary-light: #eef0fd;

  --success:     #0ea66a;
  --success-bg:  #e8f8f2;
  --warning:     #d97706;
  --warning-bg:  #fef3e2;
  --danger:      #dc2626;
  --danger-bg:   #fef2f2;
  --info:        #0284c7;
  --info-bg:     #e0f2fe;

  --sidebar-w:   240px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   5px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --transition:  .15s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.flex   { display: flex; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mb-16  { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 12px; }
.text-right { text-align: right; }
.fw-600     { font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.badge::before { content: '●'; font-size: 8px; }
.badge-online  { background: var(--success-bg); color: var(--success); }
.badge-offline { background: var(--danger-bg);  color: var(--danger); }
.badge-unknown { background: var(--bg3);        color: var(--text-muted); }
.badge-trial   { background: var(--warning-bg); color: var(--warning); }
.badge-active  { background: var(--success-bg); color: var(--success); }

/* ============================================================
   LOADING
   ============================================================ */
.app-loading {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   VIEWS
   ============================================================ */
.view { width: 100%; min-height: 100vh; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef0fd 0%, #f5f6fa 50%, #e0f2fe 100%);
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(67,97,238,.3);
}
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.login-logo p  { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.powered-by {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 24px;
}
.powered-by a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.powered-by a:hover { color: var(--primary); text-decoration: underline; }

.login-divider {
  text-align: center; position: relative; margin: 24px 0;
}
.login-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.login-divider span {
  position: relative; background: var(--bg2);
  padding: 0 14px; color: var(--text-muted); font-size: 13px;
}
.login-register {
  text-align: center; margin-top: 22px;
  font-size: 14px; color: var(--text-muted);
}

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], input[type=search],
select, textarea {
  width: 100%; padding: 10px 13px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}
input::placeholder { color: var(--text-light); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition); white-space: nowrap;
  font-family: inherit; letter-spacing: .01em;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(67,97,238,.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-h); border-color: var(--primary-h);
  box-shadow: 0 4px 12px rgba(67,97,238,.35); transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg2); color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg3); border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger-bg); color: var(--danger);
  border-color: #fca5a5;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger); color: #fff; border-color: var(--danger);
}

.btn-success {
  background: var(--success-bg); color: var(--success);
  border-color: #6ee7b7;
}
.btn-success:hover:not(:disabled) {
  background: var(--success); color: #fff; border-color: var(--success);
}

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); }

.btn-block  { width: 100%; }
.btn-sm     { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-xs     { padding: 4px 9px; font-size: 12px; border-radius: var(--radius-xs); }

.btn-icon {
  padding: 7px; background: transparent; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 15px;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg3); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); }

.btn-google {
  background: var(--bg2); color: var(--text);
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
.btn-google:hover { background: var(--bg3); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #6ee7b7; }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid #7dd3fc; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fcd34d; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#view-app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform var(--transition);
  z-index: 100;
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  min-height: 62px;
}
.logo-icon-sm {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; color: white;
  box-shadow: 0 3px 8px rgba(67,97,238,.3);
}
.sidebar-title { font-weight: 700; font-size: 15px; flex: 1; color: var(--text); }
.sidebar-close {
  display: none; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 18px;
  padding: 4px; border-radius: var(--radius-xs);
}
.sidebar-close:hover { background: var(--bg3); }

.company-select-wrap {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.company-select { font-size: 13px; background: var(--bg3); }

.company-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.company-brand-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0; overflow: hidden;
}
.company-brand-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.company-brand-name { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.company-brand-edit {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 13px; padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.company-brand-edit:hover { color: var(--primary); background: var(--bg3); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; color: var(--text-muted);
  font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border-radius: var(--radius-sm);
  text-decoration: none; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--primary-light); color: var(--primary);
  font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-section {
  padding-top: 10px; margin-top: 8px;
  border-top: 1px solid var(--border);
}
.nav-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text-light); padding: 6px 10px 4px; letter-spacing: .06em;
}

.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  margin-left: auto; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  padding: 6px; border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
}
.btn-logout:hover { color: var(--danger); background: var(--danger-bg); }

/* ============================================================
   TOPBAR
   ============================================================ */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 62px; padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.topbar-menu { display: none; }
#page-title  { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content-area { flex: 1; overflow-y: auto; padding: 24px; }

/* ============================================================
   CARDS / STATS
   ============================================================ */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon  { font-size: 26px; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

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

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg3); }
th, td { padding: 12px 16px; text-align: left; }
th {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: .05em;
}
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: #fafbff; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
}
.empty-icon { font-size: 44px; margin-bottom: 14px; }
.empty-state p { font-size: 15px; line-height: 1.6; }
.empty-state .btn { margin-top: 18px; }

/* ============================================================
   SCREEN CARDS
   ============================================================ */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.screen-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.screen-card:hover {
  box-shadow: var(--shadow); border-color: var(--primary);
  transform: translateY(-2px);
}
.screen-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 14px;
}
.screen-card-name   { font-weight: 700; font-size: 15px; }
.screen-card-branch { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.pill {
  padding: 3px 9px; border-radius: 99px;
  font-size: 12px; background: var(--bg3);
  color: var(--text-muted); font-weight: 500;
}
.pill-primary { background: var(--primary-light); color: var(--primary); }

.screen-card-info { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }

.screen-preview {
  position: relative; border-radius: 8px; overflow: hidden;
  margin-bottom: 10px; background: var(--bg3);
  border: 1px solid var(--border);
  min-height: 36px; display: flex; align-items: center;
}
.screen-preview-img {
  width: 100%; max-height: 120px; object-fit: cover; display: block;
}
.screen-preview-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; padding: 3px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screen-preview-text {
  padding: 8px 10px;
}
.screen-preview-text .screen-preview-label {
  position: static; background: none; color: var(--primary);
  font-size: 12px; font-weight: 600; padding: 0;
}

.screen-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.screen-last-seen { font-size: 12px; color: var(--text-muted); }
.screen-actions   { display: flex; gap: 4px; }
.btn-fixed-active { color: var(--primary) !important; background: var(--primary-light) !important; }

/* ============================================================
   CONTENT GRID
   ============================================================ */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.content-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
}
.content-card:hover {
  box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--primary);
}
.content-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; overflow: hidden; position: relative;
}
.content-thumb img { width: 100%; height: 100%; object-fit: cover; }
.content-type-badge {
  position: absolute; top: 7px; right: 7px;
  background: rgba(255,255,255,.9); color: var(--text);
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--border);
}
.content-card-body { padding: 12px 12px 8px; }
.content-name {
  font-weight: 600; font-size: 13px; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.content-duration { font-size: 12px; color: var(--text-muted); }
.content-card-actions {
  display: flex; gap: 6px; padding: 0 10px 10px;
}

/* ============================================================
   PLAYLIST EDITOR
   ============================================================ */
.playlist-items-list { list-style: none; }
.playlist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; cursor: grab;
  transition: box-shadow var(--transition);
}
.playlist-item:active { cursor: grabbing; box-shadow: var(--shadow); }
.playlist-item-drag  { color: var(--text-light); font-size: 16px; cursor: grab; }
.playlist-item-thumb {
  width: 56px; height: 32px; border-radius: 5px;
  background: var(--border); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.playlist-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.playlist-item-info { flex: 1; min-width: 0; }
.playlist-item-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-item-type { font-size: 11px; color: var(--text-muted); }
.playlist-item-dur  { font-size: 13px; color: var(--text-muted); margin-left: auto; white-space: nowrap; padding-left: 8px; }

/* ============================================================
   WYSIWYG EDITOR
   ============================================================ */
.wysiwyg-wrap {
  display: grid; grid-template-columns: 250px 1fr; gap: 16px; height: 560px;
}
.wysiwyg-sidebar {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; overflow-y: auto;
}
.wysiwyg-canvas-wrap {
  background: #1a1a2e; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.wysiwyg-canvas {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  container-type: size;
}
.wysiwyg-element {
  position: absolute; cursor: move;
  border: 2px solid transparent; border-radius: 2px;
  user-select: none;
}
.wysiwyg-element.selected { border-color: var(--primary); }
.wysiwyg-element .resize-handle {
  position: absolute; right: -5px; bottom: -5px;
  width: 10px; height: 10px; background: var(--primary);
  border-radius: 50%; cursor: se-resize;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.element-tools { display: grid; gap: 6px; }
.element-tool-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer; font-size: 13px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.element-tool-btn:hover {
  border-color: var(--primary); background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.props-panel { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.props-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px; }
.prop-row { margin-bottom: 10px; }
.prop-row label { font-size: 12px; color: var(--text-muted); font-weight: 500; display: block; margin-bottom: 4px; }
.prop-row input, .prop-row select { font-size: 13px; padding: 7px 10px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,17,30,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
  backdrop-filter: blur(3px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 92vh; display: flex; flex-direction: column;
  animation: slideUp .18s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: none; } }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  padding: 20px 24px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 20px; padding: 5px;
  border-radius: var(--radius-xs); line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body   { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
  background: var(--bg3); border-radius: 0 0 16px 16px;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
  pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  animation: toastIn .2s ease;
  display: flex; align-items: center; gap: 10px;
  max-width: 340px; pointer-events: all;
  border: 1px solid transparent;
}
.toast-success { background: var(--success-bg); color: var(--success); border-color: #6ee7b7; }
.toast-error   { background: var(--danger-bg);  color: var(--danger);  border-color: #fca5a5; }
.toast-info    { background: var(--info-bg);    color: var(--info);    border-color: #7dd3fc; }
@keyframes toastIn { from { opacity:0; transform: translateX(16px) scale(.96); } to { opacity:1; transform: none; } }

/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px; text-align: center;
  color: var(--text-muted); cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg3);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-zone input[type=file] { display: none; }
.upload-icon { font-size: 32px; margin-bottom: 10px; }
.upload-text { font-size: 14px; line-height: 1.6; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 20px; gap: 0;
}
.tab-btn {
  padding: 10px 18px; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 13.5px;
  font-weight: 600; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover  { color: var(--text); }
.tab-panel      { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center;
}
.filter-bar input[type=search] { max-width: 260px; }
.filter-bar select { max-width: 180px; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-header h3 { font-size: 15px; font-weight: 700; }

/* ============================================================
   TOKEN BOX
   ============================================================ */
.token-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: 'SF Mono', 'Consolas', monospace; font-size: 13px;
  word-break: break-all; position: relative;
}

/* ============================================================
   SUBSCRIPTION BANNER
   ============================================================ */
.subscription-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 13px; font-weight: 500;
  position: relative;
}
.subscription-banner--warning {
  background: var(--warning-bg); color: #92400e;
  border-bottom: 1px solid #fde68a;
}
.subscription-banner--danger {
  background: var(--danger-bg); color: #991b1b;
  border-bottom: 1px solid #fecaca;
}
.subscription-banner-close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; font-size: 14px; opacity: .6; padding: 2px 6px;
}
.subscription-banner-close:hover { opacity: 1; }

/* ============================================================
   DRAG STATES
   ============================================================ */
.drag-over { border: 2px dashed var(--primary) !important; background: var(--primary-light) !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%); box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0); box-shadow: var(--shadow-lg);
  }
  .sidebar-close { display: flex; }
  .topbar-menu   { display: flex; }
  .content-area  { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .wysiwyg-wrap  { grid-template-columns: 1fr; height: auto; }
  .stats-grid    { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid   { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr 1fr; }
  .screens-grid { grid-template-columns: 1fr; }
}

/* ── Help Banners ─────────────────────────────────── */
.help-banner {
  background: var(--primary-light);
  border: 1px solid #c7d0f8;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}
.help-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--primary);
}
.help-banner-header:hover { background: #e4eafd; }
.help-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.help-banner-chevron {
  margin-left: auto;
  font-size: 11px;
  opacity: .6;
}
.help-banner-body {
  padding: 0 16px 14px 46px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.help-banner-body ol,
.help-banner-body ul { margin: 6px 0 6px 18px; }
.help-banner-body li { margin-bottom: 4px; }
.help-banner-body p  { margin: 6px 0; }
.help-banner-body code {
  background: #dde3fb;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
  word-break: break-all;
}
.help-link {
  display: inline-block;
  margin-left: 6px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}
