/* Painel Smart Indoor · folha base (desktop)
   ID visual da marca: roxo profundo + branco, magenta só em detalhes.
   Os componentes usam só as variáveis de :root. */

/* ---------- Tokens ---------- */
:root {
  --font-ui: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: var(--font-ui);
  --font-num: var(--font-ui);
  --head-weight: 800;
  --head-transform: none;
  --head-tracking: -0.025em;
  --h1: 28px;
  --h2: 17px;
  --stat-font: var(--font-ui);
  --stat-size: 32px;
  --label-font: var(--font-ui);
  --label-transform: none;
  --label-tracking: 0em;
  --label-size: 12px;
  --label-weight: 600;

  /* Marca */
  --brand: #320E45;
  --brand-deep: #1A082C;
  --brand-2: #4A1A66;
  --brand-pop: #E879F9;

  --bg: #F5F3F7;
  --panel: #FFFFFF;
  --panel-2: #F6F4F8;
  --line: #E9E5EE;
  --line-2: #D6D0DE;
  --card-line: #E9E5EE;
  --text: #1D1027;
  --text-2: #51465C;
  --text-3: #675C73;

  --side-bg: var(--brand);
  --side-line: rgba(255, 255, 255, 0.12);
  --side-text: #DCD0E6;
  --side-text-2: #AE9BBD;
  --side-strong: #FFFFFF;
  --side-hover: rgba(255, 255, 255, 0.08);
  --side-on-bg: rgba(255, 255, 255, 0.14);
  --side-on-text: #FFFFFF;
  --side-on-icon: var(--brand-pop);

  --accent: #A435C9;
  --accent-ink: #5B1A80;
  --accent-soft: #F3E8FA;

  --btn-bg: var(--brand);
  --btn-text: #FFFFFF;
  --btn-hover: var(--brand-2);
  --btn2-bg: #FFFFFF;
  --btn2-text: #1D1027;
  --btn2-line: #D6D0DE;
  --btn-radius: 999px;
  --btn-font: var(--font-ui);
  --btn-transform: none;
  --btn-tracking: 0em;
  --btn-size: 14px;

  --seg-bg: #EEEAF2;
  --seg-line: #E9E5EE;
  --seg-on-bg: #FFFFFF;
  --seg-on-text: #1D1027;
  --seg-shadow: 0 1px 2px rgba(50, 14, 69, 0.14);

  --radius: 16px;
  --radius-sm: 10px;
  --chip-radius: 999px;
  --pill-radius: 999px;
  --tv-radius: 10px;
  --shadow: 0 1px 2px rgba(50, 14, 69, 0.04), 0 8px 24px rgba(50, 14, 69, 0.07);
  --pad: 20px;
  --gap: 20px;
  --main-pad: 36px;
  --tcard-min: 250px;

  --ok: #16A34A;
  --ok-ink: #11793A;
  --ok-soft: #E4F5EA;
  --bad: #E5484D;
  --bad-ink: #B42318;
  --bad-soft: #FDEBEC;
  --warn: #F59E0B;
  --warn-ink: #8A3C0B;
  --warn-soft: #FEF2DC;
  --info: #2F5BEA;
  --info-ink: #1D4ED8;
  --info-soft: #E8EEFF;

  --sch-a-bg: var(--brand);
  --sch-a-text: #FFFFFF;
  --sch-b-bg: #2F5BEA;
  --sch-b-text: #FFFFFF;
  --sch-def-bg: #F0EDF3;
  --sch-def-text: #51465C;
  --sch-def-line: #CDC6D6;

  --pill-bg: rgba(255, 255, 255, 0.95);
  --pill-text: #1D1027;
  --focus: 0 0 0 3px rgba(164, 53, 201, 0.4);
}

