:root {
  --primary: #0a8f58;
  --primary-dark: #076b43;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --text: #1d2b24;
  --muted: #65736c;
  --line: #dce5df;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: #0f2118;
  color: #fff;
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
}
.brand small { display: block; color: #aebbb4; margin-top: 2px; }
.sidebar nav { display: grid; gap: 8px; margin-top: 32px; }
.sidebar nav a {
  color: #e8f2ed;
  padding: 12px 14px;
  border-radius: 8px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; }
.topbar {
  min-height: 82px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
}
.topbar h1 { margin: 0; font-size: 24px; }
.topbar span { color: var(--muted); font-size: 14px; }
.menu-button { display: none; }
.logout { color: var(--muted); font-weight: 700; }
.content { padding: 28px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stats-grid article, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(22, 45, 34, .06);
}
.stats-grid article { padding: 18px; }
.stats-grid span { color: var(--muted); font-size: 13px; }
.stats-grid strong { display: block; margin-top: 8px; font-size: 28px; }
.panel { padding: 22px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-header h2 { margin: 0; font-size: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.actions button {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
select[multiple] { min-height: 130px; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.detail-list p { margin: 0 0 12px; }
.messages { padding: 18px 28px 0; }
.message {
  padding: 12px 14px;
  border-radius: 8px;
  background: #e9f7ef;
  border: 1px solid #c8ead7;
  margin-bottom: 10px;
}
.message.error { background: #fff0ed; border-color: #ffd3ca; color: var(--danger); }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #eef7f1, #ffffff);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(20, 52, 36, .12);
}
.login-brand { margin-bottom: 28px; color: var(--text); }
.form { display: grid; gap: 16px; }
.destination-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.destination-box legend { color: var(--text); font-weight: 800; }
.inline { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.inline input { width: auto; min-height: auto; }
.destination-modes { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }

@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s ease; z-index: 20; }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-flex; }
  .topbar { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .content, .topbar { padding: 18px; }
  .form-grid, .stats-grid { grid-template-columns: 1fr; }
  .panel-header { align-items: stretch; flex-direction: column; }
}


.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: #eef3f0;
  color: var(--muted);
}
.status-pill.ativo { background: #e4f7ee; color: var(--primary-dark); }
.status-pill.agendado { background: #eef5ff; color: #23579c; }
.status-pill.expirado { background: #f3ece5; color: #8b5a2b; }
.status-pill.inativo { background: #f4eeee; color: #84636a; }
.compact-actions { flex-wrap: wrap; gap: 8px; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdfc;
}
.form-section h2, .comunicado-detail h2 { margin: 0 0 14px; font-size: 16px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mosaic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mosaic-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
}
.mosaic-card input { width: auto; min-height: auto; margin-bottom: 10px; }
.mosaic-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,143,88,.14); }
.mosaic-card strong { display: block; margin-top: 10px; color: var(--text); }
.mosaic-card small, .field-note { color: var(--muted); }
.mosaic-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: #101816;
}
.mosaic-preview i, .mosaic-preview b, .mosaic-preview em { display: block; border-radius: 4px; background: #dce5df; }
.mosaic-preview.video_fullscreen i { grid-column: 1 / -1; grid-row: 1 / -1; background: #0a8f58; }
.mosaic-preview.informativo_completo { grid-template-columns: 1.2fr 1fr .8fr; grid-template-rows: 1fr 1fr; }
.mosaic-preview.informativo_completo i { grid-row: 1 / 3; background: #dfeee7; }
.mosaic-preview.informativo_completo b { background: #0a8f58; }
.mosaic-preview.informativo_completo em { background: #f0d6a7; }
.mosaic-preview.mosaico_3 { grid-template-columns: 1fr 1fr .9fr; grid-template-rows: 1.25fr 1fr; }
.mosaic-preview.mosaico_3 i { grid-column: 1 / 3; background: #0a5b3b; }
.mosaic-preview.mosaico_3 b { background: #d87922; }
.mosaic-preview.mosaico_3 em { background: #092f4f; }
.nested { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.repeat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}
.upload-meter {
  align-self: end;
  height: 8px;
  border-radius: 999px;
  background: #e8efeb;
  overflow: hidden;
}
.upload-meter span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .2s ease; }
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 17, 12, .72);
  padding: 28px;
}
.preview-dialog {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.preview-toolbar select { max-width: 220px; margin-left: auto; }
.preview-frame-wrap { display: grid; place-items: center; overflow: auto; padding: 18px; background: #18231e; }
.preview-frame {
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  color: #fff;
}
.preview-frame[data-size="1920x1080"] { width: min(100%, 1200px); }
.preview-frame[data-size="1280x720"] { width: min(100%, 900px); }
@media (max-width: 900px) {
  .mosaic-grid, .nested, .repeat-row { grid-template-columns: 1fr; }
  .preview-modal { padding: 10px; }
}


.painel-stats { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.painel-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
}
.painel-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}
.painel-item {
  display: grid;
  gap: 7px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}
.painel-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(10,143,88,.12); }
.painel-item strong { font-size: 15px; }
.painel-item small { color: var(--muted); line-height: 1.35; }
.painel-preview-area { min-width: 0; display: grid; gap: 12px; align-content: start; }
.painel-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.painel-preview-toolbar strong, .painel-preview-toolbar span { display: block; }
.painel-preview-toolbar span { color: var(--muted); margin-top: 3px; }
.painel-tv-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #07100c;
  border: 1px solid var(--line);
}
.empty-admin-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}
.tv-mosaic {
  width: 100%;
  height: 100%;
  background: #07100c;
  color: #fff;
  font-family: Inter, Arial, sans-serif;
}
.mosaic-video { display: grid; place-items: center; background: #000; }
.mosaic-video video, .loop-video video { width: 100%; height: 100%; background: #000; display: block; }
.mosaic-info {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(220px, 1fr) minmax(170px, .78fr);
  grid-template-rows: 1fr 1fr 42px;
  gap: 10px;
  padding: 14px;
  background: #0b1511;
}
.birthday-feature, .loop-video, .weather-box, .alert-box {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: #12221a;
}
.birthday-feature { grid-row: 1 / 3; display: grid; grid-template-rows: minmax(0, 1.2fr) auto; }
.birthday-feature img, .photo-placeholder { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: #20362b; }
.photo-placeholder::after { content: "Foto"; display: grid; place-items: center; height: 100%; color: #b6c8bf; font-size: clamp(18px, 2.2vw, 36px); }
.birthday-feature div { padding: 14px; }
.birthday-feature span, .weather-box span { color: #82d6ad; font-size: clamp(10px, 1.1vw, 18px); font-weight: 800; text-transform: uppercase; }
.birthday-feature h1 { margin: 6px 0; font-size: clamp(22px, 3vw, 52px); line-height: 1; }
.birthday-feature p, .birthday-feature strong, .birthday-feature em { display: block; margin: 4px 0; font-size: clamp(12px, 1.35vw, 24px); line-height: 1.2; }
.birthday-feature em { color: #e8f2ed; font-style: normal; }
.loop-video { grid-row: 1 / 3; }
.weather-box, .alert-box { padding: 14px; }
.weather-box h2 { margin: 8px 0; font-size: clamp(28px, 4vw, 64px); }
.weather-box p, .alert-box p, .weather-box small, .weather-box em { display: block; font-size: clamp(12px, 1.35vw, 22px); line-height: 1.25; color: #d9efe3; }
.alert-box { border-left: 6px solid #6ea7d8; }
.alert-box.atencao { border-left-color: #d9a441; }
.alert-box.urgente { border-left-color: #c94f45; }
.alert-box.seguranca { border-left-color: #0a8f58; }
.alert-box h2 { margin: 8px 0; font-size: clamp(20px, 2.4vw, 42px); }
.alert-box span { font-size: clamp(16px, 2vw, 34px); }
.empty-panel { height: 100%; display: grid; place-items: center; color: #aebbb4; font-size: clamp(12px, 1.5vw, 24px); text-align: center; padding: 14px; }
.mosaic-info footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #c8d8d0;
  font-size: clamp(11px, 1.2vw, 20px);
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 8px;
}
.mosaic-info footer b { color: #82d6ad; }
@media (max-width: 1100px) {
  .painel-layout { grid-template-columns: 1fr; }
  .painel-list { max-height: none; }
}
@media (max-width: 680px) {
  .painel-stats { grid-template-columns: 1fr; }
  .painel-preview-toolbar { align-items: stretch; flex-direction: column; }
}


.painel-tv-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
}
.painel-tv-frame:fullscreen .tv-mosaic { width: 100vw; height: 100vh; }


/* modern-admin-refresh */
:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --text: #18231d;
  --muted: #64736b;
  --line: #dde6e1;
  --line-strong: #cbd8d1;
  --surface: #fbfcfb;
  --surface-hover: #f0f6f3;
  --focus: rgba(10, 143, 88, .24);
  --shadow-sm: 0 1px 2px rgba(22, 45, 34, .05);
  --shadow-md: 0 14px 34px rgba(22, 45, 34, .08);
  --shadow-lg: 0 24px 70px rgba(12, 34, 24, .14);
}

html { background: var(--bg); }
body { line-height: 1.45; }
a { font-weight: 700; }
.sidebar {
  width: 248px;
  padding: 22px 18px;
  background: #0d1c16;
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand {
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mark {
  width: 40px;
  height: 40px;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.12);
}
.sidebar nav { gap: 4px; margin-top: 22px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  color: #dbe7e1;
  border: 1px solid transparent;
}
.sidebar nav a:hover,
.sidebar nav a:focus-visible {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.08);
  color: #fff;
  outline: none;
}
.topbar {
  min-height: 74px;
  padding: 14px 28px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 22px; letter-spacing: 0; }
.content { padding: 24px 28px 34px; }
.panel,
.stats-grid article {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.panel { padding: 20px; }
.panel-header {
  min-height: 42px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-header h2 { font-size: 17px; }
.stats-grid { gap: 14px; }
.stats-grid article {
  position: relative;
  overflow: hidden;
  padding: 16px;
}
.stats-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}
.stats-grid span { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stats-grid strong { font-size: 30px; line-height: 1.1; }
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
table { min-width: 880px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8faf9;
  border-bottom-color: var(--line-strong);
  letter-spacing: .04em;
}
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #f8fbf9; }
th, td { padding: 12px 12px; }
td { color: #27352e; }
.actions a,
.actions button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  background: #eef6f2;
  color: var(--primary-dark);
}
.actions button {
  border: 0;
  color: var(--danger);
  background: #fff1ef;
}
.actions a:hover,
.actions button:hover { filter: brightness(.97); }
.button {
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(22,45,34,.08);
}
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.painel-item:focus-visible,
.mosaic-card:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.button.primary {
  background: linear-gradient(180deg, #0b9a60, var(--primary));
  border-color: #07804f;
}
.button.danger { background: #b42318; border-color: #9f1f16; }
input, select, textarea {
  min-height: 40px;
  border-color: var(--line-strong);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover, select:hover, textarea:hover { border-color: #b8c8c0; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
label { gap: 7px; color: #56665e; }
.form-grid { gap: 14px; }
.form-section,
.destination-box {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.form-section h2,
.destination-box legend { color: var(--text); }
.status-pill {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  letter-spacing: .04em;
}
.status-pill.ativo { background: #dbf3e7; color: #076b43; }
.status-pill.agendado { background: #e8f1ff; color: #1d4f91; }
.status-pill.expirado { background: #f6eadf; color: #7f4d20; }
.status-pill.inativo { background: #eee9eb; color: #735963; }
.mosaic-card {
  position: relative;
  padding: 12px;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.mosaic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.mosaic-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,143,88,.16), var(--shadow-md);
}
.mosaic-preview { background: #111a16; border: 1px solid rgba(255,255,255,.08); }
.repeat-row {
  padding: 14px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.preview-modal { background: rgba(9, 18, 14, .78); backdrop-filter: blur(6px); }
.preview-dialog { box-shadow: var(--shadow-lg); }
.preview-toolbar { background: #fff; }
.painel-view { padding: 18px; }
.painel-layout { gap: 16px; }
.painel-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbf9;
}
.painel-item {
  border-color: transparent;
  box-shadow: none;
  background: #fff;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.painel-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--line);
}
.painel-item.active {
  background: #f0f8f4;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(10,143,88,.12);
}
.painel-preview-toolbar {
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.painel-tv-frame {
  border-color: #c6d5cd;
  box-shadow: 0 20px 45px rgba(13, 28, 22, .12);
}
.empty-admin-state {
  background: #f8fbf9;
  border-radius: 8px;
}
.message { box-shadow: var(--shadow-sm); }
.login-card { box-shadow: var(--shadow-lg); }
@media (max-width: 1000px) {
  .sidebar { box-shadow: 20px 0 55px rgba(0,0,0,.24); }
}
@media (max-width: 680px) {
  .content { padding: 16px; }
  .panel { padding: 16px; }
  .table-wrap { border-radius: 8px; }
  .actions a, .actions button { min-height: 34px; }
}
