/* dashboard.css — CMS admin control center. Dark sidebar + light content. */

:root {
  /* ---- Typography ---- */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;

  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;

  --leading-tight: 1.25;
  --leading-normal: 1.45;
  --leading-relaxed: 1.6;

  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* ---- Spacing (4px scale) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;

  /* ---- Neutral palette (cool grey) ---- */
  --grey-50: #f7f8fa;
  --grey-100: #eef0f4;
  --grey-200: #e1e5eb;
  --grey-300: #cbd1db;
  --grey-400: #9aa3b2;
  --grey-500: #5b6675;
  --grey-600: #434e5e;
  --grey-700: #2c3644;
  --grey-800: #1c2430;
  --grey-900: #141a24;

  /* ---- Semantic surface / text tokens ---- */
  --bg: var(--grey-50);
  --surface: #ffffff;
  --surface-2: var(--grey-100);
  --border: var(--grey-200);
  --text: var(--grey-900);
  --text-muted: var(--grey-500);

  /* ---- Sidebar (fixed dark shell, independent of white-label accent) ---- */
  --sidebar-bg: #1b2330;
  --sidebar-fg: #c7cedb;
  --sidebar-fg-active: #ffffff;
  --sidebar-accent: #2a66ec;

  /* ---- Accent (white-label injection entry point — names fixed) ---- */
  --accent: #2a66ec;
  --accent-dark: #1e4fc7;
  --accent-soft: rgba(42, 102, 236, 0.1);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
  --accent-ink: #214ea6;
  --accent-ink: color-mix(in srgb, var(--accent) 70%, black);
  --focus-ring: rgba(42, 102, 236, 0.35);
  --focus-ring: color-mix(in srgb, var(--accent) 35%, transparent);

  /* ---- Status semantics ---- */
  --success: #166534;
  --success-soft: rgba(22, 101, 52, 0.12);
  --success-soft: color-mix(in srgb, var(--success) 12%, white);
  --danger: #b91c1c;
  --danger-dark: #991b1b;
  --danger-soft: rgba(185, 28, 28, 0.12);
  --danger-soft: color-mix(in srgb, var(--danger) 12%, white);
  --warning: #92400e;
  --warning-soft: rgba(146, 64, 14, 0.12);
  --warning-soft: color-mix(in srgb, var(--warning) 12%, white);
  --grey: var(--grey-400);

  /* ---- Elevation ---- */
  --shadow-1: 0 1px 2px rgba(20, 25, 35, 0.06), 0 1px 1px rgba(20, 25, 35, 0.04);
  --shadow-2: 0 4px 10px rgba(20, 25, 35, 0.1), 0 1px 3px rgba(20, 25, 35, 0.08);
  --shadow-3: 0 14px 32px rgba(20, 25, 35, 0.22), 0 4px 10px rgba(20, 25, 35, 0.14);

  /* ---- Radius ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* ---- Legacy aliases (compatibility) ---- */
  --card-bg: var(--surface);
  --muted: var(--text-muted);
  --shadow: var(--shadow-1);
  --shadow-lift: var(--shadow-3);
  --radius: var(--radius-md);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}

h1, h2, h3, h4 { margin: 0 0 12px; font-weight: var(--font-semibold); }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
p { margin: 0 0 8px; }
a { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------------------------------------------------------------
   Accessibility: focus rings + reduced motion
   --------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--sidebar-bg), #2a3446);
}

.login-card {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: var(--space-8) var(--space-6);
}

.login-card h1 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-1);
  text-align: center;
}

.login-card .login-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.login-card form { display: flex; flex-direction: column; gap: var(--space-3); }

.login-card .btn { margin-top: var(--space-1); }

.login-error {
  color: var(--danger);
  font-size: var(--text-sm);
  min-height: 16px;
}

.sso-block { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.sso-divider {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.sso-divider::before, .sso-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.sso-divider span { padding: 0 10px; }
.sso-btn { justify-content: center; gap: 10px; text-decoration: none; }
.sso-icon { display: inline-flex; width: 18px; height: 18px; }

/* ---------------------------------------------------------------------
   App shell
   --------------------------------------------------------------------- */

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

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  padding: 0 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* White-label logo shown in place of the wordmark */
.sidebar-brand-logo { max-height: 32px; max-width: 150px; object-fit: contain; }

/* Notification bell (sidebar header) */
.notif-bell { position: relative; }

.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  color: var(--sidebar-fg);
  font-size: 16px;
  border-radius: 6px;
}

.notif-bell-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 950;
  width: 300px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.notif-head-title { font-weight: 700; font-size: 13px; }

.notif-empty { padding: 16px 12px; color: var(--muted); font-size: 13px; margin: 0; }

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(0, 0, 0, 0.03); }
.notif-item.notif-unread { background: rgba(37, 99, 235, 0.06); }

.notif-icon { flex: 0 0 auto; font-size: 15px; line-height: 1.3; }
.notif-main { min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: var(--sidebar-fg-active); }

.sidebar-nav a.active {
  background: var(--sidebar-accent);
  color: var(--sidebar-fg-active);
  font-weight: var(--font-semibold);
}

.sidebar-nav .nav-icon { width: 18px; text-align: center; }