/* ---------- Base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 1100px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.c-ok { color: var(--ok); }
.c-bad { color: var(--bad); }
.c-warn { color: var(--warn); }
.c-ok-ink { color: var(--ok-ink); }
.c-bad-ink { color: var(--bad-ink); }
.c-warn-ink { color: var(--warn-ink); }
.c-info-ink { color: var(--info-ink); }
.c-acc-ink { color: var(--accent-ink); }
.rot { transform: rotate(180deg); }

/* ---------- Casca: menu lateral fixo + conteúdo ---------- */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex: 0 0 236px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 14px;
  background: var(--side-bg);
  border-right: 1px solid var(--side-line);
  color: var(--side-text);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.logo {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  color: #FFFFFF;
}
.side .btn-g { color: var(--side-text); }
.side .btn-g:hover { background: var(--side-hover); color: var(--side-strong); }
.side :focus-visible { box-shadow: 0 0 0 3px rgba(232, 121, 249, 0.55); }
.brand-name { display: block; font-family: var(--font-head); font-size: 15px; font-weight: 800; line-height: 1.1; letter-spacing: 0.01em; text-transform: uppercase; color: var(--side-strong); }
.brand-co { display: block; margin-top: 2px; font-size: 12px; color: var(--side-text-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  padding: 14px 12px 6px;
  font-family: var(--label-font);
  text-transform: var(--label-transform);
  letter-spacing: var(--label-tracking);
  font-size: 11px;
  font-weight: var(--label-weight);
  color: var(--side-text-2);
}
.nav a,
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  font-weight: 500;
  text-decoration: none;
}
.nav button { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--side-hover); color: var(--side-strong); }
.nav a.on { background: var(--side-on-bg); color: var(--side-on-text); font-weight: 600; }
.nav a.on svg { color: var(--side-on-icon); }
.nav-alert {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pill-radius);
  background: var(--bad-soft);
  color: var(--bad-ink);
  font-size: 12px;
  font-weight: 700;
}
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 10px 2px; border-top: 1px solid var(--side-line); }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}
.who { min-width: 0; line-height: 1.3; }
.who b { display: block; font-size: 13px; font-weight: 600; color: var(--side-strong); }
.who span { display: block; font-size: 12px; color: var(--side-text-2); }
.main { flex: 1; min-width: 0; padding: var(--main-pad); }
.wrap { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--gap); }
.page-top { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Títulos e arranjos ---------- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.head-l { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.h1, .h2 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  text-transform: var(--head-transform);
  letter-spacing: var(--head-tracking);
  color: var(--text);
}
.h1 { font-size: var(--h1); line-height: 1.05; }
.h2 { font-size: var(--h2); line-height: 1.2; }
.sub { font-size: 14px; color: var(--text-2); }
.lbl {
  font-family: var(--label-font);
  text-transform: var(--label-transform);
  letter-spacing: var(--label-tracking);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  color: var(--text-3);
}
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.actions, .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gap); }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  font-family: var(--btn-font);
  text-transform: var(--btn-transform);
  letter-spacing: var(--btn-tracking);
  font-size: var(--btn-size);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-p { background: var(--btn-bg); color: var(--btn-text); }
