/* Baluarte — Universidade Lusófona
   Tema claro: fundo cinza suave, cartões brancos arredondados, barra lateral branca com ícones,
   rosa Lusófona como acento. Modos: Fechada (rosa) e Filtrada (âmbar), também diferentes em luminosidade. */

:root {
  --accent: #d3125b;
  --accent-hover: #b50e4d;
  --accent-ink: #b00d45;        /* rosa para texto (contraste ≥ 4.5:1 em branco e rosa claro) */
  --accent-soft: #fde7ef;
  --accent-line: #f3b7cb;
  --bg: #f3f4f7;
  --surface: #fff;
  --surface-2: #f3f4f7;
  --line: #e6e8ee;
  --line-soft: #f1f2f5;
  --ink: #16181d;
  --ink-2: #3a404c;
  --muted: #5b6270;
  --ok: #1e8e5a;
  --ok-soft: #e3f4ec;
  --warn: #8a5a00;
  --warn-soft: #fff1d6;
  --warn-line: #f0d49a;
  --bad: #b00d45;
  --info: #2450b8;
  --info-soft: #e6eefd;
  --closed: #c80f4e;
  --filtered: #c98a00;
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 256px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.is-hidden { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }

/* ---------- Estrutura ---------- */

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
#sidebar {
  flex: 1 1 var(--sidebar); max-width: var(--sidebar);
  padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 26px;
  /* Presa à altura do ecrã: o estado do FortiGate, o utilizador e a versão ficam sempre no fundo da janela */
  position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
}
#wrapper { flex: 999 1 560px; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; fill: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 16px; letter-spacing: .02em; }
.brand-text span { font-size: 12px; color: var(--muted); }

#sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.nav-group:first-child { padding-top: 0; }
#sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500;
}
#sidebar nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
#sidebar nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.fg-status { padding: 14px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.fg-status:hover { text-decoration: none; color: var(--ink); background: #eceef2; }
.fg-status strong { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fg-status span { font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.warn { background: #d99a00; }
.dot.off { background: #b9bec8; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.who-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.who-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text span { font-size: 12px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.version { font-size: 11px; color: var(--muted); padding: 0 8px; text-align: center; }

/* ---------- Cabeçalho da página ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; }
.page-head .eyebrow { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; font-weight: 400; letter-spacing: 0; }
.page-head .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 4px; letter-spacing: 0; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: -12px; }

/* ---------- Cartões ---------- */

.card { background: var(--surface); border: 1px solid #ebedf2; border-radius: var(--radius); padding: 22px; }
.card > h2:first-child, .card-head h2 { margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head .link { font-size: 13px; font-weight: 600; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > .main { flex: 999 1 520px; min-width: 0; }
.cols > .side { flex: 1 1 320px; min-width: 0; }
section > h2 { margin-top: 8px; }

/* ---------- Formulários ---------- */

input, select, textarea, button { font: inherit; color: inherit; }
input:not([type]), input[type=text], input[type=search], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=password], select, textarea {
  appearance: none; width: 100%; height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); outline: 0;
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; }
select { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6270' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(211, 18, 91, .14); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-2); }
::placeholder { color: #8a909c; opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; white-space: nowrap; transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { border-color: var(--accent-line); color: var(--accent-ink); }
.btn-danger:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn-small { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.btn-link:hover { color: var(--ink); }
.btn-link.danger { color: var(--accent-ink); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; max-width: 960px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; }
.field > span, .field > legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0; }
.field small, .hint { color: var(--muted); font-size: 12.5px; }
.field .err { color: var(--bad); font-size: 12.5px; font-weight: 500; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.choice:hover { border-color: #c9cdd6; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); margin: 2px 0 0; width: 17px; height: 17px; flex: none; }
.choice span { font-weight: 600; }
.choice small { display: block; color: var(--muted); font-weight: 400; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-sm); flex-wrap: wrap; }
.segmented label, .segmented a { padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked), .segmented a.active, .segmented button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 24, 29, .08); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.days label { min-width: 52px; text-align: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); font-weight: 500; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.days label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
[data-when] { display: contents; }
.meta-line { color: var(--muted); font-size: 12.5px; margin: 0; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--muted); min-width: 240px; }
.search input { border: 0; height: auto; padding: 0; background: transparent; box-shadow: none; flex: 1; min-width: 0; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(211, 18, 91, .14); }

/* ---------- Avisos ---------- */

.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0; background: var(--ok-soft); color: #145c3b; border: 1px solid #bfe3d0; }
.notice.error { background: var(--accent-soft); color: #8e0a38; border-color: var(--accent-line); }
.notice.warn { background: var(--warn-soft); color: #6a4400; border-color: var(--warn-line); }
.notice.info { background: var(--info-soft); color: #1b3f91; border-color: #c6d6f7; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice a { color: inherit; text-decoration: underline; }

/* ---------- Tabelas ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid #ebedf2; border-radius: var(--radius); }
.card .table-wrap { border: 0; border-radius: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 13px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
table.data th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom-color: #ebedf2; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafbfc; }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions form { display: inline; }
table.data .strong { font-weight: 600; color: var(--ink); }
table.data a.strong:hover { color: var(--accent-ink); }
table.data .sub { display: block; color: var(--muted); font-size: 12.5px; }
table.data tr.dim td { color: var(--muted); }
table.data tr.empty td { color: var(--muted); text-align: center; padding: 28px; }

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eef0f4; color: var(--ink-2); white-space: nowrap; }
.tag.pink { background: var(--accent-soft); color: var(--accent-ink); }
.tag.off { background: var(--accent-soft); color: var(--accent-ink); }
.tag.ok { background: var(--ok-soft); color: #145c3b; }
.mode { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.mode::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mode.free { background: #eef0f4; color: var(--ink-2); }
.mode.fechada { background: var(--accent-soft); color: var(--accent-ink); }
.mode.filtrada { background: var(--warn-soft); color: #7a4f00; }

/* ---------- Painel ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid #ebedf2; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #eef0f4; color: var(--ink-2); }
.stat-icon.closed { background: var(--accent-soft); color: var(--closed); }
.stat-icon.filtered { background: var(--warn-soft); color: var(--warn); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-icon.good { background: var(--ok-soft); color: var(--ok); }
.stat-icon.alert { background: var(--warn-soft); color: var(--warn); }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); }

.rooms-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.room-card { border: 1px solid #ebedf2; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); }
/* Faixa do estado: a cor do modo vê-se de longe */
.room-band { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 8px 16px;
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.room-state { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; letter-spacing: .06em; }
.room-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8a919e; }
.room-card.fechada .room-band { background: var(--accent-soft); color: var(--accent-ink); }
.room-card.fechada .room-state::before { background: var(--closed); }
.room-card.filtrada .room-band { background: var(--warn-soft); color: #7a4f00; }
.room-card.filtrada .room-state::before { background: var(--filtered); }
.room-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.room-id { min-width: 0; }
.room-id a { font-weight: 750; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; color: var(--ink); display: block; }
.room-id span { font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-card .what { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.room-card .what a, .room-card .what strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.room-card .what > span { font-size: 12px; color: var(--muted); }
.room-card .what .progress { margin-top: 8px; }
.progress { height: 6px; border-radius: 6px; background: #eef0f4; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: var(--closed); }
.filtrada .progress > span { background: var(--filtered); }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.progress-meta span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-card .buttons { display: flex; margin: auto 0 0; }
.room-card .buttons .btn { width: 100%; }
/* Barras de progresso: larguras em passos de 5% (o CSP não deixa usar style="...") */
.w-0 { width: 0 } .w-5 { width: 5% } .w-10 { width: 10% } .w-15 { width: 15% } .w-20 { width: 20% } .w-25 { width: 25% } .w-30 { width: 30% }
.w-35 { width: 35% } .w-40 { width: 40% } .w-45 { width: 45% } .w-50 { width: 50% } .w-55 { width: 55% } .w-60 { width: 60% } .w-65 { width: 65% }
.w-70 { width: 70% } .w-75 { width: 75% } .w-80 { width: 80% } .w-85 { width: 85% } .w-90 { width: 90% } .w-95 { width: 95% } .w-100 { width: 100% }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 48px 14px minmax(0, 1fr); gap: 12px; }
.timeline time { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-top: 1px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .rail::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3px solid #b9bec8; background: #fff; margin-top: 3px; box-sizing: border-box; flex: none; }
.timeline .rail::after { content: ""; flex: 1; width: 2px; background: #eef0f4; margin-top: 4px; }
.timeline li:last-child .rail::after { display: none; }
.timeline li.fechada .rail::before { border-color: var(--closed); }
.timeline li.filtrada .rail::before { border-color: var(--filtered); }
.timeline li.past { opacity: .6; }
.timeline .body { display: flex; flex-direction: column; gap: 2px; padding-bottom: 18px; }
.timeline .body a { font-size: 13px; font-weight: 600; color: var(--ink); }
.timeline .body span { font-size: 12px; color: var(--muted); }

.quick { background: var(--surface); border: 1px solid #ebedf2; border-radius: var(--radius); padding: 18px 22px; }
.quick summary { cursor: pointer; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; list-style: none; }
.quick summary::-webkit-details-marker { display: none; }
.quick summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); font-weight: 400; }
.quick[open] summary::after { content: "–"; }
.quick[open] summary { margin-bottom: 18px; }

/* ---------- Agenda (linha do tempo por sala) ---------- */

.day-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-picker a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid #ebedf2; color: var(--ink);
}
.day-picker a:hover { text-decoration: none; border-color: #c9cdd6; color: var(--ink); }
.day-picker .wd { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.day-picker .num { font-size: 22px; font-weight: 700; line-height: 1.1; }
.day-picker .cnt { font-size: 12px; color: var(--muted); }
.day-picker a.today .wd { color: var(--accent-ink); }
.day-picker a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-picker a.active .wd, .day-picker a.active .cnt { color: rgba(255, 255, 255, .88); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid; display: inline-block; }
.legend i.fechada { background: var(--accent-soft); border-color: var(--closed); }
.legend i.filtrada { background: var(--warn-soft); border-color: var(--filtered); }
.legend i.now { width: 2px; height: 14px; border: 0; border-radius: 0; background: var(--info); }

/* A janela vai das 07:00 às 22:00, em colunas de 15 minutos (60 colunas) */
.tl { min-width: 780px; }
.tl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-top: 1px solid var(--line-soft); }
.tl-row.head { border-top: 0; }
.tl-room { display: flex; flex-direction: column; justify-content: center; padding: 12px 12px 12px 0; min-width: 0; }
.tl-room a { font-weight: 700; color: var(--ink); }
.tl-room span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-hours { display: grid; grid-template-columns: repeat(19, minmax(0, 1fr)); font-size: 11px; color: var(--muted); padding-bottom: 8px; }
.tl-track {
  display: grid; grid-template-columns: repeat(76, minmax(0, 1fr)); grid-template-rows: 1fr; position: relative;
  min-height: 74px; padding: 10px 0;
  background-image: linear-gradient(to right, var(--line-soft) 1px, transparent 1px); background-size: calc(100% / 19) 100%;
}
.tl-block {
  grid-row: 1; margin-right: 4px; border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  overflow: hidden; border: 2px solid; min-width: 0; color: var(--ink);
}
.tl-block:hover { text-decoration: none; box-shadow: 0 6px 16px rgba(22, 24, 29, .12); }
.tl-block strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block.fechada { background: var(--accent-soft); border-color: var(--accent-line); color: #8e0a38; }
.tl-block.fechada:hover { border-color: var(--closed); color: #8e0a38; }
.tl-block.filtrada { background: var(--warn-soft); border-color: var(--warn-line); color: #6a4400; }
.tl-block.filtrada:hover { border-color: var(--filtered); color: #6a4400; }
.tl-block.stopped { opacity: .65; border-style: dashed; }
.tl-now { grid-row: 1; width: 2px; background: var(--info); margin: -10px 0; z-index: 2; pointer-events: none; }
/* Com JS, a linha "Agora" ocupa a faixa toda e anda ao minuto (margin-left em %, posta pelo site.js) */
.tl-now.live { grid-column: 1 / -1; justify-self: start; }
.tl-empty { grid-column: 1 / -1; grid-row: 1; align-self: center; font-size: 12px; color: var(--muted); padding-left: 8px; }

/* ---------- Listas e CLI ---------- */

pre.cli { background: #0f1115; color: #e8eaef; border-radius: 14px; padding: 18px 20px; overflow-x: auto; line-height: 1.5; max-height: 520px; margin: 0; }
.copy-wrap { position: relative; }
.copy-wrap .copy { position: absolute; top: 10px; right: 12px; background: #262a33; color: #fff; border-color: #3a404c; }
.copy-wrap .copy:hover { background: #31363f; color: #fff; }
.entries .domain { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.entries .published { color: var(--muted); font-size: 12.5px; }
/* Uma linha por entrada e sempre espaço para duas: trocar "Só este" / "Com subdomínios" não muda a altura da linha */
.pub-lines { display: flex; flex-direction: column; min-height: 3em; line-height: 1.5; justify-content: center; }
.pub-lines span { overflow-wrap: anywhere; }
.steps { padding-left: 20px; margin: 0 0 18px; }
.steps li { margin: 8px 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--surface); border: 1px solid #ebedf2; border-radius: var(--radius-sm); align-self: flex-start; }
.tabs a { padding: 8px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.tabs a:hover { text-decoration: none; background: var(--surface-2); color: var(--ink); }
.tabs a.active { background: var(--ink); color: #fff; }
.tabs a .n { margin-left: 6px; opacity: .7; font-size: 12px; }

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

/* Login: castelo de Bourtzi (Náuplia) ao pôr do sol por trás do cartão, escurecido para o cartão sobressair.
   Em ecrãs largos o cartão fica centrado na metade direita (céu), ao lado do castelo; nos estreitos, ao centro. */
.auth-page { background: #5a5f86 url("login-bourtzi.jpg") 28% center / cover no-repeat; }
.auth-page .auth-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px 56px;
  background: linear-gradient(180deg, rgba(16, 18, 24, .15) 0%, rgba(16, 18, 24, .4) 100%); }
.auth-page::after { content: "Castelo de Bourtzi, Náuplia"; position: fixed; left: 20px; bottom: 16px;
  font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .88); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; }
@media (min-width: 1100px) { .auth-page .auth-main { padding-left: 52%; padding-right: 2%; } }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid #ebedf2; border-radius: 22px; padding: 32px; box-shadow: 0 24px 60px rgba(10, 12, 16, .35); border-color: rgba(255, 255, 255, .6); }
.auth-card .brand { padding: 0; margin-bottom: 24px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); margin-bottom: 20px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.auth-card .btn { width: 100%; height: 48px; }
.auth-card .hint { margin: 0; }
.auth-card .notice { margin-bottom: 16px; }
.auth-card .inline-actions { display: flex; justify-content: space-between; margin-top: 16px; }
.auth-card .btn-link { font-size: 13px; }
.code-input { font-size: 26px !important; letter-spacing: .4em; text-indent: .4em; text-align: center; height: 56px !important; }

/* ---------- Ecrãs mais pequenos ---------- */

@media (max-width: 1000px) {
  .shell { flex-direction: column; flex-wrap: nowrap; }
  #sidebar { position: static; height: auto; overflow: visible; align-self: stretch; max-width: none; flex: none; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  #sidebar nav { flex-direction: row; flex-wrap: wrap; flex-basis: 100%; order: 3; gap: 4px; }
  .nav-group { display: none; }
  #sidebar nav a { padding: 8px 10px; font-size: 13px; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .fg-status span, .who-text, .version { display: none; }
  .fg-status { padding: 8px 10px; }
  #wrapper { padding: 22px 16px 40px; }
  .day-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .search { min-width: 0; flex: 1 1 100%; }
  .card { padding: 16px; }
  .fg-status strong span.lbl { display: none; }
}

/* Posição dos blocos da Agenda: coluna de início (gs-N) e de fim (ge-N), 1 coluna = 15 min a partir das 07:00 */
.gs-1{grid-column-start:1} .gs-2{grid-column-start:2} .gs-3{grid-column-start:3} .gs-4{grid-column-start:4} .gs-5{grid-column-start:5} .gs-6{grid-column-start:6} .gs-7{grid-column-start:7} .gs-8{grid-column-start:8} .gs-9{grid-column-start:9} .gs-10{grid-column-start:10} .gs-11{grid-column-start:11} .gs-12{grid-column-start:12} .gs-13{grid-column-start:13} .gs-14{grid-column-start:14} .gs-15{grid-column-start:15} .gs-16{grid-column-start:16} .gs-17{grid-column-start:17} .gs-18{grid-column-start:18} .gs-19{grid-column-start:19} .gs-20{grid-column-start:20} .gs-21{grid-column-start:21} .gs-22{grid-column-start:22} .gs-23{grid-column-start:23} .gs-24{grid-column-start:24} .gs-25{grid-column-start:25} .gs-26{grid-column-start:26} .gs-27{grid-column-start:27} .gs-28{grid-column-start:28} .gs-29{grid-column-start:29} .gs-30{grid-column-start:30} .gs-31{grid-column-start:31} .gs-32{grid-column-start:32} .gs-33{grid-column-start:33} .gs-34{grid-column-start:34} .gs-35{grid-column-start:35} .gs-36{grid-column-start:36} .gs-37{grid-column-start:37} .gs-38{grid-column-start:38} .gs-39{grid-column-start:39} .gs-40{grid-column-start:40} .gs-41{grid-column-start:41} .gs-42{grid-column-start:42} .gs-43{grid-column-start:43} .gs-44{grid-column-start:44} .gs-45{grid-column-start:45} .gs-46{grid-column-start:46} .gs-47{grid-column-start:47} .gs-48{grid-column-start:48} .gs-49{grid-column-start:49} .gs-50{grid-column-start:50} .gs-51{grid-column-start:51} .gs-52{grid-column-start:52} .gs-53{grid-column-start:53} .gs-54{grid-column-start:54} .gs-55{grid-column-start:55} .gs-56{grid-column-start:56} .gs-57{grid-column-start:57} .gs-58{grid-column-start:58} .gs-59{grid-column-start:59} .gs-60{grid-column-start:60} .gs-61{grid-column-start:61} .gs-62{grid-column-start:62} .gs-63{grid-column-start:63} .gs-64{grid-column-start:64} .gs-65{grid-column-start:65} .gs-66{grid-column-start:66} .gs-67{grid-column-start:67} .gs-68{grid-column-start:68} .gs-69{grid-column-start:69} .gs-70{grid-column-start:70} .gs-71{grid-column-start:71} .gs-72{grid-column-start:72} .gs-73{grid-column-start:73} .gs-74{grid-column-start:74} .gs-75{grid-column-start:75} .gs-76{grid-column-start:76} .gs-77{grid-column-start:77}
.ge-1{grid-column-end:1} .ge-2{grid-column-end:2} .ge-3{grid-column-end:3} .ge-4{grid-column-end:4} .ge-5{grid-column-end:5} .ge-6{grid-column-end:6} .ge-7{grid-column-end:7} .ge-8{grid-column-end:8} .ge-9{grid-column-end:9} .ge-10{grid-column-end:10} .ge-11{grid-column-end:11} .ge-12{grid-column-end:12} .ge-13{grid-column-end:13} .ge-14{grid-column-end:14} .ge-15{grid-column-end:15} .ge-16{grid-column-end:16} .ge-17{grid-column-end:17} .ge-18{grid-column-end:18} .ge-19{grid-column-end:19} .ge-20{grid-column-end:20} .ge-21{grid-column-end:21} .ge-22{grid-column-end:22} .ge-23{grid-column-end:23} .ge-24{grid-column-end:24} .ge-25{grid-column-end:25} .ge-26{grid-column-end:26} .ge-27{grid-column-end:27} .ge-28{grid-column-end:28} .ge-29{grid-column-end:29} .ge-30{grid-column-end:30} .ge-31{grid-column-end:31} .ge-32{grid-column-end:32} .ge-33{grid-column-end:33} .ge-34{grid-column-end:34} .ge-35{grid-column-end:35} .ge-36{grid-column-end:36} .ge-37{grid-column-end:37} .ge-38{grid-column-end:38} .ge-39{grid-column-end:39} .ge-40{grid-column-end:40} .ge-41{grid-column-end:41} .ge-42{grid-column-end:42} .ge-43{grid-column-end:43} .ge-44{grid-column-end:44} .ge-45{grid-column-end:45} .ge-46{grid-column-end:46} .ge-47{grid-column-end:47} .ge-48{grid-column-end:48} .ge-49{grid-column-end:49} .ge-50{grid-column-end:50} .ge-51{grid-column-end:51} .ge-52{grid-column-end:52} .ge-53{grid-column-end:53} .ge-54{grid-column-end:54} .ge-55{grid-column-end:55} .ge-56{grid-column-end:56} .ge-57{grid-column-end:57} .ge-58{grid-column-end:58} .ge-59{grid-column-end:59} .ge-60{grid-column-end:60} .ge-61{grid-column-end:61} .ge-62{grid-column-end:62} .ge-63{grid-column-end:63} .ge-64{grid-column-end:64} .ge-65{grid-column-end:65} .ge-66{grid-column-end:66} .ge-67{grid-column-end:67} .ge-68{grid-column-end:68} .ge-69{grid-column-end:69} .ge-70{grid-column-end:70} .ge-71{grid-column-end:71} .ge-72{grid-column-end:72} .ge-73{grid-column-end:73} .ge-74{grid-column-end:74} .ge-75{grid-column-end:75} .ge-76{grid-column-end:76} .ge-77{grid-column-end:77}

/* Formulários de edição soltos na página (sala, lista, agendamento): num cartão branco */
#wrapper > form:has(.form-grid):not(.quick) { background: var(--surface); border: 1px solid #ebedf2; border-radius: var(--radius); padding: 24px; max-width: 1010px; }
#wrapper > form:has(.form-grid):not(.quick) .form-actions { margin-top: 22px; }
/* Listas de sites e Salas: uma só coluna central de 1100px (como no Faturas); formulários e tabelas com a mesma largura */
#wrapper.narrow > :not(.overlay) { width: 100%; max-width: 1100px; margin-left: auto; margin-right: auto; }
#wrapper.narrow > form:has(.form-grid) { max-width: 1100px; }
#wrapper.narrow .form-grid { max-width: none; }
#wrapper > h2 { margin: 8px 0 -8px; }
#wrapper > ul { margin: 0; }

/* Ativar / desativar (interruptor em destaque no topo de um formulário) */
.toggle-bar { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 22px; border-radius: 14px; cursor: pointer;
  background: #eef0f4; border: 1px solid var(--line); }
.toggle-bar.on { background: var(--ok-soft); border-color: #bfe3d0; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text strong { font-size: 15px; }
.toggle-text small { color: var(--ink-2); font-size: 12.5px; }
input.switch { appearance: none; flex: none; width: 52px; height: 30px; margin: 0; border-radius: 999px; background: #b9bec8; position: relative; cursor: pointer; transition: background-color .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
input.switch:checked { background: var(--ok); }
input.switch:checked::after { transform: translateX(22px); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input.switch:disabled { cursor: default; opacity: .7; }

.readonly-value { display: flex; align-items: baseline; gap: 10px; height: 44px; padding: 0 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.readonly-value strong { font-size: 16px; line-height: 42px; font-variant-numeric: tabular-nums; }
.readonly-value span { font-size: 12.5px; color: var(--muted); }

/* ---------- janela a meio (como no Faturas): formulário por cima da página, o resto fica escurecido ---------- */
body:has(.overlay) { overflow: hidden; }
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 32px 16px;
  background: rgba(16, 18, 24, .5); backdrop-filter: blur(2px); animation: ov-fade .12s ease-out; }
.dialog { width: min(860px, 100%); max-height: calc(100vh - 64px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 24px 64px rgba(16, 18, 24, .28); overflow: hidden;
  animation: ov-rise .16s ease-out; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 26px; border-bottom: 1px solid var(--line-soft); }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dialog-body { overflow-y: auto; padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 16px; }
.dialog-body .form-grid { max-width: none; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--line-soft); background: var(--surface); }
@keyframes ov-fade { from { opacity: 0; } }
@keyframes ov-rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .overlay, .dialog { animation: none; } }
@media (max-width: 760px) {
  .overlay { padding: 0; }
  .dialog { max-height: none; height: 100%; border-radius: 0; }
  .dialog-body .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- popup com os domínios de uma lista (botão Ver) ---------- */
.choice .btn-view { margin-left: auto; }
.btn-view { flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink-2); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer; vertical-align: middle; }
.btn-view:hover { border-color: #c9cdd6; color: var(--ink); }
.btn-view:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.popup { width: min(440px, calc(100vw - 32px)); max-height: min(70vh, 560px); padding: 0; border: 1px solid #ebedf2;
  border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(16, 18, 24, .28); overflow: hidden; }
.popup:popover-open { display: flex; flex-direction: column; }
.popup::backdrop { background: rgba(16, 18, 24, .25); }
.popup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--line-soft); }
.popup-head strong { display: block; font-size: 16px; }
.popup-head span { display: block; font-size: 12.5px; color: var(--muted); }
.popup-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.popup-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 20px; }
.popup-list li + li { border-top: 1px solid var(--line-soft); }
.popup-list .mono { overflow-wrap: anywhere; }
.popup-list .small { white-space: nowrap; }
.popup-empty { margin: 0; padding: 18px 20px; }

/* Lista essencial no agendamento: mesmo cartão das outras, mas sempre incluída e sem se poder tirar */
.choice.fixed, .choice.fixed:hover, .choice.fixed:has(input:checked) { cursor: default; border-color: var(--line); background: var(--surface-2); }
.choice.fixed input { accent-color: var(--muted); opacity: 1; }
@media (max-width: 640px) { .auth-page::after { left: 16px; right: 16px; text-align: center; } }

/* Ações de cada domínio (página da lista): escolha "Com subdomínios / Só este" e botão Retirar */
.row-actions { display: inline-flex; align-items: center; gap: 8px; }
.seg-mini { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-mini button { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  font: 600 12px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.seg-mini button:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, .6); }
.seg-mini button.on { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 3px rgba(22, 24, 29, .12); cursor: default; }
.seg-mini button:disabled { opacity: 1; }
.seg-mini button:focus-visible, .btn-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-row { height: 34px; gap: 6px; }
table.data td.actions form.seg-mini { display: inline-flex; }
table.data td.actions .row-actions form:not(.seg-mini) { display: flex; }

/* ---------- Listas de sites (proposta C): pesquisa, filtro por uso, aviso das essenciais, tabela com pré-visualização ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); flex: 1 1 240px; max-width: 360px; min-width: 0; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; min-width: 0; height: auto; padding: 0; box-shadow: none; }
.seg-filter { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seg-filter button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer; }
.seg-filter button:hover { color: var(--ink); }
.seg-filter button.on { background: var(--accent-soft); color: var(--accent-ink); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-soft); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: #145c3b; }
.pill.warn { background: var(--warn-soft); color: #7a4f00; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-soft);
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.more { font-family: inherit; font-weight: 600; color: var(--muted); }
.ess-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--accent-line); font-size: 13px; }
.ess-banner strong { color: var(--accent-ink); }
.ess-banner .ess-edit { margin-left: auto; }
.lists-table th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); }
.lists-table td { padding-top: 14px; padding-bottom: 14px; }
.lists-table td.name .strong { font-size: 14px; }
.lists-table .col-prev { max-width: 380px; }
.icon-btn-sq { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.icon-btn-sq:hover { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.icon-btn-sq:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) { .lists-table .col-prev { display: none; } }
/* Nº e Agend. centrados (cabeçalho e números) */
table.data.lists-table th.num, table.data.lists-table td.num { text-align: center; }
.tabular { font-variant-numeric: tabular-nums; }

/* Lista importada de um endereço: origem, última importação e botão de atualizar */
.import-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin: 4px 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.import-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.import-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.import-url { font-size: 13px; overflow-wrap: anywhere; }
.import-meta { font-size: 12.5px; color: var(--ink-2); }
.import-action { flex: none; }
.import-search { margin-bottom: 10px; align-items: center; }
@media (max-width: 640px) { .import-card { flex-direction: column; align-items: stretch; } }

/* Agendamentos: cabeçalho como nas Listas de sites; cada linha com a cor do modo à esquerda */
.sched-table th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); }
.sched-table td { padding-top: 16px; padding-bottom: 16px; vertical-align: middle; }
.sched-table td .sub { display: block; margin-top: 2px; }
.sched-row td:first-child { box-shadow: inset 4px 0 0 var(--line); padding-left: 20px; }
.sched-row.fechada td:first-child { box-shadow: inset 4px 0 0 var(--closed); }
.sched-row.filtrada td:first-child { box-shadow: inset 4px 0 0 var(--filtered); }
.sched-row.is-running { background: #fbfdfc; }
.sched-table td.name .strong { font-size: 14.5px; display: block; }
.sched-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.sched-meta .mode { height: 22px; font-size: 11.5px; }
.when-main { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.sched-lists { margin-top: 6px; color: var(--ink-2); max-width: 280px; }
.sched-state { min-width: 150px; }
.state { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.state.on { color: #145c3b; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: #c3c8d2; flex: none; }
.st-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.st-dot.next { background: var(--info); }
.st-dot.off { background: var(--closed); }
.progress { display: block; width: 140px; height: 4px; border-radius: 4px; background: var(--line-soft); margin-top: 7px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.progress .pct-0{width:0%} .progress .pct-5{width:5%} .progress .pct-10{width:10%} .progress .pct-15{width:15%} .progress .pct-20{width:20%} .progress .pct-25{width:25%} .progress .pct-30{width:30%} .progress .pct-35{width:35%} .progress .pct-40{width:40%} .progress .pct-45{width:45%} .progress .pct-50{width:50%} .progress .pct-55{width:55%} .progress .pct-60{width:60%} .progress .pct-65{width:65%} .progress .pct-70{width:70%} .progress .pct-75{width:75%} .progress .pct-80{width:80%} .progress .pct-85{width:85%} .progress .pct-90{width:90%} .progress .pct-95{width:95%} .progress .pct-100{width:100%}
.sched-table td.actions { width: 1%; }
.sched-table .row-actions { justify-content: flex-end; }
@media (max-width: 900px) { .sched-lists { max-width: none; } }

/* Agendamento (janela de edição): nos semanais, a lista das próximas vezes */
.occ-list { list-style: none; margin: 0; padding: 0; }
.occ-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; min-height: 52px; }
.occ-list li:first-child { border-top: 0; }
.occ-list li.dim { opacity: .6; }
.occ-list li.empty { display: block; }
.occ-day { font-weight: 600; }
.occ-act { justify-self: end; }
@media (max-width: 760px) { .occ-list li { grid-template-columns: 1fr auto; } .occ-state { grid-column: 1; } }
.dialog-foot-left { margin-right: auto; display: flex; gap: 10px; }
.dlg-occs { display: flex; flex-direction: column; gap: 4px; }
.dlg-occs-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.dlg-meta { margin-top: 4px; }
.sched-table td .sub { display: block; }
.state-act { margin-top: 6px; }

/* Painel e agendamento: tabelas de ocorrências (A seguir / Histórico) com as mesmas colunas.
   Larguras nas <col> e também nos <th> (com table-layout: fixed, a primeira linha manda). */
table.data.occ-table { table-layout: fixed; width: 100%; }
table.data.occ-table .c-when { width: 24%; }
table.data.occ-table .c-mode { width: 12%; }
table.data.occ-table .c-sched { width: 20%; }
table.data.occ-table .c-rooms { width: 12%; }
table.data.occ-table .c-act { width: 150px; }
table.data.occ-table td { overflow-wrap: anywhere; }
@media (max-width: 900px) { table.data.occ-table { table-layout: auto; } }
.when-hint { color: var(--muted); font-size: 12.5px; margin-top: -6px; }