/* Dark-shell focus ring */
.sidebar :focus-visible,
.login-wrap :focus-visible {
  outline-color: var(--sidebar-fg-active);
}

.sidebar-footer {
  padding: var(--space-2) var(--space-2) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer button,
.sidebar-footer a {
  background: none;
  border: none;
  text-align: left;
  color: var(--sidebar-fg);
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--text-base);
  width: 100%;
  display: block;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-footer button:hover,
.sidebar-footer a:hover { background: rgba(255, 255, 255, 0.06); color: var(--sidebar-fg-active); }

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 60px;
  overflow-x: auto;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.view-header h1 { margin: 0; }

/* ---------------------------------------------------------------------
   Buttons / inputs
   --------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--border); color: var(--text); }

/* Busy state */
.btn[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
  position: relative;
}
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-color: var(--border) var(--border) var(--text-muted) var(--border);
  border-radius: 50%;
  animation: btn-busy-spin 0.7s linear infinite;
}
.btn-primary[aria-busy="true"]::after,
.btn-danger-solid[aria-busy="true"]::after {
  border-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.4) #fff rgba(255, 255, 255, 0.4);
}
@keyframes btn-busy-spin { to { transform: rotate(360deg); } }

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

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

.btn-small { padding: 4px 9px; font-size: var(--text-sm); }
.btn-icon { padding: 5px 8px; line-height: 1; }

input[type="text"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Keyboard focus ring */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; min-height: 90px; font-family: var(--font); }

label { display: block; font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--text-muted); margin-bottom: var(--space-1); }
.field { margin-bottom: var(--space-4); }
.field-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.field-row { display: flex; gap: var(--space-3); align-items: flex-end; }
.field-row > * { flex: 1; }

.checkbox-row { display: flex; align-items: center; gap: 6px; }
.checkbox-row input { width: auto; }

/* ---------------------------------------------------------------------
   Cards / lists
   --------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}

.empty-hint { color: var(--text-muted); font-size: var(--text-base); padding: var(--space-5) 0; }

/* ---------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------- */

.toast-area {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
  max-width: 340px;
}

.toast {
  background: var(--grey-800);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--danger-dark); }
.toast-success { background: var(--success); }
.toast-info { background: var(--grey-700); }

/* ---------------------------------------------------------------------
   Status dots
   --------------------------------------------------------------------- */

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  flex: 0 0 auto;
}

.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.never { background: var(--grey); }

.status-label { font-size: var(--text-xs); color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Screens view
   --------------------------------------------------------------------- */

.pair-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pair-form .field { margin-bottom: 0; }

#pair-code {
  text-transform: uppercase;
  letter-spacing: 2px;
  width: 130px;
  font-weight: 700;
}

.screens-list { display: flex; flex-direction: column; gap: 10px; }

.screen-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  flex-wrap: wrap;
}

.screen-row .screen-status { display: flex; align-items: center; min-width: 110px; }
.screen-row .screen-name-input { max-width: 220px; }
.screen-row .screen-name-wrap { display: flex; align-items: center; gap: 4px; max-width: 240px; min-width: 140px; }
.screen-row .screen-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.screen-row .screen-last-seen { font-size: 12px; color: var(--muted); min-width: 130px; }
.screen-row .screen-playlist select { min-width: 170px; }
.screen-row .screen-actions { display: flex; gap: 6px; margin-left: auto; }

/* ---------------------------------------------------------------------
   Playlists view
   --------------------------------------------------------------------- */

.playlists-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
}

.playlists-sidebar { display: flex; flex-direction: column; gap: 12px; }

#new-playlist-form { display: flex; gap: 6px; }
#new-playlist-form input { flex: 1; }

.playlists-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.playlists-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
}

.playlists-list li.selected { border-color: var(--accent); background: var(--accent-soft); }
.playlists-list li .pl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.playlists-list li .pl-count { font-size: 11px; color: var(--muted); }
.playlists-list li .pl-actions { display: none; gap: 4px; }
.playlists-list li:hover .pl-actions { display: flex; }

.playlist-editor { min-height: 200px; }

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-header .dirty-flag {
  font-size: 11px;
  color: var(--warning);
  font-weight: 600;
}

.editor-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}

.timeline-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.timeline-rows {
  display: flex;
  flex-direction: column;
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid transparent;
  touch-action: none;
}

.timeline-row:not(.dragging):hover { background: #f7f9fc; }

.timeline-row.dragging {
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
  background: #fff;
  z-index: 5;
  position: relative;
}

.timeline-row.displaced { transition: transform 0.12s ease; }

.drag-handle {
  cursor: grab;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  padding: 4px 6px;
  touch-action: none;
}

.drag-handle:active { cursor: grabbing; }

.row-icon { font-size: 18px; width: 24px; text-align: center; flex: 0 0 auto; }

.row-thumb {
  width: 40px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex: 0 0 auto;
  background: #eee;
}

.row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.row-duration-wrap { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.row-duration { width: 68px; padding: 5px 6px; }
.row-duration:disabled { background: #f0f1f4; color: var(--muted); }
.row-duration-hint { font-size: 10px; color: var(--muted); white-space: nowrap; }

.row-move-btns { display: flex; flex-direction: column; gap: 1px; }
.row-move-btns button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 20px;
  height: 16px;
  line-height: 1;
  font-size: 9px;
  cursor: pointer;
  color: var(--muted);
}

.row-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  flex: 0 0 auto;
}

.row-remove:hover { color: var(--danger); }

.add-item-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  padding: 10px;
}