.btn-p:hover { background: var(--btn-hover); }
.btn-s { background: var(--btn2-bg); color: var(--btn2-text); border-color: var(--btn2-line); }
.btn-s:hover { background: var(--panel-2); }
.btn-g { background: transparent; color: var(--text-2); }
.btn-g:hover { background: var(--panel-2); color: var(--text); }
.btn-d { background: transparent; color: var(--bad-ink); border-color: var(--line-2); }
.btn-d:hover { background: var(--bad-soft); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 54px; padding: 0 22px; font-size: 16px; }
.btn-ico { width: 40px; padding: 0; }
.btn-ico.btn-sm { width: 32px; }
.btn-block { width: 100%; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-l { font-size: 13px; font-weight: 600; color: var(--text); }
.input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}
.input::placeholder { color: var(--text-3); }
textarea.input { min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.hint { font-size: 12.5px; color: var(--text-3); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search .input { width: 260px; max-width: 100%; padding-left: 38px; }
.select { position: relative; display: flex; align-items: center; }
.select .input { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.select svg { position: absolute; right: 12px; color: var(--text-3); pointer-events: none; }

/* ---------- Seletor segmentado ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--seg-line);
  border-radius: calc(var(--radius-sm) + 4px);
  background: var(--seg-bg);
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--seg-on-bg); color: var(--seg-on-text); box-shadow: var(--seg-shadow); }
.seg .n { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 500; opacity: 0.8; }
.seg-ico button { width: 36px; padding: 0; justify-content: center; }

/* ---------- Selos de status ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--pill-radius);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
button.pill { cursor: pointer; }
.pill-ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill-bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-info { background: var(--info-soft); color: var(--info-ink); }
.pill-acc { background: var(--accent-soft); color: var(--accent-ink); }
.pill-mute { background: var(--panel-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.dot-live { background: var(--ok); animation: live 2.2s ease-out infinite; }
.dot-off { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ---------- Cartões ---------- */
.card { min-width: 0; background: var(--panel); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.clip { overflow: hidden; }
.card-pad { padding: var(--pad); }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 16px var(--pad); border-bottom: 1px solid var(--line); }
.card-b { display: flex; flex-direction: column; gap: 16px; padding: var(--pad); }

/* ---------- Miniatura da TV (16:9, conteúdo em unidades da própria TV) ---------- */
.tv {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--tv-radius);
  background: #05070A;
  container-type: inline-size;
}
.zones { position: absolute; inset: 0; }
.zone { position: absolute; overflow: hidden; }
.ad {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4cqw;
  padding: 0 6cqw;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
}
.ad-k { font-family: "Barlow", Arial, sans-serif; font-size: 2.6cqw; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.ad-t { font-size: 8.4cqw; font-weight: 800; line-height: 0.92; text-transform: uppercase; }
.w {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8cqw;
  text-align: center;
  color: #FFFFFF;
  font-family: "Barlow", Arial, sans-serif;
}
.w-clock { background: #0F1626; }
.w-weather { background: #0C2740; }
.w-big { font-size: 5.4cqw; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.w-small { font-size: 1.9cqw; color: #C7D0DF; }
.w-ico { width: 4.8cqw; height: 4.8cqw; }
.w-ticker {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  background: #0A0F1A;
  color: #FFFFFF;
  border-top: 0.35cqw solid var(--accent);
  font-family: "Barlow", Arial, sans-serif;
  font-size: 2.6cqw;
  font-weight: 600;
}
.w-ticker span { display: inline-block; padding-left: 2.5cqw; }
.marquee span { animation: marquee 26s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tv-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--pill-radius);
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}
.tv.off .zones { filter: grayscale(1) brightness(0.42); }
.tv-msg {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px;
  text-align: center;
  color: #FFFFFF;
  font-size: 12.5px;
}
.tv-msg b { font-weight: 600; }
.tv-msg span { font-size: 11.5px; color: #D5DAE3; }
.tv-wait {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2cqw;
  background: #0D1017;
  color: #8B95A8;
  font-family: "Barlow", Arial, sans-serif;
  font-size: 2.8cqw;
}
.tv-wait b { color: var(--brand-pop); font-size: 5.6cqw; font-weight: 800; letter-spacing: 0.02em; }
.badge-v {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--pill-radius);
  background: rgba(0, 0, 0, 0.72);
  color: #FFFFFF;
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- Mural de telas ---------- */
.grid-telas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--tcard-min), 100%), 1fr)); gap: var(--gap); }
.tcard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tcard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.tcard .tv { border-radius: 0px; }
.tcard-b { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.tcard-n { font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--text); }
.tcard-n span { font-weight: 500; color: var(--text-2); }
.tcard-m { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.tcard-m span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard-m span:last-child { flex: none; }
.tcard-add {
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 24px;
  text-align: center;
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed var(--line-2);
  color: var(--text-2);
}
.tcard-add b { font-size: 15px; color: var(--text); }
.tcard-add .hint { max-width: 230px; }
.plus { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Aviso ---------- */
.alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bad-soft);
}
.alert-i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--panel); color: var(--bad-ink); }
.alert-t { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-t b { font-weight: 600; color: var(--text); }
.alert-t span { font-size: 13px; color: var(--text-2); }

/* ---------- Listas em grade (tabelas) ---------- */
.tbox { overflow-x: auto; }
.dt { display: flex; flex-direction: column; min-width: 720px; }
.dt-h, .dt-r { display: grid; align-items: center; gap: 14px; padding: 12px var(--pad); border-bottom: 1px solid var(--line); }
.dt-h {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--panel-2);
  font-family: var(--label-font);
  text-transform: var(--label-transform);
  letter-spacing: var(--label-tracking);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  color: var(--text-3);
}
.dt > :last-child { border-bottom: 0; }
.dt-pl .dt-h, .dt-pl .dt-r { grid-template-columns: 48px minmax(0, 2.6fr) minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 1.2fr) 72px; }
.dt-rep .dt-h, .dt-rep .dt-r { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.7fr) minmax(0, 0.6fr) minmax(0, 1fr) 40px; }
.dt-r.sel { background: var(--accent-soft); }
.dt-r.sub { padding-top: 9px; padding-bottom: 9px; background: var(--panel-2); font-size: 13px; }
.sub-n { padding-left: 100px; color: var(--text-2); }
.dt-edit { padding: 0 var(--pad) var(--pad); border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.cell-r { text-align: right; justify-self: end; }
.cell-act { display: flex; justify-content: flex-end; gap: 2px; }
.expand { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); cursor: pointer; }
.expand:hover { background: var(--panel-2); }

