:root {
  --bg: #f3f7f9;
  --surface: #ffffff;
  --ink: #1e384b;
  --muted: #6c8496;
  --line: #dde7ee;
  --teal: #0e9c95;
  --teal-dark: #0b7a75;
  --navy: #142c44;
  --blue: #4678d0;
  --gold: #d99736;
  --red: #c94c57;
  --purple: #8468ba;
  --shadow: 0 8px 26px rgba(17, 46, 68, 0.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; }
button, select, input { font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(170deg, #10263b, #1a3750);
  color: #e9f5f6;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.brand { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 2px 4px 12px; border-bottom: 1px solid rgba(255,255,255,0.14); }
.brand-logo-wrap { background: #ffffff; border-radius: 9px; padding: 5px 8px; width: 100%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.brand-logo-wrap img { max-height: 36px; max-width: 100%; width: auto; height: auto; display: block; object-fit: contain; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--teal); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 15px; position: relative; overflow: hidden; }
.brand-head { font-weight: 850; font-size: 13px; line-height: 1.25; letter-spacing: -0.2px; }
.brand-caption { font-size: 11px; font-weight: 800; color: #6ad7cf; display: block; margin-top: 2px; letter-spacing: 0.7px; }
.side-meta { font-size: 9.5px; letter-spacing: 1.6px; color: #83a6b6; font-weight: 800; padding: 0 10px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: #c7dce4; transition: background 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.09); color: #fff; }
.nav-link.active { background: #264d63; color: #fff; box-shadow: inset 3px 0 0 #3ad4ca; font-weight: 750; }
.nav-ico { width: 20px; text-align: center; color: #6ad7cf; font-size: 15px; }
.sidebar-spacer { flex: 1; }
.side-block { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 12px; font-size: 11.5px; color: #b7d2dc; }
.side-block b { color: #fff; display: block; margin-bottom: 3px; }
.side-footer { font-size: 10.5px; color: #9db8c4; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 12px; line-height: 1.5; }

.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: rgba(255,255,255,0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 40;
}
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mobile-menu-btn { display: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 16px; }
.top-location { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-location b { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.freshness { font-size: 11px; color: #286e68; background: #eaf7f6; border: 1px solid #bde5e1; border-radius: 20px; padding: 4px 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.fresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.top-btn { border: 1px solid var(--line); background: #fff; color: #2a556a; border-radius: 8px; padding: 7px 12px; font-size: 11.5px; font-weight: 700; }
.top-btn:hover { background: #edf8f7; border-color: #9ed4d0; }
.top-btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.top-btn.primary:hover { background: var(--teal-dark); }

.content { max-width: 1520px; width: 100%; margin: 0 auto; padding: 22px 26px 40px; }
.page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.eyebrow { font-size: 10px; letter-spacing: 1.5px; font-weight: 800; color: var(--teal); margin-bottom: 4px; }
.page-intro h1 { margin: 0; font-size: clamp(24px, 2.2vw, 33px); font-weight: 850; letter-spacing: -0.7px; }
.page-intro p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.intro-side { text-align: right; }
.status-pill { display: inline-block; font-size: 11px; font-weight: 750; color: #8c6423; background: #fff6e6; border: 1px solid #efd6aa; border-radius: 20px; padding: 4px 11px; }
.data-origin { font-size: 11px; color: var(--muted); margin-top: 5px; }

.panel, .filter-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0;
}
.filter-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.filter-title { font-weight: 800; font-size: 13.5px; }
.filter-desc { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.text-btn { border: none; background: transparent; color: var(--teal-dark); font-size: 12px; font-weight: 750; }
.filters-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; }
.field label { display: block; font-size: 10px; letter-spacing: 0.55px; font-weight: 800; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; }
.field select, .multi-btn {
  width: 100%; height: 39px; border-radius: 8px; border: 1px solid #d5e2ea; background: #fbfdfe;
  padding: 0 10px; font-size: 12.5px; font-weight: 650; color: var(--ink);
}
.disease-field { grid-column: span 2; }
.filter-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef3f7; font-size: 12px; color: var(--muted); }
.active-scope { font-weight: 700; color: var(--ink); }

.multi { position: relative; }
.multi-btn { display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 8px; }
.multi-btn .value-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-pop {
  display: none; position: absolute; top: 43px; left: 0; min-width: 250px; width: 100%; max-width: 380px;
  background: #fff; border: 1px solid #d5e2ea; border-radius: 10px; box-shadow: 0 14px 34px rgba(10,36,56,0.18);
  padding: 10px; z-index: 60;
}
.multi.open .multi-pop { display: block; }
.multi-search { width: 100%; height: 34px; border: 1px solid #d5e2ea; border-radius: 7px; padding: 0 10px; margin-bottom: 8px; font-size: 12px; }
.multi-bulk { display: flex; gap: 8px; margin-bottom: 6px; }
.multi-bulk button { border: 1px solid #dce7ee; background: #f5f9fb; border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 700; color: #355a70; }
.check-scroll { max-height: 220px; overflow-y: auto; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.check-item:hover { background: #eef7f7; }
.multi-tip { font-size: 10.5px; color: var(--muted); border-top: 1px solid #eef3f7; padding-top: 6px; margin-top: 6px; }

.notice-bar {
  display: flex; align-items: center; gap: 12px; background: #eef7f8; border: 1px solid #cbe4e7;
  border-radius: 11px; padding: 11px 15px; margin-bottom: 18px; font-size: 12.5px;
}
.notice-bar.warn { background: #fff8eb; border-color: #f0d7a5; }
.notice-bar.success { background: #eaf7f5; border-color: #a8dfd8; color: #0c5f58; }
.user-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.user-form-grid input, .user-form-grid select { width: 100%; height: 39px; border: 1px solid #d5e2ea; border-radius: 8px; padding: 0 10px; background: #fbfdfe; font-size: 13px; }
@media (max-width: 900px) { .user-form-grid { grid-template-columns: 1fr; } }
.notice-symbol { width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; box-shadow: var(--shadow); border-top: 3px solid var(--teal); }
.kpi.blue { border-top-color: var(--blue); }
.kpi.gold { border-top-color: var(--gold); }
.kpi.purple { border-top-color: var(--purple); }
.kpi.muted { border-top-color: #93a7b6; }
.kpi.danger { border-top-color: var(--red); }
.kpi-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px; color: var(--muted); text-transform: uppercase; }
.kpi-value { font-size: 27px; font-weight: 850; margin: 6px 0 4px; letter-spacing: -0.6px; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid-2-wide { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-overline { font-size: 9.5px; font-weight: 850; letter-spacing: 1.4px; color: var(--teal); }
.panel-head h2 { margin: 2px 0; font-size: 16.5px; font-weight: 800; }
.panel-head p { margin: 0; font-size: 12px; color: var(--muted); }
.chart-head-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.icon-btn { border: 1px solid var(--line); background: #fff; color: #2b596d; border-radius: 7px; padding: 6px 10px; font-size: 11.5px; font-weight: 700; }
.icon-btn:hover { background: #eef8f7; }
.segmented { display: inline-flex; background: #eef4f7; padding: 3px; border-radius: 8px; border: 1px solid var(--line); }
.segmented button { border: none; background: transparent; padding: 5px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.segmented button:disabled { opacity: 0.45; cursor: not-allowed; }

.legend-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.svg-wrap svg { width: 100%; height: auto; display: block; }
.chart-bottom { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }

.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: grid; grid-template-columns: 160px 1fr 70px; align-items: center; gap: 10px; cursor: pointer; padding: 3px 4px; border-radius: 6px; }
.rank-row:hover { background: #f2f8fa; }
.rank-name { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { height: 10px; background: #ebf2f6; border-radius: 99px; overflow: hidden; }
.rank-fill { height: 100%; background: var(--teal); border-radius: 99px; }
.rank-value { text-align: right; font-weight: 750; font-size: 12.5px; }

.week-heatmap { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; }
.week-square { height: 26px; border-radius: 5px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.week-square.has { background: #13968c; color: #fff; }
.week-square.zero { background: #d4eff2; color: #195663; }
.week-square.missing { background: #f7dfc1; color: #7a4b13; }
.week-square.future { background: #edf1f5; color: #7b8d9c; }
.week-square.active { border-color: #102a42; box-shadow: 0 0 0 1px #102a42; }

.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 9px 10px; border-bottom: 1px solid #ebf1f5; text-align: left; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.45px; color: var(--muted); background: #f9fbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.active-row { background: #ebf8f7; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 750; background: #e3f4f2; color: #126b64; }
.badge.warn { background: #fff0cf; color: #8c5a0d; }
.badge.crit { background: #fde2e5; color: #9c2735; }
.badge.mute { background: #edf2f6; color: #5f7587; }

.tooltip { position: fixed; z-index: 90; background: rgba(17, 38, 57, 0.96); color: #fff; padding: 9px 12px; border-radius: 9px; font-size: 12px; pointer-events: none; box-shadow: 0 10px 24px rgba(0,0,0,0.22); min-width: 170px; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 3px; }
.page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); padding-top: 8px; }
dialog { border: 1px solid var(--line); border-radius: 14px; max-width: 680px; width: calc(100vw - 32px); padding: 20px 22px; box-shadow: 0 20px 60px rgba(10,30,50,0.25); }
dialog::backdrop { background: rgba(12, 28, 44, 0.55); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-close { border: none; background: transparent; font-size: 18px; }
.dialog-ok { background: var(--teal); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 750; margin-top: 10px; }

.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 9px; margin-top: 10px; }
.series-chip { text-align: left; border: 1px solid var(--line); background: #fafcfd; border-radius: 10px; padding: 10px 12px; }
.series-chip.active { border-color: var(--teal); background: #eaf7f6; box-shadow: inset 3px 0 0 var(--teal); }
.series-chip b { display: block; font-size: 12.5px; }
.series-chip small { color: var(--muted); font-size: 11px; }
.matrix-scroll { overflow-x: auto; }
.matrix-grid { display: grid; gap: 3px; align-items: center; }
.matrix-cell { height: 18px; border-radius: 3px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.editor-box { background: #f8fbfd; border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.55; }

/* Tela de Login */
body.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 18% 12%, #19445f 0%, #0f253a 58%, #091827 100%);
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: 0 24px 60px rgba(4, 15, 28, 0.45);
  border: 1px solid #d7e5ed;
}
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #e7eff4; }
.login-logo { max-height: 44px; max-width: 100%; width: auto; height: auto; display: block; object-fit: contain; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 850; color: var(--ink); }
.login-sub { margin: 0 0 20px; font-size: 13px; color: var(--muted); }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.login-field input {
  width: 100%; height: 42px; border: 1px solid #cddce5; border-radius: 9px;
  padding: 0 12px; font-size: 14px; color: var(--ink); background: #fbfdfe;
}
.login-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 156, 149, 0.14); }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 6px; }
.login-submit {
  width: 100%; height: 43px; border: none; border-radius: 9px;
  background: var(--teal); color: #fff; font-weight: 800; font-size: 14px; margin-top: 6px;
}
.login-submit:hover { background: var(--teal-dark); }
.login-submit:disabled { opacity: 0.65; cursor: wait; }
.login-error { background: #fde8ea; color: #9c2432; border: 1px solid #f4c1c7; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; }
.login-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e9f0f4; font-size: 11.5px; color: var(--muted); text-align: center; }

.user-box { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 10px 11px; font-size: 11.5px; }
.user-box-name { font-weight: 750; color: #fff; display: block; }
.user-box-role { color: #9ed0db; font-size: 10.5px; }
.user-box-actions { display: flex; gap: 6px; margin-top: 8px; }
.user-box-actions button {
  flex: 1; border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.08);
  color: #edf7f9; border-radius: 6px; padding: 5px 6px; font-size: 11px; font-weight: 700;
}
.user-box-actions button:hover { background: rgba(255,255,255,0.18); }

/* Módulo Operacional: Registo Semanal e Qualidade (2 abas) */
.op-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.op-tab { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 9px; padding: 9px 16px; font-weight: 750; font-size: 13px; }
.op-tab.active { background: #fff; color: var(--teal-dark); border-color: var(--teal); box-shadow: var(--shadow); }
.op-page { display: none; }
.op-page.active { display: block; }
.op-mode { display: flex; gap: 10px; flex-wrap: wrap; background: #f2f7f9; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 14px; }
.op-mode label { padding: 6px 12px; border-radius: 7px; font-weight: 700; font-size: 12.5px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.op-mode label:has(input:checked) { background: #fff; color: var(--teal-dark); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.op-cell { width: 108px; height: 34px; border: 1px solid #cbdae2; border-radius: 7px; padding: 4px 8px; text-align: center; font-weight: 650; color: var(--ink); background: #fff; }
.op-cell:focus { outline: 2px solid #8adbd3; border-color: var(--teal); }
.op-cell:disabled { background: #f2f5f7; color: #7e92a0; cursor: not-allowed; }
.op-correction { background: #fcfdfd; border: 1px solid #d6e6e8; border-left: 4px solid var(--gold); border-radius: 10px; padding: 14px; margin-top: 14px; }
.op-correction input { width: 100%; height: 39px; border: 1px solid #cbdae2; border-radius: 8px; padding: 0 10px; margin-top: 4px; }
.op-toast { position: fixed; bottom: 18px; right: 20px; background: #12394d; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 28px rgba(10,30,46,0.28); font-size: 13px; max-width: 420px; z-index: 120; display: none; }
.op-toast.show { display: block; }
.op-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 11.5px; color: var(--muted); }
.op-legend span { background: #f3f7f9; border: 1px solid #e2ecf0; border-radius: 6px; padding: 4px 9px; }
.op-search { height: 38px; min-width: min(320px, 100%); border: 1px solid #cbdae2; border-radius: 8px; padding: 0 11px; }
@media (max-width: 720px) {
  #entryTable thead { display: none; }
  #entryTable, #entryTable tbody, #entryTable tr, #entryTable td { display: block; width: 100%; }
  #entryTable tr { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
  #entryTable td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 5px 0; }
  #entryTable td::before { content: attr(data-label); font-size: 11px; font-weight: 700; color: var(--muted); }
  #entryTable td:first-child { display: block; margin-bottom: 6px; }
  #entryTable td:first-child::before { display: none; }
}

/* Calendário e seletor de data/hora SVIR (PT / 24h / SE ISO) */
.svir-dt { position: relative; }
.svir-dt-btn {
  width: 100%; height: 39px; border: 1px solid #d5e2ea; border-radius: 8px; background: #fbfdfe;
  padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--ink); text-align: left;
}
.svir-dt-btn:hover:not(:disabled) { border-color: var(--teal); background: #fff; }
.svir-dt-btn:disabled { background: #f2f5f7; color: #7e92a0; cursor: not-allowed; }
.svir-dt-placeholder { color: #879ba8; font-weight: 500; }
.svir-dt-pop {
  display: none; position: absolute; top: 44px; left: 0; width: 320px; max-width: calc(100vw - 28px);
  background: #fff; border: 1px solid #cfe0e9; border-radius: 13px;
  box-shadow: 0 18px 44px rgba(13, 38, 58, 0.22); padding: 13px; z-index: 95;
}
.svir-dt.open .svir-dt-pop { display: block; }
.svir-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 6px; }
.svir-cal-title { font-weight: 800; font-size: 13.5px; color: var(--navy); text-transform: capitalize; }
.svir-cal-nav { display: flex; gap: 4px; }
.svir-cal-nav button {
  width: 28px; height: 28px; border: 1px solid var(--line); background: #f6fafc;
  border-radius: 7px; font-weight: 800; color: var(--ink); display: grid; place-items: center;
}
.svir-cal-nav button:hover { background: #e8f5f4; border-color: var(--teal); color: var(--teal-dark); }
.svir-cal-grid { display: grid; grid-template-columns: 32px repeat(7, 1fr); gap: 3px; align-items: center; }
.svir-cal-dow { font-size: 10px; font-weight: 800; color: var(--muted); text-align: center; padding-bottom: 4px; text-transform: uppercase; }
.svir-cal-wk { font-size: 10px; font-weight: 800; color: #16827a; background: #eaf7f6; border-radius: 5px; text-align: center; padding: 5px 0; }
.svir-cal-day {
  height: 31px; border: 1px solid transparent; background: transparent; border-radius: 7px;
  font-size: 12px; font-weight: 650; color: var(--ink); display: grid; place-items: center;
}
.svir-cal-day:hover { background: #eaf6f6; border-color: #bfe4e1; }
.svir-cal-day.other { color: #9fb0bc; font-weight: 500; }
.svir-cal-day.today { border-color: var(--teal); color: var(--teal-dark); font-weight: 800; }
.svir-cal-day.selected { background: var(--teal); color: #fff; font-weight: 800; border-color: var(--teal); }
.svir-cal-time {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #ebf1f5; font-size: 12px;
}
.svir-cal-time select {
  height: 32px; border: 1px solid #d5e2ea; border-radius: 7px; padding: 0 7px;
  background: #fbfdfe; font-weight: 700; color: var(--ink);
}
.svir-cal-quick { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; }
.svir-cal-quick button {
  flex: 1; border: 1px solid var(--line); background: #f5f9fb; border-radius: 7px;
  padding: 6px 8px; font-size: 11.5px; font-weight: 750; color: #2b596d;
}
.svir-cal-quick button:hover { background: #e8f6f5; border-color: var(--teal); }
.svir-cal-quick button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }

/* Sala de Situação TV */
body.tv-mode { background: #0e1f30; color: #edf6f9; }
body.tv-mode .tv-shell { min-height: 100vh; display: flex; flex-direction: column; padding: 16px 24px; gap: 14px; }
body.tv-mode .tv-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid #264259; padding-bottom: 10px; }
body.tv-mode .tv-brand { display: flex; align-items: center; gap: 12px; }
body.tv-mode .tv-logo-wrap { width: auto; padding: 4px 8px; border-radius: 8px; }
body.tv-mode .tv-logo-wrap img { max-height: 36px; }
body.tv-mode .tv-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; background: #142a40; padding: 12px; border-radius: 12px; border: 1px solid #264660; }
body.tv-mode .tv-filters label { display: block; font-size: 10px; color: #9fc0d1; text-transform: uppercase; font-weight: 800; margin-bottom: 4px; }
body.tv-mode .tv-filters select { width: 100%; height: 36px; border-radius: 7px; border: 1px solid #2c516e; background: #0f2234; color: #fff; padding: 0 8px; }
body.tv-mode .tv-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
body.tv-mode .tv-tabs button { border: 1px solid #2b4c66; background: #152c42; color: #bfd6e3; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
body.tv-mode .tv-tabs button.active { background: #13998f; border-color: #13998f; color: #fff; }
body.tv-mode .tv-slide { flex: 1; background: #13273b; border: 1px solid #26435c; border-radius: 14px; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
body.tv-mode .tv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.tv-mode .tv-kpi { background: #18324a; border: 1px solid #2b4e6b; border-radius: 10px; padding: 12px 14px; }
body.tv-mode .tv-kpi small { color: #9ec0d1; font-size: 11px; display: block; }
body.tv-mode .tv-kpi strong { font-size: 26px; display: block; margin: 4px 0; }
body.tv-mode .tv-stage { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; flex: 1; }
body.tv-mode .tv-pane { background: #0f2133; border: 1px solid #234058; border-radius: 12px; padding: 14px; }
body.tv-mode.presentation .tv-filters, body.tv-mode.presentation .tv-tabs { display: none; }

@media (max-width: 1080px) {
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
  body.tv-mode .tv-stage { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -270px; top: 0; bottom: 0; width: 256px; z-index: 100; transition: left 0.2s ease; }
  .sidebar.mobile-open { left: 0; box-shadow: 12px 0 36px rgba(0,0,0,0.35); }
  .mobile-menu-btn { display: inline-flex; align-items: center; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 32px; }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .disease-field { grid-column: span 2; }
  .intro-side { display: none; }
  body.tv-mode .tv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .sidebar, .topbar, .filter-panel, .hide-print, .icon-btn, .top-actions { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; break-inside: avoid; }
}