.tabs { display: flex; gap: 4px; margin-bottom: 10px; }

.tabs button {
  flex: 1;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.add-list { display: flex; flex-direction: column; gap: 4px; max-height: 480px; overflow-y: auto; }

.add-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 12px;
}

.add-item:hover { background: #f7f9fc; border-color: var(--border); }
.add-item .row-icon { font-size: 15px; width: 20px; }
.add-item .add-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-item .add-item-type { font-size: 10px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Media view
   --------------------------------------------------------------------- */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.drop-zone .drop-zone-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.drop-zone.drag-over .drop-zone-title { color: var(--accent-ink); }
.drop-zone .drop-zone-sub { font-size: 12px; }
.drop-zone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.drop-zone.drop-zone-compact { padding: 10px 12px; margin-bottom: 8px; }
.drop-zone.drop-zone-compact .drop-zone-title { font-size: 12px; font-weight: 500; margin-bottom: 0; }

.upload-queue { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
}

.upload-item .upload-name { flex: 0 0 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .upload-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.upload-item .upload-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.15s ease; }
.upload-item.upload-error .upload-bar-fill { background: var(--danger); }
.upload-item.upload-success .upload-bar-fill { background: var(--success); }
.upload-item .upload-status { flex: 0 0 auto; min-width: 90px; text-align: right; color: var(--muted); }
.upload-item.upload-error .upload-status { color: var(--danger); }
.upload-item.upload-success .upload-status { color: var(--success); }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.media-card { padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.media-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.media-thumb-icon {
  width: 100%;
  height: 90px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--muted);
}

.media-card .media-name {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card .media-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
.media-card .media-actions { display: flex; justify-content: flex-end; }

.media-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.media-main { min-width: 0; }

.media-sidebar { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.media-sidebar-title { margin: 0 0 6px; font-size: 13px; }

.media-folder-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.media-folder-item:hover { background: #f0f2f6; }
.media-folder-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.media-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-folder-count { font-size: 11px; color: var(--muted); }
.media-folder-actions { display: none; gap: 2px; }
.media-folder-item:hover .media-folder-actions,
.media-folder-item.active .media-folder-actions { display: inline-flex; }
.media-new-folder { margin-top: 8px; }

.media-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.media-toolbar .media-search { flex: 1; max-width: 320px; }

.media-bulkbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.media-bulk-count { font-size: 12px; font-weight: 600; }

.media-card { position: relative; }
.media-card .media-select { position: absolute; top: 8px; left: 8px; z-index: 2; width: 16px; height: 16px; }
.media-card.selected { outline: 2px solid var(--accent); }

.media-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.media-tag { font-size: 10px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

/* ---------------------------------------------------------------------
   Widgets view
   --------------------------------------------------------------------- */

.widgets-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }

.widgets-list {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.widget-type-badge {
  font-size: var(--text-2xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 2px 6px;
  flex: 0 0 auto;
}

.widget-item .widget-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.widget-item .widget-item-actions { display: flex; gap: 4px; }

.widget-form-panel { flex: 1; min-width: 340px; display: flex; gap: 18px; flex-wrap: wrap; }
.widget-form-col { flex: 1; min-width: 300px; }
.widget-preview-col { flex: 0 0 320px; }

.widget-preview-card {
  background: #10151d;
  border-radius: var(--radius);
  border: 1px solid #232b39;
  min-height: 220px;
  padding: 10px;
  color: #f2f4f8;
  position: relative;
  overflow: hidden;
}

.widget-preview-placeholder {
  color: #8a94a6;
  font-size: 12px;
  text-align: center;
  padding: 40px 10px;
}

.clock-entry {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  position: relative;
}

.clock-entry .clock-entry-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.geocode-row { display: flex; gap: 6px; }
.geocode-row input { flex: 1; }
.geocode-results { margin-top: 6px; }
.geocode-chosen { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}

.modal {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: var(--space-5);
}

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.modal-header button { background: none; border: none; font-size: var(--text-lg); cursor: pointer; color: var(--text-muted); border-radius: var(--radius-sm); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.modal-message { margin: 0; font-size: var(--text-base); color: var(--text); line-height: var(--leading-normal); }

.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: var(--danger-dark); border-color: var(--danger-dark); color: #fff; }

/* ---------------------------------------------------------------------
   Help tip: small circled "?" toggling a floating popover
   --------------------------------------------------------------------- */

.help-tip { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; }

.help-tip-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.help-tip-btn:hover,
.help-tip-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

.help-tip-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  width: 220px;
  padding: 8px 10px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
}

/* ---------------------------------------------------------------------
   SignageWidgets preview sizing (small card context; widgets.js carries
   only structural inline styles, so sizing/typography lives here)
   --------------------------------------------------------------------- */

.sw-widget { font-size: 11px; height: 100%; display: flex; flex-direction: column; }
.sw-title { font-size: 13px; font-weight: 700; margin: 0 0 6px; color: #fff; }
.sw-error, .sw-offline-msg { color: #ffb4b4; font-size: 11px; }
.sw-offline-placeholder { text-align: center; padding: 20px 8px; }
.sw-offline-title { font-weight: 700; margin-bottom: 4px; }
.sw-stale-note { font-size: 9px; color: #8a94a6; margin-top: 6px; }

.sw-notice-body { font-size: 12px; line-height: 1.4; }
.sw-notice-body h1, .sw-notice-body h2, .sw-notice-body h3 { color: #fff; margin: 0 0 4px; }
.sw-notice-body p { margin: 0 0 6px; }

.sw-weather-current { display: flex; align-items: center; gap: 10px; }
.sw-weather-icon { font-size: 26px; }
.sw-weather-temp { font-size: 22px; font-weight: 700; }
.sw-weather-cond { font-size: 11px; color: #b7c0d0; }
.sw-weather-forecast { display: flex; gap: 8px; margin-top: 8px; }
.sw-weather-day { flex: 1; text-align: center; font-size: 10px; }
.sw-weather-day-icon { font-size: 15px; }
.sw-weather-range { color: #b7c0d0; }

.sw-clocks-grid { gap: 8px !important; }
.sw-card.sw-clock-card {
  background: #1a2231;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.sw-clock-label { font-size: 10px; color: #b7c0d0; margin-bottom: 2px; }
.sw-clock-time { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sw-clock-sub { font-size: 9px; color: #b7c0d0; }
.sw-card.sw-reached .sw-clock-time { color: #7ee787; }

.sw-rss-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sw-rss-item-title { font-size: 12px; font-weight: 600; }
.sw-rss-snippet { font-size: 10px; color: #b7c0d0; }
.sw-rss-meta { font-size: 9px; color: #7c8598; }

.sw-ticker { justify-content: center; }
.sw-ticker-viewport { overflow: hidden; white-space: nowrap; width: 100%; }
.sw-ticker-track { display: inline-flex; will-change: transform; }
.sw-ticker-copy { white-space: pre; font-size: 13px; font-weight: 600; }
@keyframes sw-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.sw-excel-table { border-collapse: collapse; width: 100%; }
.sw-excel-table th, .sw-excel-table td {
  border: 1px solid #2a3345;
  padding: 2px 4px;
  color: #f2f4f8;
}
.sw-excel-header-row th { background: #232d40; }
.sw-excel-wrap { max-height: 260px; }
.sw-excel-cloud-frame { min-height: 220px; }

/* ---------------------------------------------------------------------
   Responsive (~800px): sidebar collapses to a top icon bar
   --------------------------------------------------------------------- */

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
  }

  .sidebar-brand { border-bottom: none; padding: 0 10px 0 0; margin-bottom: 0; }

  .sidebar-nav { flex-direction: row; padding: 0; }
  .sidebar-nav a span.nav-text { display: none; }
  .sidebar-nav a { padding: 8px 10px; }

  .sidebar-footer {
    flex-direction: row;
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0;
    margin-left: auto;
    padding: 0 0 0 10px;
  }

  .sidebar-footer button span.footer-text,
  .sidebar-footer a span.footer-text { display: none; }

  .main { padding: 16px; }

  .playlists-layout { grid-template-columns: 1fr; }
  .editor-body { grid-template-columns: 1fr; }
  .widget-form-panel { flex-direction: column; }
  .widget-preview-col { flex-basis: auto; width: 100%; }
}

/* ---------------------------------------------------------------------
   v2 shell additions: company picker, badges, view stubs, no-access
   --------------------------------------------------------------------- */

.company-picker {
  padding: 0 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.company-picker label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sidebar-fg);
  margin-bottom: 4px;
}

.company-picker select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.company-picker select option { color: var(--text); background: var(--card-bg); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-kiosk { background: var(--warning-soft); color: var(--warning); }
.badge-allergen { background: var(--accent-soft); color: var(--accent-ink); }
.badge-metrics { background: var(--success-soft); color: var(--success); }
.badge-shell { background: var(--accent-soft); color: var(--accent-ink); }

.screen-badges { display: flex; gap: 6px; align-items: center; }

.view-stub { padding: var(--space-6); color: var(--text-muted); }
.view-stub p { margin: 0; }

.no-access-card {
  max-width: 420px;
  margin: 60px auto;
  padding: var(--space-6);
  text-align: center;
}

.no-access-card p { color: var(--text-muted); margin: 0; }

/* ---------------------------------------------------------------------
   v2 screens view: group panel, group/kiosk controls, company chip
   --------------------------------------------------------------------- */

.group-panel { padding: 14px 16px; margin-bottom: 16px; }

.group-panel h3 { margin-bottom: 10px; }

.group-create-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.group-create-form input { flex: 1; min-width: 160px; }

.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.group-list li.empty-hint { border: none; color: var(--muted); }

.group-list .group-name { font-weight: 500; }
.group-list .group-count { font-size: 12px; color: var(--muted); }
.group-list .group-actions { margin-left: auto; display: flex; gap: 4px; }

.screen-company {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.screen-row .screen-group select { min-width: 130px; }

.screen-kiosk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.screen-kiosk .kiosk-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.screen-kiosk .kiosk-idle { width: 72px; }

.screen-allergen {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.screen-allergen .kiosk-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   v2 playlist row extras: transition, opacity, expiry
   --------------------------------------------------------------------- */

.timeline-row { flex-wrap: wrap; }

.row-extras {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-extras .row-transition { max-width: 110px; font-size: 12px; }
.row-extras .row-opacity { width: 64px; font-size: 12px; }
.row-extras .row-expires { max-width: 180px; font-size: 12px; }

/* ---------------------------------------------------------------------
   v2 widgets view: allergen menu form, permission-locked forms
   --------------------------------------------------------------------- */

.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.allergen-cols { width: 72px; }

.form-locked { opacity: 0.55; }
.form-locked input:disabled,
.form-locked select:disabled,
.form-locked textarea:disabled,
.form-locked button:disabled { cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Designer: toolbar, palette, 16:9 canvas, inspector, layer list
   --------------------------------------------------------------------- */

.designer-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

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

.designer-toolbar-row label { margin: 0; white-space: nowrap; }
.designer-toolbar-row .preset-label { margin-left: 12px; }

.designer-layout-select { width: auto; max-width: 240px; }

.designer-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.toolbar-spacer { flex: 1; }

.designer-bg-text { width: 130px; }

.designer-bg-swatch {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.designer-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

/* Palette (left rail) */

.designer-palette {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 640px;
  overflow-y: auto;
}

.palette-group h3 { margin-bottom: 6px; }
.palette-group .empty-hint { padding: 4px 0; }

.palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  cursor: grab;
}

.palette-item:hover { background: #f7f9fc; border-color: var(--border); }
.palette-item:active { cursor: grabbing; }
.palette-item .row-icon { font-size: 15px; width: 20px; }
.palette-item .palette-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .palette-item-type { font-size: 10px; color: var(--muted); }

/* Canvas */

.designer-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.designer-canvas.portrait { aspect-ratio: 9 / 16; max-width: 380px; margin: 0 auto; }

.designer-canvas.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; }

.canvas-empty-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a94a6;
  font-size: 13px;
  pointer-events: none;
}

.designer-zone {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(59, 130, 246, 0.16);
  overflow: visible;
  cursor: move;
  touch-action: none;
}

.designer-zone.selected {
  border-color: var(--sidebar-accent);
  background: rgba(59, 130, 246, 0.3);
}

.zone-label {
  position: absolute;
  top: 2px;
  left: 4px;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.zone-z-badge {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  padding: 0 4px;
  pointer-events: none;
}

.zone-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1px solid var(--sidebar-accent);
  border-radius: 2px;
  z-index: 5;
  touch-action: none;
}

.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-n  { top: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-e  { top: 50%; right: -5px; margin-top: -5px; cursor: ew-resize; }
.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.handle-s  { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.handle-w  { top: 50%; left: -5px; margin-top: -5px; cursor: ew-resize; }

.designer-guide {
  position: absolute;
  background: var(--warning);
  pointer-events: none;
  display: none;
  z-index: 400;
}

.designer-guide.v { top: 0; bottom: 0; width: 1px; }
.designer-guide.h { left: 0; right: 0; height: 1px; }

/* Right rail: inspector + layers */

.designer-rail { display: flex; flex-direction: column; gap: 14px; }

.designer-inspector { padding: 12px 14px; }
.designer-inspector .field { margin-bottom: 10px; }

.inspector-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.zone-id-chip {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 4px;
  padding: 2px 8px;
}

.zone-kind-note { font-size: 12px; color: var(--muted); }

.geo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}

.z-order-row { margin-bottom: 12px; }
.z-order-btns { display: flex; gap: 4px; flex-wrap: wrap; }

.zone-content-editor { border-top: 1px solid var(--border); padding-top: 10px; }

.zone-mini-preview { margin-bottom: 10px; }

.zone-media-thumb {
  max-width: 100%;
  max-height: 110px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.designer-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: #f7f9fc;
}

.designer-text-preview {
  background: #10151d;
  border: 1px solid #232b39;
  border-radius: 6px;
  min-height: 110px;
  max-height: 200px;
  padding: 8px;
  color: #f2f4f8;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.designer-text-preview .sw-zone-text-body {
  font-size: calc(12px * var(--sw-text-scale, 1));
  line-height: 1.35;
}

.zone-delete-btn { margin-top: 4px; }

.designer-layers { padding: 12px 14px; }

.layer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.layer-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
}

.layer-list li.selected { border-color: var(--accent); background: var(--accent-soft); }
.layer-list li .row-icon { font-size: 14px; width: 18px; }
.layer-list li .layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-list li .layer-z { font-size: 10px; color: var(--muted); }

.layer-list .layer-btns { display: flex; gap: 2px; }

.layer-list .layer-btns button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 20px;
  height: 18px;
  line-height: 1;
  font-size: 10px;
  cursor: pointer;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .designer-layout { grid-template-columns: 1fr; }
  .designer-palette { max-height: 220px; }
}

/* ---------------------------------------------------------------------
   Toasts: warning variant (schedule overlap hints)
   --------------------------------------------------------------------- */

.toast-warning { background: var(--warning); }

/* ---------------------------------------------------------------------
   Schedule view: row list, target/content radios, day/time pickers
   --------------------------------------------------------------------- */

.schedule-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.schedule-row {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 1fr 1fr 1.3fr 0.7fr 0.9fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.schedule-row-head {
  background: transparent;
  border: none;
  padding: 0 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.schedule-target-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 4px;
}

.schedule-actions { display: flex; gap: 6px; justify-self: end; }

.schedule-form-panel { padding: 16px 18px; max-width: 480px; }

.radio-row { display: flex; gap: 14px; margin-bottom: 8px; }
.radio-item { font-weight: 400; }

.day-checkbox-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.day-check { font-size: 12px; }

.time-row { display: flex; align-items: center; gap: 8px; }
.time-row input { max-width: 140px; }

.form-actions-row { display: flex; gap: 8px; margin-top: 14px; }

.schedule-campaign { font-size: 12px; color: var(--muted); }

/* Campaigns (C3): sub-panel above the schedule list + status badges */
.campaign-panel { padding: 14px 16px; margin-bottom: 16px; }

.campaign-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.campaign-panel-head h2 { margin: 0; font-size: 15px; }

.campaign-row {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 0.9fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.campaign-name { font-weight: 500; }
.campaign-dates, .campaign-count { color: var(--muted); font-size: 12px; }
.campaign-actions { display: flex; gap: 6px; justify-self: end; }

.campaign-status { margin-left: 4px; }
.campaign-status-draft     { background: var(--surface-2); color: var(--muted); }
.campaign-status-scheduled { background: var(--warning-soft); color: var(--warning); }
.campaign-status-live      { background: var(--success-soft); color: var(--success); }
.campaign-status-ended     { background: var(--surface-2); color: var(--muted); }
.campaign-tag { background: var(--accent-soft); color: var(--accent-ink); }

@media (max-width: 720px) {
  .campaign-row { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   Monitor wall: staggered snapshot cards, metric chips, offline badge
   --------------------------------------------------------------------- */

.status-dot.warn { background: var(--warning); }

.badge-offline { background: var(--danger-soft); color: var(--danger); }

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.monitor-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; }

.monitor-card-head { display: flex; align-items: center; gap: 8px; }
.monitor-status { display: flex; align-items: center; gap: 6px; }
.monitor-name { font-weight: 600; font-size: 14px; }

.monitor-sub { font-size: 12px; color: var(--muted); }

.monitor-badges { flex-wrap: wrap; }

.monitor-snapshot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #10151d;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.monitor-snapshot-img { width: 100%; height: 100%; object-fit: contain; }

.monitor-snapshot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a94a6;
  font-size: 11px;
  text-align: center;
  padding: 8px;
}

.monitor-captured { font-size: 10px; color: var(--muted); }

.monitor-metrics { display: flex; flex-wrap: wrap; gap: 6px; }

.metric-chip {
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Allergens view: dish list, editor form, allergen grid, kiosk preview,
   traceability fieldset
   --------------------------------------------------------------------- */

.allergen-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }

.dish-list { flex: 0 0 320px; display: flex; flex-direction: column; gap: 10px; }

.dish-card { display: flex; align-items: center; gap: 10px; padding: 10px; }

.dish-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.dish-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--muted);
}

.dish-info { flex: 1; min-width: 0; }
.dish-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.dish-price { font-size: 12px; color: var(--muted); }

.badge-vegan { background: var(--success-soft); color: var(--success); }
.badge-vegetarian { background: var(--accent-soft); color: var(--accent-ink); }
.allergen-count-chip { background: var(--surface-2); color: var(--muted); }

.dish-actions { display: flex; flex-direction: column; gap: 4px; }

.dish-form-panel { flex: 1; min-width: 340px; display: flex; gap: 18px; flex-wrap: wrap; }
.dish-form-col { flex: 1; min-width: 300px; }
.dish-preview-col { flex: 0 0 320px; }

.dish-diet-field { display: flex; gap: 16px; }

.dish-image-preview {
  display: block;
  max-width: 160px;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: var(--surface-2);
}

.allergen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
}

.allergen-check { font-size: 12px; }

.allergen-preview-card {
  background: #10151d;
  border-radius: var(--radius);
  border: 1px solid #232b39;
  min-height: 160px;
  padding: 14px;
  color: #f2f4f8;
}

.preview-dish-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.preview-dish-price { font-size: 13px; color: #b7c0d0; margin-bottom: 8px; }
.preview-badge-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.preview-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-no-allergens { font-size: 11px; color: #8a94a6; }

.allergen-chip {
  font-size: 10px;
  background: rgba(217, 119, 6, 0.18);
  color: #ffc978;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.traceability-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }

.traceability-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.traceability-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.traceability-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
}

.traceability-body { flex: 1; min-width: 0; }
.traceability-supplier { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.traceability-date { font-size: 10px; color: var(--muted); margin-top: 2px; }

.traceability-add-form { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 800px) {
  .schedule-row { grid-template-columns: 1fr; }
  .schedule-row-head { display: none; }
  .dish-form-panel { flex-direction: column; }
  .dish-preview-col { flex-basis: auto; width: 100%; }
}

/* ---------------------------------------------------------------------
   Users view — rows reuse .screen-row/.screen-actions/.screen-company/
   .screens-list; role/status/count badges reuse the .badge base.
   --------------------------------------------------------------------- */

.user-name-wrap { display: flex; align-items: center; gap: 6px; min-width: 140px; }

.badge-role-super_admin { background: var(--danger-soft); color: var(--danger); }
.badge-role-company_admin { background: var(--accent-soft); color: var(--accent-ink); }
.badge-role-user { background: var(--surface-2); color: var(--muted); }
.badge-you { background: var(--surface-2); color: var(--muted); }
.badge-count { background: var(--surface-2); color: var(--muted); }

/* ---------------------------------------------------------------------
   Companies view — rows reuse .screen-row/.screen-actions/
   .screen-name-input/.screen-last-seen; create form reuses
   .group-create-form.
   --------------------------------------------------------------------- */

.badge-active { background: var(--success-soft); color: var(--success); }
.badge-suspended { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------------
   Billing banner — persistent strip above the view container
   --------------------------------------------------------------------- */

.billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 500;
}

.billing-banner-trial { background: rgba(42, 102, 236, 0.08); border-color: rgba(42, 102, 236, 0.35); color: var(--accent-dark); }
.billing-banner-pastdue { background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.4); color: var(--warning); }
.billing-banner-restricted { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.4); color: var(--danger); }

/* Plan chooser (Billing view) */
.billing-usage { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 8px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card h3 { margin: 0; font-size: 16px; }
.plan-card-limit { font-weight: 600; }
.plan-card-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.plan-card-features li::before { content: "\2713 "; color: var(--accent); }
.plan-card-current-tag { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--accent); }
.plan-card-total { font-size: 20px; font-weight: 700; }
.plan-card .btn { margin-top: auto; }

.billing-addon-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.billing-addon-box h3 { margin: 0 0 8px; font-size: 15px; }

/* White-label appearance panel */
.branding-swatch { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.branding-logo-preview { max-height: 48px; max-width: 180px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; padding: 4px; background: #fff; }
.branding-locked { color: var(--muted); font-size: 14px; }

/* Emergency takeover + schedule priority */
.schedule-priority { font-size: 12px; color: var(--muted); }

.emergency-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
}
.emergency-banner-text { flex: 1 1 auto; letter-spacing: 0.02em; }

.emergency-open-btn { margin-left: auto; }

.emergency-panel { display: flex; flex-direction: column; gap: 14px; }
.emergency-section-title { margin: 4px 0 0; font-size: 15px; }

.emergency-active-box {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.emergency-active-title { font-weight: 700; color: var(--danger); }
.emergency-active-meta { font-size: 12px; color: var(--muted); }

.emergency-activate-opts { display: flex; gap: 14px; flex-wrap: wrap; }
.emergency-activate-opts .field { flex: 1 1 180px; margin: 0; }

.emergency-template-list, .emergency-trigger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.emergency-template-row, .emergency-trigger-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
}
.emergency-template-row.is-active { border-color: var(--danger); background: rgba(220, 38, 38, 0.06); }
.emergency-template-info, .emergency-trigger-info { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.emergency-trigger-info { flex-direction: column; align-items: flex-start; gap: 2px; }
.emergency-template-title { font-weight: 600; }
.emergency-template-actions, .emergency-trigger-actions { display: flex; gap: 6px; flex-shrink: 0; }
.emergency-trigger-name { font-weight: 600; }
.emergency-trigger-meta { font-size: 12px; color: var(--muted); }

.emergency-preset-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
}
.emergency-preset-badge.preset-fire { background: #b00020; }
.emergency-preset-badge.preset-lockdown { background: #1a2b5c; }
.emergency-preset-badge.preset-weather { background: #b8860b; }
.emergency-preset-badge.preset-info { background: #0b5cad; }
.emergency-preset-badge.preset-custom { background: var(--muted); }

.emergency-trigger-section { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.emergency-color-row { display: flex; gap: 16px; }
.emergency-color-field { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.emergency-token-warning { color: var(--danger); font-weight: 600; }
.emergency-token-value {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  padding: 8px 10px;
  background: var(--code-bg, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.emergency-help-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.emergency-help-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
   Billing view — status card + super_admin override form; status badges
   reuse the .badge base (also shown on Companies rows). Users rows get
   a .user-email column.
   --------------------------------------------------------------------- */

.billing-card { max-width: 560px; padding: 18px 20px; margin-bottom: 18px; }
.billing-status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.billing-status-line h2 { margin: 0; }
.billing-detail { color: var(--muted); font-size: 13px; margin: 2px 0; }
.billing-note { color: var(--muted); font-style: italic; margin-top: 8px; }
.billing-actions { display: flex; gap: 8px; margin-top: 14px; }

.badge-billing-trialing { background: var(--accent-soft); color: var(--accent-ink); }
.badge-billing-active { background: var(--success-soft); color: var(--success); }
.badge-billing-past_due { background: var(--warning-soft); color: var(--warning); }
.badge-billing-canceled { background: var(--danger-soft); color: var(--danger); }
.badge-exempt { background: var(--surface-2); color: var(--muted); }

.user-email { font-size: 12px; color: var(--muted); min-width: 140px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------------
   Onboarding — getting-started checklist + welcome wizard
   --------------------------------------------------------------------- */

.onboarding-checklist { padding: 12px 16px; margin-bottom: 18px; }
.onboarding-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.onboarding-progress { color: var(--muted); font-size: 13px; }
.onboarding-dismiss { margin-left: auto; }
.onboarding-steps { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.onboarding-step { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: inherit; }
a.onboarding-step { color: var(--accent); text-decoration: none; }
a.onboarding-step:hover { text-decoration: underline; }
.onboarding-step.done { color: var(--muted); text-decoration: line-through; }
.onboarding-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink);
}
.onboarding-step.done .onboarding-tick { background: var(--success-soft); color: var(--success); }

.onboard-wizard h3 { margin: 0 0 10px; }
.onboard-wizard p { margin: 0 0 12px; color: var(--muted); }
.onboard-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.onboard-flow-chip {
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.onboard-flow-arrow { color: var(--muted); font-size: 16px; }

/* Pairing help expander (Screens view) */
.pairing-help { padding: 0; margin-bottom: 14px; }
.pairing-help summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.pairing-help-body { padding: 0 16px 14px; }
.pairing-help-body p { margin: 0 0 10px; }
.pairing-help-url { overflow-wrap: anywhere; }
.pairing-help-qr svg { width: 160px; height: 160px; display: block; margin: 6px 0; }
.pairing-help-hint { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------------
   Help centre (#help) + view help popovers + empty-state CTAs
   --------------------------------------------------------------------- */

.help-tip-pop-wide { width: 280px; }
.view-help-blurb { display: block; margin-bottom: 8px; }
.view-help-more { font-weight: 600; text-decoration: none; }
.view-help-more:hover { text-decoration: underline; }

.help-layout {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.help-sidebar { width: 250px; flex: 0 0 auto; }

.help-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  margin-bottom: 10px;
}

.help-article-list { list-style: none; margin: 0; padding: 0; }
.help-article-list li { margin: 0 0 2px; }

.help-article-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.help-article-list a:hover { background: var(--accent-soft); }

.help-article-list li.selected a {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.help-article {
  flex: 1;
  min-width: 0;
  max-width: 780px;
  padding: 24px 28px;
}

.help-article h2 { font-size: 18px; margin: 0 0 12px; }
.help-article h3 { font-size: 14px; margin: 18px 0 6px; }
.help-article p, .help-article li { line-height: 1.6; }
.help-article ul, .help-article ol { margin: 0 0 10px; padding-left: 22px; }

.help-article code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty-state { padding: 12px 0; }
.empty-state .empty-hint { padding: 0 0 10px; }
.empty-cta { align-self: flex-start; }

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

@media (max-width: 800px) {
  .help-layout { flex-direction: column; }
  .help-sidebar { width: 100%; }
}

/* ---------------------------------------------------------------------
   Shared UI: skip link, loading placeholder, inline rename
   --------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}

.view-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: view-loading-spin 0.8s linear infinite;
}

@keyframes view-loading-spin {
  to { transform: rotate(360deg); }
}

.inline-rename-input {
  width: 100%;
  max-width: 240px;
  padding: 3px 8px;
  font-size: 13px;
}

/* ---------------------------------------------------------------------
   Template gallery (modal grid, category chips, CSS thumbs)
   --------------------------------------------------------------------- */
.template-gallery-btn { width: 100%; margin-top: 8px; }

.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.template-chip {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

.template-chip:hover { border-color: var(--accent); color: var(--accent); }

.template-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--card-bg);
}

.template-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.template-card h3 { margin: 0; font-size: 14px; }

.template-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}

.template-card .btn { align-self: flex-start; }

.badge-template-cat {
  background: var(--accent-soft);
  color: var(--accent-ink);
  white-space: nowrap;
}

.tpl-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  overflow: hidden;
  background: #0f172a;
}

.tpl-thumb-block {
  position: absolute;
  border-radius: 2px;
  opacity: 0.92;
}

/* Per-screen remote command menu (Screens view). */
.screen-remote { position: relative; display: inline-block; }
.screen-remote > summary {
  list-style: none;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--card-bg);
  white-space: nowrap;
}
.screen-remote > summary::-webkit-details-marker { display: none; }
.screen-remote > summary:hover { border-color: var(--accent); color: var(--accent); }
.screen-remote-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  min-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.screen-remote-menu .btn { justify-content: flex-start; text-align: left; }

/* Reports view (proof-of-play). */
.report-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.report-filters .field { margin: 0; }
.report-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.report-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-1);
}
.report-tile-value { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.report-tile-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.report-chart-svg { width: 100%; height: auto; display: block; }
.report-grid { stroke: var(--border); stroke-width: 1; }
.report-axis-line { stroke: var(--muted); stroke-width: 1; }
.report-bar { fill: var(--accent); }
.report-axis-x, .report-axis-y {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}
.report-axis-y { text-anchor: end; }
.report-axis-x { text-anchor: start; }
.report-chart-data { margin-top: 12px; }
.report-chart-data > summary { cursor: pointer; color: var(--accent); font-size: 0.85rem; }

.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: var(--text-base);
}
.report-table th {
  color: var(--text-muted);
  font-weight: var(--font-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  user-select: none;
}
.report-table tbody tr:hover { background: var(--surface-2); }
.report-asset-table th[role="button"] { cursor: pointer; }
.report-asset-table th[role="button"]:hover { color: var(--accent); }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