/* ---------- Mídia (miniatura + nome) ---------- */
.media { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thumb { width: 88px; flex: none; }
.thumb .tv { border-radius: 4px; }
.media-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.media-t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.media-t span { font-size: 12.5px; color: var(--text-3); }
.bar { height: 6px; min-width: 60px; overflow: hidden; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.barcell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* ---------- Biblioteca de mídias ---------- */
.grid-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: var(--gap); }
.mcard { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.mcard .tv { border-radius: 0px; }
.mcard-b { display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 12px 14px; }
.mcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.mcard-n { font-weight: 600; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-m { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; padding-right: 4px; font-size: 12.5px; color: var(--text-3); }
.drop { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--panel); }
.drop-i { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); }
.drop-t { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drop-t b { font-weight: 600; color: var(--text); }
.drop-t span { font-size: 13px; color: var(--text-3); }
.upl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px; border: 1px solid var(--card-line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.upl-t { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upl-t b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog { height: 6px; overflow: hidden; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.prog i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ---------- Playlist e agendamento ---------- */
.where { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--chip-radius);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.chip:hover { border-color: var(--text-3); }
.pos { display: flex; align-items: center; gap: 4px; }
.grip { width: 22px; height: 32px; display: grid; place-items: center; color: var(--text-3); cursor: grab; }
.idx { width: 18px; font-family: var(--font-num); font-size: 12.5px; color: var(--text-3); text-align: right; }
.sched { display: flex; flex-direction: column; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.sched-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px 16px; align-items: start; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--chip-radius);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.day.on { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--chip-radius); background: var(--panel); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.presets button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.summary { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); font-size: 13.5px; }
.summary svg { color: var(--accent-ink); margin-top: 1px; }
.cycle { display: flex; gap: 2px; height: 14px; overflow: hidden; border-radius: 999px; }
.cycle i { display: block; height: 100%; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25); }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-r { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-r span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.legend-r b { font-family: var(--font-num); font-weight: 600; color: var(--text); }
.sw { width: 10px; height: 10px; flex: none; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25); }
.play-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-3); }

/* ---------- Programação da tela (semana) ---------- */
.week { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.week-d { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.week-d.today { color: var(--accent-ink); }
.week-r { position: relative; display: flex; gap: 2px; height: 28px; }
.wseg { display: flex; align-items: center; min-width: 0; padding: 0 8px; overflow: hidden; white-space: nowrap; border-radius: 5px; font-size: 11.5px; font-weight: 600; }
.wseg-def { background: var(--sch-def-bg); color: var(--sch-def-text); box-shadow: inset 0 0 0 1px var(--sch-def-line); }
.wseg-a { background: var(--sch-a-bg); color: var(--sch-a-text); }
.wseg-b { background: var(--sch-b-bg); color: var(--sch-b-text); }
.now { position: absolute; top: -5px; bottom: -5px; z-index: 2; width: 2px; border-radius: 2px; background: var(--text); }
.now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
.week-scale { display: flex; justify-content: space-between; font-family: var(--font-num); font-size: 11px; color: var(--text-3); }
.legend-inline { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.sw-lg { display: inline-block; width: 14px; height: 14px; flex: none; border-radius: 4px; }
.sw-a { background: var(--sch-a-bg); }
.sw-b { background: var(--sch-b-bg); }
.sw-c { background: #0E8F9E; }
.sw-def { background: var(--sch-def-bg); box-shadow: inset 0 0 0 1px var(--sch-def-line); }
.slist { display: flex; flex-direction: column; }
.sitem { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.sitem-t { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sitem-t b { font-weight: 600; color: var(--text); }
.sitem-t span { font-size: 12.5px; color: var(--text-3); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { color: var(--text); text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- Editor de layout ---------- */
.tpls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.tpl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.tpl:hover { border-color: var(--text-3); }
.tpl.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-pv { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: var(--panel-2); }
.tpl-z { position: absolute; display: block; border: 2px solid var(--panel); }
.z-main { background: var(--line-2); }
.z-side { background: var(--text-3); }
.z-bottom { background: var(--accent); }
.tpl-n { font-size: 13px; font-weight: 600; }
.tpl-d { font-size: 12px; color: var(--text-3); }
.zbtn { position: absolute; inset: 0; z-index: 4; display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0); transition: box-shadow 0.15s ease; }
.zbtn:hover { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }
.zbtn.on { box-shadow: inset 0 0 0 3px var(--accent); }
.ztag { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--pill-radius); background: rgba(10, 12, 16, 0.82); color: #FFFFFF; font-family: var(--font-ui); font-size: 12px; font-weight: 600; line-height: 1; }
.zbtn.on .ztag { background: var(--accent); color: #FFFFFF; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt input { flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.opt-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt-t b { font-weight: 600; color: var(--text); }
.opt-t span { font-size: 12.5px; color: var(--text-3); }
.content-box { display: flex; flex-direction: column; gap: 10px; }
.content-cfg { display: flex; flex-direction: column; gap: 16px; padding: 6px 2px 12px 14px; margin-left: 8px; border-left: 2px solid var(--line-2); }
.content-row { gap: 16px; align-items: flex-start; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--accent); margin: 0; }

/* ---------- Relatório ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--gap); }
.stat { display: flex; flex-direction: column; gap: 8px; padding: var(--pad); }
.stat-n { font-family: var(--stat-font); font-size: var(--stat-size); font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.note { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-2); }
.note svg { margin-top: 1px; color: var(--text-3); }

/* ---------- Botões extras ---------- */
.btn-danger { background: var(--bad-ink); color: #FFFFFF; }
.btn-danger:hover { background: #962015; }
.btn[disabled], .btn[disabled]:hover { opacity: 0.5; cursor: not-allowed; }

/* ---------- Avisos rápidos (toasts) ---------- */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(26, 8, 44, 0.08), 0 12px 32px rgba(26, 8, 44, 0.16);
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast svg { margin-top: 1px; }
.toast-ok svg { color: var(--ok-ink); }
.toast-error { background: var(--bad-soft); }
.toast-error svg { color: var(--bad-ink); }
.toast-info svg { color: var(--info-ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Fundo escurecido, diálogo e gaveta ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 8, 44, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.scrim:has(.drawer) { display: block; }
.dialog {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 4px 8px rgba(26, 8, 44, 0.08), 0 24px 48px rgba(26, 8, 44, 0.2);
}
.dialog-body { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: -8px 0 32px rgba(26, 8, 44, 0.16);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.scrim.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------- Estados: vazio, carregando, erro ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-2);
}
.empty-i { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.empty b { font-size: 15px; color: var(--text); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-3); }
.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.errbox, .content-error {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bad-soft);
}
.content-error { margin: 32px; }
.errbox svg, .content-error svg { color: var(--bad-ink); }
.errbox > div, .content-error > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.errbox b, .content-error b { font-weight: 600; color: var(--text); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 56px;
  background: var(--brand-deep);
  color: #FFFFFF;
}
.auth-logo { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; }
.auth-title { max-width: 460px; font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.auth-title b { color: var(--brand-pop); }
.auth-title + .auth-text { margin-top: 16px; }
.auth-text { max-width: 440px; font-size: 16px; color: #B9A9C7; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .seg { display: flex; width: 100%; }
.auth-card .seg button { flex: 1; justify-content: center; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .dot-live, .marquee span, .toast { animation: none; }
  .spinner { animation-duration: 2.4s; }
  .tcard, .zbtn, .scrim, .drawer { transition: none; }
}
