:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #07101e;
  --surface: #0d192a;
  --surface-2: #122137;
  --line: rgba(255,255,255,.1);
  --muted: #92a4bc;
  --text: #f4f8ff;
  --green: #00d6a2;
  --blue: #5b8cff;
  --danger: #ff718b;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -20%, rgba(91,140,255,.18), transparent 32%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(7,16,30,.88); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--green); box-shadow: 0 0 24px rgba(0,214,162,.7); }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 16px; }
.brand span, .top-actions { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.top-actions a { color: var(--text); text-decoration: none; }
.install-app { min-height: 34px; padding: 7px 11px; border: 1px solid rgba(0,214,162,.28); border-radius: 9px; background: rgba(0,214,162,.1); color: #7effdf; font-size: 12px; font-weight: 800; }
.logout-app { min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 800; }
.health { display: inline-flex; align-items: center; gap: 7px; }
.health i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.health.offline { color: #ff9cad; }
.health.offline i { background: var(--danger); }
main { width: min(1440px, calc(100% - 40px)); margin: 0 auto 80px; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: end; padding: 72px 0 52px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 700px; font-size: clamp(42px, 6vw, 76px); line-height: .98; letter-spacing: -.055em; }
.hero-copy { color: var(--muted); font-size: 18px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 12px; }
.metric { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(18,33,55,.94), rgba(10,22,38,.94)); }
.metric strong { display: block; font-size: 34px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric-link { color: var(--text); text-decoration: none; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.metric-link:hover, .metric-link:focus-visible { border-color: rgba(0,214,162,.55); transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.2); outline: none; }
.metric-link .metric-arrow { position: absolute; top: 18px; right: 20px; color: var(--green); font-size: 20px; }
.tabs { display: flex; gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13,25,42,.8); overflow-x: auto; }
.tab { min-width: 130px; padding: 12px 18px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.tab.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.notice { margin: 18px 0 0; padding: 14px 18px; border-radius: 12px; background: rgba(0,214,162,.12); color: #7effdf; border: 1px solid rgba(0,214,162,.25); }
.notice.error { background: rgba(255,113,139,.11); color: #ff9cad; border-color: rgba(255,113,139,.25); }
.admin-toast { position: fixed; top: 92px; right: clamp(12px, 4vw, 56px); z-index: 1000; display: flex; align-items: flex-start; gap: 18px; width: min(440px, calc(100vw - 24px)); margin: 0; padding: 16px 16px 16px 18px; background: #0d2b29; box-shadow: 0 20px 54px rgba(0,0,0,.38); animation: toast-in .2s ease-out; }
.admin-toast[hidden] { display: none; }
.admin-toast.error { background: #321824; }
.admin-toast-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.admin-toast-copy strong { color: var(--text); font-size: 14px; }
.admin-toast-copy span { overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
.admin-toast-close { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: rgba(255,255,255,.07); color: currentColor; font-size: 21px; line-height: 1; }
.admin-toast-close:hover, .admin-toast-close:focus-visible { background: rgba(255,255,255,.14); outline: 2px solid currentColor; outline-offset: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.panel { display: none; padding: 48px 0 0; }
.panel.active { display: block; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 34px; letter-spacing: -.035em; }
.section-heading > p { max-width: 540px; color: var(--muted); }
.form-card { display: grid; gap: 14px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.upload-card { grid-template-columns: 1.2fr 1fr .7fr auto; align-items: end; }
.compact-form { grid-template-columns: 1.2fr 1.2fr .8fr auto; align-items: end; }
.screen-form { grid-template-columns: repeat(4, minmax(150px, 1fr)); align-items: end; }
.user-form { grid-template-columns: repeat(4, minmax(150px, 1fr)); align-items: end; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #091525; color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,214,162,.09); }
button { border: 0; cursor: pointer; }
.primary { min-height: 44px; padding: 10px 18px; border-radius: 10px; color: #04130f; background: var(--green); font-weight: 850; white-space: nowrap; }
.secondary, .danger, .icon-button { min-height: 38px; padding: 8px 13px; border-radius: 9px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.danger { color: #ff9cad; }
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.content-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.content-preview { --preview-height: 220px; height: var(--preview-height); min-height: var(--preview-height); overflow: hidden; contain: paint; display: grid; place-items: center; background: #030a13; color: var(--muted); }
.content-preview img, .content-preview video { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; transform-origin: center; }
.content-preview img.quarter-turn, .content-preview video.quarter-turn { width: var(--preview-height); height: var(--preview-height); }
.content-body { position: relative; z-index: 1; padding: 0; background: var(--surface); }
.content-body h3 { margin: 0 0 5px; font-size: 16px; }
.content-body p { margin: 0 0 13px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.content-presentation { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.content-presentation button { grid-column: 1 / -1; }
.media-inspection { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.media-inspection.ready { color: #7effdf; }
.archived { opacity: .55; }
.stack { display: grid; gap: 12px; }
.entity-card { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.compact-card { padding: 0; overflow: hidden; }
.entity-details { display: block; }
.entity-details > summary, .subsection-details > summary { list-style: none; cursor: pointer; }
.entity-details > summary::-webkit-details-marker, .subsection-details > summary::-webkit-details-marker { display: none; }
.entity-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; }
.entity-summary > span:first-child { display: grid; gap: 5px; min-width: 0; }
.entity-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.entity-summary small, .subsection-details summary small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.summary-action { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: #7effdf; font-size: 12px; font-weight: 850; }
.summary-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.entity-body { display: grid; gap: 14px; padding: 0 18px 18px; }
.subsection-details { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.subsection-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; }
.subsection-details > summary span { font-weight: 850; }
.subsection-details[open] > summary { border-bottom: 1px solid var(--line); }
.subsection-details > .entity-grid, .subsection-details > .schedule-grid, .subsection-details > .playlist-schedule, .subsection-details > .pin-controls, .subsection-details > .screen-shot, .subsection-details > .content-presentation { margin: 14px; }
.screen-alert { display: grid; gap: 5px; padding: 16px 18px; border: 1px solid rgba(255,190,65,.34); border-radius: 16px; background: rgba(255,190,65,.1); color: #ffd68a; }
.screen-alert strong { color: #ffe6ad; font-size: 15px; }
.screen-alert span { color: #d7c39b; font-size: 13px; }
.screen-alert.ok { border-color: rgba(0,214,162,.26); background: rgba(0,214,162,.08); color: #7effdf; }
.screen-alert.ok strong { color: #7effdf; }
.screen-alert.ok span { color: var(--muted); }
.entity-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.entity-head h3 { margin: 0; }
.entity-head span { color: var(--muted); font-size: 12px; }
.device-title { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 4px; }
.device-badge { padding: 4px 8px; border: 1px solid rgba(0,214,162,.28); border-radius: 999px; background: rgba(0,214,162,.11); color: #7effdf !important; font-size: 10px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.device-badge.pending { border-color: rgba(255,190,65,.35); background: rgba(255,190,65,.12); color: #ffd68a !important; }
.device-badge.rejected { border-color: rgba(255,85,105,.35); background: rgba(255,85,105,.12); color: #ff9aaa !important; }
.device-badge.authorized { border-color: rgba(0,214,162,.28); background: rgba(0,214,162,.11); color: #7effdf !important; }
.device-details { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.entity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.schedule-grid { display: grid; grid-template-columns: .8fr 1fr 1fr 1.4fr; gap: 12px; align-items: end; margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,204,153,.035); }
.schedule-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.playlist-schedule { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,204,153,.035); }
.playlist-schedule > p { margin: 0; align-self: end; color: var(--muted); font-size: 12px; }
.weekday-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.weekday { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; }
.weekday input { width: auto; }
.pin-controls { display: grid; grid-template-columns: minmax(220px, .8fr) auto 1fr; gap: 12px; align-items: end; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.pin-controls > span { color: var(--muted); padding-bottom: 11px; }
.screen-shot { margin: 14px 0 0; max-width: 520px; }
.screen-shot img { display: block; width: 100%; max-height: 320px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #000; }
.screen-shot figcaption { margin-top: 6px; color: var(--muted); font-size: 12px; }
.playlist-item { display: grid; grid-template-columns: 96px minmax(220px, 1.4fr) .5fr .7fr .5fr auto; gap: 9px; align-items: end; margin-top: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.playlist-thumb { grid-row: span 2; align-self: stretch; min-height: 86px; margin: 0; overflow: hidden; display: grid; grid-template-rows: 1fr auto; border: 1px solid var(--line); border-radius: 12px; background: #030a13; }
.playlist-thumb img, .playlist-thumb video { width: 100%; height: 62px; object-fit: contain; background: #000; transform-origin: center; }
.playlist-thumb figcaption { display: grid; gap: 2px; padding: 6px; color: var(--text); font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
.playlist-thumb figcaption span { color: var(--muted); font-size: 10px; }
.empty-thumb { place-items: center; padding: 8px; color: var(--muted); font-size: 11px; text-align: center; }
.playlist-schedule-details { grid-column: 2 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.checkbox input { width: 18px; min-height: 18px; }
.card-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(100%, 460px); margin: 0; }
.login-card { padding: clamp(26px, 7vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: rgba(13,25,42,.96); box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 42px; }
.login-brand div { display: grid; gap: 2px; }
.login-brand span { color: var(--muted); font-size: 12px; }
.login-card h1 { font-size: clamp(38px, 10vw, 54px); }
.login-copy { margin: 14px 0 24px; color: var(--muted); }
.login-form { display: grid; gap: 16px; }
.login-form .primary { margin-top: 4px; }
.login-footnote { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; } .upload-card, .compact-form, .screen-form, .user-form, .entity-grid, .playlist-item, .schedule-grid, .playlist-schedule { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { main { width: min(100% - 24px, 1440px); } .topbar { padding: 0 14px; } .health, .top-actions a { display: none; } .hero { padding-top: 44px; } .metrics, .upload-card, .compact-form, .screen-form, .user-form, .entity-grid, .playlist-item, .schedule-grid, .playlist-schedule, .pin-controls { grid-template-columns: 1fr; } .playlist-thumb, .playlist-schedule-details { grid-column: auto; } .content-grid { grid-template-columns: 1fr; } .content-preview { --preview-height: 240px; } .section-heading { display: block; } .admin-toast { top: 84px; right: 12px; } }
