/* SignCast shell theme (dark). Modules may inject their own <style> for module-specific rules. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117; --bg2: #161a23; --bg3: #1e2430; --border: #2a3140;
  --text: #e8ebf2; --muted: #8b93a7; --accent: #6366f1; --accent2: #f59e0b;
  --green: #22c55e; --red: #ef4444;
}
body.light {
  --bg: #f3f4f9; --bg2: #ffffff; --bg3: #e9ebf3; --border: #d4d8e3;
  --text: #1b1e28; --muted: #5d6575; --accent: #5458e0; --accent2: #d97706;
  --green: #16a34a; --red: #dc2626;
}
body.light .dsgn-workspace { background: #dde1ec !important; }
body.light .toast { box-shadow: 0 8px 24px rgba(0,0,0,.15); }
body.light .modal { box-shadow: 0 24px 60px rgba(0,0,0,.2); }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; overflow: hidden; }

#app { display: flex; height: 100vh; }
#sidebar { width: 190px; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 10px; gap: 6px; flex-shrink: 0; }
.logo { font-size: 21px; font-weight: 800; padding: 6px 10px 18px; letter-spacing: .5px; }
.logo span { color: var(--accent); }
.nav-btn { background: none; border: none; color: var(--muted); text-align: left; padding: 11px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: var(--accent); color: #fff; }
.sidebar-foot { margin-top: auto; color: var(--muted); font-size: 11px; padding: 8px 10px; }

#content { flex: 1; overflow: auto; position: relative; }
.tab { display: none; height: 100%; }
.tab.active { display: block; }

.panel { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 20px; }
h2 { font-size: 19px; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-top: 8px; }
.field-label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 5px; }
.row { display: flex; gap: 8px; align-items: center; }

input, select, textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 8px 10px; font-size: 13px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="color"] { padding: 2px; width: 36px; height: 32px; cursor: pointer; }
input[type="range"] { padding: 0; }

.btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 8px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.danger:hover { filter: brightness(1.15); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; width: 520px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.modal-wide { width: 880px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-x { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 20px; overflow: auto; }

/* toast */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg3); border: 1px solid var(--green); color: var(--text); padding: 11px 18px; border-radius: 9px; opacity: 0; transform: translateY(8px); transition: all .25s; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: var(--red); }

/* generic card grid (used by lists) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.card .card-body { padding: 9px 11px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card .card-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge.on { background: rgba(34,197,94,.15); color: var(--green); }
.badge.off { background: rgba(239,68,68,.15); color: var(--red); }

/* empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state-icon { font-size: 48px; display: block; margin-bottom: 12px; opacity: .6; }
.empty-state-text { font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.empty-state-action { display: inline-block; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* Bundled fonts */
@font-face {
  font-family: 'Bodoni Moda';
  src: url('fonts/bodoni-moda-500.ttf') format('truetype');
  font-weight: 500;
  font-display: block;
}

@font-face {
  font-family: 'Bodoni Moda';
  src: url('fonts/bodoni-moda-600.ttf') format('truetype');
  font-weight: 600;
  font-display: block;
}

@font-face {
  font-family: 'Bodoni Moda';
  src: url('fonts/bodoni-moda-700.ttf') format('truetype');
  font-weight: 700;
  font-display: block;
}

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-400.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-600.ttf') format('truetype');
  font-weight: 600;
  font-display: block;
}

@font-face {
  font-family: 'Lato';
  src: url('fonts/lato-300.ttf') format('truetype');
  font-weight: 300;
  font-display: block;
}

@font-face {
  font-family: 'Lato';
  src: url('fonts/lato-400.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}
