:root {
  --primary: #ff2d78;
  --secondary: #9b30ff;
  --primary-rgb: 255,45,120;
  --primary-dim: rgba(var(--primary-rgb),.15);
}

/* shared.css – Digital Signage */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0e0e12; color: #e8e8f0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; min-height: 100vh;
}

/* TOPBAR */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 52px; border-bottom: 1px solid #1e1e28;
  flex-shrink: 0; position: sticky; top: 0; background: #0e0e12; z-index: 100;
}
.topbar-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--primary); text-decoration: none; }
.topbar-nav { display: flex; gap: 4px; }
.nav-link {
  color: #555568; text-decoration: none; padding: 6px 12px; border-radius: 5px;
  font-size: 13px; transition: color .15s, background .15s;
}
.nav-link:hover { color: #e8e8f0; background: #1a1a24; }
.nav-link.active { color: var(--primary); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* BUTTONS */
.btn {
  border: none; padding: 8px 16px; border-radius: 6px; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; transition: opacity .15s, border-color .15s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg,var(--primary),var(--secondary)); color: #fff; }
.btn-primary:hover { opacity: .85; }
.btn-outline { background: none; border: 1px solid #2a2a38; color: #888898; }
.btn-outline:hover { border-color: var(--primary); color: #e8e8f0; }
.btn-danger  { background: none; border: 1px solid #2a2a38; color: #555568; }
.btn-danger:hover  { border-color: #ff4444; color: #ff4444; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-live { border: 1px solid var(--primary); color: var(--primary); background: none; }
.btn-live:hover { background: var(--primary); color: #fff; }
.btn-stop { border: 1px solid #555568; color: #888898; background: none; }
.btn-stop:hover { border-color: #e8e8f0; color: #e8e8f0; }
.btn-icon { background: none; border: none; color: #444456; cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: color .15s; font-size: 16px; line-height: 1; }
.btn-icon:hover { color: #e8e8f0; }
.btn-icon.del:hover { color: #ff4444; }

/* CARDS */
.card { background: #13131c; border: 1px solid #22222e; border-radius: 10px; padding: 16px; }
.card-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #00e5cc; text-transform: uppercase; margin-bottom: 12px; }

/* FORM FIELDS */
.field { margin-bottom: 14px; }
.field-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .07em; color: #666680; text-transform: uppercase; margin-bottom: 5px; }
.field-input, .field-select {
  width: 100%; background: #0e0e12; border: 1px solid #2a2a38; border-radius: 6px;
  color: #e8e8f0; font-size: 13px; padding: 9px 12px; outline: none;
  font-family: inherit; transition: border-color .15s;
}
.field-input:focus, .field-select:focus { border-color: var(--primary); }
.field-input::placeholder { color: #2a2a38; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

/* TOGGLE */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #2a2a38; border-radius: 22px; cursor: pointer; transition: background .2s; }
.toggle-slider::before { content:''; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.toggle input:checked + .toggle-slider { background: linear-gradient(135deg,var(--primary),var(--secondary)); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.toggle-label { font-size: 13px; color: #e8e8f0; }

/* BADGES */
.badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; }
.badge-video { background: #1a0d30; color: var(--secondary); }
.badge-image { background: #0d1a20; color: #00c8ff; }
.badge-live  { background: var(--primary); color: #fff; }

/* LOGIN OVERLAY */
.login-screen { position: fixed; inset: 0; background: #0e0e12; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.login-screen.hidden { display: none; }
.login-box { background: #16161f; border: 1px solid #2a2a38; border-radius: 12px; padding: 36px 32px; width: 360px; max-width: 95vw; }
.login-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 28px; }
.login-error { color: #ff4444; font-size: 12px; margin-bottom: 12px; display: none; }
.login-error.show { display: block; }

/* SIDEBAR LAYOUT */
.layout { display: flex; flex: 1; overflow: hidden; height: calc(100vh - 52px); }
.sidebar { width: 260px; flex-shrink: 0; padding: 16px 12px; border-right: 1px solid #1e1e28; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #444456; text-transform: uppercase; padding: 0 4px; margin-bottom: 2px; }
.main-panel { flex: 1; overflow-y: auto; padding: 24px; }
.right-panel { width: 320px; flex-shrink: 0; border-left: 1px solid #1e1e28; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

/* CHANNEL ITEM */
.channel-item { background: #16161f; border: 1px solid #22222e; border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: border-color .15s, background .15s; }
.channel-item:hover { border-color: var(--primary); background: #1a1a24; }
.channel-item.active { border-color: var(--primary); background: #1e1020; }
.channel-name { font-size: 13px; font-weight: 600; color: #e8e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-slug { font-size: 11px; color: #444456; margin-top: 2px; font-family: monospace; }
.channel-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.channel-item:hover .channel-actions { opacity: 1; }

/* MEDIA ITEMS */
.media-item { background: #13131c; border: 1px solid #22222e; border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: grab; transition: border-color .15s; user-select: none; }
.media-item:hover { border-color: #333348; }
.media-item.dragging { opacity: .35; border-color: var(--primary); }
.media-thumb { width: 68px; height: 42px; border-radius: 5px; background: #0a0a10; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #333; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-info { flex: 1; min-width: 0; }
.media-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { font-size: 11px; color: #444456; margin-top: 2px; }
.dur-input { width: 56px; background: #0e0e12; border: 1px solid #2a2a38; border-radius: 5px; color: #e8e8f0; font-size: 12px; padding: 4px 6px; text-align: center; outline: none; font-family: inherit; }
.dur-input:focus { border-color: var(--primary); }

/* KIOSK BOX */
.kiosk-box { background: #13131c; border: 1px solid #22222e; border-radius: 8px; padding: 12px; }
.kiosk-code { background: #0a0a10; border-radius: 5px; padding: 8px; font-family: 'Consolas', monospace; font-size: 11px; color: #00e5cc; line-height: 1.6; margin: 8px 0; white-space: pre-wrap; word-break: break-all; }

/* DROP ZONE */
.drop-zone { border: 2px dashed #2a2a38; border-radius: 10px; padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--primary); background: #1a0d16; }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* PROGRESS */
.progress-wrap { background: #1a1a24; border-radius: 4px; height: 4px; overflow: hidden; display: none; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg,var(--primary),var(--secondary)); transition: width .2s; }

/* SECTION TITLE */
.section-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #444456; text-transform: uppercase; margin-bottom: 10px; }

/* STAT ROW */
.stat-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 7px; }
.stat-row:last-child { margin-bottom: 0; }
.stat-label { color: #444456; }
.stat-val { font-weight: 600; }

/* LINEUP */
.lineup-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1a1a24; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; overflow: hidden; border: 1px solid #2a2a38; }
.lineup-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lineup-row { background: #13131c; border: 1px solid #22222e; border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.lineup-row.is-live { border-color: rgba(var(--primary-rgb),.5); background: #1a0a14; }
.lineup-row-color { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.lineup-row-info { flex: 1; min-width: 0; }
.lineup-row-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lineup-row-meta { font-size: 12px; color: #444456; margin-top: 3px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.2s ease-in-out infinite; display: inline-block; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.3} }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 500; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #16161f; border: 1px solid #2a2a38; border-radius: 10px; padding: 28px; width: 440px; max-width: 95vw; max-height: 92vh; overflow-y: auto; }
.modal h2 { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* TOAST */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1e1e28; border: 1px solid #2a2a38; color: #e8e8f0; font-size: 13px; padding: 10px 20px; border-radius: 6px; z-index: 9999; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* SETTINGS PANEL */
.settings-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 800; align-items: center; justify-content: center; }
.settings-overlay.open { display: flex; }
.settings-box { background: #16161f; border: 1px solid #2a2a38; border-radius: 12px; padding: 28px; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.settings-section { margin-bottom: 24px; }
.settings-section-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #444456; text-transform: uppercase; margin-bottom: 12px; }
.user-item { background: #13131c; border: 1px solid #22222e; border-radius: 6px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* ── DEMO watermark + banner ─────────────────────────────────── */
#demo-watermark { position: fixed; inset: 0; z-index: 9000; pointer-events: none; overflow: hidden; }
#demo-watermark .demo-wm-inner {
  position: absolute; inset: -50%;
  background-image: repeating-linear-gradient(
    -30deg,
    transparent 0, transparent 120px,
    rgba(255,45,120,.10) 120px, rgba(255,45,120,.10) 122px
  );
}
#demo-watermark .demo-wm-inner::before {
  content: "DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO  DEMO";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 40px;
  font-size: 42px; font-weight: 900; letter-spacing: .3em;
  color: rgba(255,45,120,.10);
  transform: rotate(-30deg) scale(1.4);
  white-space: pre-wrap; line-height: 2.6; text-align: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
#demo-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 9100; display: flex; align-items: center; gap: 14px;
  background: rgba(20,20,28,.96); border: 1px solid rgba(255,45,120,.4);
  color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 13px; box-shadow: 0 10px 40px rgba(0,0,0,.5); backdrop-filter: blur(6px);
  max-width: 94vw;
}
#demo-banner strong { color: #ff5d96; }
#demo-banner button {
  background: linear-gradient(135deg,#ff2d78,#9b30ff); color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
