:root {
  --brand: #f6bf61;
  --brand-strong: #f0a126;
  --brand-soft: #fff5e5;
  --ink: #15252b;
  --ink-strong: #08171c;
  --muted: #65757c;
  --muted-2: #87949a;
  --line: #e1e8ea;
  --line-strong: #cfd9dc;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --surface-3: #eef3f4;
  --header: #0b1f33;
  --header-2: #102b46;
  --success: #17835f;
  --warning: #b26d13;
  --danger: #c43f48;
  --info: #376d9c;
  --shadow: 0 8px 28px rgba(9, 31, 37, .07);
  --shadow-lg: 0 24px 80px rgba(2, 18, 22, .2);
  --radius: 8px;
  --radius-sm: 5px;
  --content: 1540px;
}

* { box-sizing: border-box; }
html { background: var(--surface-2); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.mono { font-family: "Roboto Mono", Consolas, monospace; }
.muted { color: var(--muted-2); }
.align-right { text-align: right; }

/* Header */
.topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: 68px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: var(--header);
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.topbar-inner {
  width: min(calc(100% - 36px), var(--content));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0,1fr) auto;
  align-items: center;
}
.brand {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}
.brand img { width: 112px; max-height: 32px; filter: none; object-fit: contain; }
.brand-divider { width: 1px; height: 20px; background: rgba(255,255,255,.2); }
.brand strong { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.nav-primary { height: 100%; display: flex; justify-content: center; align-items: stretch; gap: 2px; }
.nav-primary a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  color: #9fb0b5;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease;
}
.nav-primary a i { width: 14px; color: #809399; text-align: center; font-size: 12px; }
.nav-primary a:hover { background: rgba(255,255,255,.035); color: #e8f0f1; }
.nav-primary a.active { color: #fff; background: rgba(255,255,255,.045); }
.nav-primary a.active i { color: var(--brand); }
.nav-primary a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--brand); }
.account-area { position: relative; z-index: 320; height: 100%; display: flex; align-items: center; gap: 10px; padding-left: 18px; }
.account-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); background: #102b46; color: #d8e4e6; font-size: 11px; font-weight: 700; }
.account-copy { min-width: 110px; max-width: 160px; display: flex; flex-direction: column; }
.account-copy strong, .account-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: #edf4f5; font-size: 11px; font-weight: 600; }
.account-copy span { margin-top: 1px; color: #7f9399; font-size: 10px; }
.environment-tag { padding: 3px 6px; border: 1px solid rgba(0,195,182,.28); background: rgba(0,195,182,.08); color: #7ce0d9; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.icon-button, .icon-action, .modal-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.icon-button { width: 32px; height: 32px; color: #8fa0a5; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.05); }

/* Layout */
.content-shell { width: min(calc(100% - 36px), var(--content)); min-height: calc(100vh - 132px); margin: 0 auto; padding: 34px 0 48px; }
.app-footer { width: min(calc(100% - 36px), var(--content)); margin: 0 auto; padding: 18px 0 28px; display: flex; gap: 18px; border-top: 1px solid var(--line); color: #8a979c; font-size: 11px; }
.app-footer a:hover { color: var(--brand-strong); }
.page-heading { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.compact-heading { align-items: flex-end; }
.page-heading h1 { margin: 4px 0 5px; color: var(--ink-strong); font-size: 27px; line-height: 1.12; letter-spacing: -.035em; font-weight: 700; }
.page-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; }
.eyebrow { color: #708087; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: -4px 0 18px; color: #829096; font-size: 11px; }
.breadcrumb a:hover { color: var(--brand-strong); }
.breadcrumb i { font-size: 7px; color: #acb7bb; }
.breadcrumb strong { color: #526169; font-weight: 600; }

/* Buttons */
.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.button:active { transform: translateY(1px); }
.button-primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.button-primary:hover { background: #147bdc; border-color: #147bdc; }
.button-primary:active { background: #106bc2; border-color: #106bc2; }
.button-secondary { border-color: var(--line-strong); background: #fff; color: #405159; }
.button-secondary:hover { border-color: #aebcc0; background: #f8fafb; color: var(--ink); }
.button-small { min-height: 30px; padding: 0 10px; font-size: 10px; }
.button-danger-ghost { border-color: #efc7ca; background: #fff; color: var(--danger); }
.button-danger-ghost:hover { border-color: #df9fa4; background: #fff5f5; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: #52636a; font-size: 11px; font-weight: 600; }
.text-link:hover { color: var(--brand-strong); }
.icon-action { width: 30px; height: 30px; border: 1px solid transparent; border-radius: 4px; color: #718087; }
.icon-action:hover { border-color: var(--line); background: var(--surface-2); color: var(--ink); }

/* Alerts */
.notice { margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid; border-radius: var(--radius-sm); font-size: 11px; }
.notice-success { border-color: #b9ded1; background: #f0faf6; color: #236d54; }
.notice-error { border-color: #ebc2c5; background: #fff4f4; color: #9f343b; }
.notice[data-notice-auto-dismiss] { transition: opacity .2s ease, transform .2s ease; }
.notice[data-notice-auto-dismiss].is-dismissing { opacity: 0; transform: translateY(-4px); }

/* KPI and dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.kpi-card { position: relative; min-height: 108px; display: grid; grid-template-columns: 42px 1fr 22px; align-items: center; gap: 13px; padding: 17px 18px; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 8px rgba(10,31,37,.025); }
.kpi-card::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 2px; background: var(--brand); }
.kpi-card.status-warning::before { background: #d29137; }
.kpi-card.status-critical::before { background: #cc4d55; }
.kpi-icon { width: 42px; height: 42px; display: grid; place-items: center; background: #eef7f6; color: var(--brand-strong); font-size: 15px; }
.status-warning .kpi-icon { background: #fff7e9; color: #a76812; }
.status-critical .kpi-icon { background: #fff0f1; color: #b6353d; }
.kpi-copy span { display: block; color: #718087; font-size: 10px; font-weight: 600; }
.kpi-copy strong { display: block; margin: 2px 0 1px; color: var(--ink-strong); font-size: 28px; letter-spacing: -.04em; line-height: 1; font-weight: 700; }
.kpi-copy small { color: #8b989d; font-size: 10px; }
.kpi-card > a { color: #a1adb1; font-size: 10px; }
.kpi-card > a:hover { color: var(--brand-strong); }
.dashboard-grid { display: grid; grid-template-columns: 1.55fr .72fr .72fr; gap: 12px; margin-bottom: 12px; }
.panel { border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 8px rgba(10,31,37,.022); }
.panel-header { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 2px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.panel-hint { color: #89969b; font-size: 10px; }
.panel-hint i { margin-right: 5px; }
.chart-frame { position: relative; height: 250px; padding: 14px 16px; }
.chart-frame-line { height: 285px; }
.donut-frame { width: 190px; height: 190px; margin: 16px auto 8px; padding: 0; }
.chart-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.chart-center strong { font-size: 25px; line-height: 1; color: var(--ink-strong); }
.chart-center span { margin-top: 3px; color: #8b979c; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.chart-legend { padding: 0 17px 16px; }
.compact-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; }
.compact-legend.three-cols { grid-template-columns: repeat(3,minmax(0,1fr)); }
.compact-legend span { min-width: 0; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 6px; color: #6d7c82; font-size: 9px; }
.compact-legend b { color: #39494f; font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: block; }
.sev-dot-5 { background: #c83f47; }.sev-dot-4 { background: #e17231; }.sev-dot-3 { background: #d89d2c; }.sev-dot-2 { background: #5f86a8; }
.status-online { background: #21a477; }.status-offline { background: #cc4d55; }.status-unknown { background: #b4c0c4; }
.table-panel { margin-top: 12px; }
.flush-panel { margin-top: 0; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.table th { height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #f8fafb; color: #77868c; font-size: 9px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid #edf1f2; color: #43545b; font-size: 11px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfc; }
.table td strong { color: #223238; font-weight: 600; }
.table-sub { display: block; margin-top: 3px; color: #89969b; font-size: 9px; line-height: 1.35; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.entity-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; background: #f0f5f6; color: #63777e; }
.device-client-logo { overflow: hidden; background: #fff; border: 1px solid #e1e8ea; }
.device-client-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }
.entity-cell strong, .entity-cell span { display: block; }
.entity-cell span { margin-top: 2px; color: #8b989d; font-size: 9px; }
.number-pill { min-width: 27px; height: 22px; display: inline-grid; place-items: center; padding: 0 7px; border: 1px solid var(--line); background: #fafbfb; color: #526269; font-size: 10px; font-weight: 600; }
.tag, .origin-badge, .state-badge, .method-badge, .recognition, .availability, .severity-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tag { margin: 2px 3px 2px 0; padding: 3px 6px; border: 1px solid #d8e1e3; background: #f9fbfb; color: #65757c; font-size: 9px; }
.tag.subtle { background: #fff; }
.tag-stack { max-width: 360px; }
.method-badge { color: #476068; font-size: 9px; font-weight: 600; }
.method-badge.module i { color: var(--brand-strong); }
.method-badge.snmp i { color: #4779a1; }
.method-badge.advanced i { color: #8a6a9d; }
.availability { font-size: 9px; font-weight: 600; }
.availability i { width: 6px; height: 6px; border-radius: 50%; }
.availability.online { color: #2f765f; }.availability.online i { background: #2ba078; }
.availability.offline { color: #a74147; }.availability.offline i { background: #ce5159; }
.availability.unknown { color: #7e8a8f; }.availability.unknown i { background: #aeb9bd; }
.state-badge { padding: 3px 7px; border: 1px solid; font-size: 9px; font-weight: 600; }
.state-badge.active { border-color: #c7e1d7; background: #f1f9f5; color: #32765f; }
.state-badge.paused { border-color: #dddfe1; background: #f7f8f8; color: #707d82; }
.state-badge.closed { border-color: #dce2e4; background: #f8f9fa; color: #7b888d; }
.state-badge.alarm-active { border-color: #efc6c9; background: #fff4f4; color: #a23840; }
.origin-badge { color: #63757b; font-size: 9px; }
.origin-badge.inherited { color: #7e6b8b; }
.recognition { font-size: 9px; font-weight: 600; }
.recognition.done { color: #34755f; }.recognition.pending { color: #9a651a; }
.severity-badge { padding: 3px 7px; border-left: 2px solid; background: #f6f8f8; color: #5c6a70; font-size: 9px; font-weight: 700; }
.sev-0 { border-color: #99a8ad; }.sev-1 { border-color: #5f86a8; }.sev-2 { border-color: #c49a32; }.sev-3 { border-color: #d1802b; }.sev-4 { border-color: #d95a35; }.sev-5 { border-color: #bd343c; background: #fff5f5; color: #9e3239; }
.empty-state { height: 160px; text-align: center; color: #93a0a5 !important; }
.empty-state i { display: block; margin-bottom: 8px; font-size: 22px; color: #b2bdc1; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: #65747a !important; }
.empty-state span { margin-top: 4px; font-size: 10px; }

/* Filters */
.filter-bar { min-height: 52px; display: grid; grid-template-columns: minmax(260px,1fr) 190px auto auto; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px; border: 1px solid var(--line); background: #fff; }
.filter-bar-wide { grid-template-columns: minmax(240px,1fr) repeat(4,minmax(140px,190px)) auto auto; }
.alarm-filter-bar { grid-template-columns: minmax(260px,1.2fr) repeat(5,minmax(140px,180px)) auto auto; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9aa6aa; font-size: 10px; }
.search-box input { padding-left: 31px; }
.control, .search-box input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: #26383e;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.control, .search-box input, .field input, .field select { height: 36px; padding: 0 10px; }
.field textarea { min-height: 76px; padding: 9px 10px; resize: vertical; }
.control:focus, .search-box input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #76b9ef; box-shadow: 0 0 0 2px rgba(31,149,242,.10); }
.control:disabled, .field input:disabled, .field select:disabled { background: #f4f6f7; color: #9aa5aa; cursor: not-allowed; }
.filter-clear { height: 34px; padding: 0 8px; border: 0; background: transparent; color: #839096; font-size: 9px; cursor: pointer; white-space: nowrap; }
.filter-clear:hover { color: var(--brand-strong); }
.result-count { color: #87949a; font-size: 9px; font-weight: 600; white-space: nowrap; }

/* Forms */
.field { min-width: 0; }
.field > label { display: block; margin-bottom: 6px; color: #4d5e65; font-size: 10px; font-weight: 600; }
.field-help { display: block; margin-top: 5px; color: #909ca1; font-size: 9px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field-narrow { max-width: 220px; }
.modal-sections { display: grid; gap: 12px; }
.form-section-block { padding: 16px; border: 1px solid #e4e9eb; background: #fff; }
.form-section-block + .form-section-block { margin-top: 0; }
.form-section-block.compact-block { padding: 13px 16px; }
.form-section-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.form-section-title > i { width: 27px; height: 27px; display: grid; place-items: center; background: #f0f5f5; color: #62767d; font-size: 11px; }
.form-section-title h3 { margin: 0; color: #314249; font-size: 11px; font-weight: 700; }
.form-section-title p { margin: 3px 0 0; color: #8a979c; font-size: 9px; }
.form-section-block > .field + .field,
.form-section-block > .form-grid + .field,
.form-section-block > .field + .form-grid,
.form-section-block > .form-grid + .form-grid { margin-top: 12px; }
.choice-list { border: 1px solid var(--line); background: #fbfcfc; }
.scroll-list { max-height: 180px; overflow-y: auto; }
.grid-choice-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; }
.choice-row { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-bottom: 1px solid #edf1f2; cursor: pointer; }
.grid-choice-list .choice-row { border-right: 1px solid #edf1f2; }
.choice-row:last-child { border-bottom: 0; }
.choice-row:hover { background: #f5f9f9; }
.choice-row input { width: 14px; height: 14px; accent-color: var(--brand-strong); }
.choice-row span { color: #53646b; font-size: 10px; }
.method-selector { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 13px; }
.method-selector label { cursor: pointer; }
.method-selector input { position: absolute; opacity: 0; pointer-events: none; }
.method-selector label > span { min-height: 76px; display: grid; grid-template-columns: 34px 1fr; align-items: center; column-gap: 10px; padding: 12px 13px; border: 1px solid var(--line-strong); background: #fff; }
.method-selector label > span > i { grid-row: 1 / span 2; width: 34px; height: 34px; display: grid; place-items: center; background: #f0f5f5; color: #5d737a; }
.method-selector strong { color: #394b52; font-size: 10px; }
.method-selector small { color: #89969b; font-size: 9px; }
.method-selector input:checked + span { border-color: #79bfff; background: #f2f8ff; box-shadow: inset 3px 0 0 var(--brand); }
.method-selector input:checked + span > i { background: #e0f0ff; color: var(--brand-strong); }
.method-selector.compact label > span { min-height: 54px; }
.method-selector.compact small { display: none; }
.toggle-row { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.toggle-row > input { position: absolute; opacity: 0; }
.toggle-ui { position: relative; width: 34px; height: 18px; flex: 0 0 auto; border: 1px solid #bfc9cc; background: #dce2e4; transition: .15s ease; }
.toggle-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); transition: .15s ease; }
.toggle-row input:checked + .toggle-ui { border-color: var(--brand-strong); background: var(--brand-strong); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { color: #46575e; font-size: 10px; }
.toggle-row small { margin-top: 2px; color: #8d999e; font-size: 9px; }
.inline-note { display: flex; gap: 8px; padding: 10px; border: 1px solid #dbe5e6; background: #f7fafb; color: #6d7d83; font-size: 9px; }

/* Modals */
.modal { position: fixed; z-index: 5000; inset: 0; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,18,22,.62); backdrop-filter: blur(2px); }
.modal-dialog { position: relative; z-index: 1; width: min(100%, 760px); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid rgba(255,255,255,.3); background: #fff; box-shadow: var(--shadow-lg); }
.modal-small { max-width: 480px; }
.modal-medium { max-width: 680px; }
.modal-large { max-width: 920px; }
.modal-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 2px 0 0; color: #203137; font-size: 15px; font-weight: 700; }
.modal-close { width: 34px; height: 34px; color: #7c8a8f; font-size: 14px; }
.modal-close:hover { background: var(--surface-2); color: #28393f; }
.modal-body { padding: 18px; }
.modal-footer { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfc; }
.modal-footer-danger { justify-content: space-between; }
.modal-footer-danger > div:last-child { display: flex; gap: 8px; }
.danger-zone-inline { position: absolute; left: 18px; bottom: 13px; z-index: 3; }

/* Profile cards */
.profile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.profile-card { min-height: 246px; display: flex; flex-direction: column; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 8px rgba(10,31,37,.02); }
.profile-card-top { display: grid; grid-template-columns: 38px 1fr 32px; align-items: center; gap: 10px; padding: 15px 15px 12px; }
.profile-icon { width: 38px; height: 38px; display: grid; place-items: center; background: #edf7f6; color: var(--brand-strong); }
.profile-title h2 { margin: 0; color: #283a40; font-size: 12px; font-weight: 700; }
.profile-title span { display: block; margin-top: 2px; color: #929ea3; font-size: 8px; }
.profile-card > p { min-height: 42px; margin: 0; padding: 0 15px; color: #75848a; font-size: 10px; line-height: 1.5; }
.profile-categories { min-height: 33px; padding: 9px 15px 5px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: auto; border-top: 1px solid var(--line); }
.profile-stats > div { padding: 10px 15px; }
.profile-stats > div + div { border-left: 1px solid var(--line); }
.profile-stats strong, .profile-stats span { display: block; }
.profile-stats strong { color: #2f4147; font-size: 15px; }
.profile-stats span { margin-top: 1px; color: #8b989d; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.profile-actions a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; color: #586b72; font-size: 9px; font-weight: 600; }
.profile-actions a + a { border-left: 1px solid var(--line); }
.profile-actions a:hover { background: #f7faf9; color: var(--brand-strong); }
.empty-card { grid-column: 1/-1; min-height: 280px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line); background: #fff; color: #8b989d; text-align: center; }
.empty-card i { margin-bottom: 12px; font-size: 30px; color: #bbc5c8; }.empty-card strong,.empty-card span { display:block; }.empty-card strong { color:#607077; }.empty-card span { margin-top:5px; font-size:10px; }

/* Rule builder */
.rule-builder { display: grid; grid-template-columns: 1.5fr 1fr .9fr 1fr .9fr; gap: 9px; align-items: end; }
.advanced-toggle { margin-top: 11px; padding: 0; border: 0; background: transparent; color: #65777e; font-size: 9px; font-weight: 600; cursor: pointer; }
.advanced-toggle i { margin-right: 5px; }.advanced-toggle:hover { color: var(--brand-strong); }
.advanced-condition { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #dce4e6; }
.condition-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; max-width: 420px; }
.condition-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border: 1px solid #d7e4e3; background: #f3f9f8; color: #4f706f; font-size: 8px; font-weight: 600; }
.condition-chip.advanced { border-color: #ddd7e3; background: #f8f5fa; color: #7c6689; }
.condition-text { color: #69787e; font-family: "Roboto Mono", monospace; font-size: 9px; }

/* History */
.history-filters { display: grid; grid-template-columns: 1.1fr 1.2fr 1.4fr .8fr auto; align-items: end; gap: 9px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); background: #fff; }
.history-summary-grid { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 10px; margin-bottom: 10px; }
.history-summary-card { min-height: 84px; padding: 13px 15px; border: 1px solid var(--line); background: #fff; }
.history-summary-card > span { display: block; color: #7e8c91; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .045em; }
.history-summary-card strong { display: block; margin-top: 5px; color: #283a40; font-size: 15px; font-weight: 700; }
.history-summary-card strong small { font-size: 10px; font-weight: 500; color: #718087; }
.history-summary-card > small { display: block; margin-top: 3px; color: #8f9b9f; font-size: 9px; }
.history-chart-panel { margin-bottom: 10px; }
.history-chart-frame { height: 360px; padding: 18px 20px 12px; }
.history-table { max-height: 520px; }
.empty-workspace { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; text-align: center; }
.empty-workspace-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 15px; background: #eff7f6; color: var(--brand-strong); font-size: 20px; }
.empty-workspace h2 { margin: 0; color: #33454c; font-size: 15px; }
.empty-workspace p { max-width: 520px; margin: 7px auto 20px; color: #7c8a90; font-size: 10px; }
.empty-workspace-steps { display: flex; align-items: center; gap: 10px; color: #809096; font-size: 9px; }
.empty-workspace-steps span { display: flex; align-items: center; gap: 6px; }
.empty-workspace-steps b { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #cfdadd; color: #5d7077; }
.empty-workspace-steps i { color: #bec7ca; font-size: 8px; }

/* Alarm modal */
.recognize-summary { margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); background: #f8fafb; }
.recognize-summary > strong, .recognize-summary > small { display: block; }
.recognize-summary > strong { margin-top: 8px; color: #34464d; font-size: 11px; }
.recognize-summary > small { margin-top: 3px; color: #88959a; font-size: 9px; }
.alarm-name { min-width: 260px; }

/* Login */
.auth-page { min-height: 100vh; overflow-x: hidden; background: #fff; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.58fr) minmax(420px,.72fr); background: #fff; }
.login-gallery { position: relative; min-height: 100vh; overflow: hidden; background: #0c1b20; }
.login-image { position: absolute; inset: 0; opacity: 0; background-position: center; background-size: cover; transform: scale(1.02); transition: opacity 1s ease, transform 8s ease; }
.login-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,16,20,.05), rgba(4,16,20,.08) 65%, rgba(4,16,20,.28)); }
.login-image.active { opacity: 1; transform: scale(1); }
.login-pagination { position: absolute; z-index: 10; left: 32px; bottom: 28px; display: flex; gap: 6px; }
.login-pagination button { width: 28px; height: 2px; padding: 0; border: 0; background: rgba(255,255,255,.38); cursor: pointer; }
.login-pagination button.active { background: #fff; }
.login-panel { min-height: 100vh; display: flex; align-items: stretch; border-left: 1px solid #dfe5e7; background: #fff; }
.login-panel-inner { width: 100%; display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(42px,5vw,78px) 28px; }
.login-card { width: 100%; max-width: 365px; margin: auto; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.login-logo { width: 155px; }
.login-brand span { padding-left: 12px; border-left: 1px solid #dce3e5; color: #78868b; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-field { margin-bottom: 15px; }
.login-field > label { color: #56666d; font-size: 10px; }
.input-with-icon { position: relative; }
.input-with-icon > i { position: absolute; z-index: 2; left: 13px; top: 50%; transform: translateY(-50%); color: #9ba7ab; font-size: 11px; }
.input-with-icon input { height: 46px; padding-left: 36px; border-radius: 4px; }
.password-input input { padding-right: 45px; }
.password-input button { position: absolute; right: 1px; top: 1px; width: 42px; height: 44px; border: 0; background: #fff; color: #8b989d; cursor: pointer; }
.password-input button:hover { color: #3f5158; }
.login-action { width: 100%; min-height: 46px; margin-top: 7px; justify-content: space-between; padding: 0 16px; }
.login-legal { max-width: 365px; width: 100%; margin: 34px auto 0; display: flex; justify-content: center; gap: 8px; color: #9aa5a9; font-size: 9px; }
.login-legal a:hover { color: var(--brand-strong); }
.login-legal button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }.login-legal button:hover { color: var(--brand-strong); }
.form-alert, .demo-note { display: flex; gap: 8px; margin: -20px 0 20px; padding: 10px 11px; border: 1px solid; font-size: 10px; }
.form-alert { border-color: #edc6c9; background: #fff5f5; color: #a03a42; }.demo-note { border-color: #bee0dc; background: #f0faf8; color: #36766f; }

/* Cookie */
.cookie-notice { position: fixed; z-index: 300; right: 20px; bottom: 20px; width: min(calc(100% - 40px), 610px); display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid #ccd8da; background: #fff; box-shadow: 0 18px 60px rgba(3,24,29,.18); }
.cookie-icon { width: 34px; height: 34px; display: grid; place-items: center; background: #ecf7f6; color: var(--brand-strong); }
.cookie-copy strong, .cookie-copy span { display: block; }.cookie-copy strong { color: #34464d; font-size: 10px; }.cookie-copy span { margin-top: 2px; color: #7b898f; font-size: 9px; }
.cookie-notice > a { color: #5b6d74; font-size: 9px; font-weight: 600; white-space: nowrap; }.cookie-notice > a:hover { color: var(--brand-strong); }

/* Legal */
.legal-page { min-height: 100vh; background: #f5f7f8; }
.legal-header { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px,calc((100vw - 1060px)/2)); border-bottom: 1px solid var(--line); background: #fff; }
.legal-header img { width: 136px; }
.legal-content { width: min(calc(100% - 36px), 850px); margin: 0 auto; padding: 62px 0 80px; }
.legal-content h1 { margin: 6px 0 12px; color: #192b31; font-size: 32px; letter-spacing: -.035em; }
.legal-lead { margin: 0 0 34px; color: #63737a; font-size: 13px; line-height: 1.65; }
.legal-content section { padding: 22px 0; border-top: 1px solid var(--line); }
.legal-content h2 { margin: 0 0 8px; color: #32454c; font-size: 13px; }
.legal-content p { margin: 0; color: #67777d; font-size: 11px; line-height: 1.7; }.legal-content p a { color: var(--brand-strong); font-weight: 600; }

@media (max-width: 1380px) {
  .topbar-inner { grid-template-columns: 190px minmax(0,1fr) auto; }
  .nav-primary a { padding: 0 10px; }
  .nav-primary a span { font-size: 11px; }
  .account-copy { display: none; }
  .filter-bar-wide, .alarm-filter-bar { grid-template-columns: minmax(230px,1fr) repeat(2,minmax(140px,1fr)) repeat(2,minmax(130px,1fr)); }
  .filter-bar-wide .filter-clear, .filter-bar-wide .result-count, .alarm-filter-bar .filter-clear, .alarm-filter-bar .result-count { grid-row: 2; }
}
@media (max-width: 1120px) {
  .topbar { height: auto; position: static; }
  .topbar-inner { width: 100%; grid-template-columns: 1fr auto; }
  .brand { height: 60px; padding-left: 18px; }.account-area { height: 60px; padding-right: 14px; }
  .nav-primary { grid-column: 1/-1; order: 3; height: 44px; overflow-x: auto; justify-content: flex-start; border-top: 1px solid rgba(255,255,255,.06); }
  .nav-primary a { flex: 0 0 auto; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }.chart-panel-wide { grid-column: 1/-1; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rule-builder { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .history-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }.history-filters .button { align-self: end; }
  .login-layout { grid-template-columns: minmax(0,1.1fr) 430px; }
}
@media (max-width: 820px) {
  .content-shell { width: min(calc(100% - 24px),var(--content)); padding-top: 24px; }
  .page-heading, .compact-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .kpi-grid, .dashboard-grid, .profile-grid, .history-summary-grid { grid-template-columns: 1fr; }
  .chart-panel-wide { grid-column: auto; }
  .filter-bar, .filter-bar-wide, .alarm-filter-bar { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1/-1; }
  .form-grid.cols-2, .form-grid.cols-3, .grid-choice-list, .method-selector { grid-template-columns: 1fr; }
  .rule-builder { grid-template-columns: 1fr 1fr; }
  .history-filters { grid-template-columns: 1fr; }
  .login-layout { display: block; min-height: 100vh; background: #fff; }
  .login-gallery { min-height: 34vh; height: 34vh; }.login-panel { min-height: 66vh; border-left: 0; }.login-panel-inner { padding: 38px 28px 24px; }.login-brand { margin-bottom: 32px; }
  .cookie-notice { grid-template-columns: 34px 1fr; }.cookie-notice > a, .cookie-notice > .button { grid-column: 2; justify-self: start; }
  .modal { padding: 0; align-items: end; }.modal-dialog { width: 100%; max-height: 92vh; border: 0; }
}
@media (max-width: 560px) {
  .brand img { width: 102px; }.brand-divider,.brand strong { display:none; }
  .nav-primary a { padding: 0 12px; }.nav-primary a span { display:none; }.nav-primary a i { font-size: 13px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .filter-bar, .filter-bar-wide, .alarm-filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-box { grid-column: auto; }
  .rule-builder { grid-template-columns: 1fr; }
  .modal-footer, .modal-footer-danger { align-items: stretch; flex-direction: column-reverse; }.modal-footer .button { width: 100%; }.left-danger { width:100%; }.left-danger .button { width:100%; }
  .danger-zone-inline { position: static; padding: 0 18px 14px; }.danger-zone-inline .button { width:100%; }
  .cookie-notice { right: 10px; bottom: 10px; width: calc(100% - 20px); }
}

/* Interactive states */
.modal[hidden], .cookie-notice[hidden] { display: none !important; }
.modal { opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility .16s ease; }
.modal.is-open { opacity: 1; visibility: visible; }
.modal-dialog { transform: translateY(8px) scale(.995); transition: transform .16s ease; }
.modal.is-open .modal-dialog { transform: translateY(0) scale(1); }
.cookie-notice { opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.cookie-notice.is-visible { opacity: 1; transform: translateY(0); }
.field-disabled { opacity: .55; }
.is-filtered-out { display: none !important; }

/* Product readability pass */
.nav-primary a { font-size: 12.5px; }
.account-copy strong { font-size: 12px; }
.account-copy span { font-size: 10.5px; }
.page-heading p { font-size: 13px; line-height: 1.55; }
.eyebrow { font-size: 10px; letter-spacing: .11em; }
.button { min-height: 38px; font-size: 12px; }
.button-small { min-height: 32px; font-size: 11px; }
.text-link, .notice { font-size: 12px; }
.kpi-copy span, .kpi-copy small { font-size: 11px; }
.panel-header h2 { font-size: 14px; }
.panel-hint { font-size: 11px; }
.compact-legend span, .chart-center span { font-size: 10px; }
.table th { height: 40px; font-size: 10px; }
.table td { font-size: 12px; line-height: 1.45; }
.table-sub, .entity-cell span { font-size: 10px; }
.tag, .origin-badge, .state-badge, .method-badge, .recognition, .availability, .severity-badge { font-size: 10.5px; }
.result-count, .filter-clear { font-size: 10.5px; }
.control, .search-box input, .field input, .field select { height: 39px; font-size: 12px; }
.field textarea { font-size: 12px; }
.field > label { font-size: 11px; }
.field-help, .form-section-title p, .method-selector small, .toggle-row small, .inline-note { font-size: 10.5px; }
.form-section-title h3, .method-selector strong, .toggle-row strong, .choice-row span { font-size: 11.5px; }
.profile-title h2 { font-size: 13px; }
.profile-title span { font-size: 9.5px; }
.profile-card > p { font-size: 11px; }
.profile-stats span, .profile-actions a { font-size: 10.5px; }
.advanced-toggle, .condition-chip, .condition-text { font-size: 10.5px; }
.history-summary-card > span, .history-summary-card > small { font-size: 10px; }
.empty-workspace p, .empty-workspace-steps { font-size: 11px; }
.recognize-summary > strong { font-size: 12px; }
.recognize-summary > small { font-size: 10.5px; }
.login-field > label { font-size: 11px; }
.login-legal { font-size: 10.5px; }
.form-alert, .demo-note { font-size: 11px; }
.cookie-notice { width: min(calc(100% - 40px), 680px); padding: 14px; gap: 13px; }
.cookie-copy strong { font-size: 11.5px; }
.cookie-copy span, .cookie-notice > a { font-size: 10.5px; line-height: 1.45; }
.legal-content h2 { font-size: 14px; }
.legal-content p { font-size: 12.5px; }

/* More deliberate login composition */
.login-panel { position: relative; }
.login-panel::before { content: ""; position: absolute; top: 0; left: -1px; width: 3px; height: 100%; background: linear-gradient(180deg, transparent 8%, var(--brand) 35%, var(--brand) 65%, transparent 92%); opacity: .9; }
.login-card { max-width: 390px; }
.login-brand { margin-bottom: 42px; }
.login-logo { width: 168px; }
.input-with-icon input { height: 49px; border-color: #cbd6d9; background: #fff; }
.login-action { min-height: 49px; margin-top: 10px; }
.login-pagination button { width: 36px; height: 3px; border-radius: 99px; }
.login-image::after { background: linear-gradient(90deg, rgba(3,15,18,.02), rgba(3,15,18,.05) 68%, rgba(3,15,18,.2)); }
.legal-meta { margin: -22px 0 34px; color: #94a0a5; font-size: 10.5px; font-weight: 500; }

/* Read-only state inherited from backend permissions */
.permission-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #8a979c;
  border: 1px solid #e0e6e8;
  background: #f7f9f9;
  border-radius: 5px;
}
.history-limit-note { margin: -4px 0 14px; }

/* ==========================================================================
   e-Jay Operations Control v4 — console polish
   ========================================================================== */

/* Modal geometry: header/footer fixed, only content scrolls. */
.modal-dialog {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 980px);
  border: 1px solid #d8e1e3;
  border-radius: 7px;
}
.modal-dialog > form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.modal-header,
.modal-footer { flex: 0 0 auto; }
.modal-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.modal-large { width: min(96vw, 980px); max-width: 980px; }
.modal-medium { width: min(94vw, 720px); max-width: 720px; }
.modal-small { width: min(92vw, 500px); max-width: 500px; }
.modal-header { padding: 16px 20px; }
.modal-body { padding: 18px 20px 20px; }
.modal-footer { padding: 12px 20px; }
.modal-sections { gap: 13px; }
.form-section-block { padding: 17px; }
.form-section-title { margin-bottom: 15px; }

/* Forms: every control starts on the same baseline. */
.form-grid { align-items: start; }
.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.field > label {
  min-height: 17px;
  margin-bottom: 6px;
  display: flex;
  align-items: flex-end;
  line-height: 1.25;
}
.field input,
.field select,
.control,
.search-box input {
  min-width: 0;
  min-height: 40px;
  height: 40px;
}
.field textarea { line-height: 1.45; }
.field-help { min-height: 15px; line-height: 1.4; }
.field-disabled { opacity: .58; }
.field-disabled select { background: #f3f6f7; }

/* Searchable client/profile selectors used inside device create/edit. */
.choice-columns { align-items: stretch; }
.choice-columns > .field { height: 100%; }
.choice-picker {
  min-width: 0;
  height: 246px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #fff;
}
.choice-search {
  position: relative;
  flex: 0 0 auto;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}
.choice-search i {
  position: absolute;
  z-index: 1;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #95a2a7;
  font-size: 10px;
  pointer-events: none;
}
.choice-search input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 31px;
  border: 1px solid #d3dde0;
  border-radius: 4px;
  background: #fff;
  color: #304148;
  outline: none;
}
.choice-search input:focus {
  border-color: #76b9ef;
  box-shadow: 0 0 0 2px rgba(31,149,242,.10);
}
.choice-picker .choice-list {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  border: 0;
  background: #fff;
}
.choice-picker .choice-row {
  min-height: 42px;
  padding: 9px 12px;
}
.choice-picker .choice-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.choice-empty {
  padding: 20px 12px;
  color: #8b989d;
  font-size: 11px;
  text-align: center;
}

/* Communication editor. */
.method-selector label > span {
  height: 82px;
  min-height: 82px;
  align-content: center;
  border-radius: 5px;
}
.method-selector strong { line-height: 1.25; }
.method-selector small { margin-top: 3px; line-height: 1.35; }

/* Guided alarm-rule editor: a stable five-column form; no raw/advanced editor. */
.rule-builder {
  grid-template-columns: minmax(190px,1.65fr) minmax(125px,1fr) minmax(120px,.9fr) minmax(145px,1.08fr) minmax(120px,.85fr);
  gap: 10px;
  align-items: start;
}
.rule-builder .field { align-self: start; }
.rule-builder .field > label { min-height: 17px; }
.rule-builder select,
.rule-builder input { width: 100%; }
.protected-condition {
  min-height: 70px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #d8e2e4;
  background: #f7fafb;
}
.protected-condition > i {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #eaf4f3;
  color: #46716e;
}
.protected-condition strong,
.protected-condition span { display: block; }
.protected-condition strong { color: #3b4d54; font-size: 11.5px; }
.protected-condition span { margin-top: 3px; color: #7d8b90; font-size: 10.5px; line-height: 1.45; }
.condition-chip.protected {
  border-color: #d8e2e4;
  background: #f5f8f9;
  color: #65777d;
}
.settings-stack { display: grid; gap: 12px; }

/* Recent readings / assisted data exploration. */
.context-filters {
  display: grid;
  grid-template-columns: minmax(180px,1fr) minmax(220px,1.15fr) minmax(220px,1.15fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.readings-filter-bar {
  grid-template-columns: minmax(280px,1fr) minmax(155px,190px) minmax(155px,190px) auto auto;
}
.reading-value {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 440px;
  color: #26393f;
  font-family: "Roboto Mono", Consolas, monospace;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.reading-value small { color: #809096; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 500; }
.reading-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 650;
}
.reading-state i { width: 7px; height: 7px; border-radius: 50%; background: #95a1a6; }
.reading-state.received { color: #26745b; }.reading-state.received i { background: #1f9a70; }
.reading-state.collection_failure { color: #b42318; }.reading-state.collection_failure i { background: #d92d20; }
.reading-state.unsupported { color: #aa4147; }.reading-state.unsupported i { background: #cf4c54; }
.reading-state.never { color: #7e8d92; }.reading-state.never i { background: #9eaaae; }
.history-all-filter { grid-template-columns: minmax(300px,1fr) minmax(170px,210px) auto auto; }

/* Alarm severity becomes part of the row, not only a tiny badge. */
.alarm-row td { transition: background .12s ease; }
.alarm-row.sev-row-5 td { background: #fff0f1; border-bottom-color: #f1cfd2; }
.alarm-row.sev-row-4 td { background: #fff5ef; border-bottom-color: #f2d8c8; }
.alarm-row.sev-row-3 td { background: #fff9ed; border-bottom-color: #eadcbd; }
.alarm-row.sev-row-2 td { background: #f3f8fc; border-bottom-color: #d8e4ee; }
.alarm-row.sev-row-1 td { background: #f4f8fb; border-bottom-color: #dde6ec; }
.alarm-row.sev-row-0 td { background: #f8fafb; }
.alarm-row.sev-row-5 td:first-child { box-shadow: inset 4px 0 #c83f47; }
.alarm-row.sev-row-4 td:first-child { box-shadow: inset 4px 0 #df7131; }
.alarm-row.sev-row-3 td:first-child { box-shadow: inset 4px 0 #d3992b; }
.alarm-row.sev-row-2 td:first-child { box-shadow: inset 4px 0 #6589aa; }
.alarm-row.sev-row-1 td:first-child { box-shadow: inset 4px 0 #7899b2; }
.alarm-row.sev-row-0 td:first-child { box-shadow: inset 4px 0 #a1acb0; }
.alarm-row:hover td { filter: brightness(.992); }
.alarm-row-closed td { background: #f7f9fa !important; opacity: .68; box-shadow: none !important; }

/* Full-screen NOC wallboard. */
.wallboard-bar { display: none; }
body.alarm-wallboard {
  min-width: 900px;
  overflow: auto;
  background: #071828;
}
body.alarm-wallboard .topbar,
body.alarm-wallboard .app-footer,
body.alarm-wallboard .alarm-normal-heading,
body.alarm-wallboard .alarm-filter-controls,
body.alarm-wallboard > .cookie-notice,
body.alarm-wallboard .notice { display: none !important; }
body.alarm-wallboard .content-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  background: #071828;
}
body.alarm-wallboard .wallboard-bar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: #0b2137;
  color: #fff;
}
body.alarm-wallboard .wallboard-bar > div:first-child { display: flex; align-items: baseline; gap: 16px; }
.wallboard-brand { color: #69d5e9; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
body.alarm-wallboard .wallboard-bar strong { font-size: 22px; letter-spacing: -.02em; }
.wallboard-meta { display: flex; align-items: center; gap: 14px; font-family: "Roboto Mono", Consolas, monospace; font-size: 17px; color: #d9e7e9; }
.wallboard-exit { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.15); border-radius: 4px; background: rgba(255,255,255,.04); color: #e3eeee; cursor: pointer; }
.wallboard-exit:hover { background: rgba(255,255,255,.09); }
body.alarm-wallboard .alarm-panel { margin: 0; border: 0; box-shadow: none; background: #0b2137; }
body.alarm-wallboard .alarm-panel .table-wrap { max-height: none; overflow: visible; }
body.alarm-wallboard .alarm-table { width: 100%; }
body.alarm-wallboard .alarm-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 48px;
  padding: 0 18px;
  border-color: #173039;
  background: #0b2229;
  color: #8fa6ac;
  font-size: 11px;
}
body.alarm-wallboard .alarm-table td {
  height: 63px;
  padding: 12px 18px;
  border-bottom-width: 1px;
  font-size: 14px;
}
body.alarm-wallboard .alarm-table .table-sub { font-size: 11px; }
body.alarm-wallboard .alarm-table .severity-badge,
body.alarm-wallboard .alarm-table .recognition,
body.alarm-wallboard .alarm-table .state-badge { font-size: 12px; }
body.alarm-wallboard .alarm-action-col { display: none; }
body.alarm-wallboard .alarm-row-closed { display: none; }

/* Footer ownership is intentionally separated from tenant visual branding. */
.app-footer { align-items: center; justify-content: space-between; flex-wrap: wrap; }

@media (max-width: 1180px) {
  .context-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .context-filters .button { justify-self: start; }
  .readings-filter-bar { grid-template-columns: 1fr 1fr; }
  .readings-filter-bar .search-box { grid-column: 1 / -1; }
  .rule-builder { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .modal-dialog { border-radius: 0; max-height: 94vh; }
  .modal-large,.modal-medium,.modal-small { width: 100%; max-width: none; }
  .choice-picker { height: 220px; }
  .context-filters,.readings-filter-bar,.history-all-filter { grid-template-columns: 1fr; }
  .rule-builder { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .rule-builder { grid-template-columns: 1fr; }
  .modal-body { padding: 14px; }
  .modal-header,.modal-footer { padding-left: 14px; padding-right: 14px; }
  .form-section-block { padding: 14px; }
}

.legal-brand {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: end;
  column-gap: 6px;
  color: #15282e;
}
.legal-brand span { font-size: 19px; font-weight: 750; letter-spacing: -.035em; }
.legal-brand strong { color: var(--brand-strong); font-size: 19px; font-weight: 650; letter-spacing: -.035em; }
.legal-brand small { grid-column: 1 / -1; margin-top: -2px; color: #87959a; font-size: 8.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }

/* ==========================================================================
   e-Jay Operations Control v5 — identity and alarm refresh controls
   ========================================================================== */

/* Tenant header: Gemelo visual identity. */
.topbar-inner { grid-template-columns: 150px minmax(0,1fr) auto; }
.brand { gap: 0; }
.brand img { width: 118px; max-height: 34px; }
.brand-divider,
.brand strong { display: none !important; }

/* Login terminology. */
.login-brand span { min-width: 112px; }

/* Footer: ownership without exposing the support mailbox. */
.app-footer { justify-content: space-between; }
.app-footer > span { flex: 1 1 auto; }
.app-footer > a { flex: 0 0 auto; }

/* Privacy page product identity. */
.legal-product { display: flex; flex-direction: column; line-height: 1.05; }
.legal-product strong { color: #20343a; font-size: 16px; font-weight: 750; letter-spacing: -.025em; }
.legal-product span { margin-top: 5px; color: #88959a; font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.legal-content section p + p { margin-top: 9px; }

/* Alarm refresh selector. */
.refresh-control { position: relative; }
.refresh-button strong { min-width: 30px; padding-left: 8px; border-left: 1px solid #d8e1e3; color: #42615f; font-size: 10px; font-weight: 700; }
.refresh-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  right: 0;
  width: 210px;
  overflow: hidden;
  border: 1px solid #d6e0e2;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(6,28,34,.16);
}
.refresh-menu-title {
  display: block;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #e4eaec;
  color: #7b898e;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.refresh-menu button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid #eef2f3;
  background: #fff;
  color: #4e6067;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.refresh-menu button:last-child { border-bottom: 0; }
.refresh-menu button:hover { background: #f5f9f8; color: #1e5350; }
.refresh-menu button.active { background: #eef7ff; color: #147bdc; font-weight: 700; }
.refresh-menu button.active::after { content: "✓"; margin-left: auto; font-weight: 800; }

/* Wallboard: only tenant logo and operational controls. */
body.alarm-wallboard .wallboard-bar { height: 70px; }
.wallboard-logo { display: flex; align-items: center; min-width: 130px; }
.wallboard-logo img { width: 126px; max-height: 34px; filter: none; object-fit: contain; }
body.alarm-wallboard .wallboard-bar > div:first-child { display: flex; align-items: center; gap: 0; }
.wallboard-meta { position: relative; }
.wallboard-tool,
.wallboard-exit {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 4px;
  background: rgba(255,255,255,.04);
  color: #e3eeee;
  cursor: pointer;
}
.wallboard-tool:hover,
.wallboard-exit:hover { background: rgba(255,255,255,.09); }
.wallboard-tool span { color: #a8c1c6; font-family: "Roboto Mono", Consolas, monospace; font-size: 11px; font-weight: 600; }
.wallboard-refresh .refresh-menu { top: calc(100% + 9px); right: 0; }
.refresh-menu-dark { border-color: #29434a; background: #102b46; box-shadow: 0 18px 55px rgba(0,0,0,.38); }
.refresh-menu-dark .refresh-menu-title { border-color: #213b42; color: #86a0a6; }
.refresh-menu-dark button { border-color: #1c353c; background: #102b46; color: #bfd0d3; }
.refresh-menu-dark button:hover { background: #163a5d; color: #fff; }
.refresh-menu-dark button.active { background: #153b62; color: #69d5e9; }

@media (max-width: 1380px) {
  .topbar-inner { grid-template-columns: 140px minmax(0,1fr) auto; }
}
@media (max-width: 820px) {
  .refresh-control { max-width: 100%; }
  .refresh-menu { left: 0; right: auto; }
  .wallboard-refresh .refresh-menu { left: auto; right: 0; }
}

/* ==========================================================================\n   e-Jay Operations Control v6 — local metadata, image profile and search correction\n   ========================================================================== */

/* Search icon correction: the generic control shorthand used to reset the
   left padding and visually overlap the icon with the placeholder. */
.search-box { position: relative; min-width: 0; }
.search-box > i {
  position: absolute;
  z-index: 2;
  left: 13px;
  top: 50%;
  width: 14px;
  transform: translateY(-50%);
  color: #8c9ba0;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}
.search-box > input[type="search"] {
  width: 100%;
  padding: 0 36px 0 38px;
  line-height: 40px;
  appearance: none;
  -webkit-appearance: none;
}
.search-box > input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.search-box > input[type="search"]::-webkit-search-cancel-button { margin-right: 2px; cursor: pointer; }

/* Account image. */
.account-avatar-button {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.16);
  background: #102b46;
  color: #d8e4e6;
  cursor: pointer;
}
.account-avatar-button > img,
.account-avatar-button > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
  overflow: hidden;
}
.account-avatar-button > img { display: block; }
.account-avatar-button > .account-avatar-fallback {
  background: #eef3f5;
  color: #657d88;
  font-size: 12px;
}
.account-avatar-button > .account-avatar-fallback i { transform: translateY(1px); }
.account-avatar-edit {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 2px solid var(--header);
  border-radius: 50%;
  background: var(--brand-strong);
  color: #fff;
  font-size: 6px;
  opacity: 0;
  transform: scale(.88);
  transition: opacity .14s ease, transform .14s ease;
}
.account-avatar-button:hover .account-avatar-edit,
.account-avatar-button:focus-visible .account-avatar-edit { opacity: 1; transform: scale(1); }

/* Client logos and local metadata editor. */
.client-entity-cell { gap: 11px; }
.client-logo-thumb {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe7e9;
  background: #f7f9f9;
  color: #839198;
}
.client-logo-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }

.image-upload {
  display: grid;
  grid-template-columns: 128px minmax(0,1fr);
  gap: 18px;
  align-items: center;
}
.image-preview-box {
  width: 128px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px dashed #cbd7da;
  background: #f8fafb;
  color: #8b999e;
  font-size: 10px;
}
.image-preview-box > i { font-size: 18px; color: #9ca9ad; }
.image-preview-box.has-image { border-style: solid; background: #fff; }
.image-preview-box img { width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; }
.image-upload-fields { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.image-upload-field input[type="file"] {
  height: auto;
  min-height: 40px;
  padding: 7px 9px;
  line-height: 1.3;
}
.image-upload-field input[type="file"]::file-selector-button {
  margin: -3px 10px -3px -4px;
  padding: 6px 10px;
  border: 1px solid #cbd7da;
  border-radius: 4px;
  background: #f7f9fa;
  color: #405159;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.image-upload-field input[type="file"]::file-selector-button:hover { background: #eef3f4; }
.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: #586970;
  font-size: 11px;
  cursor: pointer;
}
.compact-check input { width: 15px; height: 15px; accent-color: var(--brand-strong); }

.user-photo-upload { grid-template-columns: 112px minmax(0,1fr); }
.image-preview-avatar { width: 112px; height: 112px; border-radius: 50%; border-style: solid; }
.image-preview-avatar img { padding: 0; object-fit: cover; }
.avatar-fallback-large {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: #eef3f5; color: #6a818b; font-size: 25px; font-weight: 700;
}
.avatar-fallback-large i { transform: translateY(2px); }

.user-photo-modal-footer { gap: 8px; }
.user-photo-modal-footer .button:nth-child(2) { margin-left: auto; }
.user-profile-edit-dialog { width: min(680px, calc(100vw - 28px)); }
.user-profile-edit-body { display: grid; gap: 20px; }
.user-profile-edit-section { display: grid; gap: 13px; }
.user-profile-edit-section + .user-profile-edit-section { padding-top: 18px; border-top: 1px solid #e9eef0; }
.user-profile-edit-section-head { display: flex; flex-direction: column; gap: 3px; }
.user-profile-edit-section-head strong { color: #233b45; font-size: 11.5px; }
.user-profile-edit-section-head span { color: #839299; font-size: 9.5px; line-height: 1.45; }
.user-profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.user-profile-field-wide { grid-column: 1 / -1; }
.user-profile-photo-editor { align-items: center; }
.user-profile-remove-photo span { display: inline-flex; align-items: center; gap: 6px; }
.user-profile-remove-photo i { color: #8a5a5a; }

@media (max-width: 620px) {
  .user-profile-form-grid { grid-template-columns: 1fr; }
  .user-profile-field-wide { grid-column: auto; }
  .user-photo-modal-footer { flex-wrap: wrap; }
  .user-photo-modal-footer .button:nth-child(2) { margin-left: 0; }
}

@media (max-width: 560px) {
  .image-upload, .user-photo-upload { grid-template-columns: 1fr; }
  .image-preview-box { width: 100%; height: 120px; }
  .image-preview-avatar { width: 112px; height: 112px; justify-self: center; }
}


/* ==========================================================================
   e-Jay Operations Control — modal field alignment
   ==========================================================================
 *
 * Root cause: `.form-section-block .field + .field { margin-top }` (descendant,
 * not child) matched the SECOND field sitting BESIDE the first in a 2-col grid.
 * Nome dropped above Identificador interno; Clientes above Perfis de coleta.
 * Native <input> min-content width then made the right column look wider.
 *
 * Contract: equal tracks, CSS subgrid so every label row and every control
 * row share a baseline, no sibling margin inside the grid. Checkbox matrices
 * use the same 2-col + 14px split as the inputs above them.
 */

.form-grid > .field,
.form-grid > .field + .field,
.modal .form-grid > .field,
.modal .form-grid > .field + .field,
.modal-device .form-section-block .form-grid > .field,
.modal-device .form-section-block .form-grid > .field + .field {
  margin-top: 0;
}

.form-grid {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  column-gap: 14px;
  row-gap: 12px;
}

.form-grid.cols-2,
.form-grid.cols-3 {
  grid-auto-flow: row;
  grid-auto-rows: auto;
  row-gap: 0;
}

.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.form-grid.cols-2 > .field,
.form-grid.cols-3 > .field {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  row-gap: 6px;
  min-width: 0;
  width: auto;
  max-width: 100%;
  margin: 0;
  align-self: stretch;
  justify-self: stretch;
}

.form-grid.cols-2 > .field > label,
.form-grid.cols-3 > .field > label {
  min-height: 0;
  margin: 0;
  display: block;
  align-self: end;
  line-height: 1.35;
}

.form-grid.cols-2 > .field > input,
.form-grid.cols-2 > .field > select,
.form-grid.cols-2 > .field > textarea,
.form-grid.cols-3 > .field > input,
.form-grid.cols-3 > .field > select,
.form-grid.cols-3 > .field > textarea,
.form-grid.cols-2 > .field > .choice-picker,
.form-grid.cols-3 > .field > .choice-picker {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.form-grid.choice-columns { align-items: stretch; }
.form-grid.choice-columns > .field {
  height: auto;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
}
.form-grid.choice-columns > .field > label { min-height: 0; }
.form-grid.choice-columns > .field > .choice-picker {
  flex: none;
  height: 202px;
  min-height: 202px;
  align-self: stretch;
}

.modal .method-selector { column-gap: 14px; }

/* Category / inheritance matrices share the same 2-col axis as the inputs. */
.modal .grid-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 0;
  border: 0;
  background: transparent;
}
.modal .grid-choice-list .choice-row {
  border: 1px solid #e4e9eb;
  border-right: 1px solid #e4e9eb;
  background: #fff;
  margin-top: -1px;
}
.modal .grid-choice-list .choice-row:nth-child(1),
.modal .grid-choice-list .choice-row:nth-child(2) {
  margin-top: 0;
}
.modal .grid-choice-list .choice-row:last-child {
  border-bottom: 1px solid #e4e9eb;
}

.modal .form-section-block {
  min-width: 0;
  padding: 16px 17px;
}
.modal .form-section-title {
  min-height: 32px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.modal .form-section-title > div:last-child { min-width: 0; }
.modal .form-section-title h3 { line-height: 1.25; }
.modal .form-section-title p { line-height: 1.4; }
.modal .modal-sections { gap: 12px; }
.modal .field-help { margin-top: 6px; }

.modal .field:not(.image-upload-field) > label { flex-shrink: 0; }

.modal .image-upload,
.modal .user-photo-upload { align-items: start; }
.modal .image-upload-fields,
.modal .image-upload-field { align-self: start; }
.modal .image-upload-field > label {
  min-height: 17px;
  margin: 0 0 7px;
  display: flex;
  align-items: flex-end;
  line-height: 1.3;
}
.modal .image-upload-field input[type="file"] {
  width: 100%;
  min-height: 40px;
  margin: 0;
}
.modal .image-upload-fields > .field {
  width: 100%;
  align-self: stretch;
}

.modal-client {
  width: min(94vw, 700px);
  max-width: 700px;
}
.modal-client .modal-body { padding: 18px 20px 20px; }
.modal-client .image-upload {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.modal-client .image-preview-box { width: 112px; height: 96px; }
.modal-client .image-upload-fields,
.modal-client .image-upload-field {
  width: 100%;
  align-self: stretch;
}
.modal-client .image-upload-field input[type="file"] {
  width: 100%;
  max-width: none;
}
.modal-client .compact-check { margin-top: 1px; }

.modal-device {
  width: min(95vw, 940px);
  max-width: 940px;
  max-height: min(90vh, 900px);
}
.modal-device .modal-body { padding: 16px 18px 18px; }
.modal-device .form-section-block { padding: 15px 16px; }
.modal-device .form-section-title { margin-bottom: 12px; }
.modal-device .field textarea { min-height: 68px; }
.modal-device .choice-picker { height: 202px; }
.modal-device .choice-picker .choice-row { min-height: 38px; padding: 7px 11px; }
.modal-device .choice-search { padding: 7px; }
.modal-device .choice-search input { height: 36px; }
.modal-device .method-selector { gap: 14px; margin-bottom: 11px; }
.modal-device .method-selector label > span {
  height: 72px;
  min-height: 72px;
  padding: 10px 12px;
}
.modal-device .form-section-block > .field + .field,
.modal-device .form-section-block > .form-grid + .field,
.modal-device .form-section-block > .field + .form-grid,
.modal-device .form-section-block > .form-grid + .form-grid {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .modal-client,
  .modal-device {
    width: 100%;
    max-width: none;
  }
  .form-grid.cols-2,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }
  .form-grid.cols-2 > .field,
  .form-grid.cols-3 > .field,
  .form-grid.choice-columns > .field {
    display: flex;
    flex-direction: column;
    grid-template-rows: none;
    grid-row: auto;
    row-gap: 0;
  }
  .form-grid.cols-2 > .field > label,
  .form-grid.cols-3 > .field > label {
    min-height: 0;
    margin-bottom: 6px;
    align-self: start;
  }
  .modal-client .image-upload { grid-template-columns: 1fr; }
  .modal-client .image-preview-box { width: 100%; height: 120px; }
  .modal .grid-choice-list {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  .modal .method-selector,
  .modal-device .method-selector {
    grid-template-columns: 1fr;
  }
  .modal .grid-choice-list .choice-row { margin-top: -1px; }
  .modal .grid-choice-list .choice-row:nth-child(1) { margin-top: 0; }
}

/* History enterprise reports */
.history-heading { margin-bottom: 18px; }
.history-pdf-button { min-width: 132px; }
.history-pdf-button.is-loading { pointer-events: none; opacity: .65; }
.history-filters-enterprise {
  grid-template-columns: minmax(145px,.7fr) minmax(180px,1fr) minmax(220px,1.15fr) minmax(220px,1.25fr) minmax(145px,.75fr) auto;
  position: relative;
  gap: 10px;
  padding: 16px;
  box-shadow: 0 4px 18px rgba(9,31,37,.025);
}
.history-filters-enterprise .history-type-field select { font-weight: 700; color: #31464d; background: #f7faf9; }
.history-filters-enterprise .button { min-height: 38px; }
.history-limit-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: -6px 0 14px;
  padding: 9px 12px;
  border: 1px solid #dce7e9;
  border-left: 3px solid var(--brand-strong);
  border-radius: 6px;
  background: #f8fbfb;
  color: #607379;
  font-size: 11px;
  line-height: 1.45;
}
.history-limit-note i { margin-top: 2px; color: var(--brand-strong); font-size: 11px; }
.history-chart-frame-compact { height: 300px; }
.alarm-history-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 10px; }
.alarm-history-summary-grid .history-summary-card { position: relative; overflow: hidden; }
.alarm-history-summary-grid .history-summary-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #aeb9bd; }
.alarm-summary-total::before { background: var(--brand-strong) !important; }
.alarm-summary-active::before { background: #c83f47 !important; }
.alarm-summary-closed::before { background: #6f858d !important; }
.alarm-summary-recognized::before { background: #2f8a69 !important; }
.alarm-history-chart-grid { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(330px,.8fr); gap: 10px; }
.alarm-history-trend-frame, .alarm-history-severity-frame { height: 315px; }
.alarm-history-local-filter { grid-template-columns: minmax(320px,1fr) minmax(180px,220px) minmax(170px,210px) auto auto; }
.alarm-history-panel { margin-top: 0; }
.alarm-history-table-wrap { max-height: 620px; }
.alarm-history-table { min-width: 1380px; }
.alarm-history-table th { position: sticky; z-index: 3; top: 0; background: #fff; }
.alarm-history-row td { transition: background .12s ease; }
.alarm-history-row.sev-row-5 td { background: #fff0f1; border-bottom-color: #f1cfd2; }
.alarm-history-row.sev-row-4 td { background: #fff5ef; border-bottom-color: #f2d8c8; }
.alarm-history-row.sev-row-3 td { background: #fff9ed; border-bottom-color: #eadcbd; }
.alarm-history-row.sev-row-2 td { background: #f3f8fc; border-bottom-color: #d8e4ee; }
.alarm-history-row.sev-row-1 td { background: #f4f8fb; border-bottom-color: #dde6ec; }
.alarm-history-row.sev-row-0 td { background: #f8fafb; }
.alarm-history-row.sev-row-5 td:first-child { box-shadow: inset 4px 0 #c83f47; }
.alarm-history-row.sev-row-4 td:first-child { box-shadow: inset 4px 0 #df7131; }
.alarm-history-row.sev-row-3 td:first-child { box-shadow: inset 4px 0 #d3992b; }
.alarm-history-row.sev-row-2 td:first-child { box-shadow: inset 4px 0 #6589aa; }
.alarm-history-row.sev-row-1 td:first-child { box-shadow: inset 4px 0 #7899b2; }
.alarm-history-row.sev-row-0 td:first-child { box-shadow: inset 4px 0 #a1acb0; }
.alarm-history-row:hover td { filter: brightness(.992); }
.alarm-history-row-closed td { filter: saturate(.75); }
.alarm-history-row-closed .state-badge { opacity: .85; }

@media (max-width: 1380px) {
  .history-filters-enterprise { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .history-filters-enterprise .button { align-self: end; }
  .alarm-history-local-filter { grid-template-columns: minmax(260px,1fr) repeat(2,minmax(160px,1fr)) auto; }
  .alarm-history-local-filter .result-count { grid-column: 1/-1; justify-self: end; }
}
@media (max-width: 1120px) {
  .alarm-history-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .alarm-history-chart-grid { grid-template-columns: 1fr; }
  .alarm-history-severity-frame { height: 280px; }
}
@media (max-width: 820px) {
  .history-filters-enterprise { grid-template-columns: 1fr; }
  .alarm-history-summary-grid { grid-template-columns: 1fr; }
  .alarm-history-local-filter { grid-template-columns: 1fr; }
  .alarm-history-local-filter .search-box, .alarm-history-local-filter .result-count { grid-column: auto; }
  .alarm-history-local-filter .result-count { justify-self: start; }
}

/* History hybrid source + compact account identity */
.account-copy-name-only {
  min-width: 0;
  max-width: 190px;
  justify-content: center;
}
.account-copy-name-only strong { line-height: 1.25; }
.history-summary-grid-metrics {
  grid-template-columns: minmax(260px,1.35fr) minmax(190px,1fr) minmax(135px,.65fr) minmax(220px,1fr);
}
.history-source-card { border-left: 3px solid #0b70c9; }
.history-source-card strong { font-size: 13px; }
.panel-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.metric-source-pill,
.metric-source-table {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dce5e7;
  background: #f8fafb;
  color: #65777d;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.metric-source-pill { padding: 6px 8px; border-radius: 999px; }
.metric-source-table { padding: 4px 6px; border-radius: 3px; }
.metric-source-pill.is-trend,
.metric-source-table.is-trend {
  border-color: #bfe2de;
  background: #eff9f7;
  color: #0b70c9;
}
.history-all-metrics-table { min-width: 1180px; }
.history-all-metrics-table th:nth-child(2) { min-width: 250px; }
.history-all-metrics-table td:nth-child(3),
.history-all-metrics-table td:nth-child(4),
.history-all-metrics-table td:nth-child(5) { font-variant-numeric: tabular-nums; }

@media (max-width: 1320px) {
  .history-summary-grid-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .history-summary-grid-metrics { grid-template-columns: 1fr; }
  .panel-meta { justify-content: flex-start; }
}

/* ========================================================================== 
   Client geolocation + alarm geographic/event views
   ========================================================================== */
.client-location {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5c6d73;
  white-space: nowrap;
}
.client-location i { color: #789096; font-size: 11px; }
.client-coordinate-grid { margin-top: 12px; }
.form-grid.cols-2.client-coordinate-grid > .field { grid-row: span 3; }
.client-coordinate-grid .field-help { margin-top: 0; }
.section-inline-help {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #78888e;
  font-size: 10px;
  line-height: 1.4;
}
.section-inline-help i { color: #5f827f; }
.modal-client { width: min(94vw, 760px); max-width: 760px; }

.alarm-view-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0 0 12px;
  padding: 3px;
  border: 1px solid #dce5e7;
  border-radius: 6px;
  background: #f6f8f9;
}
.alarm-view-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64757b;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.alarm-view-button i { width: 14px; text-align: center; font-size: 11px; }
.alarm-view-button:hover { color: #33474e; background: #eef3f4; }
.alarm-view-button.active {
  background: #fff;
  color: #243940;
  box-shadow: 0 1px 3px rgba(18,42,49,.10);
}
.alarm-view-button.active i { color: var(--brand-strong); }
.alarm-view-panel[hidden] { display: none !important; }
.alarm-location-notice { margin-bottom: 12px; }

.alarm-map-panel { padding: 0; overflow: hidden; }
.alarm-view-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px 14px;
}
.alarm-view-section-head h2,
.alarm-view-section-head h3 { margin: 3px 0 4px; color: #263a40; font-size: 17px; letter-spacing: -.025em; }
.alarm-view-section-head p { margin: 0; color: #75858b; font-size: 10.5px; line-height: 1.5; }
.alarm-map-stats {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 154px;
  padding: 9px 12px;
  border: 1px solid #e1e8ea;
  background: #f8fafb;
}
.alarm-map-stats strong { color: #30464c; font-family: "Roboto Mono", Consolas, monospace; font-size: 18px; }
.alarm-map-stats span { color: #7c8b90; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }

.alarm-severity-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  color: #6c7d83;
  font-size: 9.5px;
  font-weight: 600;
}
.alarm-severity-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.compact-legend {
  justify-content: flex-start;
  padding: 0 20px 13px;
  border-bottom: 1px solid #e7ecee;
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sev-dot-5 { background: #c83f47; }
.sev-dot-4 { background: #df7131; }
.sev-dot-3 { background: #d3992b; }
.sev-dot-2 { background: #6589aa; }
.sev-dot-1 { background: #7899b2; }
.sev-dot-0 { background: #8a979c; }

.alarm-map-frame { position: relative; min-height: 480px; background: #e9eff0; }
#alarm-map { width: 100%; height: 520px; background: #e9eff0; z-index: 1; }
.alarm-map-frame .leaflet-control-container { font-family: Inter, "Segoe UI", Arial, sans-serif; }
.alarm-map-frame .leaflet-control-zoom a { color: #34494f; }
.alarm-map-frame .leaflet-control-attribution { color: #76878c; font-size: 8px; }
.alarm-map-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 28px;
  background: rgba(245,248,249,.94);
  color: #7b8b90;
  text-align: center;
}
.alarm-map-empty[hidden] { display: none; }
.alarm-map-empty i { margin-bottom: 3px; color: #839a9f; font-size: 28px; }
.alarm-map-empty strong { color: #41555b; font-size: 13px; }
.alarm-map-empty span { max-width: 420px; font-size: 10.5px; line-height: 1.5; }
.alarm-map-footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 20px;
  border-top: 1px solid #e3e9eb;
  background: #fafcfc;
  color: #74858a;
  font-size: 9.5px;
}
.alarm-map-footnote i { color: #6b8986; }
.alarm-map-div-icon { background: transparent !important; border: 0 !important; }
.alarm-map-marker {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  position: relative;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--marker-color, #8a979c);
  box-shadow: 0 4px 13px rgba(12,31,37,.28), 0 0 0 2px color-mix(in srgb, var(--marker-color, #8a979c) 35%, transparent);
  color: #fff;
}
.alarm-map-marker::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--marker-color, #8a979c);
}
.alarm-map-marker strong { font-family: "Roboto Mono", Consolas, monospace; font-size: 13px; line-height: 1; }
.alarm-map-popup { min-width: 190px; display: grid; gap: 8px; padding: 2px; }
.alarm-map-popup > strong { color: #2f4248; font-size: 12px; }
.alarm-map-popup > span:last-child { color: #718187; font-size: 10px; }

.alarm-event-overview { display: grid; gap: 12px; }
.event-panel-head {
  padding: 0 0 2px;
  align-items: flex-end;
}
.event-panel-head .alarm-severity-legend { max-width: 650px; }
.alarm-client-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 10px;
}
.alarm-client-card {
  --severity-color: #8a979c;
  --severity-bg: #f6f8f9;
  min-width: 0;
  min-height: 126px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 15px 16px 12px;
  border: 1px solid #dde5e7;
  border-top: 4px solid var(--severity-color);
  border-radius: 5px;
  background: linear-gradient(180deg, var(--severity-bg) 0, #fff 74px);
  color: #35494f;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(23,47,54,.04);
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.alarm-client-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--severity-color) 45%, #dce5e7); box-shadow: 0 5px 14px rgba(23,47,54,.08); }
.alarm-client-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.severity-card-5 { --severity-color: #c83f47; --severity-bg: #fff1f2; }
.severity-card-4 { --severity-color: #df7131; --severity-bg: #fff5ef; }
.severity-card-3 { --severity-color: #d3992b; --severity-bg: #fff9ed; }
.severity-card-2 { --severity-color: #6589aa; --severity-bg: #f1f6fa; }
.severity-card-1 { --severity-color: #7899b2; --severity-bg: #f3f7fa; }
.severity-card-0 { --severity-color: #8a979c; --severity-bg: #f6f8f9; }
.alarm-client-card-header { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.alarm-client-card-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  object-fit: contain;
  padding: 3px;
  border: 1px solid rgba(61,82,88,.12);
  border-radius: 4px;
  background: #fff;
}
.alarm-client-card-logo-fallback { color: #778a90; font-size: 14px; }
.alarm-client-card-title { min-width: 0; display: grid; gap: 3px; }
.alarm-client-card-title strong { overflow: hidden; color: #2e4248; font-size: 12.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.alarm-client-card-title span { color: var(--severity-color); font-size: 9px; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
.alarm-client-card-total { min-width: 48px; display: grid; justify-items: end; }
.alarm-client-card-total strong { color: #2d4248; font-family: "Roboto Mono", Consolas, monospace; font-size: 21px; line-height: 1; }
.alarm-client-card-total span { margin-top: 3px; color: #89979b; font-size: 8.5px; text-transform: uppercase; }
.alarm-client-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px solid rgba(75,96,102,.10); color: #718187; font-size: 9.5px; }
.alarm-client-card-footer span { display: inline-flex; align-items: center; gap: 5px; }
.alarm-client-card-footer i { color: var(--severity-color); font-size: 8px; }
.alarm-client-cards-empty {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed #d9e2e4;
  background: #fafcfc;
  color: #75868b;
  font-size: 10.5px;
}
.alarm-client-cards-empty[hidden] { display: none; }

.event-feed-panel { overflow: hidden; }
.event-feed-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5ebed;
}
.event-feed-header h3 { margin: 2px 0 0; color: #30444a; font-size: 14px; }
.event-feed { display: grid; }
.event-feed-item {
  --event-severity: #8a979c;
  min-width: 0;
  display: grid;
  grid-template-columns: 104px minmax(0,1fr) minmax(205px,auto);
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 16px 12px 19px;
  position: relative;
  border-bottom: 1px solid #edf1f2;
  background: #fff;
}
.event-feed-item:last-child { border-bottom: 0; }
.event-feed-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--event-severity); }
.severity-feed-5 { --event-severity: #c83f47; }
.severity-feed-4 { --event-severity: #df7131; }
.severity-feed-3 { --event-severity: #d3992b; }
.severity-feed-2 { --event-severity: #6589aa; }
.severity-feed-1 { --event-severity: #7899b2; }
.severity-feed-0 { --event-severity: #8a979c; }
.event-feed-body { min-width: 0; display: grid; gap: 6px; }
.event-feed-body > strong { overflow: hidden; color: #30444a; font-size: 11.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.event-feed-meta { min-width: 0; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; color: #7b898e; font-size: 9px; }
.event-feed-meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.event-feed-meta i { color: #92a0a4; font-size: 8px; }
.event-feed-side { display: grid; justify-items: end; gap: 7px; }
.event-feed-side time { color: #75858a; font-family: "Roboto Mono", Consolas, monospace; font-size: 9px; white-space: nowrap; }
.event-feed-badges { display: flex; align-items: center; gap: 7px; }
.event-feed-empty[hidden] { display: none; }

body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-map-panel,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="panel"] .event-feed-panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-view-section-head,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .compact-legend,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-map-footnote { background: #0b2137; border-color: #173039; }
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-view-section-head h2 { color: #e4eff1; }
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-view-section-head p,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-severity-legend,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-map-footnote { color: #8fa6ac; }
body.alarm-wallboard #alarm-map { height: calc(100vh - 190px); min-height: 520px; }
body.alarm-wallboard .alarm-event-overview { padding: 14px 18px 24px; background: #0b2137; }
body.alarm-wallboard .event-panel-head h2 { color: #e4eff1; }
body.alarm-wallboard .event-panel-head p,
body.alarm-wallboard .event-panel-head .alarm-severity-legend { color: #8fa6ac; }

@media (max-width: 1180px) {
  .alarm-view-section-head { gap: 14px; }
  .event-panel-head { align-items: flex-start; flex-direction: column; }
  .event-panel-head .alarm-severity-legend { justify-content: flex-start; }
  .event-feed-item { grid-template-columns: 96px minmax(0,1fr) 180px; }
}
@media (max-width: 820px) {
  .client-location { white-space: normal; }
  .alarm-view-toolbar { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .alarm-view-button { justify-content: center; padding: 0 8px; }
  .alarm-view-section-head { flex-direction: column; }
  .alarm-map-stats { width: 100%; grid-template-columns: auto 1fr auto 1fr; }
  .alarm-severity-legend { justify-content: flex-start; gap: 9px 12px; }
  #alarm-map { height: 400px; }
  .alarm-client-cards { grid-template-columns: 1fr; }
  .event-feed-item { grid-template-columns: 1fr; gap: 8px; padding: 13px 14px 13px 18px; }
  .event-feed-severity { width: fit-content; }
  .event-feed-side { justify-items: start; }
  .event-feed-body > strong { white-space: normal; }
  .event-feed-header { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 560px) {
  .alarm-view-button span { display: none; }
  .alarm-view-button i { font-size: 13px; }
  .alarm-map-panel .alarm-view-section-head,
  .compact-legend,
  .alarm-map-footnote { padding-left: 14px; padding-right: 14px; }
  #alarm-map { height: 350px; }
  .alarm-client-card-header { grid-template-columns: 34px minmax(0,1fr) auto; }
  .alarm-client-card-logo { width: 34px; height: 34px; }
  .alarm-client-card-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}

/* Panels / dashboards */
.notice-warning { border-color: #ead6ae; background: #fffaf0; color: #8b621c; }
.panel-runtime-warning code, .panel-inline-warning code { font-family: "Roboto Mono", Consolas, monospace; font-size: .95em; }
.dashboard-catalog { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.dashboard-catalog-card { min-width: 0; display: grid; gap: 15px; padding: 17px; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 8px rgba(10,31,37,.025); }
.dashboard-catalog-head { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.dashboard-catalog-icon { width: 38px; height: 38px; display: grid; place-items: center; background: #edf8f6; color: var(--brand-strong); }
.dashboard-catalog-title { min-width: 0; }
.dashboard-catalog-title h2 { margin: 0; overflow: hidden; color: #203238; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-catalog-title span { display: block; margin-top: 3px; overflow: hidden; color: #819096; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-public-state { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid #dce4e6; background: #f8fafb; color: #7d898e; font-size: 9px; font-weight: 650; }
.dashboard-public-state.enabled { border-color: #bfe2d8; background: #f0faf7; color: #27755e; }
.dashboard-catalog-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 10px 0; border-top: 1px solid #edf1f2; border-bottom: 1px solid #edf1f2; color: #7b8a8f; font-size: 9.5px; }
.dashboard-catalog-meta strong { color: #42555b; font-weight: 650; }
.dashboard-catalog-actions { display: flex; gap: 7px; }
.dashboard-empty-panel .empty-state { height: 250px; }
.dashboard-empty-panel .empty-state .button { width: fit-content; margin: 16px auto 0; color: #fff !important; }
.public-link-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.public-link-row input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: #f8fafb; color: #56686e; font: 10px "Roboto Mono", Consolas, monospace; outline: none; }
.compact-public-link input { height: 31px; font-size: 9px; }

.panel-builder-step { margin-bottom: 12px; }
.panel-host-picker { display: grid; grid-template-columns: minmax(260px,1fr) auto; align-items: end; gap: 10px; padding: 17px; }
.panel-builder-body { display: grid; gap: 17px; padding: 17px; }
.panel-public-field { min-width: 0; }
.panel-public-toggle { min-height: 54px; display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fbfcfc; cursor: pointer; }
.panel-public-toggle input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--brand-strong); }
.panel-public-toggle span { display: grid; gap: 2px; }
.panel-public-toggle strong { color: #31464c; font-size: 10.5px; }
.panel-public-toggle small { color: #849298; font-size: 9px; line-height: 1.35; }
.panel-inline-warning { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid #ead6ae; background: #fffaf0; color: #8b621c; font-size: 9.5px; }
.panel-inline-warning i { margin-top: 2px; }
.panel-item-toolbar { min-height: 52px; display: grid; grid-template-columns: minmax(260px,1fr) auto; align-items: center; gap: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
.panel-item-toolbar > span { color: #78888e; font-size: 9.5px; white-space: nowrap; }
.panel-item-toolbar > span strong { color: #35494f; }
.panel-item-table-wrap { max-height: 620px; overflow: auto; }
.panel-item-table thead th { position: sticky; z-index: 3; top: 0; }
.panel-item-table tr.is-disabled td { opacity: .48; }
.panel-item-table tr.is-search-hidden { display: none; }
.panel-check-col { width: 44px; }
.panel-item-check { width: 18px; height: 18px; display: inline-grid; place-items: center; cursor: pointer; }
.panel-item-check input { position: absolute; opacity: 0; pointer-events: none; }
.panel-item-check span { width: 15px; height: 15px; display: block; border: 1px solid #bdc9cc; border-radius: 3px; background: #fff; position: relative; }
.panel-item-check input:checked + span { border-color: var(--brand-strong); background: var(--brand-strong); }
.panel-item-check input:checked + span::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.panel-visual-select { min-width: 130px; }
.panel-scale-fields { min-width: 170px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.panel-scale-fields input { width: 72px; height: 32px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 4px; outline: none; color: #35484e; font: 10px "Roboto Mono", Consolas, monospace; }
.panel-scale-fields input:focus { border-color: #76b9ef; box-shadow: 0 0 0 2px rgba(31,149,242,.10); }
.panel-scale-fields span { color: #9aa5a9; }
.panel-scale-fields.is-disabled { opacity: .4; }
.panel-builder-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 16px 0 24px; }
.panel-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px; }
.panel-danger-zone h2 { margin: 3px 0 4px; color: #34484e; font-size: 13px; }
.panel-danger-zone p { margin: 0; color: #839197; font-size: 9.5px; }
.panel-danger-zone .heading-actions form { margin: 0; }

.panel-view-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 15px; }
.panel-view-identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.panel-view-identity h1 { margin: 3px 0 4px; color: var(--ink-strong); font-size: 27px; letter-spacing: -.035em; line-height: 1.1; }
.panel-view-identity p { margin: 0; color: #78888e; font-size: 10px; }
.panel-client-logo { width: 56px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; padding: 5px; border: 1px solid var(--line); background: #fff; }
.panel-client-logo img { width: 100%; height: 100%; object-fit: contain; }
.public-share-panel { display: grid; grid-template-columns: minmax(210px,.7fr) minmax(300px,1.3fr); align-items: center; gap: 22px; margin-bottom: 12px; padding: 15px 17px; }
.public-share-copy h2 { margin: 2px 0 3px; color: #31464c; font-size: 12px; }
.public-share-copy p { margin: 0; color: #87949a; font-size: 9.5px; }
.monitor-panel-shell { border: 1px solid #dbe4e6; background: #edf2f3; }
.monitor-panel-statusbar { min-height: 39px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 0 13px; border-bottom: 1px solid #dbe4e6; background: #fff; color: #78898f; font-size: 9px; }
.monitor-panel-statusbar strong { color: #40545a; font-family: "Roboto Mono", Consolas, monospace; font-weight: 550; }
.panel-live-dot { color: #20a177; font-size: 6px; }
.monitor-panel-statusbar .panel-live-dot { margin-right: 3px; }
.panel-runtime-error { margin: 12px 12px 0; padding: 9px 11px; border: 1px solid #ebc2c5; background: #fff4f4; color: #9f343b; font-size: 10px; }
.monitor-widget-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(275px,1fr)); gap: 10px; padding: 10px; }
.monitor-widget-card { min-width: 0; min-height: 248px; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid #d7e0e2; background: #fff; box-shadow: 0 2px 8px rgba(8,31,37,.025); overflow: hidden; }
.monitor-widget-head { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #e7edef; }
.monitor-widget-head > div { min-width: 0; }
.monitor-widget-head h2 { margin: 2px 0 0; overflow: hidden; color: #31464c; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.monitor-widget-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; color: #87959a; font-size: 8.5px; }
.monitor-widget-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #a8b3b7; }
.monitor-widget-card.is-ok .monitor-widget-state { color: #3c7b67; }
.monitor-widget-card.is-ok .monitor-widget-state::before { background: #20a177; }
.monitor-widget-card.is-error .monitor-widget-state { color: #aa4249; }
.monitor-widget-card.is-error .monitor-widget-state::before { background: #c84b53; }
.monitor-widget-visual { min-height: 156px; display: grid; place-items: center; padding: 10px 14px 7px; }
.monitor-widget-footer { min-height: 33px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; border-top: 1px solid #edf1f2; color: #8a979b; font-size: 8.5px; }
.monitor-widget-footer.is-time-only { justify-content: flex-end; }
.monitor-widget-footer span:last-child { font-family: "Roboto Mono", Consolas, monospace; }
.monitor-widget-skeleton { width: 62%; height: 13px; place-self: center; border-radius: 8px; background: linear-gradient(90deg,#edf1f2 20%,#f8fafa 50%,#edf1f2 80%); background-size: 220% 100%; animation: panel-skeleton 1.2s linear infinite; }
@keyframes panel-skeleton { to { background-position: -220% 0; } }
.dashboard-value-visual { width: 100%; display: grid; place-items: center; text-align: center; }
.dashboard-value-main { max-width: 100%; color: #17292f; font: 650 clamp(32px,4.6vw,58px)/1 "Roboto Mono", Consolas, monospace; letter-spacing: -.055em; overflow-wrap: anywhere; }
.dashboard-value-main small { margin-left: 6px; color: #728389; font: 500 16px/1 Inter, sans-serif; letter-spacing: 0; }
.dashboard-value-main.is-text { font-family: Inter, sans-serif; font-size: clamp(22px,3vw,36px); letter-spacing: -.025em; }
.dashboard-bar-visual { width: min(100%,390px); display: grid; gap: 13px; }
.dashboard-bar-reading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dashboard-bar-reading strong { color: #1b2f35; font: 650 32px/1 "Roboto Mono", Consolas, monospace; letter-spacing: -.04em; }
.dashboard-bar-reading strong small { margin-left: 4px; color: #73858a; font: 500 12px Inter, sans-serif; letter-spacing: 0; }
.dashboard-bar-reading span { color: #849398; font-size: 8.5px; }
.dashboard-bar-track { height: 15px; overflow: hidden; border-radius: 2px; background: #e9eff0; position: relative; }
.dashboard-bar-fill { height: 100%; width: 0; background: var(--bar-color,#18a17a); transition: width .35s ease; }
.dashboard-bar-axis { display: flex; justify-content: space-between; color: #8b999d; font: 8.5px "Roboto Mono", Consolas, monospace; }
.dashboard-gauge { width: 100%; max-width: 290px; height: auto; overflow: visible; }
.dashboard-gauge-bg { fill: #e8eeef; }
.dashboard-gauge-value { fill: var(--gauge-color,#18a17a); }
.dashboard-gauge-needle { stroke: #243a40; stroke-width: 3; stroke-linecap: round; }
.dashboard-gauge-center { fill: #243a40; }
.dashboard-gauge-value-text { fill: #1d3137; font-family: "Roboto Mono", Consolas, monospace; font-size: 25px; font-weight: 650; text-anchor: middle; }
.dashboard-gauge-unit { fill: #71838a; font-family: Inter, sans-serif; font-size: 10px; font-weight: 500; text-anchor: middle; }
.dashboard-gauge-bound { fill: #87969a; font-family: "Roboto Mono", Consolas, monospace; font-size: 8px; }
.dashboard-no-data { display: grid; justify-items: center; gap: 7px; color: #8a989d; font-size: 10px; text-align: center; }
.dashboard-no-data::before { content: "—"; color: #b2bdc0; font: 500 38px/1 "Roboto Mono", Consolas, monospace; }

.public-dashboard-body { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: #e8edef; }
.public-dashboard-header { min-height: 82px; display: grid; grid-template-columns: minmax(150px,1fr) minmax(260px,2fr) minmax(150px,1fr); align-items: center; gap: 24px; padding: 13px clamp(18px,3vw,46px); border-bottom: 1px solid rgba(255,255,255,.08); background: #0b1f33; color: #fff; }
.public-brand-slot { min-width: 0; height: 52px; display: flex; align-items: center; }
.public-brand-slot img { max-width: 150px; max-height: 43px; object-fit: contain; }
.public-brand-gemelo img { filter: none; }
.public-brand-client { justify-content: flex-end; }
.public-brand-client strong { max-width: 220px; overflow: hidden; color: #dfe9eb; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.public-dashboard-title { min-width: 0; text-align: center; }
.public-dashboard-title span { color: #69d5e9; font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.public-dashboard-title h1 { margin: 3px 0; overflow: hidden; color: #f6f9fa; font-size: clamp(18px,2.2vw,28px); line-height: 1.05; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.public-dashboard-title p { margin: 0; overflow: hidden; color: #8fa3a8; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.public-dashboard-main { min-width: 0; padding: 13px clamp(12px,2vw,28px) 18px; }
.public-monitor-panel { border-color: #cfdadd; background: transparent; }
.public-monitor-panel .monitor-widget-grid { padding: 0; }
.public-monitor-panel .monitor-panel-statusbar { margin-bottom: 10px; border: 1px solid #d3dddf; }
.public-dashboard-footer { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 clamp(18px,3vw,46px); border-top: 1px solid #d5dfe1; background: #f7f9f9; color: #879499; font-size: 8.5px; }
.public-dashboard-footer span:first-child { color: #4f6268; font-weight: 650; }

@media (max-width: 1180px) {
  .dashboard-catalog { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .dashboard-catalog { grid-template-columns: 1fr; }
  .panel-host-picker, .public-share-panel { grid-template-columns: 1fr; }
  .panel-danger-zone, .panel-view-heading { align-items: flex-start; flex-direction: column; }
  .monitor-panel-statusbar { justify-content: flex-start; flex-wrap: wrap; gap: 6px 14px; padding: 8px 11px; }
  .public-dashboard-header { grid-template-columns: 1fr auto; gap: 12px; }
  .public-dashboard-title { grid-column: 1/-1; grid-row: 2; text-align: left; }
  .public-brand-client { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .panel-item-toolbar { grid-template-columns: 1fr; }
  .panel-builder-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .public-link-row { grid-template-columns: 1fr; }
  .panel-view-identity h1 { font-size: 22px; }
  .panel-client-logo { display: none; }
  .monitor-widget-grid { grid-template-columns: 1fr; }
  .monitor-widget-card { min-height: 230px; }
  .public-dashboard-header { padding: 12px 14px; }
  .public-brand-slot img { max-width: 110px; max-height: 34px; }
  .public-dashboard-main { padding: 8px; }
  .public-dashboard-footer { padding: 0 14px; }
}

/* ========================================================================== 
   Painéis v7 — builder responsivo + thresholds
   ========================================================================== */
.panel-builder-heading { margin-bottom: 16px; }
.panel-builder-card {
  overflow: hidden;
  border-color: #d9e2e4;
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(12, 34, 40, .025);
}
.panel-builder-card-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  border-bottom: 1px solid #e5ebed;
  background: linear-gradient(180deg, #fff 0%, #fbfcfc 100%);
}
.panel-builder-card-head-split { justify-content: space-between; gap: 24px; }
.panel-builder-card-title { min-width: 0; display: flex; align-items: center; gap: 13px; }
.panel-builder-card-head h2 { margin: 2px 0 2px; color: #203238; font-size: 14px; font-weight: 700; }
.panel-builder-card-head p { margin: 0; color: #829095; font-size: 9.5px; line-height: 1.4; }
.panel-step-number {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid #bfe0dc;
  border-radius: 50%;
  background: #eff9f7;
  color: #087f78;
  font: 700 11px/1 "Roboto Mono", Consolas, monospace;
}
.panel-host-picker-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 17px;
}
.panel-builder-body-v2 { display: grid; gap: 15px; padding: 17px; }
.panel-config-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: start; }
.panel-config-span-5 { grid-column: span 5; }
.panel-config-span-2 { grid-column: span 2; }
.panel-config-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.panel-config-field > label,
.panel-config-label { color: #4c5e64; font-size: 10px; font-weight: 650; line-height: 1.3; }
.panel-config-field > small { color: #87959a; font-size: 9px; line-height: 1.35; }
.panel-config-field input,
.panel-config-field select,
.panel-scale-inputs input,
.panel-threshold-fields input,
.panel-threshold-fields select {
  width: 100%;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: #35484e;
  font: 11px Inter, sans-serif;
  outline: none;
}
.panel-scale-inputs input,
.panel-threshold-fields input { font-family: "Roboto Mono", Consolas, monospace; }
.panel-config-field input:focus,
.panel-config-field select:focus,
.panel-scale-inputs input:focus,
.panel-threshold-fields input:focus,
.panel-threshold-fields select:focus {
  border-color: #76b9ef;
  box-shadow: 0 0 0 2px rgba(31,149,242,.10);
}
.panel-public-toggle-v2 {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid #dfe7e9;
  border-radius: 6px;
  background: #fafcfc;
  cursor: pointer;
}
.panel-public-toggle-v2 > input { position: absolute; opacity: 0; pointer-events: none; }
.panel-switch-ui {
  width: 34px;
  height: 19px;
  position: relative;
  border-radius: 20px;
  background: #cbd5d8;
  transition: background .18s ease;
}
.panel-switch-ui::after {
  content: "";
  width: 13px;
  height: 13px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20,40,45,.22);
  transition: transform .18s ease;
}
.panel-public-toggle-v2 > input:checked + .panel-switch-ui { background: var(--brand-strong); }
.panel-public-toggle-v2 > input:checked + .panel-switch-ui::after { transform: translateX(15px); }
.panel-public-toggle-v2:focus-within { border-color: #76b9ef; box-shadow: 0 0 0 2px rgba(31,149,242,.10); }
.panel-public-toggle-copy { min-width: 0; display: grid; gap: 2px; }
.panel-public-toggle-copy strong { color: #31464c; font-size: 10.5px; }
.panel-public-toggle-copy small { color: #859398; font-size: 9px; line-height: 1.35; }
.panel-item-toolbar-v2 {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid #e6ecee;
  background: #fbfcfc;
}
.panel-selection-counter { color: #76878c; font-size: 9.5px; white-space: nowrap; }
.panel-selection-counter strong { color: #30474d; font-family: "Roboto Mono", Consolas, monospace; }
.panel-threshold-legend-mini { display: flex; align-items: center; justify-content: flex-end; gap: 11px; flex-wrap: wrap; color: #78888e; font-size: 8.5px; }
.panel-threshold-legend-mini span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.panel-threshold-legend-mini i { width: 7px; height: 7px; border-radius: 50%; background: #18a17a; }
.panel-threshold-legend-mini .warning i { background: #d3992b; }
.panel-threshold-legend-mini .critical i { background: #c83f47; }
.panel-metric-list { display: grid; gap: 8px; padding: 10px; background: #f3f6f7; }
.panel-metric-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9e2e4;
  border-radius: 7px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.panel-metric-card:not(.is-disabled) { border-color: #bcded9; box-shadow: 0 2px 8px rgba(8,88,80,.04); }
.panel-metric-card.is-search-hidden { display: none; }
.panel-metric-card.is-disabled { opacity: .72; }
.panel-metric-summary {
  min-width: 0;
  min-height: 60px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) minmax(130px, auto);
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
}
.panel-item-check-lg { width: 22px; height: 22px; }
.panel-item-check-lg span { width: 18px; height: 18px; }
.panel-item-check-lg input:checked + span::after { left: 5px; top: 2px; }
.panel-metric-identity { min-width: 0; display: grid; gap: 3px; }
.panel-metric-identity strong { overflow: hidden; color: #20343a; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.panel-metric-identity span { overflow: hidden; color: #859399; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.panel-metric-reading { min-width: 0; display: grid; justify-items: end; gap: 2px; text-align: right; }
.panel-metric-reading > span { max-width: 220px; overflow: hidden; color: #2d4248; font: 600 12px/1.2 "Roboto Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.panel-metric-reading > span small { color: #74868b; font: 500 9px Inter, sans-serif; }
.panel-metric-reading > small { color: #93a0a4; font-size: 8.5px; }
.panel-metric-config {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px,.8fr) minmax(210px,1fr) minmax(360px,1.7fr);
  align-items: start;
  gap: 14px;
  padding: 13px;
  border-top: 1px solid #e8edef;
  background: #fcfdfd;
}
.panel-metric-card.is-disabled .panel-metric-config { display: none; }
.panel-scale-config { min-width: 0; display: grid; gap: 6px; }
.panel-scale-inputs { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.panel-scale-inputs label,
.panel-threshold-fields label { min-width: 0; display: grid; gap: 4px; }
.panel-scale-inputs label > span,
.panel-threshold-fields label > span { color: #87959a; font-size: 8.5px; }
.panel-scale-config.is-disabled { opacity: .38; }
.panel-threshold-config {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid #e1e8ea;
}
.panel-threshold-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-threshold-head > small { color: #8b989d; font-size: 8.5px; line-height: 1.35; text-align: right; }
.panel-threshold-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.panel-threshold-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.panel-threshold-toggle > span { width: 16px; height: 16px; position: relative; border: 1px solid #bdc9cc; border-radius: 3px; background: #fff; }
.panel-threshold-toggle input:checked + span { border-color: var(--brand-strong); background: var(--brand-strong); }
.panel-threshold-toggle input:checked + span::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.panel-threshold-toggle strong { color: #40545a; font-size: 9.5px; }
.panel-threshold-fields { min-width: 0; display: grid; grid-template-columns: minmax(125px,1.2fr) repeat(2,minmax(90px,.8fr)); gap: 7px; }
.panel-threshold-config.is-disabled .panel-threshold-fields { opacity: .38; }
.panel-threshold-unavailable { min-height: 65px; display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-left: 1px solid #e1e8ea; color: #8c999e; font-size: 9px; line-height: 1.4; }
.panel-threshold-unavailable i { color: #9aabad; }
.panel-metric-empty { min-height: 180px; background: #fff; }
.panel-builder-actions-v2 { position: sticky; bottom: 0; z-index: 8; padding: 10px 0; background: linear-gradient(180deg, rgba(244,247,248,0), #f4f7f8 28%); }
.dashboard-empty-panel .empty-state { height: 185px; }

/* Threshold state reflected in the dashboard widgets. */
.monitor-widget-card.has-threshold { box-shadow: inset 0 3px 0 var(--metric-state-color), 0 2px 8px rgba(8,31,37,.025); }
.monitor-widget-card.has-threshold.threshold-warning { border-color: #ead8b2; }
.monitor-widget-card.has-threshold.threshold-critical { border-color: #e9c1c4; }
.monitor-widget-card.has-threshold .monitor-widget-state { color: var(--metric-state-color); font-weight: 650; }
.monitor-widget-card.has-threshold .monitor-widget-state::before { background: var(--metric-state-color); }
.dashboard-value-visual.has-threshold-state .dashboard-value-main { color: var(--metric-state-color); }
.public-dashboard-footer { justify-content: center; }

@media (max-width: 1180px) {
  .panel-config-span-5 { grid-column: span 6; }
  .panel-config-span-2 { grid-column: span 6; }
  .panel-metric-config { grid-template-columns: minmax(160px,.7fr) minmax(220px,1fr); }
  .panel-threshold-config,
  .panel-threshold-unavailable { grid-column: 1 / -1; padding-top: 12px; padding-left: 0; border-top: 1px solid #e5ebed; border-left: 0; }
}
@media (max-width: 820px) {
  .panel-builder-card-head-split { align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel-threshold-legend-mini { justify-content: flex-start; padding-left: 45px; }
  .panel-host-picker-v2 { grid-template-columns: 1fr; }
  .panel-host-picker-v2 .button { width: 100%; }
  .panel-config-grid { grid-template-columns: 1fr; }
  .panel-config-span-5,
  .panel-config-span-2 { grid-column: auto; }
  .panel-item-toolbar-v2 { grid-template-columns: 1fr; }
  .panel-selection-counter { justify-self: start; }
  .panel-metric-config { grid-template-columns: 1fr; }
  .panel-threshold-config,
  .panel-threshold-unavailable { grid-column: auto; }
  .panel-threshold-head { align-items: flex-start; flex-direction: column; }
  .panel-threshold-head > small { text-align: left; }
}
@media (max-width: 560px) {
  .panel-builder-card-head { align-items: flex-start; }
  .panel-builder-card-head p { font-size: 9px; }
  .panel-threshold-legend-mini { padding-left: 0; }
  .panel-builder-body-v2,
  .panel-host-picker-v2 { padding: 13px; }
  .panel-metric-list { padding: 7px; }
  .panel-metric-summary { grid-template-columns: 26px minmax(0,1fr); }
  .panel-metric-reading { grid-column: 2; justify-items: start; text-align: left; }
  .panel-metric-reading > span { max-width: 100%; }
  .panel-threshold-fields { grid-template-columns: 1fr; }
  .panel-scale-inputs { grid-template-columns: 1fr 1fr; }
  .panel-builder-actions-v2 { grid-template-columns: 1fr 1fr; }
}

/* Navigation: grouped configuration menu */
.nav-menu { position: relative; height: 100%; display: flex; align-items: stretch; }
.nav-menu-toggle {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: #9fb0b5;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.nav-menu-toggle > i:first-child { width: 14px; color: #809399; text-align: center; font-size: 12px; }
.nav-menu-chevron { width: auto !important; margin-left: 1px; color: #647b81 !important; font-size: 8px !important; transition: transform .16s ease; }
.nav-menu-toggle:hover,
.nav-menu.is-open .nav-menu-toggle { background: rgba(255,255,255,.035); color: #e8f0f1; }
.nav-menu.active .nav-menu-toggle { color: #fff; background: rgba(255,255,255,.045); }
.nav-menu.active .nav-menu-toggle > i:first-child { color: var(--brand); }
.nav-menu.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--brand); }
.nav-menu.is-open .nav-menu-chevron { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute;
  z-index: 260;
  top: calc(100% - 1px);
  right: 0;
  width: 270px;
  padding: 7px;
  border: 1px solid #233b41;
  background: #102b46;
  box-shadow: 0 18px 46px rgba(0,0,0,.28);
}
.nav-primary .nav-dropdown a,
.nav-dropdown-disabled {
  min-height: 54px;
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  color: #b8c6ca;
  white-space: normal;
}
.nav-primary .nav-dropdown a { font-size: 11px; }
.nav-primary .nav-dropdown a::after { display: none !important; }
.nav-primary .nav-dropdown a > i,
.nav-dropdown-disabled > i { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.035); color: #8ca0a6; font-size: 12px; }
.nav-primary .nav-dropdown a > div,
.nav-dropdown-disabled > div { min-width: 0; display: grid; gap: 2px; }
.nav-primary .nav-dropdown a strong,
.nav-dropdown-disabled strong { color: #e2eaec; font-size: 10.5px; font-weight: 650; }
.nav-primary .nav-dropdown a small,
.nav-dropdown-disabled small { color: #70868c; font-size: 8.5px; font-weight: 500; }
.nav-primary .nav-dropdown a:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-primary .nav-dropdown a.active { background: rgba(31,149,242,.10); }
.nav-primary .nav-dropdown a.active > i { border-color: rgba(31,149,242,.24); color: #69d5e9; }
.nav-dropdown-disabled { opacity: .48; cursor: default; }

.nav-primary-placeholder {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: #9fb0b5;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.nav-primary-placeholder > i { width: 14px; color: #809399; text-align: center; font-size: 12px; }
.nav-dropdown-compact { width: 286px; }
.nav-submenu { border-radius: 4px; }
.nav-submenu > summary {
  min-height: 54px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) 12px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: #b8c6ca;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-submenu > summary::-webkit-details-marker { display: none; }
.nav-submenu > summary:hover,
.nav-submenu[open] > summary { background: rgba(255,255,255,.045); }
.nav-submenu-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.035);
  color: #8ca0a6;
  font-size: 12px;
}
.nav-submenu > summary > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.nav-submenu > summary strong { color: #e2eaec; font-size: 10.5px; font-weight: 650; }
.nav-submenu > summary small { color: #70868c; font-size: 8.5px; font-weight: 500; }
.nav-submenu-chevron { color: #6f858b; font-size: 8px; transition: transform .15s ease; }
.nav-submenu[open] .nav-submenu-chevron { transform: rotate(90deg); }
.nav-submenu-items { display: grid; gap: 2px; padding: 1px 0 5px 22px; }
.nav-dropdown-disabled-compact { min-height: 42px; grid-template-columns: 26px minmax(0,1fr); padding: 6px 8px; }
.nav-dropdown-disabled-compact > i { width: 26px; height: 26px; font-size: 10px; }

/* Shift check-in / checkout */
.shift-dialog { overflow: hidden; }
.shift-modal-header { min-height: 76px; background: linear-gradient(180deg,#fff,#fbfcfc); }
.shift-user-chip { max-width: 230px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #dce5e7; background: #f5f8f8; color: #506269; font-size: 9.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-user-chip i { color: var(--brand-strong); }
.shift-modal-body { display: grid; gap: 16px; }
.shift-briefing-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.shift-briefing-card { min-width: 0; display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 11px; padding: 13px; border: 1px solid #e0e8ea; background: #fbfcfc; }
.shift-briefing-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #cde7e3; background: #eefaf8; color: #16877f; font-size: 14px; }
.shift-briefing-card strong { display: block; margin: 1px 0 4px; color: #253a40; font-size: 10.5px; }
.shift-briefing-card p { margin: 0; color: #708087; font-size: 9px; line-height: 1.5; }
.shift-briefing-card a { color: var(--brand-strong); font-weight: 650; }
.handover-section { border: 1px solid #dce5e7; background: #fff; }
.handover-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; border-bottom: 1px solid #e5ebed; background: #f8fafa; }
.handover-heading h3 { margin: 2px 0 0; color: #25383e; font-size: 11px; }
.handover-meta { color: #87959a; font-size: 8.5px; white-space: nowrap; }
.handover-notes { list-style: none; margin: 0; padding: 6px 13px 8px; max-height: 190px; overflow: auto; }
.handover-notes li { display: grid; grid-template-columns: 14px minmax(0,1fr); gap: 6px; padding: 7px 0; border-bottom: 1px solid #edf1f2; color: #506168; font-size: 9.5px; line-height: 1.45; }
.handover-notes li:last-child { border-bottom: 0; }
.handover-notes i { margin-top: 2px; color: var(--brand-strong); font-size: 8px; }
.handover-empty { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #8b989d; font-size: 9.5px; }
.handover-empty i { color: #a8b4b8; }
.shift-modal-footer { justify-content: space-between; }
.shift-required-copy { display: inline-flex; align-items: center; gap: 6px; color: #7b8b91; font-size: 8.5px; }
.shift-required-copy i { color: #699197; }
.checkout-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid #e0e7e9; background: #f8fafa; }
.checkout-summary > div { min-width: 0; display: grid; gap: 3px; padding: 11px 13px; }
.checkout-summary > div + div { border-left: 1px solid #e0e7e9; }
.checkout-summary span { color: #89979c; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.checkout-summary strong { color: #35484e; font-size: 10px; overflow-wrap: anywhere; }
.checkout-notes-field textarea { min-height: 132px; resize: vertical; line-height: 1.5; }
.optional-label { margin-left: 5px; color: #9aa6aa; font-size: 8px; font-weight: 500; }

/* Audit */
.audit-heading { margin-bottom: 16px; }
.audit-tabs { display: inline-flex; align-items: center; gap: 3px; margin-bottom: 14px; padding: 3px; border: 1px solid #dbe4e6; background: #eef3f4; }
.audit-tab { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; color: #687a81; font-size: 10px; font-weight: 650; }
.audit-tab i { color: #84969b; }
.audit-tab:hover { background: rgba(255,255,255,.65); color: #2e454c; }
.audit-tab.active { background: #fff; color: #1d343a; box-shadow: 0 1px 3px rgba(7,23,27,.06); }
.audit-tab.active i { color: var(--brand-strong); }
.audit-filter { margin-bottom: 10px; }
.audit-panel { margin-top: 0; }
.audit-table-wrap { max-height: 650px; }
.audit-table th { white-space: nowrap; }
.audit-table td { vertical-align: top; }
.audit-action { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid #d9e2e4; background: #f5f8f8; color: #5d7076; font-size: 8.5px; font-weight: 700; }
.audit-action-create { border-color: #bfe2d5; background: #f0faf6; color: #287458; }
.audit-action-update,.audit-action-profile,.audit-action-link { border-color: #c9ddeb; background: #f2f8fc; color: #356987; }
.audit-action-delete { border-color: #efc8cb; background: #fff4f4; color: #a33e45; }
.audit-action-acknowledge { border-color: #ead9b6; background: #fffaf0; color: #8b641d; }
.audit-action-checkin,.audit-action-checkout { border-color: #cde3e0; background: #f1f9f8; color: #39746f; }
.audit-origin { color: #829096; font-family: "Roboto Mono",Consolas,monospace; font-size: 8.5px; }
.shift-state { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 7px; border: 1px solid; font-size: 8.5px; font-weight: 700; }
.shift-state i { font-size: 6px; }
.shift-state.active { border-color: #b9ded1; background: #f0faf6; color: #237255; }
.shift-state.closed { border-color: #d7e0e2; background: #f5f7f8; color: #65767c; }
.shift-notes-inline { min-width: 220px; max-width: 520px; margin: 0; padding-left: 15px; color: #596a70; font-size: 9px; line-height: 1.45; }
.shift-notes-inline li + li { margin-top: 3px; }

@media (max-width: 1120px) {
  .nav-menu-toggle { padding: 0 10px; }
  .nav-primary-placeholder { padding: 0 10px; }
  .nav-menu-toggle span { font-size: 11px; }
  .nav-primary-placeholder span { font-size: 11px; }
}
@media (max-width: 980px) {
  .nav-menu { flex: 0 0 auto; }
  .nav-menu-toggle { min-height: 44px; }
  .nav-menu.active::after { left: 10px; right: 10px; }
  .nav-dropdown { position: fixed; top: 102px; right: 12px; width: min(300px,calc(100vw - 24px)); }
}
@media (max-width: 720px) {
  .shift-briefing-grid { grid-template-columns: 1fr; }
  .handover-heading { align-items: flex-start; flex-direction: column; }
  .handover-meta { white-space: normal; }
  .shift-modal-footer { align-items: stretch; flex-direction: column; }
  .shift-required-copy { order: 2; }
  .checkout-summary { grid-template-columns: 1fr; }
  .checkout-summary > div + div { border-left: 0; border-top: 1px solid #e0e7e9; }
  .audit-tabs { width: 100%; }
  .audit-tab { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 560px) {
  .nav-menu-toggle span { display: none; }
  .nav-primary-placeholder span { display: none; }
  .nav-menu-chevron { display: none; }
  .shift-user-chip { max-width: 150px; }
  .shift-briefing-card { grid-template-columns: 34px minmax(0,1fr); padding: 11px; }
  .shift-briefing-icon { width: 34px; height: 34px; }
}

/* Export de dados / API de integração */
.export-heading { margin-bottom: 18px; }
.export-grid {
  display: grid;
  grid-template-columns: minmax(0,1.65fr) minmax(300px,.75fr);
  gap: 12px;
  margin-bottom: 12px;
}
.export-api-panel,
.export-token-panel { margin: 0; min-width: 0; }
.api-version-badge {
  min-width: 34px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid #c8e6e2;
  background: #effaf8;
  color: #147d76;
  font: 600 9px/1 "Roboto Mono", Consolas, monospace;
}
.export-api-body { padding: 15px 17px 17px; display: grid; gap: 14px; }
.api-auth-copy { padding: 11px 12px; border-left: 3px solid #3bb3aa; background: #f5faf9; }
.api-auth-copy strong { display: block; color: #32474d; font-size: 10.5px; }
.api-auth-copy p { margin: 4px 0 0; color: #718087; font-size: 9.5px; line-height: 1.5; }
.api-auth-copy code,
.api-endpoint-head code,
.api-token-prefix,
.api-device-id,
.api-path,
.api-secret-value code {
  font-family: "Roboto Mono", Consolas, monospace;
}
.api-auth-copy code { color: #315e63; font-size: .95em; }
.api-endpoint-list { display: grid; gap: 8px; }
.api-endpoint-card { min-width: 0; padding: 12px; border: 1px solid #e0e7e9; background: #fff; }
.api-endpoint-head { min-width: 0; display: flex; align-items: center; gap: 9px; }
.api-endpoint-head code { min-width: 0; overflow-wrap: anywhere; color: #2b4147; font-size: 10px; }
.http-method { min-width: 38px; height: 22px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 3px; background: #eaf8f5; color: #137c73; font-size: 8.5px; font-weight: 750; }
.api-endpoint-card p { margin: 7px 0 0 47px; color: #7e8d92; font-size: 9px; line-height: 1.45; }
.export-token-form { padding: 15px 17px 17px; display: grid; gap: 12px; }
.export-token-form .button { justify-self: start; }
.api-secret-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  gap: 13px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #b9ddd8;
  background: linear-gradient(180deg,#fbfefd,#f4faf9);
  box-shadow: inset 0 3px 0 #1aa095;
}
.api-secret-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #cce8e4; background: #ebf8f6; color: #14877e; font-size: 16px; }
.api-secret-body { min-width: 0; }
.api-secret-body h2 { margin: 2px 0 3px; color: #283d43; font-size: 13px; }
.api-secret-body p { margin: 0 0 9px; color: #74848a; font-size: 9.5px; }
.api-secret-value { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.api-secret-value code { min-width: 0; padding: 10px 11px; border: 1px solid #d4e2e4; background: #fff; color: #20383f; font-size: 10px; overflow-wrap: anywhere; user-select: all; }
.export-token-list,
.export-device-list { margin-top: 12px; }
.export-token-list .panel-header,
.export-device-list .panel-header { min-height: 58px; }
.api-token-prefix,
.api-device-id,
.api-path { color: #3f555c; font-size: 9.5px; }
.api-token-state { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 650; }
.api-token-state i { font-size: 6px; }
.api-token-state.active { color: #21836f; }
.api-token-state.revoked { color: #9a6669; }
.inline-form { display: inline; margin: 0; }
.export-device-filter { margin: 0; border: 0; border-bottom: 1px solid #e4eaec; border-radius: 0; background: #fbfcfc; }
.export-device-filter .search-box { max-width: 480px; }
.export-device-table-wrap { max-height: 480px; }
.api-path { overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .export-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .api-secret-card { grid-template-columns: 1fr; }
  .api-secret-value { grid-template-columns: 1fr; }
  .api-secret-value .button { width: 100%; }
  .api-endpoint-head { align-items: flex-start; flex-direction: column; }
  .api-endpoint-card p { margin-left: 0; }
}

/* Export API documentation */
.export-api-panel-head { gap: 14px; }
.export-api-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.export-api-head-actions .button { white-space: nowrap; }
@media (max-width: 680px) {
  .export-api-panel-head { align-items: flex-start; flex-direction: column; }
  .export-api-head-actions { width: 100%; justify-content: space-between; }
}

/* Catálogo de integrações */
.integration-page-heading { margin-bottom: 20px; }
.integration-catalog {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.integration-type-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto 22px;
  align-items: center;
  gap: 15px;
  padding: 18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(9,31,37,.045);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.integration-type-card:hover { border-color: #a9c8c7; box-shadow: 0 10px 30px rgba(9,31,37,.08); transform: translateY(-1px); }
.integration-type-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 17px;
}
.integration-type-card.api .integration-type-icon { background: #eaf8f6; color: #12877e; }
.integration-type-card.sender .integration-type-icon { background: #eef3f8; color: #376d9c; }
.integration-type-copy { min-width: 0; }
.integration-type-copy h2 { margin: 2px 0 4px; color: var(--ink-strong); font-size: 16px; letter-spacing: -.02em; }
.integration-type-copy p { margin: 0; max-width: 620px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.integration-type-meta { min-width: 76px; padding-left: 14px; border-left: 1px solid var(--line); text-align: right; }
.integration-type-meta strong { display: block; color: #263d44; font-size: 17px; line-height: 1.1; }
.integration-type-meta span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8.5px; white-space: nowrap; }
.integration-type-arrow { color: #93a4a9; font-size: 11px; }

.integration-section { scroll-margin-top: 86px; margin-top: 24px; }
.integration-section + .integration-section { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.integration-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}
.integration-section-heading > div:first-child { min-width: 0; display: flex; align-items: center; gap: 12px; }
.integration-section-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; font-size: 13px; }
.integration-section-icon.api { background: #eaf8f6; color: #12877e; }
.integration-section-icon.sender { background: #eef3f8; color: #376d9c; }
.integration-section-heading h2 { margin: 1px 0 2px; color: var(--ink-strong); font-size: 18px; letter-spacing: -.025em; }
.integration-section-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.integration-api-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(300px,.72fr); gap: 12px; }
.integration-api-layout > * { min-width: 0; }
.integration-reference { margin-top: 12px; border: 1px solid var(--line); background: #fff; }
.integration-reference summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; cursor: pointer; list-style: none; color: #43575d; }
.integration-reference summary::-webkit-details-marker { display: none; }
.integration-reference summary span { display: flex; align-items: center; gap: 9px; font-size: 10.5px; font-weight: 650; }
.integration-reference summary i { color: #6d858c; }
.integration-reference summary small { color: var(--muted-2); font-size: 9px; }
.integration-reference[open] summary { border-bottom: 1px solid var(--line); background: #fbfcfc; }
.integration-reference-body { min-width: 0; }

.sender-frequency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #d7e2e4;
  border-radius: 999px;
  background: #fff;
  color: #566c73;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}
.sender-frequency-badge i { color: #3f7d91; }
.sender-form-panel { margin: 0 0 12px; overflow: visible; }
.sender-form-header { min-height: 62px; }
.sender-route-form { padding: 16px 18px 18px; }
.sender-route-form input,
.sender-route-form select { min-width: 0; width: 100%; }
.sender-route-identity { display: grid; grid-template-columns: minmax(0,1fr) 235px; gap: 16px; align-items: end; margin-bottom: 16px; }
.sender-enabled-switch {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #dbe4e6;
  background: #fbfcfc;
  cursor: pointer;
}
.sender-enabled-switch input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--brand-strong); }
.sender-enabled-switch span { min-width: 0; display: flex; flex-direction: column; }
.sender-enabled-switch strong { color: #34494f; font-size: 10px; }
.sender-enabled-switch small { margin-top: 2px; color: #86949a; font-size: 8.5px; }
.sender-route-flow {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr);
  gap: 12px;
  align-items: stretch;
}
.sender-route-side {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid #dce5e7;
  background: #fbfcfc;
}
.sender-route-side.source { border-top: 3px solid #3ca89f; }
.sender-route-side.destination { border-top: 3px solid #4d769a; }
.sender-route-side legend { max-width: calc(100% - 12px); display: flex; align-items: center; gap: 9px; padding: 0 8px; color: #31464c; }
.sender-route-side legend > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.sender-route-side legend strong { font-size: 10.5px; }
.sender-route-side legend small { margin-top: 1px; color: #87969b; font-size: 8px; font-weight: 500; }
.route-step { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #e9f2f3; color: #557077; font-size: 9px; font-weight: 750; }
.sender-route-side .field + .field { margin-top: 12px; }
.sender-destination-grid { display: grid; grid-template-columns: minmax(0,1fr) 118px; gap: 10px; }
.sender-flow-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #83949a; }
.sender-flow-arrow span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #d9e3e5; border-radius: 50%; background: #fff; color: #3d757d; box-shadow: 0 4px 12px rgba(15,47,54,.06); }
.sender-flow-arrow small { color: #8b999e; font-size: 8px; font-weight: 650; }
.sender-route-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e3eaec; }
.sender-route-footer p { min-width: 0; margin: 0; color: #7a898e; font-size: 8.8px; line-height: 1.5; }
.sender-route-footer p i { margin-right: 5px; color: #557e89; }
.sender-route-footer .button { flex: 0 0 auto; }
.field-error-text { color: var(--danger) !important; }

.sender-catalog-panel { margin: 0; }
.sender-route-list { display: grid; gap: 10px; padding: 12px; }
.sender-route-card { min-width: 0; padding: 14px; border: 1px solid #dfe7e9; border-left: 3px solid #31a391; background: #fff; }
.sender-route-card.is-paused { border-left-color: #a5b0b4; background: #fcfdfd; }
.sender-route-card.has-error { border-left-color: var(--danger); }
.sender-route-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sender-route-card-head h4 { margin: 4px 0 0; color: #273d43; font-size: 12px; }
.sender-route-status { display: inline-flex; align-items: center; gap: 5px; color: #65777d; font-size: 8.5px; font-weight: 650; }
.sender-route-status i { font-size: 5px; }
.sender-route-status.success { color: var(--success); }
.sender-route-status.error { color: var(--danger); }
.sender-route-status.paused { color: #89979c; }
.sender-route-status.never { color: #557b8c; }
.sender-route-cadence { display: inline-flex; align-items: center; gap: 5px; color: #859399; font-size: 8.5px; white-space: nowrap; }
.sender-route-path { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 42px minmax(0,1fr); gap: 10px; align-items: center; margin-top: 13px; }
.sender-route-node { min-width: 0; padding: 10px 11px; border: 1px solid #e3e9eb; background: #fafcfc; }
.sender-route-node > span { display: block; color: #8a989d; font-size: 7.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sender-route-node strong,
.sender-route-node code,
.sender-route-node small { min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-route-node strong { margin-top: 4px; color: #344b52; font-size: 10px; }
.sender-route-node code { margin-top: 2px; color: #4c636a; font: 500 9px/1.4 "Roboto Mono",Consolas,monospace; }
.sender-route-node small { margin-top: 2px; color: #8a989d; font-size: 8px; }
.sender-route-path-arrow { color: #759097; text-align: center; }
.sender-route-error { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; padding: 8px 10px; border: 1px solid #efd7d9; background: #fff8f8; color: #9d4b51; font-size: 8.7px; line-height: 1.45; }
.sender-route-error i { margin-top: 2px; }
.sender-route-runtime { display: grid; grid-template-columns: 180px 180px minmax(0,1fr); gap: 10px; margin-top: 10px; }
.sender-route-runtime > div { min-width: 0; }
.sender-route-runtime span { display: block; color: #8a989d; font-size: 7.5px; }
.sender-route-runtime strong { min-width: 0; display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #53676d; font-size: 8.8px; font-weight: 550; }
.sender-last-value strong { color: #263f46; }
.sender-route-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px solid #edf1f2; }
.sender-route-actions form { margin: 0; }
.sender-empty-state { display: grid; place-items: center; padding: 44px 20px; text-align: center; }
.sender-empty-state > span { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; background: #edf4f5; color: #66848c; }
.sender-empty-state strong { color: #4b6168; font-size: 11px; }
.sender-empty-state p { margin: 5px 0 0; color: #8a979c; font-size: 9px; }

@media (max-width: 1120px) {
  .integration-api-layout { grid-template-columns: 1fr; }
  .sender-route-flow { grid-template-columns: 1fr; }
  .sender-flow-arrow { min-height: 30px; flex-direction: row; }
  .sender-flow-arrow span { width: 32px; height: 32px; }
  .sender-flow-arrow span i { transform: rotate(90deg); }
  .sender-route-runtime { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sender-last-value { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .integration-catalog { grid-template-columns: 1fr; }
  .integration-type-card { grid-template-columns: 48px minmax(0,1fr) auto; }
  .integration-type-arrow { display: none; }
  .sender-route-identity { grid-template-columns: 1fr; }
  .sender-route-path { grid-template-columns: 1fr; }
  .sender-route-path-arrow { transform: rotate(90deg); }
  .sender-route-footer { align-items: stretch; flex-direction: column; }
  .sender-route-footer .button { width: 100%; }
}
@media (max-width: 620px) {
  .integration-section-heading { align-items: flex-start; flex-direction: column; }
  .integration-section-heading > div:first-child { align-items: flex-start; }
  .integration-section-heading > .button,
  .sender-frequency-badge { width: 100%; justify-content: center; }
  .integration-type-card { grid-template-columns: 44px minmax(0,1fr); padding: 14px; }
  .integration-type-icon { width: 44px; height: 44px; }
  .integration-type-meta { grid-column: 2; width: max-content; padding: 6px 0 0; border: 0; text-align: left; }
  .integration-type-meta strong,
  .integration-type-meta span { display: inline; }
  .integration-type-meta span { margin-left: 4px; }
  .sender-route-form { padding: 13px; }
  .sender-route-side { padding: 12px; }
  .sender-destination-grid { grid-template-columns: 1fr; }
  .sender-route-runtime { grid-template-columns: 1fr; }
  .sender-last-value { grid-column: auto; }
  .sender-route-card-head { flex-direction: column; }
  .sender-route-actions { justify-content: stretch; }
  .sender-route-actions form,
  .sender-route-actions .button { width: 100%; }
}

/* Integrações v10.1 - navegação por módulo */
.integration-page-heading { margin-bottom: 14px; }
.integration-switcher {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line-strong);
}
.integration-switch-option {
  min-width: 230px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 10px;
  border-bottom: 2px solid transparent;
  color: #596d73;
  text-decoration: none;
  transition: color .14s ease, border-color .14s ease, background-color .14s ease;
}
.integration-switch-option:hover { background: #f8fafa; color: #31494f; }
.integration-switch-option.is-active { border-bottom-color: var(--brand-strong); background: #fff; color: var(--ink-strong); }
.integration-switch-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #dce5e7;
  background: #fff;
  color: #607980;
  font-size: 11px;
}
.integration-switch-option.is-active .integration-switch-icon { border-color: #b9ded9; color: var(--brand-strong); }
.integration-switch-copy { min-width: 0; display: flex; flex-direction: column; }
.integration-switch-copy strong { color: inherit; font-size: 10.5px; font-weight: 700; line-height: 1.25; }
.integration-switch-copy small { margin-top: 2px; color: #8a989d; font-size: 8.5px; line-height: 1.3; }
.integration-switch-count {
  min-width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid #dce5e7;
  background: #f8fafa;
  color: #6d8086;
  font: 650 8.5px/1 "Roboto Mono", Consolas, monospace;
}
.integration-switch-option.is-active .integration-switch-count { border-color: #cce4e1; background: #f1f8f7; color: #307b75; }
.integration-section { margin-top: 0; scroll-margin-top: 86px; }
.integration-section + .integration-section { margin-top: 0; padding-top: 0; border-top: 0; }
.integration-section-heading {
  min-height: 52px;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.integration-section-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #dce5e7;
  border-radius: 0;
  background: #fff !important;
  color: #5f7880 !important;
  font-size: 11px;
}
.integration-section-heading h2 { font-size: 16px; }
.integration-section-heading p { margin-top: 2px; font-size: 9px; }
.integration-api-layout { gap: 10px; }
.integration-api-layout .panel,
.integration-reference,
.sender-form-panel,
.sender-catalog-panel { box-shadow: none; }
.api-secret-card { box-shadow: none; background: #f8fbfa; }
.sender-frequency-badge { border-radius: 0; background: #f8fafa; }
.sender-route-side { background: #fcfdfd; }
.sender-flow-arrow span { box-shadow: none; }

@media (max-width: 680px) {
  .integration-switcher { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line-strong); }
  .integration-switch-option { min-width: 0; width: 100%; border-bottom: 1px solid var(--line); }
  .integration-switch-option:last-child { border-bottom: 0; }
  .integration-switch-option.is-active { box-shadow: inset 3px 0 0 var(--brand-strong); }
}

/* Procedures / operator runbooks */
.procedure-filter-bar { grid-template-columns: minmax(280px,1fr) 180px auto auto; }
.procedure-title-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 280px; }
.procedure-list-icon { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d8e5e4; background: #f2f8f7; color: #197b75; }
.procedure-title-cell > div { min-width: 0; }
.procedure-title-cell strong { display: block; color: #2d4046; font-size: 10.5px; }
.procedure-step-count { color: #60737a; font-size: 9px; font-weight: 600; }
.procedure-safety-form { border-left: 3px solid #d19b2e; }
.procedure-steps-input { min-height: 190px; line-height: 1.65; }

.rule-procedure-button { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid #d9e3e5; background: #fff; color: #718187; font: inherit; font-size: 8.5px; font-weight: 650; cursor: pointer; }
.rule-procedure-button:hover { border-color: #a8cfcb; background: #f4faf9; color: #1c756f; }
.rule-procedure-button.has-procedure { border-color: #b9ded9; background: #eef8f6; color: #176e69; }
.rule-procedure-context { display: grid; gap: 7px; margin-bottom: 14px; padding: 13px 14px; border: 1px solid #dde6e8; background: #f8fafb; }
.rule-procedure-context .severity-badge { width: fit-content; }
.rule-procedure-context strong { color: #2e4147; font-size: 11px; }
.rule-procedure-context small { color: #7e8c91; font-size: 9px; }
.procedure-association-list { display: grid; gap: 7px; max-height: 390px; overflow: auto; }
.procedure-association-option { display: grid; grid-template-columns: 18px 28px minmax(0,1fr); align-items: center; gap: 9px; min-height: 56px; padding: 9px 11px; border: 1px solid #dce5e7; background: #fff; cursor: pointer; }
.procedure-association-option:hover { border-color: #b7d6d3; background: #fbfdfd; }
.procedure-association-option > input { position: absolute; opacity: 0; pointer-events: none; }
.procedure-association-check { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #cbd7da; background: #fff; color: transparent; font-size: 9px; }
.procedure-association-option > input:checked + .procedure-association-check { border-color: #16978e; background: #16978e; color: #fff; }
.procedure-association-copy { min-width: 0; display: grid; gap: 3px; }
.procedure-association-copy strong { overflow: hidden; color: #32464c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.procedure-association-copy small { color: #839196; font-size: 8.5px; }
.procedure-association-option.is-inactive { opacity: .58; }
.procedure-association-empty { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px dashed #d6e0e2; color: #78888e; }
.procedure-association-empty > i { font-size: 18px; color: #9aa8ac; }
.procedure-association-empty strong,.procedure-association-empty span { display: block; }.procedure-association-empty strong { color: #52666d; font-size: 10px; }.procedure-association-empty span { margin-top: 3px; font-size: 9px; }

/* Procedure access inside alarms and wallboard */
.align-center { text-align: center; }
.alarm-procedure-col { width: 112px; }
.alarm-procedure-button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 1px solid #b8dbd7; background: #eff8f7; color: #176f69; font-size: 8.5px; font-weight: 700; white-space: nowrap; }
button.alarm-procedure-button { cursor: pointer; }
button.alarm-procedure-button:hover { border-color: #6db8b1; background: #e2f3f1; color: #105d58; }
.alarm-procedure-button.is-empty { border-color: #e1e6e8; background: #f8fafa; color: #a0aaae; font-weight: 550; }
.event-procedure-button { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid #b8dbd7; background: #eff8f7; color: #176f69; font-size: 8.5px; font-weight: 700; cursor: pointer; }
.event-procedure-button:hover { border-color: #6db8b1; background: #e2f3f1; }

.procedure-runtime-dialog { max-width: 940px; }
.procedure-runtime-header small { display: block; margin-top: 4px; color: #849298; font-size: 9px; }
.procedure-runtime-body { display: grid; gap: 14px; padding: 18px; background: #f5f8f9; }
.procedure-alarm-context { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #dce5e7; background: #fff; }
.procedure-alarm-context > div { min-width: 0; display: grid; gap: 2px; }
.procedure-alarm-context strong { color: #34484e; font-size: 10px; }
.procedure-alarm-context span:not(.severity-badge) { color: #7d8d92; font-size: 8.5px; }
.procedure-runtime-card { border: 1px solid #d8e2e4; background: #fff; }
.procedure-runtime-card-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid #e1e7e9; }
.procedure-runtime-card-head h3 { margin: 3px 0 0; color: #23383e; font-size: 14px; }
.procedure-category { color: #23847d; font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.procedure-step-badge { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #dce5e7; background: #f8fafb; color: #73848a; font-size: 8px; font-weight: 650; }
.procedure-runtime-summary { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #edf0f1; color: #53676e; }
.procedure-runtime-summary i { margin-top: 2px; color: #6f8f9d; }.procedure-runtime-summary p { margin: 0; font-size: 9.5px; line-height: 1.55; }
.procedure-runtime-safety { display: flex; gap: 12px; margin: 14px 16px 0; padding: 12px 14px; border: 1px solid #efd9a7; border-left: 4px solid #d99d28; background: #fffaf0; color: #5f5746; }
.procedure-runtime-safety > i { margin-top: 2px; color: #ba7e10; font-size: 14px; }.procedure-runtime-safety strong { display: block; color: #6e551d; font-size: 9px; text-transform: uppercase; letter-spacing: .045em; }.procedure-runtime-safety p { margin: 5px 0 0; font-size: 9.5px; line-height: 1.55; }
.procedure-runtime-steps { margin: 0; padding: 14px 16px 16px; list-style: none; counter-reset: procedure-step; }
.procedure-runtime-steps li + li { margin-top: 8px; }
.procedure-runtime-steps label { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: stretch; min-height: 52px; border: 1px solid #dce4e6; background: #fff; cursor: pointer; }
.procedure-runtime-steps input { position: absolute; opacity: 0; }
.procedure-check-ui { display: grid; place-items: center; border-right: 1px solid #dce4e6; background: #fafcfc; color: transparent; font-size: 9px; }
.procedure-step-copy { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; padding: 10px 12px; }
.procedure-step-copy b { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #cfdadd; color: #60757c; font-size: 9px; }
.procedure-step-copy > span { color: #374c52; font-size: 10px; line-height: 1.5; }
.procedure-runtime-steps input:checked + .procedure-check-ui { background: #15958b; border-color: #15958b; color: #fff; }
.procedure-runtime-steps input:checked ~ .procedure-step-copy { background: #f3faf8; }
.procedure-runtime-steps input:checked ~ .procedure-step-copy > span { color: #667d7c; text-decoration: line-through; }
.procedure-runtime-outcomes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid #e3e9ea; }
.procedure-runtime-outcomes section { display: flex; gap: 11px; padding: 14px 16px; background: #f8fbfa; }
.procedure-runtime-outcomes section + section { border-left: 1px solid #e3e9ea; }.procedure-runtime-outcomes i { margin-top: 2px; color: #23887f; }.procedure-runtime-outcomes .escalation i { color: #b07129; }.procedure-runtime-outcomes strong { display: block; color: #38504f; font-size: 9px; }.procedure-runtime-outcomes p { margin: 4px 0 0; color: #667a7c; font-size: 9px; line-height: 1.55; }

body.alarm-wallboard .alarm-procedure-col { display: table-cell; width: 78px; }
body.alarm-wallboard .alarm-procedure-button { min-width: 36px; min-height: 34px; padding: 0 10px; border-color: rgba(83,210,197,.32); background: rgba(40,177,165,.12); color: #7de2d8; font-size: 13px; }
body.alarm-wallboard .alarm-procedure-button span { display: none; }
body.alarm-wallboard .alarm-procedure-button.is-empty { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: #587078; }
body.alarm-wallboard.modal-open .procedure-runtime-modal { color: #23383e; }
body.alarm-wallboard .procedure-runtime-modal { font-family: Inter, sans-serif; }
body.alarm-wallboard .procedure-runtime-dialog { max-height: calc(100vh - 34px); }
body.alarm-wallboard .procedure-runtime-dialog .modal-footer { background: #fff; }
body.alarm-wallboard .event-procedure-button { border-color: rgba(83,210,197,.32); background: rgba(40,177,165,.12); color: #7de2d8; }

@media (max-width: 980px) {
  .procedure-filter-bar { grid-template-columns: 1fr 170px auto; }
  .procedure-filter-bar .result-count { grid-column: 1/-1; justify-self: end; }
  .procedure-runtime-outcomes { grid-template-columns: 1fr; }
  .procedure-runtime-outcomes section + section { border-left: 0; border-top: 1px solid #e3e9ea; }
}
@media (max-width: 720px) {
  .procedure-filter-bar { grid-template-columns: 1fr; }
  .procedure-filter-bar .result-count { justify-self: start; }
  .procedure-association-option { grid-template-columns: 18px 26px minmax(0,1fr); }
  .procedure-alarm-context { align-items: flex-start; flex-direction: column; }
  .procedure-runtime-card-head { align-items: flex-start; flex-direction: column; }
  .procedure-runtime-steps label { grid-template-columns: 28px minmax(0,1fr); }
  .procedure-step-copy { grid-template-columns: 24px minmax(0,1fr); padding: 9px; }
  .alarm-procedure-button span { display: none; }
  .alarm-procedure-col { width: 54px; }
}

/* Procedure execution tracking */
.procedure-action-settings { margin-bottom: 1rem; }
.procedure-contact-grid { align-items: start; }
.procedure-runtime-head-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.procedure-contact-label { display: block; margin-top: .3rem; color: var(--muted, #718096); font-size: .78rem; }
.procedure-contact-action { width: 34px; height: 34px; border: 1px solid #d7e1e4; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; background: #fff; color: #35525a; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.procedure-contact-action:hover { border-color: #9ab7bd; background: #f6fafb; }
.procedure-contact-action.whatsapp { color: #188a56; }
.procedure-contact-action.email { color: #315f84; }
.treatment-runtime-console { border-top: 1px solid #e4eaec; margin-top: 1rem; padding-top: 1rem; }
.treatment-runtime-idle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.treatment-last-run { display: flex; align-items: center; gap: .65rem; min-width: 0; color: #35645a; }
.treatment-last-run > i { color: #15936f; }
.treatment-last-run div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.treatment-last-run strong { font-size: .84rem; }
.treatment-last-run span { color: #6b7e84; font-size: .75rem; }
.treatment-runtime-active { display: grid; gap: 1rem; }
.treatment-active-head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .7rem .85rem; border-radius: 8px; background: #f2f8f7; border: 1px solid #d7e9e5; }
.treatment-active-head > div { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.treatment-active-head strong { font-size: .82rem; color: #234b43; }
.treatment-active-head span { font-size: .74rem; color: #607a76; }
.treatment-live-dot { width: 8px; height: 8px; border-radius: 999px; background: #11a47b; box-shadow: 0 0 0 3px rgba(17,164,123,.12); }
.treatment-save-status { margin-left: auto; white-space: nowrap; }
.treatment-runtime-grid { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(260px,1.3fr); gap: 1rem; align-items: start; }
.treatment-runtime-actions { display: flex; justify-content: flex-end; align-items: center; gap: .55rem; flex-wrap: wrap; }
.treatment-runtime-message { border-radius: 7px; padding: .65rem .8rem; background: #edf8f4; color: #24624f; border: 1px solid #cae8dc; font-size: .8rem; }
.treatment-runtime-message.is-error { background: #fff3f3; color: #a33b3b; border-color: #efd0d0; }
.treatment-history-filter { grid-template-columns: minmax(280px, 1fr) 180px 180px auto auto auto; }
.treatment-history-main { display: flex; flex-direction: column; gap: .16rem; min-width: 220px; }
.treatment-history-main span, .treatment-history-main small { color: #6c7c82; font-size: .76rem; }
.treatment-result { display: inline-flex; align-items: center; border-radius: 999px; padding: .25rem .55rem; font-size: .72rem; font-weight: 700; white-space: nowrap; background: #eef2f3; color: #52646a; }
.treatment-result-normalized { background: #eaf8f2; color: #17765a; }
.treatment-result-monitoring { background: #fff7df; color: #8a6816; }
.treatment-result-escalated, .treatment-result-unresolved { background: #fff0f0; color: #a83a3a; }
.treatment-ticket-link { font-family: var(--mono, monospace); font-weight: 700; text-decoration: none; }
.treatment-detail-body { display: grid; gap: 1.1rem; }
.treatment-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; }
.treatment-detail-summary > div { border: 1px solid #e0e7e9; border-radius: 8px; padding: .75rem; display: flex; flex-direction: column; gap: .2rem; background: #fbfcfc; }
.treatment-detail-summary span { font-size: .68rem; color: #718188; text-transform: uppercase; letter-spacing: .06em; }
.treatment-detail-summary strong { font-size: .82rem; overflow-wrap: anywhere; }
.treatment-detail-section { border-top: 1px solid #e5ebed; padding-top: 1rem; }
.treatment-detail-section-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.treatment-detail-section-title i { color: #179b8e; }
.treatment-detail-section-title h3 { margin: 0; font-size: .92rem; }
.treatment-detail-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.treatment-detail-steps li { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .65rem; border-radius: 7px; background: #f7f9fa; color: #7a888d; }
.treatment-detail-steps li.done { color: #264f45; background: #f0f8f5; }
.treatment-detail-steps li > i { margin-top: .16rem; font-size: .78rem; }
.treatment-detail-steps li.done > i { color: #14936f; }
.treatment-detail-steps li span { display: flex; gap: .5rem; }
.treatment-detail-notes { margin: 0; white-space: normal; line-height: 1.55; }
.treatment-evidence-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: .75rem; }
.treatment-evidence-grid a { text-decoration: none; color: inherit; border: 1px solid #dce5e7; border-radius: 8px; overflow: hidden; background: #fff; }
.treatment-evidence-grid img { width: 100%; height: 110px; object-fit: cover; display: block; background: #edf2f3; }
.treatment-evidence-grid span { display: block; padding: .45rem .55rem; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 980px) {
  .treatment-runtime-grid { grid-template-columns: 1fr; }
  .treatment-detail-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .treatment-history-filter { grid-template-columns: 1fr 1fr; }
  .treatment-history-filter .search-box { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .procedure-runtime-head-actions { justify-content: flex-start; }
  .treatment-runtime-idle, .treatment-active-head { align-items: flex-start; }
  .treatment-runtime-actions .button { flex: 1 1 100%; justify-content: center; }
  .treatment-detail-summary { grid-template-columns: 1fr; }
  .treatment-history-filter { grid-template-columns: 1fr; }
}
.procedure-support-icons { display: flex; align-items: center; gap: .38rem; min-height: 28px; }
.procedure-support-icons > span:not(.muted) { width: 28px; height: 28px; border-radius: 7px; border: 1px solid #dde6e8; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #49646b; }
.procedure-support-icons .fa-whatsapp { color: #188a56; }
.treatment-evidence-thumb { height: 90px; display: flex !important; align-items: center; justify-content: center; background: #f2f6f7; color: #6e858c; font-size: 1.35rem !important; padding: 0 !important; }
.treatment-pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
.treatment-pagination > span { color: #6d7d83; font-size: .78rem; }
.treatment-locked { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid #e1e6e8; border-radius: 8px; background: #f7f9fa; color: #5e7076; }
.treatment-locked > i { margin-top: .15rem; color: #75868c; }
.treatment-locked > div { display: flex; flex-direction: column; gap: .2rem; }
.treatment-locked strong { font-size: .82rem; color: #41575e; }
.treatment-locked span { font-size: .76rem; line-height: 1.45; }


/* v12.1 - Guided treatment wizard */
.treatment-wizard-body { background: #f4f7f8; }
.treatment-alarm-summary { align-items: center; border-radius: 10px; padding: 12px 14px; background: #fff; border: 1px solid #dfe7e9; }
.treatment-alarm-summary > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.treatment-alarm-summary > div strong { font-size: .9rem; color: #20363c; overflow-wrap: anywhere; }
.treatment-alarm-summary > div span { color: #72838a; font-size: .76rem; }
.treatment-wizard-card { border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(18, 45, 53, .06); }
.treatment-wizard-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 16px 18px; border-bottom: 1px solid #e3eaec; background: #fff; }
.treatment-wizard-titlebar h3 { margin: 4px 0 2px; color: #20363c; font-size: 1rem; }
.treatment-wizard-titlebar small { color: #74858b; font-size: .74rem; }
.treatment-wizard-title-actions { display: flex; gap: .45rem; flex-shrink: 0; }
.treatment-wizard-progress { padding: 12px 18px 0; background: #fff; }
.treatment-wizard-progress > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #5c7177; font-size: .72rem; font-weight: 700; }
.treatment-wizard-progress-track { height: 6px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: #e9eff0; }
.treatment-wizard-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #0aa497; transition: width .22s ease; }
.treatment-wizard-intro { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 1.5rem; padding: 22px 20px; background: #fff; }
.treatment-wizard-intro-copy { min-width: 0; }
.treatment-wizard-kicker { display: block; margin-bottom: 7px; color: #60747a; font-size: .69rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.treatment-wizard-summary { max-width: 760px; margin: 0; color: #334b52; font-size: .96rem; line-height: 1.6; }
.treatment-wizard-safety { display: flex; gap: 12px; margin-top: 16px; padding: 13px 14px; border-radius: 9px; border: 1px solid #ecd6a7; background: #fff9ec; }
.treatment-wizard-safety > i { margin-top: 2px; color: #aa7413; font-size: 1rem; }
.treatment-wizard-safety strong { color: #684d17; font-size: .78rem; }
.treatment-wizard-safety p { margin: 4px 0 0; color: #655c49; font-size: .82rem; line-height: 1.55; }
.treatment-wizard-start { min-width: 210px; min-height: 48px; justify-content: center; font-size: .88rem; }
.treatment-wizard-active { padding: 16px 18px 20px; background: #fff; }
.treatment-wizard-stage { margin-top: 14px; }
.treatment-wizard-screen { min-height: 310px; border: 1px solid #dfe7e9; border-radius: 12px; background: #fbfcfc; padding: 26px; }
.treatment-wizard-screen.is-active { animation: treatmentWizardIn .16s ease-out; }
@keyframes treatmentWizardIn { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.treatment-step-state { position: absolute; opacity: 0; pointer-events: none; }
.treatment-wizard-step { display: flex; flex-direction: column; align-items: stretch; justify-content: center; }
.treatment-wizard-step-number { margin-bottom: 12px; color: #168e83; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.treatment-wizard-instruction { max-width: 880px; color: #18343b; font-size: clamp(1.25rem, 2.1vw, 1.8rem); line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }
.treatment-wizard-hint { margin: 12px 0 0; color: #74858a; font-size: .8rem; }
.treatment-wizard-navigation { display: grid; grid-template-columns: auto minmax(150px,.6fr) minmax(180px,.75fr); gap: 10px; align-items: center; margin-top: 28px; }
.treatment-wizard-navigation .button { min-height: 46px; justify-content: center; }
.treatment-wizard-navigation.single-back { grid-template-columns: auto; justify-content: start; }
.treatment-wizard-cant { border: 1px solid #e6c9c9; background: #fff7f7; color: #9b4545; }
.treatment-wizard-cant:hover { background: #fff1f1; }
.treatment-wizard-done { font-weight: 800; }
.treatment-help-link { align-self: flex-start; margin-top: 16px; padding: 4px 0; border: 0; background: transparent; color: #577078; font: inherit; font-size: .78rem; cursor: pointer; }
.treatment-help-link i { margin-right: 5px; color: #788d93; }
.treatment-wizard-help { text-align: center; }
.treatment-wizard-help-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: #eef5f6; color: #436d77; font-size: 1.25rem; }
.treatment-wizard-help h4, .treatment-wizard-result h4, .treatment-wizard-finish h4 { margin: 0; color: #20383f; font-size: 1.25rem; }
.treatment-wizard-help > p { max-width: 720px; margin: 10px auto 0; color: #596f75; font-size: .86rem; line-height: 1.6; }
.treatment-wizard-support-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.treatment-wizard-support-actions .button { min-height: 42px; }
.treatment-wizard-help .treatment-wizard-navigation { max-width: 650px; margin-left: auto; margin-right: auto; grid-template-columns: 1fr 1fr; }
.treatment-wizard-check { display: flex; gap: 12px; margin-top: 16px; padding: 14px; border: 1px solid #dbe8e4; border-radius: 9px; background: #f2f8f6; }
.treatment-wizard-check > i { color: #2e8174; margin-top: 2px; }
.treatment-wizard-check strong { color: #315a52; font-size: .8rem; }
.treatment-wizard-check p { margin: 4px 0 0; color: #5f716e; font-size: .82rem; line-height: 1.5; }
.treatment-result-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.treatment-result-choices button { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 10px; min-height: 76px; padding: 12px 14px; border: 1px solid #dce5e7; border-radius: 10px; background: #fff; color: #365159; text-align: left; cursor: pointer; }
.treatment-result-choices button:hover { border-color: #8ebeb6; background: #f6fbfa; }
.treatment-result-choices button > i { font-size: 1.2rem; color: #598086; text-align: center; }
.treatment-result-choices button span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.treatment-result-choices button strong { font-size: .88rem; color: #27444b; }
.treatment-result-choices button small { color: #718187; font-size: .73rem; }
.treatment-selected-result { display: grid; grid-template-columns: auto auto minmax(0,1fr); align-items: center; gap: 8px; margin: 16px 0; padding: 12px 14px; border-radius: 9px; background: #f1f7f6; color: #3f5d59; }
.treatment-selected-result > i { color: #188b7c; }
.treatment-selected-result span { color: #74847f; font-size: .74rem; }
.treatment-selected-result strong { color: #244e46; font-size: .86rem; }
.treatment-wizard-finish .field + .field { margin-top: 12px; }
.treatment-wizard-finish .treatment-wizard-support-actions { justify-content: flex-start; margin-top: 14px; }
.treatment-wizard-complete { min-width: 220px; font-weight: 800; }
.treatment-wizard-readonly { display: grid; gap: 7px; margin-top: 12px; }
.treatment-wizard-readonly > div { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e1e7e9; border-radius: 8px; color: #718087; background: #fafbfb; }
.treatment-wizard-readonly > div.done { color: #355d53; background: #f2f8f6; }
.treatment-wizard-readonly > div > i { margin-top: 3px; font-size: .75rem; }
.treatment-wizard-readonly > div.done > i { color: #14936f; }
.treatment-wizard-readonly > div span { display: flex; gap: 8px; line-height: 1.45; font-size: .8rem; }
.treatment-wizard-readonly > div b { color: inherit; }
.treatment-runtime-message { margin-top: 12px; }
body.alarm-wallboard .treatment-wizard-screen { min-height: 260px; }

@media (max-width: 760px) {
  .treatment-wizard-titlebar, .treatment-wizard-intro { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .treatment-wizard-title-actions { align-self: flex-start; }
  .treatment-wizard-intro { display: flex; }
  .treatment-wizard-start { width: 100%; min-width: 0; }
  .treatment-wizard-screen { padding: 20px 16px; min-height: 0; }
  .treatment-wizard-navigation { grid-template-columns: 1fr 1fr; }
  .treatment-wizard-navigation .button:first-child { grid-column: 1 / -1; }
  .treatment-wizard-help .treatment-wizard-navigation { grid-template-columns: 1fr; }
  .treatment-result-choices { grid-template-columns: 1fr; }
  .treatment-wizard-support-actions { flex-direction: column; }
  .treatment-wizard-support-actions .button { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .treatment-wizard-navigation { grid-template-columns: 1fr; }
  .treatment-wizard-navigation .button:first-child { grid-column: auto; }
  .treatment-wizard-instruction { font-size: 1.2rem; }
}

.treatment-complete-banner { display:flex; align-items:center; gap:10px; margin-bottom:14px; padding:12px 14px; border:1px solid #cfe6dd; border-radius:9px; background:#f0f8f5; color:#2b5c50; }
.treatment-complete-banner > i { color:#15936f; }
.treatment-complete-banner > div { display:flex; flex-direction:column; gap:2px; }
.treatment-complete-banner strong { font-size:.82rem; }
.treatment-complete-banner span { font-size:.74rem; color:#607b73; }


/* v12.2 - procedure association and modal stability */
.procedure-association-dialog { width: min(94vw, 720px); }
.procedure-association-dialog .modal-body { overflow-x: hidden; }
.procedure-association-list { padding-right: 2px; }
.procedure-association-option {
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  min-width: 0;
}
.procedure-association-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.procedure-association-check { grid-column: 1; }
.procedure-association-copy { grid-column: 2; width: 100%; }
.procedure-association-copy strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.procedure-association-copy small { line-height: 1.4; overflow-wrap: anywhere; }

.procedure-editor-dialog {
  width: min(96vw, 980px);
  height: auto;
  max-height: calc(100vh - 32px);
}
.procedure-editor-dialog > form {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100vh - 101px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.procedure-editor-dialog .modal-body {
  min-height: 0;
  max-height: calc(100vh - 164px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.procedure-editor-dialog .modal-footer {
  position: relative;
  z-index: 2;
  margin: 0;
  background: #fbfcfc;
}

.procedure-setting-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}
.procedure-setting-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.procedure-setting-switch {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid #bfc9cc;
  background: #dce2e4;
  transition: border-color .15s ease, background .15s ease;
}
.procedure-setting-switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  transition: transform .15s ease;
}
.procedure-setting-toggle > input:checked + .procedure-setting-switch {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}
.procedure-setting-toggle > input:checked + .procedure-setting-switch::after { transform: translateX(16px); }
.procedure-setting-toggle > input:focus-visible + .procedure-setting-switch { outline: 2px solid rgba(31,149,242,.26); outline-offset: 2px; }
.procedure-setting-copy { min-width: 0; display: block; }
.procedure-setting-copy strong { display: block; color: #46575e; font-size: 10.5px; line-height: 1.35; }
.procedure-setting-copy small { display: block; margin-top: 3px; color: #8d999e; font-size: 9.5px; line-height: 1.45; overflow-wrap: anywhere; }
.procedure-action-settings { margin: 0 0 16px; }
.procedure-contact-grid { margin-top: 0; align-items: start; }
.procedure-contact-grid .field { min-width: 0; }
.procedure-contact-grid .field > input { flex: 0 0 40px; height: 40px; }
.procedure-contact-grid .field-help {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  order: 3;
  min-height: 0;
  margin: 6px 0 0;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .procedure-association-option { grid-template-columns: 28px minmax(0, 1fr); }
  .procedure-editor-dialog { width: 100%; max-height: 94vh; }
  .procedure-editor-dialog > form { max-height: calc(94vh - 68px); }
  .procedure-editor-dialog .modal-body { max-height: calc(94vh - 130px); }
  .procedure-contact-grid { grid-template-columns: 1fr; }
}

/* v12.3 - alarm treatment flow */
.procedure-contact-grid .field {
  display: block;
  min-width: 0;
}
.procedure-contact-grid .field > label {
  display: flex;
  min-height: 17px;
  margin: 0 0 6px;
  align-items: flex-end;
}
.procedure-contact-grid .field > input {
  display: block;
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin: 0;
}

.alarm-treatment-button {
  min-width: 118px;
  justify-content: center;
  white-space: nowrap;
}
.alarm-treatment-button > i { font-size: 10px; }

.procedure-runtime-dialog {
  width: min(94vw, 900px);
  max-width: 900px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.procedure-runtime-header {
  flex: 0 0 auto;
}
.procedure-runtime-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 16px;
  background: #f4f7f8;
  scrollbar-gutter: stable;
}
.procedure-runtime-footer {
  flex: 0 0 auto;
  justify-content: flex-end;
}
.treatment-alarm-summary {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #dfe7e9;
  border-radius: 8px;
  background: #fff;
}
.treatment-wizard-card {
  margin: 0;
  border: 1px solid #dce5e7;
  border-radius: 9px;
  box-shadow: none;
  background: #fff;
}
.treatment-wizard-card + .treatment-wizard-card { margin-top: 12px; }
.treatment-wizard-titlebar {
  padding: 13px 15px;
}
.treatment-wizard-titlebar h3 {
  margin-top: 3px;
  font-size: .95rem;
}
.treatment-wizard-intro {
  display: block;
  padding: 16px;
}
.treatment-wizard-intro-copy { max-width: none; }
.treatment-operation-orientation {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 13px;
  border: 1px solid #cfe1e4;
  border-radius: 8px;
  background: #f2f7f8;
}
.treatment-operation-orientation > i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #2e7580;
  background: #e3f0f2;
  border-radius: 50%;
}
.treatment-operation-orientation strong {
  display: block;
  color: #2b4b53;
  font-size: .8rem;
}
.treatment-operation-orientation p {
  margin: 4px 0 0;
  color: #526c73;
  font-size: .84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.treatment-wizard-kicker {
  margin-top: 0;
}
.treatment-wizard-start {
  width: auto;
  min-width: 210px;
  min-height: 44px;
  margin-top: 18px;
}
.treatment-wizard-progress {
  padding: 10px 15px 0;
}
.treatment-wizard-active {
  padding: 12px 15px 15px;
}
.treatment-active-head {
  margin-bottom: 10px;
}
.treatment-wizard-stage {
  margin-top: 10px;
}
.treatment-wizard-screen {
  min-height: 0;
  padding: 20px;
  border-radius: 9px;
}
.treatment-wizard-step {
  min-height: 250px;
}
.treatment-wizard-instruction {
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  line-height: 1.4;
}
.treatment-wizard-navigation {
  margin-top: 22px;
}
.treatment-result-choices {
  gap: 8px;
  margin-top: 15px;
}
.treatment-result-choices button {
  min-height: 68px;
  border-radius: 8px;
}
.treatment-wizard-check {
  margin-top: 13px;
}
body.alarm-wallboard .alarm-treatment-button {
  min-width: 36px;
}
body.alarm-wallboard .alarm-treatment-button > i {
  font-size: 13px;
}

@media (max-width: 760px) {
  .procedure-runtime-dialog {
    width: min(96vw, 900px);
    max-height: calc(100vh - 16px);
  }
  .procedure-runtime-body { padding: 10px; }
  .treatment-wizard-intro { padding: 14px; }
  .treatment-wizard-start { width: 100%; min-width: 0; }
  .treatment-wizard-step { min-height: 0; }
}

.alarm-procedure-col { width: 142px; }
body.alarm-wallboard .alarm-procedure-col { width: 78px; }

/* ========================================================================== 
   e-Jay Operations Control v13 — branding, login and operational dashboard
   ========================================================================== */

/* Password field: keep the visibility control inside the input without
   participating in the form layout. */
.password-input { position: relative; display: block; min-width: 0; }
.password-input input {
  display: block;
  width: 100%;
  min-width: 0;
  padding-right: 50px !important;
  box-sizing: border-box;
}
.password-input .password-toggle {
  position: absolute;
  z-index: 4;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 46px;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid #e1e7e9;
  border-radius: 0 4px 4px 0;
  background: #fff;
  color: #7d8c91;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}
.password-input .password-toggle:hover,
.password-input .password-toggle:focus-visible { color: #263b41; background: #f8fafb; }
.password-input .password-toggle:focus-visible { outline: 2px solid rgba(31,149,242,.24); outline-offset: -2px; }
.password-input .password-toggle i { display: block; width: 16px; text-align: center; pointer-events: none; }

.operations-overview { margin: 18px 0 12px; }
.section-heading-inline {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 10px;
  padding: 0 1px;
}
.section-heading-inline h2 { margin: 3px 0 0; color: #1f343a; font-size: 18px; letter-spacing: -.025em; }
.compact-notice { margin: 0 0 10px; min-height: 40px; }
.operations-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}
.ops-kpi-card {
  position: relative;
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.ops-kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: #b6c3c7; }
.ops-kpi-card.status-live::before { background: var(--brand); }
.ops-kpi-card.status-success::before { background: #2d9b76; }
.ops-kpi-card.status-warning::before { background: #d29237; }
.ops-kpi-card.status-critical::before { background: #c84d55; }
.ops-kpi-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e7e9;
  border-radius: 4px;
  background: #f7f9fa;
  color: #557078;
  font-size: 13px;
}
.ops-kpi-card.status-live .ops-kpi-icon { color: #0b70c9; background: #eef9f8; border-color: #d8efec; }
.ops-kpi-card.status-success .ops-kpi-icon { color: #277e62; background: #f0f8f5; border-color: #dbeee7; }
.ops-kpi-card.status-warning .ops-kpi-icon { color: #9b6825; background: #fcf7ee; border-color: #f0e2c8; }
.ops-kpi-card.status-critical .ops-kpi-icon { color: #a53d45; background: #fff4f4; border-color: #f2d7d9; }
.ops-kpi-card > div { min-width: 0; }
.ops-kpi-card span:not(.ops-kpi-icon) { display: block; color: #6f7f84; font-size: 9px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; }
.ops-kpi-card strong { display: block; margin-top: 3px; color: #172d33; font-size: 24px; line-height: 1.05; letter-spacing: -.04em; }
.ops-kpi-card strong.ops-kpi-time { font-size: 18px; letter-spacing: -.025em; }
.ops-kpi-card small { display: block; margin-top: 5px; overflow: hidden; color: #89979b; font-size: 9.5px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }

.operations-chart-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.7fr); gap: 12px; margin: 0 0 12px; }
.operations-trend-panel .chart-frame { min-height: 245px; }
.chart-legend.two-cols { grid-template-columns: repeat(2,minmax(0,1fr)); }
.treatment-normalized { background: #2d9b76; }
.treatment-monitoring { background: #4d8aa6; }
.treatment-escalated { background: #d29237; }
.treatment-unresolved { background: #c84d55; }
.treatment-recent-panel { margin-bottom: 12px; }
.treatment-result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #dce5e7;
  border-radius: 999px;
  background: #f7f9fa;
  color: #56686e;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.treatment-result-badge.result-normalized { color: #24765c; background: #eef8f4; border-color: #d2eadf; }
.treatment-result-badge.result-monitoring { color: #3e758e; background: #f0f6f9; border-color: #d6e6ee; }
.treatment-result-badge.result-escalated { color: #936321; background: #fcf7ee; border-color: #eedfc2; }
.treatment-result-badge.result-unresolved { color: #a43b43; background: #fff3f4; border-color: #f0d4d7; }
.treatment-result-badge.result-progress { color: #0b70c9; background: #eef9f8; border-color: #d4ece9; }

@media (max-width: 1280px) {
  .operations-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .operations-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .operations-chart-grid { grid-template-columns: 1fr; }
  .section-heading-inline { align-items: flex-start; flex-direction: column; gap: 7px; }
}
@media (max-width: 560px) {
  .operations-kpi-grid { grid-template-columns: 1fr; }
  .ops-kpi-card { min-height: 88px; }
  .chart-legend.two-cols { grid-template-columns: 1fr; }
}

/* ========================================================================== 
   e-Jay Operations Control v13.1 — visual operations dashboard
   ========================================================================== */
.operations-overview-v2 { margin-top: 20px; }
.operations-summary-panel {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  margin-bottom: 12px;
  overflow: hidden;
}
.operations-summary-item {
  position: relative;
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}
.operations-summary-item:last-child { border-right: 0; }
.operations-summary-item.is-live { box-shadow: inset 2px 0 0 var(--brand); }
.operations-summary-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe7e9;
  border-radius: 50%;
  background: #f7f9fa;
  color: #557078;
  font-size: 12px;
}
.operations-summary-item.is-live .operations-summary-icon { color: #0b70c9; border-color: #d2ece9; background: #edf9f7; }
.operations-summary-item > div { min-width: 0; }
.operations-summary-item small {
  display: block;
  color: #718087;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.operations-summary-item strong {
  display: block;
  margin-top: 3px;
  color: #172d33;
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.operations-summary-item strong.summary-time { font-size: 18px; letter-spacing: -.02em; }
.operations-summary-item span:not(.operations-summary-icon) {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #8a989d;
  font-size: 9.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-visual-grid {
  display: grid;
  grid-template-columns: minmax(280px,.78fr) minmax(330px,1fr) minmax(350px,1.06fr);
  gap: 12px;
  margin-bottom: 12px;
}
.operations-story-grid {
  display: grid;
  grid-template-columns: minmax(0,1.55fr) minmax(320px,.72fr);
  gap: 12px;
  margin-bottom: 20px;
}
.operations-donut { width: 176px; height: 176px; margin-top: 13px; }
.chart-frame-horizontal { height: 226px; padding: 18px 18px 12px; }
.chart-frame-rates { height: 214px; }
.chart-frame-support { height: 220px; }
.chart-footnote {
  min-height: 36px;
  padding: 0 17px 14px;
  color: #89969b;
  font-size: 9px;
  line-height: 1.45;
}
.operations-mini-stats {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  margin: 0 16px 15px;
  border-top: 1px solid #edf1f2;
}
.operations-mini-stats span {
  min-width: 0;
  padding: 10px 8px 0;
  border-right: 1px solid #edf1f2;
  color: #819096;
  font-size: 8.5px;
  line-height: 1.25;
  text-align: center;
}
.operations-mini-stats span:last-child { border-right: 0; }
.operations-mini-stats b { display: block; margin-bottom: 2px; color: #334a51; font-size: 13px; }
.monitoring-overview { margin-top: 4px; }
.monitoring-section-heading { margin-bottom: 10px; }
.dashboard-grid-monitoring { margin-bottom: 12px; }
.treatment-recent-panel { margin-top: 0; }

@media (max-width: 1320px) {
  .operations-visual-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .operations-visual-grid > .chart-panel:first-child { grid-row: span 1; }
  .operations-visual-grid > .chart-panel:last-child { grid-column: 1/-1; }
  .operations-visual-grid > .chart-panel:last-child .chart-frame-horizontal { height: 235px; }
}
@media (max-width: 1120px) {
  .operations-summary-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .operations-summary-item:nth-child(2) { border-right: 0; }
  .operations-summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .operations-story-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .operations-visual-grid { grid-template-columns: 1fr; }
  .operations-visual-grid > .chart-panel:last-child { grid-column: auto; }
  .operations-visual-grid .chart-frame-horizontal,
  .operations-story-grid .chart-frame-horizontal { height: 225px; }
}
@media (max-width: 560px) {
  .operations-summary-panel { grid-template-columns: 1fr; }
  .operations-summary-item { min-height: 78px; border-right: 0; border-bottom: 1px solid var(--line); }
  .operations-summary-item:last-child { border-bottom: 0; }
  .operations-mini-stats { grid-template-columns: 1fr; }
  .operations-mini-stats span { border-right: 0; border-bottom: 1px solid #edf1f2; }
  .operations-mini-stats span:last-child { border-bottom: 0; }
}

/* ==========================================================================
   Operations Control v13.2 — device communication + readings refresh
   ========================================================================== */
.method-badge.agent i { color: #5f747b; }
.method-badge.modbus_tcp i { color: #147d73; }
.method-badge.bacnet_ip i { color: #8a6a31; }
.method-badge.opcua i { color: #5f6690; }

.modal-device .device-method-selector {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}
.modal-device .device-method-selector label > span {
  height: 78px;
  min-height: 78px;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 8px;
  padding: 10px;
}
.modal-device .device-method-selector label > span > i {
  width: 30px;
  height: 30px;
}
.modal-device .device-method-selector strong,
.modal-device .device-method-selector small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-device .device-method-selector strong { white-space: nowrap; }
.modal-device .device-method-selector small { white-space: normal; }

.snmp-settings {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: #fafcfc;
}
.snmp-settings > .field + [data-snmp-v3],
.snmp-settings [data-snmp-v3] > .field,
.snmp-settings [data-snmp-v3] > .form-grid {
  margin-top: 11px;
}

/* Dedicated pause control. It is intentionally isolated from the generic
   toggle-row rules so checking it never changes the modal geometry. */
.device-state-block { overflow: visible; }
.device-pause-control {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 8px 10px;
  cursor: pointer;
  box-sizing: border-box;
}
.device-pause-control > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.device-pause-switch {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  border: 1px solid #bcc8cc;
  background: #dce3e5;
  box-sizing: border-box;
  transition: background .15s ease, border-color .15s ease;
}
.device-pause-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.14);
  transition: transform .15s ease;
}
.device-pause-control > input:checked + .device-pause-switch {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}
.device-pause-control > input:checked + .device-pause-switch::after { transform: translateX(16px); }
.device-pause-control > input:focus-visible + .device-pause-switch { outline: 2px solid rgba(0,160,150,.25); outline-offset: 2px; }
.device-pause-copy { min-width: 0; }
.device-pause-copy strong,
.device-pause-copy small { display: block; }
.device-pause-copy strong { color: #46575e; font-size: 11.5px; line-height: 1.35; }
.device-pause-copy small { margin-top: 3px; color: #89969b; font-size: 10.5px; line-height: 1.4; }

.readings-heading-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.readings-refresh-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 5px 7px 5px 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
}
.readings-refresh-control > div { min-width: 102px; }
.readings-refresh-control span,
.readings-refresh-control small { display: block; }
.readings-refresh-control span { color: #46575e; font-size: 10px; font-weight: 700; }
.readings-refresh-control small { margin-top: 1px; color: #8a989d; font-size: 9px; white-space: nowrap; }
.readings-refresh-control .control {
  width: 126px;
  min-width: 126px;
  height: 32px;
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 980px) {
  .modal-device .device-method-selector { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .modal-device .device-method-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readings-heading-actions { width: 100%; justify-content: flex-start; }
  .readings-refresh-control { width: 100%; justify-content: space-between; }
}
@media (max-width: 480px) {
  .modal-device .device-method-selector { grid-template-columns: 1fr; }
  .readings-heading-actions > .button { width: 100%; justify-content: center; }
}


/* ==========================================================================
   e-Jay Operations Control v13.3 — tratamento modal e CMMS automático
   ========================================================================== */
.procedure-runtime-dialog {
  overflow: hidden;
}
.procedure-runtime-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.procedure-runtime-footer {
  position: relative;
  z-index: 2;
}
.procedure-runtime-modal .modal-backdrop { cursor: default; }
.treatment-wizard-screen { overflow: visible; }
.treatment-wizard-finish { padding-bottom: 24px; }
.treatment-cmms-indicator {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #d8e2e4;
  border-radius: 7px;
  background: #f7fafb;
  color: #667a80;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.treatment-cmms-indicator i { color: #6b8790; }
.treatment-cmms-indicator.is-ready {
  border-color: #bfe0d9;
  background: #eff8f5;
  color: #287063;
}
.treatment-cmms-indicator.is-ready i { color: #15958b; }
@media (max-width: 760px) {
  .procedure-runtime-dialog { overflow: hidden; }
  .treatment-wizard-title-actions { flex-wrap: wrap; }
  .treatment-cmms-indicator { order: 3; width: 100%; justify-content: center; }
}


/* ========================================================================== 
   e-Jay Operations Control v13.4 — modal de tratativa estável
   ========================================================================== */
.procedure-runtime-modal {
  padding: 16px;
  overflow: hidden;
  align-items: center;
  justify-items: center;
}
.procedure-runtime-dialog {
  width: min(94vw, 900px);
  max-width: 900px;
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.procedure-runtime-header,
.procedure-runtime-footer {
  position: relative;
  z-index: 3;
  background: #fff;
}
.procedure-runtime-body {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: none;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px 16px 30px;
}
.procedure-runtime-footer {
  min-height: 58px;
  padding: 10px 16px;
  border-top: 1px solid #dfe6e8;
  box-shadow: 0 -4px 12px rgba(16, 42, 49, .035);
}
.procedure-runtime-footer .button { min-width: 76px; }
.procedure-runtime-modal .modal-backdrop { cursor: default; }

/* Do not clip the final wizard actions inside the procedure card. */
.treatment-wizard-card,
.treatment-wizard-active,
.treatment-wizard-stage,
.treatment-wizard-screen,
.treatment-wizard-finish {
  min-height: 0;
  overflow: visible;
}
.treatment-wizard-card { border-radius: 9px; }
.treatment-wizard-titlebar { border-radius: 9px 9px 0 0; }
.treatment-wizard-finish { padding-bottom: 28px; }
.treatment-wizard-finish .treatment-wizard-navigation {
  margin-bottom: 0;
  padding-bottom: 2px;
}

@media (max-width: 760px) {
  .procedure-runtime-modal { padding: 8px; }
  .procedure-runtime-dialog {
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .procedure-runtime-body { padding: 10px 10px 24px; }
}

/* Client state selector and local Brazilian state flags. */
.client-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: #52656b;
}
.client-state strong {
  color: #74858a;
  font-size: 10px;
  letter-spacing: .04em;
}
.client-state-flag,
.state-selector-current img,
.state-selector-option img {
  width: 28px;
  height: 19px;
  flex: 0 0 28px;
  object-fit: contain;
  border: 1px solid #dce4e6;
  background: #fff;
}
.state-selector { position: relative; }
.state-selector-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #cbd7da;
  border-radius: 4px;
  background: #fff;
  color: #33474d;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.state-selector-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 1px;
  border-color: var(--brand);
}
.state-selector-trigger > i { color: #829096; font-size: 10px; }
.state-selector-current {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.state-selector-current span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-selector-current strong { margin-left: auto; color: #75868b; font-size: 10px; }
.state-selector-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d7e0e2;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25,45,51,.15);
}
.state-selector-option {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #3e5258;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.state-selector-option:first-child { grid-template-columns: minmax(0,1fr); }
.state-selector-option:hover,
.state-selector-option:focus-visible { background: #f1f6f6; outline: none; }
.state-selector-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-selector-option strong { color: #75868b; font-size: 10px; }

/* Simplified device alarm editor: stable layout and visible severity context. */
.modal-alarm-editor {
  width: min(980px, calc(100vw - 36px));
  max-width: 980px;
}
.modal-alarm-editor .alarm-identification-grid {
  grid-template-columns: minmax(0, 2fr) minmax(190px, .8fr);
  grid-auto-rows: auto;
  row-gap: 12px;
  align-items: start;
}
.modal-alarm-editor .alarm-identification-grid > .field,
.modal-alarm-editor .alarm-identification-grid > .field + .field {
  display: flex;
  flex-direction: column;
  grid-row: auto;
  gap: 6px;
  margin: 0;
  min-width: 0;
  align-self: start;
}
.modal-alarm-editor .alarm-identification-grid > .field > label {
  min-height: 0;
  margin: 0;
  line-height: 1.35;
}
.modal-alarm-editor .alarm-name-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 62px;
  max-height: 120px;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.4;
}
.modal-alarm-editor .field-help {
  display: block;
  margin: 0;
  color: #7d8c91;
  font-size: 9px;
  line-height: 1.45;
}
.modal-alarm-editor .field-help strong {
  color: #52666d;
  font-weight: 700;
}
.modal-alarm-editor .rule-builder {
  grid-template-columns: minmax(220px,1.7fr) minmax(130px,.9fr) minmax(120px,.85fr) minmax(150px,1fr) minmax(110px,.75fr);
}

.severity-select {
  border-left-width: 4px !important;
  font-weight: 700;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.severity-select-0 { border-left-color: #99a8ad !important; background: #f6f8f8; color: #5f6d72; }
.severity-select-1 { border-left-color: #5f86a8 !important; background: #f2f7fb; color: #486b88; }
.severity-select-2 { border-left-color: #c49a32 !important; background: #fff9e9; color: #8d6a15; }
.severity-select-3 { border-left-color: #d1802b !important; background: #fff5e9; color: #995b1e; }
.severity-select-4 { border-left-color: #d95a35 !important; background: #fff1ec; color: #a3452b; }
.severity-select-5 { border-left-color: #bd343c !important; background: #fff0f1; color: #9e3239; }
.severity-select option[value="0"] { color: #5f6d72; }
.severity-select option[value="1"] { color: #486b88; }
.severity-select option[value="2"] { color: #8d6a15; }
.severity-select option[value="3"] { color: #995b1e; }
.severity-select option[value="4"] { color: #a3452b; }
.severity-select option[value="5"] { color: #9e3239; font-weight: 700; }

.device-alarm-table .severity-badge.sev-0 { background: #f6f8f8; color: #5f6d72; }
.device-alarm-table .severity-badge.sev-1 { background: #f2f7fb; color: #486b88; }
.device-alarm-table .severity-badge.sev-2 { background: #fff9e9; color: #8d6a15; }
.device-alarm-table .severity-badge.sev-3 { background: #fff5e9; color: #995b1e; }
.device-alarm-table .severity-badge.sev-4 { background: #fff1ec; color: #a3452b; }
.device-alarm-table .severity-badge.sev-5 { background: #fff0f1; color: #9e3239; }
.origin-badge.direct-host {
  padding: 3px 7px;
  border: 1px solid #d8e3e5;
  background: #f7fafb;
  color: #4f676f;
  font-weight: 600;
}

@media (max-width: 900px) {
  .modal-alarm-editor .rule-builder { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .modal-alarm-editor { width: calc(100vw - 16px); }
  .modal-alarm-editor .alarm-identification-grid { grid-template-columns: 1fr; row-gap: 12px; }
  .modal-alarm-editor .rule-builder { grid-template-columns: 1fr; }
}


/* ========================================================================== 
   Gemelo branding
   ========================================================================== */
.brand {
  width: 142px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.brand img { width: 100%; max-height: 36px; filter: none !important; object-fit: contain; object-position: left center; }
.wallboard-logo {
  min-width: 146px;
  height: 44px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #fff;
}
.wallboard-logo img { width: 100%; max-height: 32px; filter: none !important; object-fit: contain; }
.public-brand-gemelo {
  width: 166px;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 4px;
  background: #fff;
}
.public-brand-gemelo img { max-width: 148px; max-height: 40px; filter: none !important; }
.login-logo { width: 190px; max-height: 46px; object-fit: contain; object-position: left center; }
@media (max-width: 820px) {
  .brand { width: 126px; height: 42px; padding: 0; margin-left: 10px; }
}

/* Device alarm conditions: client-facing editor, no raw Zabbix syntax. */
.device-condition-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.device-condition-row {
  display: grid;
  grid-template-columns: minmax(220px,1.55fr) minmax(135px,.85fr) minmax(120px,.72fr) minmax(190px,1.05fr) minmax(150px,.9fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dde6e8;
  border-radius: 5px;
  background: #fbfcfc;
}
.device-condition-row > .field {
  min-width: 0;
  margin: 0;
}
.device-condition-row select,
.device-condition-row input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.device-condition-row [data-condition-value],
.device-condition-row [data-condition-other] {
  grid-column: 5;
  grid-row: 1;
}
.condition-connector-label {
  align-self: center;
  width: max-content;
  margin: -1px 0 -1px 14px;
  padding: 2px 7px;
  border: 1px solid #dbe4e6;
  border-radius: 999px;
  background: #fff;
  color: #687b81;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.condition-summary-multi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
}
.condition-summary-multi .condition-join {
  color: #86969b;
  font-size: 9px;
  font-weight: 800;
}
.condition-summary-multi .condition-text {
  color: #536970;
  font-size: 10px;
  white-space: nowrap;
}
.recovery-condition-section {
  border-left: 3px solid #9cb2b8;
}
@media (max-width: 1100px) {
  .device-condition-row {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .device-condition-row [data-condition-value],
  .device-condition-row [data-condition-other] {
    grid-column: auto;
    grid-row: auto;
  }
}
@media (max-width: 680px) {
  .device-condition-row { grid-template-columns: 1fr; }
}

/* ==========================================================================\n   Gemelo Monitoramento 24/7 — turno e leituras\n   ========================================================================== */
.handover-notes-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  scrollbar-gutter: stable;
}
.handover-note-text {
  color: #506168;
  font-size: 9.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.handover-note-text + .handover-note-text {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf1f2;
}
.checkout-notes-field textarea {
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.readings-context-filters {
  align-items: end;
}
.readings-device-field { min-width: 260px; }
.readings-device-picker-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: #304148;
  cursor: pointer;
  text-align: left;
}
.readings-device-picker-button:hover { border-color: #93b8d5; background: #fbfdff; }
.readings-device-picker-button > span { min-width: 0; display: flex; align-items: center; gap: 9px; }
.readings-device-picker-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.readings-device-picker-button i { color: #5f747c; font-size: 10px; }
.readings-device-required-error { margin-top: 4px; color: #b84848; font-size: 9px; }
.readings-device-picker-modal .modal-body { padding: 16px 18px; }
.readings-device-choice-picker { height: min(52vh, 390px); }
.readings-device-picker-modal .modal-footer { justify-content: space-between; }
.readings-device-picker-count { color: #718087; font-size: 10px; }
.required-marker {
  margin-left: 5px;
  color: #b84848;
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.readings-selection-required {
  margin-top: 12px;
}
.shift-notes-inline li { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Leituras — estado inicial aguardando seleção de dispositivo */
.readings-selection-required .empty-state {
  min-height: 220px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 24px;
  box-sizing: border-box;
}
.readings-selection-required .empty-state i {
  margin: 0 0 12px;
  font-size: 26px;
}
.readings-selection-required .empty-state strong {
  font-size: 12px;
  line-height: 1.35;
}
.readings-selection-required .empty-state span {
  max-width: 620px;
  margin-top: 7px;
  line-height: 1.55;
}

/* Leituras — atualização AJAX sem recarregar a página */
.readings-live-panel {
  position: relative;
}
.readings-live-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 96px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(1px);
  color: #188fff;
  font-size: 11px;
  font-weight: 650;
  pointer-events: none;
}
.readings-live-loading[hidden] { display: none !important; }
.readings-live-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(24, 143, 255, .2);
  border-top-color: #188fff;
  border-radius: 50%;
  animation: readings-live-spin .7s linear infinite;
}
@keyframes readings-live-spin {
  to { transform: rotate(360deg); }
}


/* Leituras — filtros compactos e refresh mínimo de 1 minuto */
.readings-context-filters {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(380px, 520px) auto;
  justify-content: start;
  align-items: start;
  column-gap: 10px;
  row-gap: 10px;
}
.readings-context-filters .readings-device-field {
  min-width: 0;
  width: 100%;
}
.readings-context-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  margin-top: 23px;
  white-space: nowrap;
}
.readings-context-actions .button {
  width: auto;
  min-width: 94px;
  height: 40px;
  padding-left: 14px;
  padding-right: 14px;
  justify-content: center;
}
.readings-context-actions .button.button-secondary { min-width: 86px; }
@media (max-width: 1080px) {
  .readings-context-filters {
    grid-template-columns: minmax(220px, .85fr) minmax(320px, 1.3fr) auto;
  }
}
@media (max-width: 820px) {
  .readings-context-filters { grid-template-columns: 1fr 1fr; }
  .readings-context-actions {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}
@media (max-width: 620px) {
  .readings-context-filters { grid-template-columns: 1fr; }
  .readings-context-actions { grid-column: auto; }
}

/* ==========================================================================
   Login + privacy refinement v16.8
   ========================================================================== */
.login-gallery { background: #06182b; }
.login-image { background-position: center center; filter: saturate(.92) contrast(1.03); }
.login-image::after { background: linear-gradient(90deg, rgba(3,15,28,.06), rgba(3,15,28,.12) 62%, rgba(3,15,28,.38)); }
.login-brand span { min-width: 0; white-space: nowrap; }
.login-recovery {
  width: 100%;
  display: block;
  margin-top: 15px;
  color: #74858d;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.login-recovery strong { color: var(--brand-strong); font-weight: 700; }
.login-recovery:hover { color: #465b64; }
.login-recovery:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.login-legal { flex-wrap: wrap; line-height: 1.45; text-align: center; }

.legal-header { min-height: 72px; height: auto; padding-top: 14px; padding-bottom: 14px; }
.legal-product { min-width: 0; }
.legal-product strong, .legal-product span { max-width: min(70vw, 620px); overflow-wrap: anywhere; }
.legal-content { width: min(calc(100% - 40px), 900px); padding: 54px 0 86px; }
.legal-content h1 { margin: 7px 0 13px; }
.legal-lead { max-width: 840px; margin-bottom: 14px; }
.legal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 36px;
  color: #8c9aa0;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}
.legal-content section { padding: 24px 0; }
.legal-content h2 { margin-bottom: 9px; color: #263d46; font-size: 14px; line-height: 1.4; }
.legal-content p { color: #61727a; font-size: 12.5px; line-height: 1.72; }
.legal-content section p + p { margin-top: 10px; }

@media (max-width: 820px) {
  .login-gallery { min-height: 30vh; height: 30vh; }
  .login-panel { min-height: 70vh; }
  .login-panel-inner { padding-top: 34px; }
  .legal-header { gap: 14px; }
  .legal-content { padding-top: 38px; }
}

@media (max-width: 560px) {
  .legal-header { align-items: flex-start; }
  .legal-product strong { font-size: 14px; }
  .legal-product span { font-size: 8px; }
  .legal-content { width: min(calc(100% - 28px), 900px); }
  .legal-content h1 { font-size: 27px; }
  .legal-meta { flex-wrap: wrap; gap: 5px; }
}

/* ==========================================================================
   Assistente virtual Chico
   ========================================================================== */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.chico-launcher {
  position: fixed;
  right: 22px;
  bottom: 28px;
  z-index: 145;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 64px;
  min-height: 64px;
  padding: 7px 14px 7px 7px;
  border: 1px solid rgba(24, 143, 255, .24);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(10, 33, 53, .18);
  color: #18323f;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.chico-launcher:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 143, 255, .55);
  box-shadow: 0 20px 44px rgba(10, 33, 53, .23);
}
.chico-launcher-photo,
.chico-header-photo {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #0b2036, #12385a);
  color: #8ddff8;
}
.chico-launcher-photo { width: 50px; height: 50px; border-radius: 50%; }
.chico-header-photo { width: 54px; height: 54px; border-radius: 14px; }
.chico-launcher-photo img,
.chico-header-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  opacity: 0;
  transition: opacity .15s ease;
}
.chico-launcher-photo img.is-loaded,
.chico-header-photo img.is-loaded { opacity: 1; }
.chico-photo-fallback { font-size: 20px; }
.chico-launcher-copy { display: grid; gap: 1px; text-align: left; line-height: 1.15; }
.chico-launcher-copy strong { font-size: 12px; font-weight: 700; color: #173445; }
.chico-launcher-copy small { font-size: 9px; color: #7b8c95; }
/* Chico compacto em toda a plataforma. */
.chico-launcher {
  min-width: 58px;
  min-height: 58px;
  width: 58px;
  height: 58px;
  padding: 4px;
  justify-content: center;
}
.chico-launcher-copy { display: none; }
.chico-launcher-photo { width: 48px; height: 48px; }

.chico-modal { z-index: 5010; }
.chico-dialog {
  width: min(94vw, 720px);
  max-width: 720px;
  height: min(84vh, 720px);
  max-height: min(84vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}
.chico-header {
  min-height: 82px;
  padding: 13px 18px;
  background: linear-gradient(180deg, #ffffff, #fbfdfe);
}
.chico-header-profile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chico-header-profile h2 { margin-top: 0; font-size: 17px; }
.chico-presence { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; color: #647983; font-size: 9.5px; font-weight: 600; }
.chico-presence i { width: 6px; height: 6px; border-radius: 50%; background: #22a879; box-shadow: 0 0 0 3px rgba(34,168,121,.10); }
.chico-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  background: #f5f8fa;
}
.chico-privacy-note {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 11px;
  padding: 9px 11px;
  border: 1px solid #dce7ec;
  border-radius: 10px;
  background: #ffffff;
  color: #6b7d86;
  font-size: 9.5px;
  line-height: 1.45;
}
.chico-privacy-note i { margin-top: 1px; color: #188fff; }
.chico-chat {
  flex: 1 1 auto;
  min-height: 180px;
  overflow-y: auto;
  padding: 5px 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #b7c8d0 transparent;
}
.chico-message-row { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.chico-message-user { align-self: flex-end; flex-direction: row-reverse; }
.chico-message-assistant { align-self: flex-start; }
.chico-message-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 30px;
  border-radius: 50%;
  background: #0d2942;
  color: #7fdcf6;
  font-size: 10px;
}
.chico-message-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  opacity: 0;
  transition: opacity .15s ease;
}
.chico-message-avatar img.is-loaded { opacity: 1; }
.chico-bubble {
  padding: 10px 12px;
  border: 1px solid #dde7eb;
  border-radius: 13px 13px 13px 4px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(21,47,61,.04);
  color: #344c58;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.chico-message-user .chico-bubble {
  border-color: #188fff;
  border-radius: 13px 13px 4px 13px;
  background: #188fff;
  color: #ffffff;
}
.chico-bubble strong { display: block; margin-bottom: 3px; color: #17384a; }
.chico-message-user .chico-bubble strong { color: #ffffff; }
.chico-bubble p { margin: 0; }
.chico-bubble p + p { margin-top: 6px; }
.chico-response-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.chico-response-list li {
  padding: 7px 8px;
  border-left: 2px solid #18bddd;
  background: #f4f9fb;
  color: #49616c;
  font-size: 10px;
  line-height: 1.45;
}
.chico-quick-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 12px;
}
.chico-quick-actions button {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #d5e2e8;
  border-radius: 11px;
  background: #ffffff;
  color: #314b58;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.chico-action-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eef7ff;
  color: #188fff;
  font-size: 13px;
}
.chico-action-copy { display: grid; gap: 2px; min-width: 0; }
.chico-action-copy strong { color: #203d4c; font-size: 10.5px; line-height: 1.35; }
.chico-action-copy small { color: #7a8c95; font-size: 9px; line-height: 1.4; font-weight: 400; }
.chico-action-chevron { justify-self: end; color: #9ab0bb; font-size: 9px; }
.chico-quick-actions button:hover {
  border-color: #188fff;
  background: #f8fcff;
  box-shadow: 0 4px 14px rgba(24,143,255,.08);
  transform: translateY(-1px);
}
.chico-quick-actions button:hover .chico-action-icon { background: #188fff; color: #ffffff; }
.chico-quick-actions button:hover .chico-action-chevron { color: #188fff; }
.chico-quick-actions button:focus-visible { outline: 2px solid #188fff; outline-offset: 2px; }
.chico-quick-actions button:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.chico-status {
  flex: 0 0 auto;
  padding: 7px 14px 10px;
  background: #ffffff;
  color: #b24a4a;
  font-size: 9.5px;
}
.chico-typing { display: inline-flex; align-items: center; gap: 4px; min-width: 42px; min-height: 18px; }
.chico-typing i { width: 5px; height: 5px; border-radius: 50%; background: #8ca0aa; animation: chicoTyping 1s infinite ease-in-out; }
.chico-typing i:nth-child(2) { animation-delay: .14s; }
.chico-typing i:nth-child(3) { animation-delay: .28s; }
@keyframes chicoTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

@media (max-width: 760px) {
  .chico-launcher { right: 14px; bottom: 18px; padding-right: 7px; }
  .chico-launcher-copy { display: none; }
  .chico-dialog { width: 100%; height: min(92vh, 760px); max-height: 92vh; border-radius: 16px 16px 0 0; }
  .chico-body { padding-left: 12px; padding-right: 12px; }
  .chico-message-row { max-width: 96%; }
}

/* ========================================================================== 
   Alarm event board by state + wallboard background selector
   ========================================================================== */
.wallboard-background-picker {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #d4dfe2;
  border-radius: 5px;
  background: #fff;
  color: #4d6067;
  font-size: 10px;
  font-weight: 600;
}
.wallboard-background-picker > i { color: #70858d; font-size: 10px; }
.wallboard-background-picker select {
  min-width: 82px;
  height: 28px;
  padding: 0 22px 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.wallboard-background-picker-dark {
  height: 38px;
  min-height: 38px;
  border-color: rgba(255,255,255,.15);
  background: rgba(255,255,255,.04);
  color: #dce8ea;
}
.wallboard-background-picker-dark > i { color: #9fb7bc; }
.wallboard-background-picker-dark select { min-width: 88px; color: #dce8ea; }
.wallboard-background-picker-dark option { background: #102b46; color: #dce8ea; }

/* Clear tenant logo: no white plate behind it in wallboard mode. */
.wallboard-logo {
  min-width: 150px;
  height: 44px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.wallboard-logo img {
  width: 150px;
  max-height: 38px;
  object-fit: contain;
  object-position: left center;
}

.sev-dot-ok { background: #238636; }
.event-panel-head .alarm-severity-legend { max-width: 760px; }
.alarm-state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.alarm-state-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce5e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(19,45,52,.045);
}
.alarm-state-header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid #e6ecee;
  background: #f8fafb;
}
.alarm-state-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.alarm-state-flag {
  width: 26px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(38,58,64,.12);
  box-shadow: 0 1px 2px rgba(20,40,46,.08);
}
.alarm-state-heading > div { min-width: 0; display: grid; gap: 2px; }
.alarm-state-heading strong {
  overflow: hidden;
  color: #2c4148;
  font-size: 11.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alarm-state-heading span {
  color: #829197;
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 8.5px;
  font-weight: 600;
}
.alarm-state-count {
  flex: 0 0 auto;
  color: #8a999e;
  font-size: 8.5px;
  white-space: nowrap;
}
.alarm-state-clients {
  display: grid;
  gap: 7px;
  padding: 9px;
}
.alarm-panel-client {
  --status-color: #8a979c;
  width: 100%;
  min-width: 0;
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--status-color);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 2px 5px rgba(18,37,43,.08);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.alarm-panel-client:hover { transform: translateY(-1px); filter: brightness(1.035); box-shadow: inset 0 0 0 1px rgba(0,0,0,.05), 0 5px 12px rgba(18,37,43,.13); }
.alarm-panel-client:focus-visible { outline: 2px solid #168ef0; outline-offset: 2px; }
.alarm-panel-client.status-ok { --status-color: #238636; }
.alarm-panel-client.severity-card-5 { --status-color: #c83f47; }
.alarm-panel-client.severity-card-4 { --status-color: #df7131; }
.alarm-panel-client.severity-card-3 { --status-color: #d3992b; }
.alarm-panel-client.severity-card-2 { --status-color: #6589aa; }
.alarm-panel-client.severity-card-1 { --status-color: #7899b2; }
.alarm-panel-client.severity-card-0 { --status-color: #8a979c; }
.alarm-panel-client-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alarm-panel-client-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  object-fit: contain;
  padding: 3px;
  border-radius: 4px;
  background: rgba(255,255,255,.94);
}
.alarm-panel-client-identity strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.alarm-panel-client-status {
  min-width: 58px;
  display: grid;
  justify-items: end;
  gap: 4px;
  color: rgba(255,255,255,.92);
  font-size: 8.5px;
  font-weight: 650;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.alarm-panel-client-status strong {
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,.16);
  color: #fff;
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 10px;
}
.alarm-panel-client-status i { font-size: 11px; }

/* Wallboard palettes. The header remains dark so the clear tenant logo stays legible. */
body.alarm-wallboard[data-wallboard-theme="white"] {
  --wallboard-page-bg: #ffffff;
  --wallboard-surface: #ffffff;
  --wallboard-surface-soft: #f7f9fa;
  --wallboard-line: #dce4e6;
  --wallboard-ink: #24383f;
  --wallboard-muted: #74858b;
}
body.alarm-wallboard[data-wallboard-theme="offwhite"] {
  --wallboard-page-bg: #f1f3f4;
  --wallboard-surface: #ffffff;
  --wallboard-surface-soft: #f7f9fa;
  --wallboard-line: #d9e2e4;
  --wallboard-ink: #263b42;
  --wallboard-muted: #74858b;
}
body.alarm-wallboard[data-wallboard-theme="blue"] {
  --wallboard-page-bg: #071828;
  --wallboard-surface: #0b2137;
  --wallboard-surface-soft: #0e2943;
  --wallboard-line: #1b3a52;
  --wallboard-ink: #e7f0f2;
  --wallboard-muted: #94aeb5;
}
body.alarm-wallboard[data-wallboard-theme="black"] {
  --wallboard-page-bg: #050607;
  --wallboard-surface: #0d1012;
  --wallboard-surface-soft: #121619;
  --wallboard-line: #242b2f;
  --wallboard-ink: #eef2f3;
  --wallboard-muted: #9aa6aa;
}
body.alarm-wallboard { background: var(--wallboard-page-bg, #f1f3f4); }
body.alarm-wallboard .content-shell { background: var(--wallboard-page-bg, #f1f3f4); }
body.alarm-wallboard .wallboard-bar {
  background: #0b2137;
  border-bottom-color: rgba(255,255,255,.10);
}
body.alarm-wallboard .alarm-event-overview {
  padding: 16px 18px 26px;
  background: var(--wallboard-page-bg, #f1f3f4);
}
body.alarm-wallboard .event-panel-head h2,
body.alarm-wallboard .event-feed-header h3 { color: var(--wallboard-ink, #263b42); }
body.alarm-wallboard .event-panel-head p,
body.alarm-wallboard .event-panel-head .alarm-severity-legend,
body.alarm-wallboard .event-feed-header .result-count { color: var(--wallboard-muted, #74858b); }
body.alarm-wallboard .alarm-state-column,
body.alarm-wallboard .event-feed-panel {
  border-color: var(--wallboard-line, #d9e2e4);
  background: var(--wallboard-surface, #fff);
}
body.alarm-wallboard .alarm-state-header,
body.alarm-wallboard .event-feed-header {
  border-color: var(--wallboard-line, #d9e2e4);
  background: var(--wallboard-surface-soft, #f7f9fa);
}
body.alarm-wallboard .alarm-state-heading strong { color: var(--wallboard-ink, #263b42); }
body.alarm-wallboard .alarm-state-heading span,
body.alarm-wallboard .alarm-state-count { color: var(--wallboard-muted, #74858b); }
body.alarm-wallboard .event-feed-item {
  border-color: var(--wallboard-line, #d9e2e4);
  background: var(--wallboard-surface, #fff);
}
body.alarm-wallboard .event-feed-body > strong { color: var(--wallboard-ink, #263b42); }
body.alarm-wallboard .event-feed-meta,
body.alarm-wallboard .event-feed-side time { color: var(--wallboard-muted, #74858b); }
body.alarm-wallboard .alarm-panel {
  background: var(--wallboard-surface, #fff);
}
body.alarm-wallboard .alarm-table th {
  border-color: var(--wallboard-line, #d9e2e4);
  background: var(--wallboard-surface-soft, #f7f9fa);
  color: var(--wallboard-muted, #74858b);
}
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-view-section-head,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .compact-legend,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-map-footnote {
  border-color: var(--wallboard-line, #d9e2e4);
  background: var(--wallboard-surface, #fff);
}
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-view-section-head h2 { color: var(--wallboard-ink, #263b42); }
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-view-section-head p,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-severity-legend,
body.alarm-wallboard .alarm-view-panel[data-alarm-view-panel="map"] .alarm-map-footnote { color: var(--wallboard-muted, #74858b); }

@media (min-width: 1500px) {
  body.alarm-wallboard .alarm-state-grid { gap: 14px; }
  body.alarm-wallboard .alarm-state-header { min-height: 66px; padding: 12px 14px; }
  body.alarm-wallboard .alarm-state-heading strong { font-size: 13px; }
  body.alarm-wallboard .alarm-panel-client { min-height: 66px; padding: 10px 12px; }
  body.alarm-wallboard .alarm-panel-client-identity strong { font-size: 13px; }
}
@media (max-width: 1180px) {
  .alarm-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wallboard-background-picker-normal > span { display: none; }
  .wallboard-background-picker-normal select { min-width: 48px; }
  .alarm-state-grid { grid-template-columns: 1fr; }
}

/* ========================================================================== 
   Gemelo | Painel de eventos operacional v2
   - painel independente dos filtros da lista/mapa
   - 4 estados por linha em monitores usuais
   - lista de alarmes com rolagem própria
   - wallboard responsivo e sem Chico
   ========================================================================== */

/* O Painel de eventos não possui filtros. Eles continuam disponíveis em Lista/Mapa. */
.alarm-page[data-alarm-view-active="panel"] .alarm-filter-controls {
  display: none !important;
}

.event-panel-head {
  gap: 24px;
  padding: 4px 0 8px;
  align-items: flex-end;
}
.event-panel-copy { min-width: 260px; }
.event-panel-copy h2 {
  margin: 4px 0 4px;
  font-size: 19px;
  letter-spacing: -.025em;
}
.event-panel-copy p { max-width: 720px; }
.event-panel-head .alarm-severity-legend {
  max-width: none;
  margin-left: auto;
  padding-bottom: 2px;
}

/* Grade por UF: quatro estados por linha em desktop/telão. */
.alarm-state-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}
.alarm-state-column {
  height: 100%;
  border-radius: 7px;
  box-shadow: 0 2px 10px rgba(18, 39, 46, .055);
}
.alarm-state-header {
  min-height: 64px;
  padding: 12px 14px;
}
.alarm-state-flag {
  width: 30px;
  height: 20px;
  border-radius: 1px;
}
.alarm-state-heading { gap: 10px; }
.alarm-state-heading strong {
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -.01em;
}
.alarm-state-heading span {
  font-size: 9px;
  letter-spacing: .05em;
}
.alarm-state-count {
  font-size: 9px;
  font-weight: 600;
}
.alarm-state-clients {
  grid-auto-rows: minmax(60px, auto);
  gap: 7px;
  padding: 10px;
}
.alarm-panel-client {
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 2px 7px rgba(11, 31, 38, .10);
  transition: filter .12s ease;
}
.alarm-panel-client:hover {
  transform: none;
  filter: brightness(1.035);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 2px 7px rgba(11, 31, 38, .10);
}
.alarm-panel-client-identity strong {
  font-size: 13px;
  font-weight: 760;
}
.alarm-panel-client-logo {
  width: 32px;
  height: 32px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 4px;
}
.alarm-panel-client-status {
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 8.5px;
  font-weight: 760;
  letter-spacing: .015em;
}
.alarm-panel-client-indicator {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  background: rgba(0,0,0,.14);
  color: #fff;
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}
.alarm-panel-client-indicator i { font-size: 10px; }

/* Lista inferior: cabeçalho fixo e corpo com rolagem própria. */
.event-feed-panel {
  min-width: 0;
  overflow: hidden;
  border-radius: 7px;
}
.event-feed-header {
  min-height: 64px;
  padding: 12px 16px;
}
.event-feed-header h3 {
  margin-top: 2px;
  font-size: 14px;
}
.event-feed-table { min-width: 0; }
.event-feed-columns,
.event-feed-item {
  --event-feed-columns: minmax(82px, .68fr) minmax(210px, 1.6fr) minmax(140px, 1fr) minmax(135px, .92fr) minmax(140px, .92fr) minmax(112px, .8fr) minmax(68px, .5fr) minmax(88px, .62fr);
  display: grid;
  grid-template-columns: var(--event-feed-columns);
  align-items: center;
  gap: 14px;
}
.event-feed-columns {
  min-height: 38px;
  padding: 0 16px;
  border-bottom: 1px solid #e2e9eb;
  background: #f7f9fa;
  color: #7a8b91;
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.event-feed-scroll {
  position: relative;
  max-height: min(420px, 42vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #9ba9ad transparent;
}
.event-feed-scroll::-webkit-scrollbar { width: 9px; }
.event-feed-scroll::-webkit-scrollbar-track { background: transparent; }
.event-feed-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #9ba9ad;
  background-clip: padding-box;
}
.event-feed { display: block; }
.event-feed-item {
  min-height: 58px;
  padding: 9px 16px 9px 18px;
  border-bottom: 1px solid #ebf0f1;
}
.event-feed-item:last-child { border-bottom: 0; }
.event-feed-cell {
  min-width: 0;
  color: #53666d;
  font-size: 10px;
  line-height: 1.35;
}
.event-feed-cell::before { display: none; }
.event-feed-severity-cell { display: flex; align-items: center; }
.event-feed-severity {
  min-width: 78px;
  justify-content: center;
  text-align: center;
}
.event-feed-event-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: #293e45;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-feed-event-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--event-severity, #8a979c);
}
.event-feed-client-cell,
.event-feed-device-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-feed-date-cell time {
  color: #65777d;
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: 9px;
  white-space: nowrap;
}
.event-feed-recognition-cell .recognition {
  white-space: nowrap;
}
.event-feed-state-cell { display: flex; align-items: center; }
.event-feed-action-cell { display: flex; align-items: center; justify-content: center; }
.event-feed-treatment-button {
  width: 100%;
  min-width: 0;
  max-width: 92px;
  min-height: 30px;
  padding-inline: 8px;
}
.event-feed-no-action { color: #9aa7ab; }
.event-feed-empty {
  min-height: 118px;
  border: 0;
  background: transparent;
}

/* Telão: cabeçalho compacto, conteúdo responsivo e atualização via AJAX sem sair do fullscreen. */
body.alarm-wallboard {
  min-width: 0;
  overflow: auto;
}
body.alarm-wallboard .chico-launcher,
body.alarm-wallboard .chico-modal {
  display: none !important;
}
body.alarm-wallboard .wallboard-bar {
  min-height: 70px;
  height: 70px;
  padding: 0 20px;
}
body.alarm-wallboard .wallboard-logo {
  width: 150px;
  min-width: 150px;
  height: 46px;
  padding: 0;
  background: transparent;
}
body.alarm-wallboard .wallboard-logo img {
  width: 150px;
  max-height: 38px;
}
body.alarm-wallboard .wallboard-meta {
  gap: 10px;
  font-size: 17px;
}
body.alarm-wallboard .wallboard-background-picker-dark,
body.alarm-wallboard .wallboard-tool,
body.alarm-wallboard .wallboard-exit {
  height: 40px;
  min-height: 40px;
  border-radius: 5px;
}
body.alarm-wallboard .alarm-event-overview {
  width: 100%;
  min-height: calc(100vh - 70px);
  align-content: start;
  gap: 16px;
  padding: 18px 20px 22px;
}
body.alarm-wallboard .event-panel-head {
  min-height: 76px;
  padding: 0 0 4px;
}
body.alarm-wallboard .event-panel-copy .eyebrow,
body.alarm-wallboard .event-feed-header .eyebrow {
  color: #38a8ff;
}
body.alarm-wallboard .event-panel-copy h2 {
  margin-top: 5px;
  font-size: clamp(20px, 1.45vw, 28px);
  font-weight: 760;
}
body.alarm-wallboard .event-panel-copy p {
  font-size: clamp(9.5px, .72vw, 12px);
}
body.alarm-wallboard .alarm-severity-legend {
  gap: 13px;
  font-size: clamp(8.5px, .62vw, 10.5px);
}
body.alarm-wallboard .alarm-state-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
body.alarm-wallboard .alarm-state-column {
  border-radius: 7px;
  box-shadow: 0 7px 24px rgba(0, 0, 0, .12);
}
body.alarm-wallboard .alarm-state-header {
  min-height: 62px;
  padding: 11px 13px;
}
body.alarm-wallboard .alarm-state-heading strong {
  font-size: clamp(11.5px, .82vw, 14px);
  font-weight: 760;
}
body.alarm-wallboard .alarm-state-heading span,
body.alarm-wallboard .alarm-state-count {
  font-size: clamp(8px, .56vw, 9.5px);
}
body.alarm-wallboard .alarm-state-clients {
  gap: 7px;
  padding: 9px;
}
body.alarm-wallboard .alarm-panel-client {
  min-height: clamp(54px, 5.2vh, 64px);
  padding: 9px 11px;
  border-radius: 6px;
}
body.alarm-wallboard .alarm-panel-client-identity strong {
  font-size: clamp(11.5px, .8vw, 13.5px);
}
body.alarm-wallboard .alarm-panel-client-status {
  font-size: clamp(7.5px, .54vw, 9px);
}
body.alarm-wallboard .alarm-panel-client-indicator {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}
body.alarm-wallboard .event-feed-panel {
  margin-top: 2px;
  border-width: 1px;
  border-style: solid;
  border-radius: 7px;
  box-shadow: 0 7px 24px rgba(0,0,0,.10);
}
body.alarm-wallboard .event-feed-header {
  min-height: 62px;
  padding: 11px 15px;
}
body.alarm-wallboard .event-feed-header h3 {
  font-size: clamp(13px, .86vw, 15px);
}
body.alarm-wallboard .event-feed-columns {
  min-height: 38px;
  border-color: var(--wallboard-line, #24323a);
  background: var(--wallboard-surface-soft, #11171c);
  color: var(--wallboard-muted, #99a8ae);
}
body.alarm-wallboard .event-feed-scroll {
  max-height: clamp(210px, 31vh, 360px);
  scrollbar-color: #687982 transparent;
}
body.alarm-wallboard .event-feed-scroll::-webkit-scrollbar-thumb { background: #687982; background-clip: padding-box; }
body.alarm-wallboard .event-feed-item {
  min-height: 58px;
  border-color: var(--wallboard-line, #24323a);
  background: var(--wallboard-surface, #0d1012);
}
body.alarm-wallboard .event-feed-cell {
  color: var(--wallboard-muted, #9aa6aa);
  font-size: clamp(9px, .65vw, 10.5px);
}
body.alarm-wallboard .event-feed-event-title {
  color: var(--wallboard-ink, #eef2f3);
  font-size: clamp(10px, .72vw, 11.5px);
}
body.alarm-wallboard .event-feed-date-cell time {
  color: var(--wallboard-muted, #9aa6aa);
  font-size: clamp(8px, .58vw, 9.5px);
}
body.alarm-wallboard .event-feed-severity {
  min-width: 78px;
  border: 0;
  color: #fff;
  font-weight: 760;
}
body.alarm-wallboard .event-feed-severity.sev-5 { background: #c51f2b; color: #fff; }
body.alarm-wallboard .event-feed-severity.sev-4 { background: #dd681f; color: #fff; }
body.alarm-wallboard .event-feed-severity.sev-3 { background: #c78c17; color: #fff; }
body.alarm-wallboard .event-feed-severity.sev-2 { background: #4f7ca5; color: #fff; }
body.alarm-wallboard .event-feed-severity.sev-1 { background: #6f94b1; color: #fff; }
body.alarm-wallboard .event-feed-severity.sev-0 { background: #748187; color: #fff; }
body.alarm-wallboard .event-feed-recognition-cell .recognition.pending { color: #f1a20a; }
body.alarm-wallboard .event-feed-recognition-cell .recognition.done { color: #61c790; }
body.alarm-wallboard .event-feed-state-cell .state-badge.alarm-active {
  border-color: rgba(222, 52, 67, .72);
  background: rgba(184, 24, 38, .08);
  color: #ff5a67;
}
body.alarm-wallboard .event-feed-empty { color: var(--wallboard-muted, #9aa6aa); }

/* Paletas refinadas do telão. O cabeçalho permanece azul-marinho para a logo clara. */
body.alarm-wallboard[data-wallboard-theme="black"] {
  --wallboard-page-bg: #030607;
  --wallboard-surface: #091015;
  --wallboard-surface-soft: #0d151b;
  --wallboard-line: #26343c;
  --wallboard-ink: #f2f5f6;
  --wallboard-muted: #9badb4;
}
body.alarm-wallboard[data-wallboard-theme="blue"] {
  --wallboard-page-bg: #061421;
  --wallboard-surface: #0a1c2a;
  --wallboard-surface-soft: #0e2638;
  --wallboard-line: #234256;
  --wallboard-ink: #edf5f7;
  --wallboard-muted: #98b0ba;
}
body.alarm-wallboard[data-wallboard-theme="offwhite"] {
  --wallboard-page-bg: #f3f5f6;
  --wallboard-surface: #ffffff;
  --wallboard-surface-soft: #f6f8f9;
  --wallboard-line: #d8e0e3;
  --wallboard-ink: #263940;
  --wallboard-muted: #74868d;
}
body.alarm-wallboard[data-wallboard-theme="white"] {
  --wallboard-page-bg: #ffffff;
  --wallboard-surface: #ffffff;
  --wallboard-surface-soft: #f8fafb;
  --wallboard-line: #dce3e6;
  --wallboard-ink: #263940;
  --wallboard-muted: #74868d;
}
body.alarm-wallboard .alarm-state-column,
body.alarm-wallboard .event-feed-panel {
  border-color: var(--wallboard-line);
  background: var(--wallboard-surface);
}
body.alarm-wallboard .alarm-state-header,
body.alarm-wallboard .event-feed-header {
  border-color: var(--wallboard-line);
  background: var(--wallboard-surface-soft);
}
body.alarm-wallboard .alarm-state-heading strong,
body.alarm-wallboard .event-feed-header h3 { color: var(--wallboard-ink); }
body.alarm-wallboard .alarm-state-heading span,
body.alarm-wallboard .alarm-state-count,
body.alarm-wallboard .event-feed-header .result-count { color: var(--wallboard-muted); }

/* 1366px continua com quatro UFs por linha. Em monitores menores a grade reduz. */
@media (max-width: 1080px) {
  .alarm-state-grid,
  body.alarm-wallboard .alarm-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-panel-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .event-panel-head .alarm-severity-legend { margin-left: 0; justify-content: flex-start; }

  .event-feed-columns { display: none; }
  .event-feed-item {
    grid-template-columns: 92px minmax(0, 1.55fr) minmax(130px, .8fr) minmax(110px, .72fr);
    grid-template-areas:
      "severity event date action"
      "state client device recognition";
    row-gap: 7px;
    min-height: 76px;
  }
  .event-feed-severity-cell { grid-area: severity; }
  .event-feed-event-cell { grid-area: event; }
  .event-feed-client-cell { grid-area: client; }
  .event-feed-device-cell { grid-area: device; }
  .event-feed-date-cell { grid-area: date; }
  .event-feed-recognition-cell { grid-area: recognition; }
  .event-feed-state-cell { grid-area: state; }
  .event-feed-action-cell { grid-area: action; }
  .event-feed-client-cell::before,
  .event-feed-device-cell::before,
  .event-feed-date-cell::before,
  .event-feed-recognition-cell::before,
  .event-feed-state-cell::before {
    content: attr(data-label) ": ";
    display: inline;
    color: inherit;
    opacity: .68;
    font-size: .82em;
    font-weight: 700;
    text-transform: uppercase;
  }
}

@media (max-width: 720px) {
  .alarm-state-grid,
  body.alarm-wallboard .alarm-state-grid { grid-template-columns: 1fr; }

  body.alarm-wallboard .wallboard-bar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  body.alarm-wallboard .wallboard-logo {
    width: 116px;
    min-width: 116px;
    height: 38px;
  }
  body.alarm-wallboard .wallboard-logo img { width: 116px; max-height: 32px; }
  body.alarm-wallboard .wallboard-meta { gap: 6px; font-size: 14px; }
  body.alarm-wallboard .wallboard-background-picker-dark { padding: 0 6px; }
  body.alarm-wallboard .wallboard-background-picker-dark select { min-width: 72px; }
  body.alarm-wallboard .alarm-event-overview { min-height: 0; padding: 12px; }

  .event-feed-item {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "severity state"
      "event event"
      "client client"
      "device device"
      "date recognition"
      "action action";
    gap: 7px 12px;
    min-height: 0;
    padding: 12px 14px 12px 17px;
  }
  .event-feed-severity-cell,
  .event-feed-state-cell,
  .event-feed-recognition-cell { align-items: center; }
  .event-feed-state-cell { justify-content: flex-end; }
  .event-feed-action-cell { justify-content: flex-start; }
  .event-feed-treatment-button { width: auto; min-width: 92px; }
  .event-feed-event-title { white-space: normal; }
  .event-feed-client-cell,
  .event-feed-device-cell { white-space: normal; }
  .event-feed-scroll,
  body.alarm-wallboard .event-feed-scroll { max-height: 44vh; }
}

/* ==========================================================================
   Gemelo | Ajuste v17.7
   - seletor visual do Painel de eventos no cadastro de clientes
   ========================================================================== */
.modal-client .event-panel-setting-field {
  align-self: stretch;
}
.modal-client .event-panel-toggle {
  position: relative;
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid #d9e3e6;
  border-radius: 7px;
  background: #f8fafb;
  color: #31464d;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.modal-client .event-panel-toggle:hover {
  border-color: #bdced3;
  background: #f4f8f9;
}
.modal-client .event-panel-toggle:focus-within {
  border-color: #6ba9de;
  box-shadow: 0 0 0 3px rgba(42, 137, 217, .12);
}
.modal-client .event-panel-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.modal-client .event-panel-toggle-control {
  position: relative;
  width: 42px;
  height: 24px;
  display: block;
  border: 1px solid #b7c5ca;
  border-radius: 999px;
  background: #d7e0e3;
  transition: border-color .16s ease, background .16s ease;
}
.modal-client .event-panel-toggle-control > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(25, 48, 57, .24);
  transition: transform .16s ease;
}
.modal-client .event-panel-toggle-input:checked + .event-panel-toggle-control {
  border-color: #1d86d5;
  background: #1f8ce0;
}
.modal-client .event-panel-toggle-input:checked + .event-panel-toggle-control > span {
  transform: translateX(18px);
}
.modal-client .event-panel-toggle-copy {
  min-width: 0;
  display: block;
}
.modal-client .event-panel-toggle-copy strong {
  display: block;
  color: #263c44;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.25;
}
.modal-client .event-panel-toggle-copy small {
  display: block;
  margin-top: 3px;
  color: #839299;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.35;
}
.modal-client .event-panel-toggle-input:checked ~ .event-panel-toggle-copy strong {
  color: #156cae;
}
@media (max-width: 560px) {
  .modal-client .event-panel-toggle {
    min-height: 58px;
    padding: 9px 10px;
  }
}


/* ========================================================================== 
   Gemelo | Ajuste v17.8
   - estados com mais de 3 clientes usam duas colunas quando houver largura
   - cards de cliente mais compactos nesse modo
   - cabeçalho do Painel de eventos sem texto descritivo
   ========================================================================== */

/* Cada card de estado decide o layout interno pela própria largura, e não
   apenas pela largura total da tela. Isso evita cards espremidos em monitores
   menores e aproveita o espaço lateral quando ele realmente existe. */
.alarm-state-column {
  container-type: inline-size;
}

.event-panel-head {
  align-items: center;
  padding-top: 2px;
  padding-bottom: 6px;
}
.event-panel-copy h2 {
  margin-bottom: 0;
}

/* Por padrão os clientes continuam em uma coluna. A classe é aplicada pelo JS
   somente quando o estado tem mais de três clientes. */
.alarm-state-clients.is-compact-grid {
  grid-template-columns: 1fr;
}

/* Duas colunas somente quando o próprio card do estado comporta o layout. */
@container (min-width: 360px) {
  .alarm-state-clients.is-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(54px, auto);
  }

  .alarm-state-clients.is-compact-grid .alarm-panel-client {
    min-height: 54px;
    gap: 7px;
    padding: 8px 9px;
  }

  .alarm-state-clients.is-compact-grid .alarm-panel-client-logo {
    width: 27px;
    height: 27px;
    padding: 2px;
  }

  .alarm-state-clients.is-compact-grid .alarm-panel-client-identity {
    gap: 6px;
  }

  .alarm-state-clients.is-compact-grid .alarm-panel-client-identity strong {
    font-size: 11.5px;
  }

  .alarm-state-clients.is-compact-grid .alarm-panel-client-status {
    min-width: 0;
    gap: 5px;
    font-size: 7.7px;
  }

  .alarm-state-clients.is-compact-grid .alarm-panel-client-indicator {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    font-size: 9px;
  }
}

/* No telão a retirada da descrição libera área vertical para os estados. */
body.alarm-wallboard .event-panel-head {
  min-height: 56px;
  padding: 0 0 3px;
}
body.alarm-wallboard .event-panel-copy h2 {
  margin-top: 4px;
  margin-bottom: 0;
}

/* Em telas estreitas, prioridade total à legibilidade: volta para uma coluna
   mesmo que o card isolado fique largo após a quebra da grade de estados. */
@media (max-width: 640px) {
  .alarm-state-clients.is-compact-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================== 
   Gemelo | Ajuste v17.9
   - alertas sonoros e notificação de novos alarmes
   - popup operacional persistente até confirmação do operador
   ========================================================================== */

.alarm-sound-toggle {
  white-space: nowrap;
}
.alarm-sound-toggle.is-active {
  border-color: #8bc89c;
  background: #f1fbf4;
  color: #176c32;
}
.alarm-sound-toggle.needs-activation {
  border-color: #e4bb69;
  background: #fff9ec;
  color: #8a5a00;
}
.alarm-sound-toggle:disabled {
  cursor: default;
  opacity: .78;
}
body.alarm-wallboard .alarm-sound-toggle-wallboard.is-active {
  border-color: rgba(102, 211, 139, .58);
  background: rgba(41, 145, 74, .20);
  color: #d9ffe4;
}
body.alarm-wallboard .alarm-sound-toggle-wallboard.needs-activation {
  border-color: rgba(233, 178, 75, .58);
  background: rgba(183, 117, 13, .16);
  color: #ffe2a0;
}

.alarm-new-alert[hidden] { display: none !important; }
.alarm-new-alert {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 22px;
}
.alarm-new-alert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 5, 9, .80);
  backdrop-filter: blur(5px);
}
.alarm-new-alert-card {
  position: relative;
  width: min(620px, calc(100vw - 36px));
  max-height: min(82vh, 720px);
  overflow: auto;
  border: 1px solid rgba(255, 91, 102, .72);
  border-top: 5px solid #df3844;
  border-radius: 16px;
  background: #0b141b;
  color: #f5f8fa;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .58), 0 0 0 1px rgba(255,255,255,.035) inset;
  padding: 30px 32px 26px;
  text-align: center;
}
.alarm-new-alert-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(223, 56, 68, .17);
  border: 1px solid rgba(255, 100, 111, .38);
  color: #ff5c68;
  font-size: 27px;
  animation: alarm-new-alert-pulse 1.15s ease-in-out infinite;
}
@keyframes alarm-new-alert-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(223, 56, 68, .20); }
  50% { transform: scale(1.045); box-shadow: 0 0 0 11px rgba(223, 56, 68, 0); }
}
.alarm-new-alert-kicker {
  display: block;
  color: #ff6a74;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}
.alarm-new-alert-card h2 {
  margin: 7px 0 6px;
  color: #fff;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.12;
}
.alarm-new-alert-card > p {
  margin: 0 0 18px;
  color: #aebdc6;
  font-size: 13px;
}
.alarm-new-alert-list {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  text-align: left;
}
.alarm-new-alert-item {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 9px 12px;
  border: 1px solid #263842;
  border-left-width: 4px;
  border-radius: 9px;
  background: #101d25;
}
.alarm-new-alert-item.sev-5 { border-left-color: #df3844; }
.alarm-new-alert-item.sev-4 { border-left-color: #df7131; }
.alarm-new-alert-item.sev-3 { border-left-color: #d3992b; }
.alarm-new-alert-item.sev-2 { border-left-color: #6589aa; }
.alarm-new-alert-item.sev-1 { border-left-color: #7899b2; }
.alarm-new-alert-item.sev-0 { border-left-color: #8a979c; }
.alarm-new-alert-item .severity-badge {
  width: 100%;
  justify-content: center;
}
.alarm-new-alert-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.alarm-new-alert-item strong {
  overflow: hidden;
  color: #f7fafb;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alarm-new-alert-item small {
  color: #81949f;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
}
.alarm-new-alert-more {
  padding: 7px 10px;
  color: #9babb4;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.alarm-new-alert-ok {
  min-width: 180px;
  min-height: 45px;
  justify-content: center;
  border: 1px solid #e04a55;
  background: #d83340;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(216, 51, 64, .22);
}
.alarm-new-alert-ok:hover,
.alarm-new-alert-ok:focus-visible {
  border-color: #ef6872;
  background: #e13c48;
  color: #fff;
}
.alarm-new-alert-card > small:last-child {
  display: block;
  margin-top: 10px;
  color: #83949d;
  font-size: 9.5px;
}

@media (max-width: 640px) {
  .alarm-new-alert { padding: 12px; }
  .alarm-new-alert-card {
    width: min(100%, 520px);
    max-height: 90vh;
    padding: 24px 18px 20px;
  }
  .alarm-new-alert-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 9px;
    padding: 8px 9px;
  }
  .alarm-new-alert-item strong { white-space: normal; }
}

/* v18.0 - painéis operacionais por domínio e associação por cliente */
.operational-panel-catalog{display:grid;gap:12px}.operational-panel-card{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;padding:18px;border:1px solid #dfe7ee;border-radius:16px;background:#fff;box-shadow:0 7px 22px rgba(15,23,42,.045)}.operational-panel-card-icon{display:grid;place-items:center;width:54px;height:54px;border-radius:14px;background:#eaf3fa;color:#1769aa;font-size:20px}.operational-panel-card-copy h2{margin:2px 0 3px;font-size:18px}.operational-panel-card-copy p{margin:0;color:#748494;font-size:12px}.operational-panel-card-meta{display:flex;gap:15px;margin-top:9px;font-size:11px;color:#66798a}.operational-panel-card-meta i{margin-right:4px;color:#3c718f}.panel-catalog-divider{display:flex;align-items:center;gap:12px;margin:28px 0 16px;color:#738394;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.panel-catalog-divider:before,.panel-catalog-divider:after{content:"";height:1px;flex:1;background:#dce5ec}.client-panel-access-section{background:linear-gradient(180deg,#fbfdff,#f7fafc)}.client-domain-field{max-width:620px}.input-prefix{display:flex;align-items:center;border:1px solid #cfd8e1;border-radius:9px;background:#fff;overflow:hidden}.input-prefix:focus-within{border-color:#397aa5;box-shadow:0 0 0 3px rgba(57,122,165,.11)}.input-prefix>span{display:flex;align-items:center;align-self:stretch;padding:0 11px;border-right:1px solid #e2e8ee;background:#f5f8fa;color:#607487;font-weight:700}.input-prefix input{border:0!important;box-shadow:none!important;border-radius:0!important;flex:1}.client-panel-selector-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.client-panel-option{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:10px;padding:11px 12px;border:1px solid #dce5ec;border-radius:11px;background:#fff;cursor:pointer;transition:.15s ease}.client-panel-option:hover{border-color:#9db8cb;background:#fbfdff}.client-panel-option:has(input:checked){border-color:#4385af;background:#f0f7fc;box-shadow:inset 0 0 0 1px rgba(67,133,175,.08)}.client-panel-option input{width:16px;height:16px;accent-color:#1769aa}.client-panel-option-icon{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:#eaf3fa;color:#1769aa}.client-panel-option strong,.client-panel-option small{display:block}.client-panel-option strong{font-size:12px;color:#253c4e}.client-panel-option small{margin-top:2px;font-size:10px;color:#7b8b99;line-height:1.25}.client-panel-empty{grid-column:1/-1;padding:14px;border:1px dashed #ccd7df;border-radius:10px;color:#768796;font-size:11px}.client-panel-empty i{margin-right:6px}.client-panel-empty code{font-size:10px}.modal-client{max-width:900px}@media(max-width:860px){.operational-panel-card{grid-template-columns:auto 1fr}.operational-panel-card-action{grid-column:1/-1}.client-panel-selector-grid{grid-template-columns:1fr}}@media(max-width:560px){.operational-panel-card{grid-template-columns:1fr}.operational-panel-card-icon{width:44px;height:44px}}

/* CMMS — técnicos pré-alocados por cliente e corretiva na conclusão da tratativa. */
.client-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.client-technician-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
}
.client-technician-summary strong { color: #29464e; font-size: .79rem; }
.client-technician-summary span { color: #718188; font-size: .7rem; line-height: 1.35; }
.client-technician-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.client-technician-option {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid #dfe7e9;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.client-technician-option:hover { border-color: #a9c8c3; background: #f8fbfa; }
.client-technician-option input { margin: 0; }
.client-technician-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef5f4;
  color: #34766d;
}
.client-technician-option > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.client-technician-option strong { color: #29464e; font-size: .79rem; overflow-wrap: anywhere; }
.client-technician-option small { color: #7a898e; font-size: .68rem; overflow-wrap: anywhere; }
.client-technician-stale {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #eadfbf;
  border-radius: 8px;
  background: #fffaf0;
  color: #7e672d;
  font-size: .74rem;
}

.treatment-wizard-corrective .treatment-corrective-intro {
  max-width: 720px;
  margin: -2px 0 14px;
  color: #65777d;
  font-size: .8rem;
  line-height: 1.55;
}
.treatment-corrective-section.is-decision-step {
  margin-top: 0;
  padding: 18px;
  border-color: #cfdfe1;
  background: #fbfdfd;
}
.treatment-corrective-choices.is-required-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.treatment-corrective-choices.is-required-choice label {
  min-height: 48px;
  min-width: 0;
  font-size: .81rem;
}

.treatment-corrective-section {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #dce6e7;
  border-radius: 11px;
  background: #fafcfc;
}
.treatment-corrective-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.treatment-corrective-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef5f4;
  color: #28766b;
}
.treatment-corrective-heading > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.treatment-corrective-heading span { color: #73848a; font-size: .67rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.treatment-corrective-heading strong { color: #203c43; font-size: .91rem; }
.treatment-corrective-heading small { color: #6d7d82; font-size: .73rem; line-height: 1.4; }
.treatment-corrective-choices { display: flex; gap: 8px; margin-top: 13px; }
.treatment-corrective-choices label {
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid #d9e2e4;
  border-radius: 8px;
  background: #fff;
  color: #3e5960;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}
.treatment-corrective-choices label:has(input:checked) { border-color: #8dbeb5; background: #f1f8f6; color: #24675d; }
.treatment-corrective-choices label.is-disabled { opacity: .48; cursor: not-allowed; }
.treatment-corrective-choices input { margin: 0; }
.treatment-corrective-technicians { margin-top: 13px; padding-top: 13px; border-top: 1px solid #e1e8e9; }
.treatment-corrective-technicians-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 9px; }
.treatment-corrective-technicians-head strong { color: #29464e; font-size: .8rem; }
.treatment-corrective-technicians-head span { color: #718187; font-size: .71rem; line-height: 1.4; }
.treatment-technician-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.treatment-technician-option {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid #dce5e7;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.treatment-technician-option:hover { border-color: #a7c7c1; }
.treatment-technician-option input { position: absolute; opacity: 0; pointer-events: none; }
.treatment-technician-check {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd8da;
  border-radius: 6px;
  color: transparent;
  background: #fff;
  font-size: .66rem;
}
.treatment-technician-option:has(input:checked) { border-color: #9cc9c1; background: #f4faf8; }
.treatment-technician-option:has(input:checked) .treatment-technician-check { border-color: #278f80; background: #278f80; color: #fff; }
.treatment-technician-option > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.treatment-technician-option strong { color: #2a4850; font-size: .78rem; overflow-wrap: anywhere; }
.treatment-technician-option small { color: #7b898e; font-size: .67rem; overflow-wrap: anywhere; }
.treatment-corrective-warning,
.treatment-corrective-created {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: .74rem;
}
.treatment-corrective-warning { border: 1px solid #eadfbd; background: #fffaf0; color: #7b652c; }
.treatment-corrective-warning.compact { padding: 8px 10px; }
.treatment-corrective-created { border: 1px solid #cde5df; background: #f1f8f6; color: #29675d; }
.treatment-corrective-created > div { display: flex; flex-direction: column; gap: 2px; }
.treatment-corrective-created strong { font-size: .79rem; }
.treatment-corrective-created span { color: #68807b; font-size: .7rem; }
.treatment-corrective-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 11px; }
.treatment-corrective-detail-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border: 1px solid #e0e7e9; border-radius: 8px; background: #fbfcfc; }
.treatment-corrective-detail-grid span,
.treatment-corrective-technicians-list > span { color: #718188; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.treatment-corrective-detail-grid strong { color: #29464e; font-size: .78rem; overflow-wrap: anywhere; }
.treatment-corrective-technicians-list { margin-bottom: 12px; }
.treatment-corrective-technicians-list > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.treatment-corrective-technicians-list > div > span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; background: #f0f5f5; color: #476068; font-size: .72rem; }

@media (max-width: 720px) {
  .client-technician-selector-grid,
  .treatment-technician-grid,
  .treatment-corrective-detail-grid { grid-template-columns: 1fr; }
  .treatment-corrective-choices { display: grid; grid-template-columns: 1fr 1fr; }
  .treatment-corrective-choices label { min-width: 0; }
}

/* =========================================================
   Clientes / Sites corporativos
   ========================================================= */
.site-page-header { margin-bottom: 18px; }
.site-console {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.site-tree-panel {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.site-tree-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}
.site-tree-heading h2 { margin: 2px 0 0; font-size: 1.08rem; }
.site-tree-total { color: #75858a; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.site-tree-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 0 11px;
  border: 1px solid #dce5e7;
  border-radius: 9px;
  background: #f9fbfb;
  color: #7b8b90;
}
.site-tree-search input {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .78rem;
}
.site-tree {
  min-height: 150px;
  overflow: auto;
  padding: 0 8px 14px;
  border-top: 1px solid #edf1f2;
}
.site-tree-branch { padding-top: 10px; }
.site-tree-branch[hidden], .site-tree-item[hidden] { display: none; }
.site-tree-branch-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: #5c7076;
}
.site-tree-branch-icon {
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: #f1f5f5;
  color: #789096;
}
.site-tree-branch-icon img { width: 100%; height: 100%; object-fit: cover; }
.site-tree-branch-header > div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.site-tree-branch-header strong { overflow: hidden; font-size: .72rem; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.site-tree-branch-header small { color: #94a0a4; font-size: .63rem; }
.site-tree-items { display: grid; gap: 2px; }
.site-tree-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 48px;
  margin-left: calc(var(--site-depth, 0) * 13px);
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #435a61;
  text-decoration: none;
}
.site-tree-item:hover { background: #f6f9f9; border-color: #e5ebec; }
.site-tree-item.active { background: #edf6f4; border-color: #cfe2de; }
.site-tree-connector { width: 10px; height: 18px; border-left: 1px solid #dce4e6; border-bottom: 1px solid #dce4e6; border-radius: 0 0 0 4px; }
.site-tree-item-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #f0f4f4; color: #6f858b; font-size: .72rem; }
.site-tree-item.active .site-tree-item-icon { background: #dceeea; color: #2f786d; }
.site-tree-item-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.site-tree-item-copy strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.site-tree-item-copy small { overflow: hidden; color: #8a999d; font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.site-tree-empty, .site-workspace-empty, .site-empty-section {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 36px 22px;
  color: #7c8d92;
  text-align: center;
}
.site-tree-empty i, .site-workspace-empty i, .site-empty-section i { font-size: 1.6rem; color: #a3b0b4; }
.site-tree-empty strong, .site-workspace-empty h2, .site-empty-section strong { margin: 0; color: #465e65; }
.site-tree-empty span, .site-workspace-empty p, .site-empty-section span { margin: 0; font-size: .74rem; }

.site-workspace { min-width: 0; display: grid; gap: 14px; }
.site-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}
.site-identity-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.site-logo-frame {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dce5e7;
  border-radius: 13px;
  background: #f7f9f9;
  color: #71868c;
  font-size: .92rem;
  font-weight: 800;
}
.site-logo-frame img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.site-identity-copy { min-width: 0; }
.site-identity-path { display: flex; align-items: center; gap: 6px; color: #7e8e93; font-size: .68rem; }
.site-identity-path img { width: 22px; height: 15px; object-fit: cover; border-radius: 3px; }
.site-identity-copy h2 { margin: 4px 0 6px; color: #263f46; font-size: 1.35rem; }
.site-identity-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; color: #6f8288; font-size: .68rem; }
.site-identity-meta span { display: inline-flex; align-items: center; gap: 5px; }
.site-monitoring-link-summary {
  min-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  padding-left: 18px;
  border-left: 1px solid #e3e9ea;
}
.site-monitoring-link-summary > span { color: #849398; font-size: .63rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.site-monitoring-link-summary a { display: inline-flex; align-items: center; gap: 7px; color: #2c7268; font-size: .78rem; font-weight: 750; text-decoration: none; }
.site-monitoring-link-summary a:hover { text-decoration: underline; }
.site-section-nav { display: flex; gap: 4px; padding: 6px; }
.site-section-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 7px; color: #5e7278; font-size: .74rem; font-weight: 700; text-decoration: none; }
.site-section-nav a:hover { background: #f3f7f7; color: #2d555d; }

.site-section { scroll-margin-top: 88px; padding: 20px; }
.site-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.site-section-heading h3 { margin: 3px 0; color: #2b444b; font-size: 1.06rem; }
.site-section-heading p { margin: 0; color: #75868b; font-size: .73rem; line-height: 1.45; }
.site-readonly-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #dde5e7; border-radius: 7px; background: #f8fafa; color: #72858b; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.site-overview-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.site-overview-facts > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px 11px; border: 1px solid #e2e8e9; border-radius: 8px; background: #fafcfc; }
.site-overview-facts span { color: #829196; font-size: .61rem; font-weight: 700; text-transform: uppercase; }
.site-overview-facts strong { overflow: hidden; color: #40595f; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.site-form-block { margin: 0; padding: 16px 0; border: 0; border-top: 1px solid #edf0f1; border-radius: 0; }
.site-form-block:first-of-type { border-top: 0; }
.site-details-form .form-grid .span-2 { grid-column: span 2; }
.site-logo-editor { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 16px; }
.site-logo-editor .image-preview-box { width: 130px; height: 82px; }
.site-logo-editor .image-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.site-logo-editor-fields { display: grid; gap: 9px; }
.site-section-actions { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f1; }
.compact-notice { margin: 0 0 12px; padding: 10px 12px; font-size: .73rem; }

.site-sla-table-wrap { overflow-x: auto; border: 1px solid #e0e7e8; border-radius: 9px; }
.site-sla-table { width: 100%; border-collapse: collapse; }
.site-sla-table th { padding: 10px 12px; background: #f7f9f9; color: #6d8086; font-size: .65rem; letter-spacing: .035em; text-align: left; text-transform: uppercase; }
.site-sla-table td { padding: 11px 12px; border-top: 1px solid #e8edee; vertical-align: middle; }
.sla-level { display: inline-flex; align-items: center; min-width: 90px; padding: 6px 8px; border-radius: 6px; background: #f3f6f6; color: #526970; font-size: .72rem; font-weight: 750; }
.sla-level-b { border-left: 3px solid #94a9a5; }
.sla-level-m { border-left: 3px solid #c5a75b; }
.sla-level-a { border-left: 3px solid #c27c4e; }
.sla-level-ma { border-left: 3px solid #aa5c5c; }
.sla-time-field { display: grid; grid-template-columns: minmax(80px, 110px) minmax(100px, 135px); gap: 7px; }
.sla-time-field input, .sla-time-field select { min-width: 0; height: 36px; }

.preventive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.preventive-card { min-width: 0; padding: 14px; border: 1px solid #dfe7e8; border-radius: 10px; background: #fff; }
.preventive-card.is-inactive { opacity: .68; }
.preventive-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #edf1f2; }
.preventive-card-head > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.preventive-card-head strong { overflow: hidden; color: #314d54; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.preventive-card-head > span { color: #788a8f; font-size: .64rem; font-weight: 700; }
.preventive-card-recurrence { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 11px 0; color: #597076; font-size: .7rem; }
.preventive-card-recurrence i { color: #5b8e84; }
.preventive-card-recurrence strong { color: #38565d; }
.preventive-card-recurrence span { color: #829297; }
.preventive-card-details { display: grid; gap: 7px; margin: 0; }
.preventive-card-details > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 9px; }
.preventive-card-details dt { color: #87969a; font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.preventive-card-details dd { min-width: 0; margin: 0; color: #526970; font-size: .69rem; overflow-wrap: anywhere; }
.preventive-card-details dd span { color: #a0aaad; }
.preventive-card-comment { margin: 11px 0 0; padding: 9px 10px; border-radius: 7px; background: #f7f9f9; color: #65797f; font-size: .68rem; line-height: 1.45; white-space: pre-line; }
.status-dot.is-off { background: #9aa8ac; box-shadow: none; }

@media (max-width: 1180px) {
  .site-console { grid-template-columns: 260px minmax(0, 1fr); }
  .site-overview-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preventive-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .site-console { grid-template-columns: 1fr; }
  .site-tree-panel { position: static; max-height: 420px; }
  .site-identity { align-items: flex-start; flex-direction: column; }
  .site-monitoring-link-summary { width: 100%; min-width: 0; align-items: flex-start; padding: 12px 0 0; border-top: 1px solid #e3e9ea; border-left: 0; }
}
@media (max-width: 620px) {
  .site-section { padding: 15px; }
  .site-section-nav { overflow-x: auto; }
  .site-section-nav a { white-space: nowrap; }
  .site-overview-facts { grid-template-columns: 1fr; }
  .site-details-form .form-grid.cols-2 { grid-template-columns: 1fr; }
  .site-details-form .form-grid .span-2 { grid-column: auto; }
  .site-logo-editor { grid-template-columns: 1fr; }
  .site-section-heading { flex-direction: column; }
  .sla-time-field { grid-template-columns: 90px 110px; }
  .preventive-card-details > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ========================================================================== 
   Clientes / Sites — listagem e ficha corporativa
   ========================================================================== */
.clients-page { display: grid; gap: 18px; }
.clients-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.clients-page-header h1 { margin: 0; color: var(--ink-strong); font-size: 27px; line-height: 1.15; letter-spacing: -.025em; }
.clients-page-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.clients-count { color: #718087; font-size: 11px; font-weight: 600; }

.clients-list-panel { overflow: hidden; }
.clients-list-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.clients-search {
  width: min(560px, 100%);
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #849197;
}
.clients-search:focus-within { border-color: #8fbce8; box-shadow: 0 0 0 3px rgba(24,143,255,.08); }
.clients-search i { font-size: 12px; }
.clients-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.clients-search input::placeholder { color: #9aa6aa; }
.clients-visible-count { color: #7a888e; font-size: 11px; white-space: nowrap; }
.clients-table-wrap { min-height: 180px; }
.clients-table { table-layout: auto; }
.clients-table th { height: 42px; padding: 0 16px; font-size: 10px; }
.clients-table td { height: 64px; padding: 10px 16px; font-size: 12px; }
.clients-table-row { cursor: pointer; outline: 0; }
.clients-table-row:hover td,
.clients-table-row:focus td { background: #f8fbfd; }
.clients-table-row:focus td:first-child { box-shadow: inset 3px 0 0 var(--brand-strong); }
.clients-table-action { width: 42px; text-align: right !important; }
.clients-table-action i { color: #a3afb3; font-size: 10px; }
.clients-site-cell { min-width: 230px; display: flex; align-items: center; gap: 12px; }
.clients-site-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid #dce5e8;
  border-radius: 6px;
  background: #f5f8f9;
  color: #4e6570;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .025em;
}
.clients-site-cell > div,
.clients-location-cell > div { min-width: 0; }
.clients-site-cell strong,
.clients-location-cell strong { display: block; overflow: hidden; color: #24363d; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.clients-site-cell span:not(.clients-site-avatar),
.clients-location-cell span { display: block; margin-top: 3px; overflow: hidden; color: #88969b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.clients-location-cell { min-width: 135px; display: flex; align-items: center; gap: 9px; }
.clients-location-cell img { width: 22px; height: 15px; flex: 0 0 auto; border: 1px solid #dde4e6; border-radius: 2px; object-fit: cover; }
.clients-value { color: #55666d; font-size: 11px; white-space: nowrap; }
.clients-status {
  max-width: 230px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid #dbe4e6;
  border-radius: 4px;
  background: #f8fafb;
  color: #66777e;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.clients-status-linked { border-color: #cde2e7; background: #f2f9fb; color: #356d7c; }
.clients-status-linked i { font-size: 9px; }
.clients-status-active { border-color: #c8e1d7; background: #f2faf6; color: #2b755d; }
.clients-status-neutral { color: #7d898e; }
.clients-monitoring-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #78868b;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.clients-monitoring-state i { font-size: 14px; }
.clients-monitoring-state.is-active { color: #23815f; }
.clients-monitoring-state.is-off { color: #9aa5a9; }
.client-monitoring-readonly { min-height: 34px; display: flex; align-items: center; }
.clients-empty { padding: 38px 18px; color: #7d8b90; font-size: 12px; text-align: center; }

.client-detail-topbar { min-height: 26px; display: flex; align-items: center; }
.client-back-link { display: inline-flex; align-items: center; gap: 8px; color: #53676f; font-size: 11px; font-weight: 600; }
.client-back-link:hover { color: var(--brand-strong); }
.client-back-link i { font-size: 10px; }
.client-detail-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 20px;
}
.client-detail-identity { min-width: 0; display: flex; align-items: center; gap: 15px; }
.client-detail-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dbe4e7;
  border-radius: 7px;
  background: #f5f8f9;
  color: #4d6470;
  font-size: 14px;
  font-weight: 700;
}
.client-detail-logo.has-image { background: #fff; }
.client-detail-logo img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.client-detail-title { min-width: 0; }
.client-detail-path { display: flex; align-items: center; gap: 7px; color: #7d8b90; font-size: 10px; }
.client-detail-path img { width: 22px; height: 15px; border: 1px solid #dce4e6; border-radius: 2px; object-fit: cover; }
.client-detail-title h1 { margin: 4px 0 6px; overflow: hidden; color: var(--ink-strong); font-size: 22px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.client-detail-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; color: #76868c; font-size: 10px; }
.client-detail-location { display: inline-flex; align-items: center; gap: 6px; }
.client-detail-state-flag { width: 18px; height: 12px; border: 1px solid #dce4e6; border-radius: 2px; object-fit: cover; }
.client-detail-monitoring {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.client-detail-monitoring > span { color: #88969b; font-size: 9px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.client-detail-monitoring a,
.client-detail-monitoring strong { color: #40565e; font-size: 11px; font-weight: 650; }
.client-detail-monitoring a { display: inline-flex; align-items: center; gap: 7px; color: #356f7f; }
.client-detail-monitoring a:hover { text-decoration: underline; }

.client-detail-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 14px; }
.client-detail-tabs button {
  position: relative;
  min-height: 48px;
  padding: 0 15px;
  border: 0;
  background: transparent;
  color: #6e7d83;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.client-detail-tabs button:hover { color: #31484f; }
.client-detail-tabs button.active { color: #162a31; }
.client-detail-tabs button.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--brand-strong); }
.client-tab-count {
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid #d5e0e4;
  border-radius: 999px;
  background: #f4f7f8;
  color: #61767f;
  font-size: 8.5px;
  font-weight: 750;
  line-height: 1;
  vertical-align: middle;
}
.client-detail-tabs button.active .client-tab-count {
  border-color: #bdd6e6;
  background: #eef7fc;
  color: #286d98;
}
.client-tab-panel { display: block; }

.client-overview-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .72fr); gap: 14px; }
.client-overview-side { min-width: 0; display: grid; align-content: start; gap: 14px; }
.client-form-card { padding: 20px; }
.client-form-card-main { min-width: 0; }
.client-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.client-card-heading h2 { margin: 0; color: #263a42; font-size: 14px; font-weight: 700; }
.client-card-heading p { margin: 4px 0 0; color: #849197; font-size: 10px; }
.client-readonly { padding: 4px 7px; border: 1px solid #dfe6e8; border-radius: 4px; background: #f9fbfb; color: #7a898e; font-size: 9px; font-weight: 600; white-space: nowrap; }
.client-facts-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: #fafcfc; }
.client-facts-row > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); }
.client-facts-row > div:last-child { border-right: 0; }
.client-facts-row span { display: block; color: #89969b; font-size: 9px; font-weight: 600; }
.client-facts-row strong { display: block; margin-top: 4px; overflow: hidden; color: #40535a; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.client-form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid #edf1f2; }
.client-form-section h3 { margin: 0 0 13px; color: #40545b; font-size: 11px; font-weight: 700; }
.client-form-grid { gap: 11px; }
.client-correlated-picker { height: 176px; }
.client-correlated-picker .choice-row { min-height: 38px; padding: 8px 11px; }
.client-form-grid .span-2 { grid-column: span 2; }
.client-notes-section textarea { min-height: 142px; resize: vertical; }
.client-form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.client-form-actions.inline { margin-top: 16px; }
.client-logo-editor { display: grid; gap: 13px; }
.client-logo-preview {
  width: 100%;
  min-height: 104px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cfdadd;
  border-radius: 6px;
  background: #f9fbfb;
  color: #6d8087;
  font-size: 16px;
  font-weight: 700;
}
.client-logo-preview.has-image { border-style: solid; background: #fff; }
.client-detail-logo-empty { border-color: #d7e0e3; background: #f4f7f8; color: #9aa8ad; }
.client-detail-logo-empty i { font-size: 16px; }
.client-logo-preview img { width: 100%; height: 102px; padding: 9px; object-fit: contain; }
.client-field-note { display: block; margin-top: 6px; color: #8a969b; font-size: 9px; }
.client-secondary-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: #376f7e; font-size: 10px; font-weight: 600; }
.client-secondary-link:hover { text-decoration: underline; }
.client-secondary-link i { font-size: 8px; }

.client-detail-section { padding: 20px; }
.client-section-heading { margin-bottom: 16px; }
.client-feature-unavailable { padding: 12px; border: 1px solid #e1e7e9; border-radius: 5px; background: #fafcfc; color: #7c898e; font-size: 10px; line-height: 1.45; }
.client-feature-unavailable-large { min-height: 120px; display: grid; place-items: center; text-align: center; }
.client-sla-table-wrap,
.client-preventive-table-wrap { border: 1px solid var(--line); border-radius: 6px; }
.client-sla-table th,
.client-preventive-table th { height: 40px; font-size: 10px; }
.client-sla-table td,
.client-preventive-table td { font-size: 11px; }
.client-sla-field { display: grid; grid-template-columns: minmax(76px, 110px) minmax(100px, 130px); gap: 7px; }
.client-sla-field input,
.client-sla-field select { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: #405159; font-size: 11px; }
.client-sla-field input { width: 100%; padding: 0 9px; }
.client-sla-field select { padding: 0 27px 0 9px; }
.client-urgency { min-width: 84px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border: 1px solid #dfe6e8; border-radius: 4px; background: #f8fafb; color: #5b6c73; font-size: 10px; font-weight: 650; }
.client-urgency-b { border-color: #c9e2d9; background: #f3faf7; color: #2e765f; }
.client-urgency-m { border-color: #e5ddbd; background: #fffaf0; color: #8a6a16; }
.client-urgency-a { border-color: #ebd0bd; background: #fff7f1; color: #995a2d; }
.client-urgency-ma { border-color: #ebc5c8; background: #fff4f5; color: #a33c45; }
.client-inline-help { margin: 9px 0 0; color: #87949a; font-size: 9px; }
.client-preventive-table td { vertical-align: top; }
.client-preventive-table td:first-child { min-width: 190px; }
.client-preventive-table td:nth-child(2) { min-width: 170px; }
.client-preventive-table td:nth-child(3),
.client-preventive-table td:nth-child(4) { min-width: 150px; }

@media (max-width: 1100px) {
  .client-overview-grid { grid-template-columns: 1fr; }
  .client-overview-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-facts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-facts-row > div:nth-child(2) { border-right: 0; }
  .client-facts-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .clients-page-header,
  .clients-list-toolbar,
  .client-detail-header { align-items: flex-start; flex-direction: column; }
  .clients-search { width: 100%; }
  .client-detail-monitoring { width: 100%; min-width: 0; align-items: flex-start; padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .client-detail-tabs { overflow-x: auto; }
  .client-detail-tabs button { white-space: nowrap; }
  .client-overview-side { grid-template-columns: 1fr; }
  .client-facts-row { grid-template-columns: 1fr; }
  .client-facts-row > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .client-facts-row > div:last-child { border-bottom: 0; }
  .client-form-grid.cols-2 { grid-template-columns: 1fr; }
  .client-form-grid .span-2 { grid-column: auto; }
  .client-sla-field { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PGC — seletor corporativo de Sites e logotipos na listagem
   ========================================================================== */
.clients-site-avatar.has-image {
  overflow: hidden;
  background: #fff;
}
.clients-site-avatar.has-image img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
}

.site-context-picker {
  position: relative;
  z-index: 330;
  height: 100%;
  display: flex;
  align-items: center;
}
.site-context-toggle {
  min-width: 178px;
  max-width: 220px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 4px;
  background: rgba(255,255,255,.035);
  color: #eaf2f3;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.site-context-toggle:hover,
.site-context-picker.is-open .site-context-toggle {
  border-color: rgba(255,255,255,.19);
  background: rgba(255,255,255,.075);
}
.site-context-toggle:disabled {
  cursor: default;
  opacity: .68;
}
.site-context-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: rgba(53,194,224,.1);
  color: #6bd4e8;
  font-size: 11px;
}
.site-context-current {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.site-context-current small {
  margin-bottom: 4px;
  color: #82969d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.site-context-current strong {
  overflow: hidden;
  color: #f0f6f7;
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-context-chevron {
  flex: 0 0 auto;
  color: #758b92;
  font-size: 8px;
  transition: transform .15s ease;
}
.site-context-picker.is-open .site-context-chevron { transform: rotate(180deg); }

.site-context-dropdown {
  position: absolute;
  z-index: 420;
  top: calc(100% - 8px);
  right: 0;
  width: 390px;
  overflow: hidden;
  border: 1px solid #d6e0e3;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(6,28,34,.2);
  color: #263940;
}
.site-context-head {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid #e3e9eb;
  background: #fbfcfc;
}
.site-context-head > div { min-width: 0; display: flex; flex-direction: column; }
.site-context-head strong { color: #263940; font-size: 11px; font-weight: 700; }
.site-context-head span:not(.site-context-stale) {
  margin-top: 3px;
  overflow: hidden;
  color: #849198;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-context-stale {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid #ead9ae;
  border-radius: 3px;
  background: #fff9e9;
  color: #8a6d24;
  font-size: 8px;
  font-weight: 700;
}
.site-context-search {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 11px;
  padding: 0 10px;
  border: 1px solid #d6e0e3;
  border-radius: 4px;
  background: #fff;
  color: #8a989d;
}
.site-context-search:focus-within {
  border-color: #98bfdc;
  box-shadow: 0 0 0 3px rgba(24,143,255,.07);
}
.site-context-search i { font-size: 10px; }
.site-context-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #31454c;
  font-size: 11px;
}
.site-context-search input::placeholder { color: #9aa7ac; }
.site-context-tree {
  max-height: min(500px, calc(100vh - 155px));
  overflow-y: auto;
  border-top: 1px solid #edf1f2;
  padding: 5px 0;
  scrollbar-width: thin;
}
.site-context-row-form { margin: 0; }
.site-context-row {
  width: 100%;
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px calc(11px + (var(--site-depth, 0) * 17px));
  border: 0;
  background: #fff;
  color: #43575e;
  text-align: left;
}
button.site-context-row { cursor: pointer; }
button.site-context-row:hover { background: #f4f8fa; color: #213940; }
.site-context-row.active {
  background: #eef7fb;
  color: #174e63;
  box-shadow: inset 3px 0 0 #1aa6c7;
}
.site-context-row-structural {
  background: #fafcfc;
  color: #687a81;
}
.site-context-row-structural .site-context-node-copy strong { font-weight: 700; }
.site-context-node-icon {
  width: 20px;
  height: 18px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: #82949a;
  font-size: 10px;
}
.site-context-node-icon img {
  width: 20px;
  height: 13px;
  border: 1px solid #dce3e5;
  border-radius: 2px;
  object-fit: cover;
}
.site-context-node-copy { min-width: 0; flex: 1 1 auto; }
.site-context-node-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-context-check { flex: 0 0 auto; color: #1586a2; font-size: 9px; }
.site-context-empty { padding: 22px 14px; color: #809096; font-size: 10px; text-align: center; }

@media (max-width: 1480px) {
  .site-context-toggle { min-width: 152px; max-width: 180px; }
}
@media (max-width: 1220px) {
  .site-context-toggle { min-width: 138px; max-width: 155px; }
  .site-context-icon { display: none; }
}
@media (max-width: 1120px) {
  .site-context-dropdown { top: calc(100% - 4px); right: 0; }
}
@media (max-width: 620px) {
  .site-context-toggle { min-width: 112px; max-width: 132px; }
  .site-context-current small { display: none; }
  .site-context-dropdown {
    position: fixed;
    top: 58px;
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* ========================================================================== 
   PGC — Clientes v6: Global, mapa, campos adicionais e logos reais
   ========================================================================== */
.clients-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.clients-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #d9e2e5;
  border-radius: 6px;
  background: #f6f8f9;
}
.clients-view-switch button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #74848a;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}
.clients-view-switch button:hover { color: #31474f; }
.clients-view-switch button.active {
  background: #fff;
  color: #273d45;
  box-shadow: 0 1px 3px rgba(20,40,48,.08);
}
.clients-view-switch button i { font-size: 10px; }

.clients-site-avatar-empty {
  border-color: #d9e1e4;
  background: #f4f7f8;
  color: #9aa8ad;
}
.clients-site-avatar-empty i { font-size: 13px; }
.clients-table-row-global td { background: #fbfdfe; }
.clients-table-row-global:hover td,
.clients-table-row-global:focus td { background: #f4fafc; }
.clients-table-row-global td:first-child { box-shadow: inset 3px 0 0 #2d8097; }
.clients-global-badge,
.site-context-global-badge,
.site-context-global-inline {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  overflow: visible !important;
  margin: 0 0 0 7px !important;
  padding: 2px 6px;
  border: 1px solid #bfdbe3;
  border-radius: 999px;
  background: #eef8fb;
  color: #24657a !important;
  font-size: 8px !important;
  font-weight: 750 !important;
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.clients-global-badge-large { transform: translateY(-2px); }
.client-global-warning {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid #c9dee5;
  border-radius: 7px;
  background: #f4fafc;
  color: #315b69;
}
.client-global-warning > i {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4f3f7;
  color: #24748b;
  font-size: 13px;
}
.client-global-warning strong,
.client-global-warning span { display: block; }
.client-global-warning strong { color: #274a55; font-size: 11px; }
.client-global-warning span { margin-top: 2px; color: #64808a; font-size: 10px; }

.client-segmented-choice {
  display: inline-flex;
  padding: 2px;
  border: 1px solid #d6e0e3;
  border-radius: 6px;
  background: #f6f8f9;
}
.client-segmented-choice label { margin: 0; cursor: pointer; }
.client-segmented-choice input { position: absolute; opacity: 0; pointer-events: none; }
.client-segmented-choice span {
  min-width: 54px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 4px;
  color: #708086;
  font-size: 10px;
  font-weight: 650;
}
.client-segmented-choice input:checked + span {
  background: #fff;
  color: #263d45;
  box-shadow: 0 1px 3px rgba(20,40,48,.09);
}
.client-segmented-choice input:disabled + span { opacity: .65; cursor: default; }

.clients-map-panel { overflow: hidden; }
.clients-map-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.clients-map-toolbar strong,
.clients-map-toolbar span { display: block; }
.clients-map-toolbar strong { color: #2d424a; font-size: 12px; }
.clients-map-toolbar > div > span { margin-top: 3px; color: #86949a; font-size: 9px; }
.clients-map-state-filter { display: flex; align-items: center; gap: 9px; }
.clients-map-state-filter > span { color: #7d8b90; font-size: 9px; font-weight: 650; text-transform: uppercase; }
.clients-map-state-filter select {
  min-width: 185px;
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid #d5dfe2;
  border-radius: 5px;
  background: #fff;
  color: #43575e;
  font-size: 10px;
}
.clients-map-canvas { width: 100%; height: min(610px, calc(100vh - 250px)); min-height: 430px; background: #eef2f2; }
.clients-map-footer {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  color: #859399;
  font-size: 9px;
}
.clients-map-footer i { margin-right: 6px; color: #6e838b; }
.leaflet-attribution-flag {
  display: none !important;
  vertical-align: baseline !important;
  width: 1em !important;
  height: .6669em !important;
}
.clients-map-div-icon {
  display: grid !important;
  place-items: center;
  background: transparent !important;
  border: 0 !important;
}
.clients-map-marker {
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 2px 9px rgba(21,47,58,.28);
}
.clients-map-marker.has-logo {
  width: 56px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 8px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: calc(100% - 10px) calc(100% - 8px);
  box-shadow: 0 2px 10px rgba(21,47,58,.30), 0 0 0 1px rgba(57,82,91,.10);
}
.clients-map-marker.has-logo.is-loading {
  background-image: none !important;
  background-color: #f7f9fa;
}
.clients-map-marker.has-logo.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid #d8e1e4;
  border-top-color: #6c8791;
  border-radius: 50%;
  animation: clients-map-logo-spin .7s linear infinite;
}
@keyframes clients-map-logo-spin { to { transform: rotate(360deg); } }
.clients-map-marker.no-logo {
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #f4f7f8;
  color: #8f9da2;
}
.clients-map-marker.no-logo i { font-size: 12px; }
.clients-map-tooltip { border: 0 !important; border-radius: 5px !important; box-shadow: 0 3px 12px rgba(18,42,52,.18) !important; }
.clients-map-tooltip strong,
.clients-map-tooltip span { display: block; }
.clients-map-tooltip strong { color: #2d424a; font-size: 10px; }
.clients-map-tooltip span { margin-top: 2px; color: #7b8a90; font-size: 9px; }

.site-context-icon-logo,
.site-context-icon-state,
.site-context-node-icon.has-site-logo,
.site-context-node-icon.is-state {
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
}
.site-context-icon-logo img,
.site-context-icon-state img,
.site-context-node-icon .site-context-site-logo,
.site-context-node-icon .site-context-state-flag {
  width: 100%;
  height: 100%;
  padding: 2px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}
.site-context-node-icon.is-placeholder,
.site-context-icon-placeholder {
  border: 1px solid #d7e0e3;
  background: #f3f6f7;
  color: #9aa8ad;
}
.site-context-node-icon.is-placeholder i,
.site-context-icon-placeholder i { font-size: 9px; }
.site-context-node-icon.is-global { color: #34798e; }
.site-context-node-copy strong { display: flex; align-items: center; min-width: 0; }
.site-context-global-badge { flex: 0 0 auto; margin-left: 6px !important; padding: 2px 5px; font-size: 7px !important; }
.site-context-current strong { display: flex; align-items: center; min-width: 0; }
.site-context-global-inline { flex: 0 0 auto; margin-left: 5px !important; padding: 1px 4px; border-color: rgba(165,216,230,.55); background: rgba(79,163,187,.16); color: #c9eef6 !important; font-size: 6.5px !important; }

@media (max-width: 760px) {
  .clients-header-actions { width: 100%; justify-content: flex-start; }
  .clients-map-toolbar { align-items: stretch; flex-direction: column; }
  .clients-map-state-filter { justify-content: space-between; }
  .clients-map-state-filter select { flex: 1 1 auto; }
  .clients-map-canvas { min-height: 390px; }
}

/* ========================================================================== 
   PGC — clientes por região + nome operacional do monitoramento
   ========================================================================== */
.clients-region-filter {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #75858b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.clients-region-filter select {
  width: 100%;
  min-height: 39px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #40535b;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  outline: 0;
}
.clients-region-filter select:focus {
  border-color: #8fbce8;
  box-shadow: 0 0 0 3px rgba(24,143,255,.08);
}
.clients-region-row td {
  height: 31px !important;
  padding: 0 16px !important;
  border-top: 1px solid #dfe8eb;
  border-bottom: 1px solid #e7edef;
  background: #f5f8fa;
}
.clients-region-row span {
  display: inline-flex;
  align-items: center;
  color: #50656e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.clients-region-row[hidden] { display: none; }
.client-panel-display-name-field { margin-top: 14px; }

@media (max-width: 900px) {
  .clients-region-filter {
    width: 100%;
    min-width: 0;
  }
}


/* ========================================================================== 
   Header compacto/responsivo + atribuição Leaflet
   ========================================================================== */
.topbar-inner {
  width: min(calc(100% - 24px), var(--content));
  grid-template-columns: 108px minmax(0,1fr) auto;
  column-gap: 6px;
}
.brand {
  width: 98px;
  min-width: 0;
  height: 42px;
  margin: 0;
}
.brand img {
  width: 98px;
  max-width: 98px;
  max-height: 30px;
}
.nav-primary {
  min-width: 0;
  justify-content: center;
  gap: 0;
}
.nav-primary > a,
.nav-primary-placeholder,
.nav-menu-toggle {
  padding-left: 9px;
  padding-right: 9px;
  gap: 6px;
}
.nav-primary > a,
.nav-primary-placeholder,
.nav-menu-toggle {
  font-size: 11px;
}
.nav-menu-settings.active::after {
  left: 8px;
  right: 8px;
}
.account-area {
  gap: 7px;
  padding-left: 8px;
}

/* O stylesheet do Leaflet é carregado depois do app.css; maior especificidade
   garante que a bandeira de atribuição permaneça oculta mesmo com !important. */
html body .leaflet-control-attribution .leaflet-attribution-flag {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 1380px) and (min-width: 1121px) {
  .topbar-inner {
    grid-template-columns: 96px minmax(0,1fr) auto;
  }
  .brand,
  .brand img {
    width: 88px;
  }
  .brand img { max-width: 88px; max-height: 28px; }
  .nav-primary > a,
  .nav-primary-placeholder,
  .nav-menu-toggle {
    padding-left: 7px;
    padding-right: 7px;
    gap: 5px;
    font-size: 10.5px;
  }
  .nav-primary > a i,
  .nav-primary-placeholder > i,
  .nav-menu-toggle > i:first-child { font-size: 11px; }
  .site-context-toggle {
    min-width: 150px;
    max-width: 172px;
  }
  .account-area { gap: 6px; padding-left: 6px; }
  .account-copy-name-only { display: none; }
}

@media (max-width: 1120px) {
  .topbar-inner { grid-template-columns: 1fr auto; column-gap: 0; }
  .nav-primary { justify-content: flex-start; }
  .brand { width: 96px; height: 60px; margin-left: 14px; padding-left: 0; }
  .brand img { width: 96px; max-width: 96px; max-height: 29px; }
  .nav-primary > a,
  .nav-primary-placeholder,
  .nav-menu-toggle { flex: 0 0 auto; }
  .nav-menu-settings .nav-dropdown { right: 12px; left: auto; }
}

/* Auditoria: filtros e identificação explícita do recurso alterado */
.audit-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(130px, .75fr)) minmax(122px, .58fr) minmax(122px, .58fr) auto auto;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dce5e7;
  background: #f8fafb;
}
.audit-filter-search { min-width: 0; align-self: end; }
.audit-filter-field { min-width: 0; display: grid; gap: 4px; }
.audit-filter-field > span { color: #7f8e93; font-size: 7.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.audit-filter-field .control { width: 100%; min-width: 0; height: 34px; }
.audit-filter-date .control { padding-inline: 8px; font-size: 9px; }
.audit-filter-clear { height: 34px; align-self: end; white-space: nowrap; }
.audit-filter-count { align-self: center; justify-self: end; white-space: nowrap; }
.audit-date-cell { white-space: nowrap; }
.audit-resource-cell { min-width: 180px; max-width: 320px; }
.audit-resource-type { display: block; margin-bottom: 3px; color: #859399; font-size: 7.5px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.audit-resource-name { display: block; max-width: 100%; overflow: hidden; color: #2c4249; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.audit-description { min-width: 260px; max-width: 620px; color: #52646a; line-height: 1.45; }
.audit-description-main { color: #52646a; }
.audit-change-summary { margin-top: 5px; color: #61757c; font-size: 8.5px; line-height: 1.4; }
.audit-change-summary strong { color: #31484f; font-weight: 700; }
.audit-change-details { margin-top: 5px; }
.audit-change-details > summary { width: max-content; cursor: pointer; color: var(--brand-strong); font-size: 8.5px; font-weight: 650; list-style: none; }
.audit-change-details > summary::-webkit-details-marker { display: none; }
.audit-change-details > summary::before { content: "+"; display: inline-block; width: 12px; margin-right: 3px; font-weight: 800; }
.audit-change-details[open] > summary::before { content: "−"; }
.audit-change-list { display: grid; gap: 4px; margin-top: 6px; padding: 7px 8px; border: 1px solid #e0e7e9; border-radius: 4px; background: #fafcfc; }
.audit-change-row { display: grid; grid-template-columns: minmax(115px, .65fr) minmax(0, 1.6fr); gap: 8px; align-items: start; }
.audit-change-field { color: #6d7e84; font-size: 8px; font-weight: 700; }
.audit-change-values { display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); gap: 5px; align-items: center; color: #334950; font-size: 8.5px; }
.audit-change-values > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-change-values > span:first-child { color: #7b898e; text-decoration: line-through; text-decoration-thickness: 1px; }
.audit-change-values i { color: #9aa8ac; font-size: 7px; text-align: center; }
.audit-action-activate,.audit-action-login,.audit-action-renew,.audit-action-start,.audit-action-complete,.audit-action-sign { border-color: #bfe2d5; background: #f0faf6; color: #287458; }
.audit-action-deactivate,.audit-action-logout { border-color: #e4d3d3; background: #fbf5f5; color: #875151; }
.audit-action-view,.audit-action-download,.audit-action-execute { border-color: #d4deea; background: #f5f8fc; color: #526f8b; }

/* Aviso de expiração da sessão autenticada */
.session-expiry-dialog { width: min(460px, calc(100vw - 28px)); }
.session-expiry-header { padding-bottom: 12px; }
.session-expiry-body { display: grid; gap: 8px; padding-top: 18px; padding-bottom: 18px; }
.session-expiry-body p { margin: 0; color: #53666c; font-size: 10px; line-height: 1.55; }
.session-expiry-body p + p { color: #263c43; font-weight: 650; }
.session-expiry-countdown { display: inline-block; min-width: 42px; color: var(--brand-strong); font-family: "Roboto Mono",Consolas,monospace; font-size: 11px; text-align: center; }
.session-expiry-error { margin: 4px 0 0; }
.session-expiry-footer form { margin: 0; }

@media (max-width: 1500px) {
  .audit-filter-grid { grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(125px, .7fr)) minmax(118px, .55fr) minmax(118px, .55fr); }
  .audit-filter-clear { grid-column: 1 / 2; justify-self: start; }
  .audit-filter-count { grid-column: -2 / -1; justify-self: end; }
}
@media (max-width: 1050px) {
  .audit-filter-grid { grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(150px, 1fr)); }
  .audit-filter-search { grid-column: 1 / -1; }
  .audit-filter-clear,.audit-filter-count { grid-column: auto; }
}
@media (max-width: 680px) {
  .audit-filter-grid { grid-template-columns: 1fr 1fr; }
  .audit-filter-search { grid-column: 1 / -1; }
  .audit-filter-field:not(.audit-filter-date) { grid-column: 1 / -1; }
  .audit-filter-clear { justify-self: start; }
  .audit-filter-count { justify-self: end; }
  .session-expiry-footer { align-items: stretch; flex-direction: column-reverse; }
  .session-expiry-footer form,.session-expiry-footer .button { width: 100%; }
}

/* ==========================================================================
   Privacy + essential cookies v19.0
   ========================================================================== */
.privacy-link-button,
.cookie-policy-link {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.privacy-link-button:hover,
.cookie-policy-link:hover { color: var(--brand-strong); }
.app-footer > .privacy-link-button { flex: 0 0 auto; color: #718188; font-weight: 600; }

.cookie-notice {
  right: 18px;
  bottom: 18px;
  width: min(calc(100% - 36px), 760px);
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid #d6e0e3;
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(4, 25, 32, .16);
}
.cookie-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #edf8f6;
  color: var(--brand-strong);
  font-size: 14px;
}
.cookie-copy { min-width: 0; }
.cookie-copy strong {
  color: #2c4249;
  font-size: 11px;
  line-height: 1.3;
}
.cookie-copy span {
  margin-top: 3px;
  color: #718188;
  font-size: 9.5px;
  line-height: 1.45;
}
.cookie-policy-link {
  color: #51666e;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.privacy-policy-dialog {
  width: min(96vw, 980px);
  max-width: 980px;
  max-height: min(92vh, 940px);
}
.privacy-policy-header {
  align-items: flex-start;
  padding: 18px 22px 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfc 100%);
}
.privacy-policy-header > div:first-child { min-width: 0; }
.privacy-policy-header h2 { margin-top: 3px; font-size: 18px; letter-spacing: -.015em; }
.privacy-policy-header p {
  margin: 5px 0 0;
  color: #819096;
  font-size: 9.5px;
  font-weight: 650;
}
.privacy-policy-modal-body { padding: 0 24px 24px; }
.privacy-policy-content { color: #60737a; }
.privacy-policy-intro { padding: 22px 0 20px; }
.privacy-policy-intro > p {
  max-width: 820px;
  margin: 15px 0 0;
  color: #53676f;
  font-size: 11.5px;
  line-height: 1.65;
}
.privacy-owner-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #dce6e8;
  border-radius: 7px;
  background: #f8fbfb;
}
.privacy-owner-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eaf7f5;
  color: var(--brand-strong);
  font-size: 14px;
}
.privacy-owner-mark strong,
.privacy-owner-mark span { display: block; }
.privacy-owner-mark strong { color: #263d45; font-size: 12px; }
.privacy-owner-mark span { margin-top: 3px; color: #718188; font-size: 9.5px; line-height: 1.4; }
.privacy-policy-intro .legal-meta {
  margin: 12px 0 0;
  padding: 0;
  color: #91a0a5;
  font-size: 9px;
}
.privacy-policy-content section {
  padding: 18px 0;
  border-top: 1px solid #e5ebed;
}
.privacy-policy-content section h2 {
  margin: 0 0 8px;
  color: #2c434b;
  font-size: 11px;
  line-height: 1.4;
}
.privacy-policy-content section p {
  margin: 0;
  color: #687a81;
  font-size: 10.5px;
  line-height: 1.68;
}
.privacy-policy-content section p + p { margin-top: 8px; }
.privacy-policy-content section a { color: var(--brand-strong); font-weight: 700; }
.privacy-policy-footer { justify-content: space-between; }
.privacy-policy-footer > span {
  color: #839298;
  font-size: 9px;
  font-weight: 600;
}

.legal-content > .privacy-policy-content .privacy-policy-intro { padding-top: 12px; }
.legal-content > .privacy-policy-content section { padding: 23px 0; }
.legal-content > .privacy-policy-content section h2 { font-size: 14px; }
.legal-content > .privacy-policy-content section p { font-size: 12.5px; line-height: 1.72; }
.legal-content > .privacy-policy-content .privacy-policy-intro > p { font-size: 12.5px; }
.legal-content > .privacy-policy-content .privacy-owner-mark strong { font-size: 13px; }
.legal-content > .privacy-policy-content .privacy-owner-mark span { font-size: 10.5px; }

@media (max-width: 760px) {
  .cookie-notice {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .cookie-icon { width: 38px; height: 38px; }
  .cookie-policy-link,
  .cookie-notice > .button { grid-column: 2; justify-self: start; }
  .privacy-policy-dialog { width: 100%; max-width: none; max-height: 94vh; }
  .privacy-policy-header { padding: 16px 16px 14px; }
  .privacy-policy-modal-body { padding: 0 16px 18px; }
  .privacy-policy-footer { align-items: stretch; flex-direction: column; }
  .privacy-policy-footer > .button { width: 100%; }
  .privacy-policy-footer > span { line-height: 1.45; }
  .privacy-owner-mark { align-items: flex-start; }
}




/* Login slider certification badge */
.login-certification-badge {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 11;
  display: block;
  width: clamp(38px, 3.2vw, 48px);
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(3, 15, 28, .28));
}
.login-certification-badge[hidden] { display: none !important; }
.login-certification-badge img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
@media (max-width: 768px) {
  .login-certification-badge {
    right: 14px;
    bottom: 14px;
    width: 36px;
  }
}

/* Indicadores: dropdown extenso no menu principal */
.nav-dropdown-indicators {
  max-height: calc(100vh - 74px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.nav-dropdown-indicators .nav-dropdown-disabled-compact { min-height: 40px; }
@media (max-width: 980px) {
  .nav-dropdown-indicators { max-height: calc(100vh - 118px); }
}

/* Monitoramento configurável por subgrupos */
.panel-section-field{min-width:180px}.monitor-section-stack{display:grid;gap:18px}.monitor-runtime-section{background:#fff;border:1px solid #dfe6e9;border-radius:10px;overflow:hidden;box-shadow:0 2px 8px rgba(10,28,38,.04)}.monitor-runtime-section>header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #edf1f3;background:linear-gradient(180deg,#fff,#f8fafb)}.monitor-runtime-section>header h2{margin:1px 0 0;font-size:16px;color:#26383e;text-transform:uppercase;letter-spacing:.025em}.monitor-runtime-section .monitor-widget-grid{padding:14px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}.monitor-section-summary{font-size:11px;font-weight:700;color:#177c62;background:#e7f6f1;border:1px solid #c8eadf;border-radius:999px;padding:5px 9px}.monitor-section-summary.has-alarm{color:#a72f36;background:#fdecee;border-color:#f6c9cd}.monitor-widget-card.threshold-normal .monitor-widget-state{background:#e7f6f1;color:#177c62}.monitor-widget-card.threshold-warning .monitor-widget-state{background:#fff4dc;color:#9b6a08}.monitor-widget-card.threshold-critical .monitor-widget-state{background:#fdecee;color:#b4333c}.monitor-widget-footer{display:flex!important;align-items:center;justify-content:space-between;gap:8px}.monitor-history-button{border:0;background:transparent;color:#405b66;font:inherit;font-size:10px;font-weight:700;cursor:pointer;padding:4px 6px;border-radius:5px}.monitor-history-button:hover{background:#eef3f5;color:#172d36}.panel-history-modal[hidden]{display:none}.panel-history-modal{position:fixed;inset:0;z-index:2500;display:grid;place-items:center;padding:24px}.panel-history-backdrop{position:absolute;inset:0;background:rgba(5,17,24,.6)}.panel-history-dialog{position:relative;width:min(960px,96vw);background:#fff;border-radius:12px;box-shadow:0 24px 70px rgba(0,0,0,.24);padding:18px}.panel-history-dialog>header{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #e7ecee;padding-bottom:12px}.panel-history-dialog h2{margin:2px 0 0;font-size:18px}.panel-history-close{border:0;background:#f1f4f5;width:34px;height:34px;border-radius:7px;cursor:pointer}.panel-history-range{display:flex;gap:6px;padding:12px 0}.panel-history-range button{border:1px solid #d7e0e4;background:#fff;padding:6px 10px;border-radius:6px;font-size:11px;font-weight:700;cursor:pointer}.panel-history-range button.active{background:#01013b;color:#fff;border-color:#01013b}.panel-history-chart{height:380px}.panel-history-note{font-size:10px;color:#76868d;margin-top:10px}.client-panel-dashboard-field select{width:100%}@media(max-width:700px){.monitor-runtime-section>header{align-items:flex-start;gap:8px;flex-direction:column}.panel-history-modal{padding:8px}.panel-history-dialog{width:100%;padding:12px}.panel-history-chart{height:300px}}

/* Painéis configuráveis com múltiplos dispositivos */
.panel-host-picker-multi .panel-config-field{min-width:min(760px,100%)}
.panel-host-picker-multi select[multiple]{min-height:210px;padding:8px;background-image:none}
.panel-host-picker-multi select[multiple] option{padding:8px 10px;border-radius:6px}
.panel-metric-host{display:flex;align-items:center;gap:6px;color:var(--text-muted,#667085);font-size:12px;margin-top:3px}
.panel-metric-host i{font-size:11px}

/* ==========================================================================
   Monitoramento — modo telão / estilo inspirado na operação legado
   ========================================================================== */
.monitor-view-actions { flex-wrap: wrap; }
.monitor-view-actions .button.is-muted { opacity: .78; }
.monitor-panel-shell-inspired {
  position: relative;
  border: 1px solid #d5dee1;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(243,246,247,.96)),
    repeating-linear-gradient(90deg, rgba(76,88,97,.03) 0 2px, transparent 2px 42px),
    linear-gradient(145deg, #eef2f3 0%, #f9fbfb 100%);
  box-shadow: 0 10px 28px rgba(7, 23, 31, .08);
}
.monitor-panel-shell-inspired.has-alarm {
  box-shadow: 0 10px 28px rgba(140, 20, 30, .12), inset 0 0 0 1px rgba(214,61,72,.16);
}
.monitor-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid #dde6e8;
  background: linear-gradient(180deg, rgba(248,250,251,.96), rgba(238,243,244,.92));
}
.monitor-panel-mode-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #49616b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.monitor-section-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.monitor-runtime-section {
  background: rgba(255,255,255,.88);
  border: 1px solid #d8e0e3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(9,28,38,.05);
}
.monitor-runtime-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e4ecee;
  background: linear-gradient(180deg, #fbfcfc, #f0f4f5);
}
.monitor-runtime-section > header h2 {
  margin: 2px 0 0;
  color: #203740;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.monitor-section-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cbe6db;
  background: #eaf8f2;
  color: #17744f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.monitor-section-summary.has-alarm {
  border-color: #f2bec3;
  background: #fdecef;
  color: #ab2732;
}
.monitor-section-body { padding: 12px; }
.monitor-status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.monitor-status-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(60px, .6fr) minmax(110px, .72fr) minmax(112px, .9fr);
  align-items: stretch;
  gap: 0;
  border: 1px solid #d8e0e3;
  border-radius: 8px;
  overflow: hidden;
  background: #fafcfc;
}
.monitor-status-row > div {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
}
.monitor-status-row .monitor-status-label {
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(180deg, #8d8f93, #6f7277);
  color: #fff;
}
.monitor-status-row .monitor-status-label strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
}
.monitor-status-row .monitor-status-label .eyebrow {
  color: rgba(255,255,255,.78);
  margin-bottom: 4px;
}
.monitor-status-reading {
  background: #f1f4f5;
  color: #223740;
  font-size: 22px;
  font-weight: 800;
}
.monitor-status-reading small {
  font-size: 12px;
  font-weight: 700;
  color: #6e838a;
  margin-left: 4px;
}
.monitor-status-badge {
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
}
.monitor-status-meta {
  flex-direction: column;
  gap: 5px;
  background: #fbfcfc;
  color: #667b83;
  font-size: 10px;
  text-align: center;
}
.monitor-status-row.is-normal .monitor-status-badge { background: #11bf11; }
.monitor-status-row.is-warning .monitor-status-badge { background: #f0b11e; }
.monitor-status-row.is-critical .monitor-status-badge { background: #e03a45; }
.monitor-status-row.is-critical { border-color: rgba(224,58,69,.34); }
.monitor-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.monitor-status-list + .monitor-widget-grid { margin-top: 12px; }
.monitor-widget-card {
  min-width: 0;
  min-height: 240px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid #d7e0e2;
  border-radius: 10px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 8px rgba(8,31,37,.035);
  overflow: hidden;
}
.monitor-widget-card.has-threshold {
  box-shadow: inset 0 4px 0 var(--metric-state-color), 0 2px 8px rgba(8,31,37,.035);
}
.monitor-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #ecf0f1;
}
.monitor-widget-head h2 {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.32;
  color: #1f3138;
}
.monitor-widget-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.monitor-widget-card.threshold-normal .monitor-widget-state { background: #e8f8ef; color: #167552; }
.monitor-widget-card.threshold-warning .monitor-widget-state { background: #fff5de; color: #97660b; }
.monitor-widget-card.threshold-critical .monitor-widget-state { background: #fdecee; color: #b12d37; }
.monitor-widget-visual {
  min-height: 132px;
  display: grid;
  place-items: center;
  padding: 8px 14px 14px;
}
.dashboard-value-visual {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.dashboard-value-main {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  color: #183039;
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 900;
  line-height: 1;
}
.dashboard-value-main small {
  font-size: 16px;
  font-weight: 700;
  color: #6e838a;
}
.monitor-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid #edf1f3;
  color: #71848b;
  font-size: 10px;
}
.monitor-history-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #2e4a54;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 5px;
}
.monitor-history-button:hover { background: #eef3f5; color: #172d36; }
.monitor-history-button.compact { padding: 3px 6px; }
.monitor-alert-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid rgba(185, 122, 18, .28);
  background: linear-gradient(180deg, #ffab31, #f28700);
  color: #fff;
}
.monitor-alert-ticker .label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.monitor-alert-ticker .items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.monitor-alert-ticker .items span {
  position: relative;
  padding-left: 12px;
  font-size: 11px;
  font-weight: 700;
}
.monitor-alert-ticker .items span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  transform: translateY(-50%);
}
.monitor-panel-shell-inspired.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.monitor-panel-shell-inspired.is-fullscreen .monitor-section-stack {
  flex: 1 1 auto;
  overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  align-content: start;
}
.monitor-panel-shell-inspired.is-fullscreen .monitor-runtime-section > header h2 { font-size: 20px; }
.monitor-panel-shell-inspired.is-fullscreen .monitor-status-row { grid-template-columns: minmax(220px,1.8fr) minmax(80px,.7fr) minmax(130px,.8fr) minmax(130px,1fr); }
.monitor-panel-shell-inspired.is-fullscreen .monitor-status-row > div { min-height: 58px; }
.monitor-panel-shell-inspired.is-fullscreen .monitor-status-reading { font-size: 26px; }
.monitor-panel-shell-inspired.is-fullscreen .monitor-widget-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.monitor-panel-shell-inspired.is-fullscreen .dashboard-value-main { font-size: clamp(42px, 5vw, 70px); }
.panel-monitor-fullscreen .page-body,
.panel-monitor-fullscreen .content-body,
.panel-monitor-fullscreen .page-wrapper { background: #f2f4f5; }
@media (max-width: 1180px) {
  .monitor-status-row { grid-template-columns: minmax(180px, 1.4fr) 80px 110px; }
  .monitor-status-meta { display: none; }
}
@media (max-width: 860px) {
  .monitor-panel-toolbar { flex-direction: column; align-items: flex-start; }
  .monitor-section-stack { grid-template-columns: 1fr; }
  .monitor-status-row { grid-template-columns: 1.5fr .8fr .8fr; }
}
@media (max-width: 620px) {
  .monitor-status-row {
    grid-template-columns: 1fr;
  }
  .monitor-status-row > div {
    min-height: auto;
    justify-content: flex-start;
  }
  .monitor-status-badge {
    width: 100%;
    justify-content: center !important;
    min-height: 46px;
  }
  .monitor-status-reading { font-size: 18px; }
  .monitor-widget-grid { grid-template-columns: 1fr; }
}

/* Refinamento HMI/OT: superfícies neutras; cor reservada para estado/anomalia. */
.monitor-panel-shell-inspired {
  border-radius: 8px;
  background: #eceff0;
  box-shadow: none;
}
.monitor-panel-toolbar {
  min-height: 42px;
  padding: 8px 12px;
  background: #e3e7e9;
  border-bottom-color: #cfd8dc;
}
.monitor-panel-mode-hint { color: #586970; }
.monitor-section-stack {
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 12px;
  padding: 12px;
}
.monitor-runtime-section {
  border-radius: 6px;
  border-color: #cfd8dc;
  background: #f7f8f8;
  box-shadow: none;
}
.monitor-runtime-section > header {
  min-height: 48px;
  padding: 9px 12px;
  background: #dde2e4;
  border-bottom-color: #c9d2d6;
}
.monitor-runtime-section > header .eyebrow { display: none; }
.monitor-runtime-section > header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .035em;
  color: #24343a;
}
.monitor-section-summary {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 3px;
  background: #eef2f0;
  border-color: #cad7d1;
  color: #1f7656;
  font-size: 9px;
}
.monitor-section-summary.has-alarm {
  background: #d83d47;
  border-color: #c5313b;
  color: #fff;
}
.monitor-section-body { padding: 10px; }
.monitor-status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.monitor-status-row {
  position: relative;
  grid-template-columns: minmax(0,1fr) 88px 34px;
  min-height: 58px;
  border: 1px solid #cbd4d7;
  border-radius: 3px;
  background: #f8f9f9;
  overflow: hidden;
}
.monitor-status-row > div {
  min-height: 58px;
  padding: 8px 10px;
}
.monitor-status-row .monitor-status-label {
  background: #666d71;
  color: #fff;
}
.monitor-status-row .monitor-status-label .eyebrow {
  display: block;
  margin: 0 0 3px;
  color: rgba(255,255,255,.66);
  font-size: 8px;
  letter-spacing: .05em;
}
.monitor-status-row .monitor-status-label strong {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .01em;
}
.monitor-status-badge {
  min-width: 88px;
  padding: 0 8px !important;
  font-size: 11px;
  letter-spacing: .04em;
}
.monitor-status-row.is-normal .monitor-status-badge {
  background: #19ad54;
  color: #fff;
}
.monitor-status-row.is-warning .monitor-status-badge {
  background: #d99a17;
  color: #1c1c1c;
}
.monitor-status-row.is-critical .monitor-status-badge {
  background: #d82d3b;
  color: #fff;
}
.monitor-status-row.is-critical {
  border-color: #bd2530;
  box-shadow: inset 3px 0 0 #bd2530;
}
.monitor-history-icon {
  width: 34px;
  min-width: 34px;
  min-height: 100%;
  border: 0;
  border-left: 1px solid #d4dcdf;
  border-radius: 0;
  background: #eef1f2;
  color: #4e626a;
  cursor: pointer;
  font-size: 12px;
}
.monitor-history-icon:hover,
.monitor-history-icon:focus-visible {
  background: #dde5e8;
  color: #172c34;
}
.monitor-widget-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 220px));
  justify-content: start;
  gap: 10px;
  margin-top: 10px;
}
.monitor-widget-card {
  aspect-ratio: 1 / 1;
  min-height: 0;
  width: 100%;
  border-radius: 4px;
  border-color: #cbd4d7;
  background: #fafbfb;
  box-shadow: none;
}
.monitor-widget-card.has-threshold {
  box-shadow: inset 0 3px 0 var(--metric-state-color);
}
.monitor-widget-head {
  min-height: 54px;
  padding: 9px 10px 8px;
  border-bottom-color: #dfe5e7;
  background: #f0f3f4;
}
.monitor-widget-head .eyebrow {
  color: #677b82;
  font-size: 7.5px;
  letter-spacing: .045em;
}
.monitor-widget-head h2 {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}
.monitor-widget-head .monitor-history-icon {
  min-height: 32px;
  height: 32px;
  width: 32px;
  min-width: 32px;
  border: 1px solid #d2dade;
  border-radius: 3px;
  background: #fff;
}
.monitor-widget-visual {
  min-height: 0;
  padding: 4px 8px;
}
.dashboard-gauge {
  width: 100%;
  max-height: 118px;
}
.dashboard-gauge-value-text {
  font-size: 30px;
  font-weight: 800;
  fill: #1e323a;
}
.dashboard-gauge-unit,
.dashboard-gauge-bound { fill: #6a7c83; }
.dashboard-gauge-bg { fill: #dce3e5; }
.dashboard-gauge-needle { stroke: #22363e; stroke-width: 3; }
.dashboard-gauge-center { fill: #22363e; }
.monitor-widget-footer {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 8px;
  background: #f5f7f7;
}
.monitor-widget-footer .monitor-widget-state {
  border-radius: 2px;
  padding: 3px 6px;
  font-size: 8px;
}
.monitor-widget-card.threshold-normal .monitor-widget-state {
  background: #e8f2ed;
  color: #1b7556;
}
.monitor-widget-card.threshold-warning .monitor-widget-state {
  background: #f5e6be;
  color: #805f13;
}
.monitor-widget-card.threshold-critical .monitor-widget-state {
  background: #f3d5d8;
  color: #a22630;
}
.monitor-alert-ticker {
  padding: 7px 12px;
  background: #c46d00;
  border-top: 1px solid #a85d00;
}
.monitor-alert-ticker .label { font-size: 9px; }
.monitor-alert-ticker .items span { font-size: 9px; }
.monitor-panel-shell-inspired.has-alarm {
  box-shadow: none;
  border-color: #b92d37;
}
.monitor-panel-shell-inspired.is-fullscreen {
  background: #e8eced;
}
.monitor-panel-shell-inspired.is-fullscreen .monitor-section-stack {
  grid-template-columns: repeat(auto-fit, minmax(470px, 1fr));
  padding: 10px;
}
.monitor-panel-shell-inspired.is-fullscreen .monitor-widget-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 235px));
}
.monitor-panel-shell-inspired.is-fullscreen .monitor-widget-card { max-width: 235px; }
@media (max-width: 900px) {
  .monitor-section-stack { grid-template-columns: 1fr; }
  .monitor-status-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .monitor-widget-grid { grid-template-columns: 1fr 1fr; }
  .monitor-widget-card { max-width: none; }
  .monitor-status-row { grid-template-columns: minmax(0,1fr) 78px 34px; }
}

/* ==========================================================================
   Monitoramento v5 — layout operacional responsivo e telão
   ========================================================================== */
.monitor-panel-shell-v5 {
  position: relative;
  width: 100%;
  max-width: none;
  overflow: clip;
  border: 1px solid #cbd4d7;
  border-radius: 6px;
  background: #e9edef;
  box-shadow: none;
}
.monitor-panel-shell-v5.has-alarm {
  border-color: #cbd4d7;
  box-shadow: none;
}
.monitor-panel-shell-v5 .monitor-section-stack {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px;
}
.monitor-panel-shell-v5 .monitor-runtime-section {
  flex: 1 1 520px;
  min-width: min(100%, 420px);
  max-width: 100%;
  margin: 0;
  align-self: flex-start;
  break-inside: avoid;
}
.monitor-panel-shell-v5 .monitor-runtime-section > header {
  min-height: 44px;
  padding: 8px 10px;
}
.monitor-panel-shell-v5 .monitor-runtime-section > header h2 {
  font-size: 14px;
}
.monitor-panel-shell-v5 .monitor-section-body { padding: 8px; }
.monitor-panel-shell-v5 .monitor-status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.monitor-panel-shell-v5 .monitor-status-row {
  grid-template-columns: minmax(0, 1fr) 82px 32px;
  min-width: 0;
  min-height: 52px;
}
.monitor-panel-shell-v5 .monitor-status-row > div { min-height: 52px; }
.monitor-panel-shell-v5 .monitor-status-label { min-width: 0; }
.monitor-panel-shell-v5 .monitor-status-label strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.monitor-panel-shell-v5 .monitor-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  justify-content: stretch;
  width: 100%;
  gap: 8px;
}
.monitor-panel-shell-v5 .monitor-widget-card {
  width: 100%;
  max-width: 260px;
  justify-self: start;
}
.monitor-panel-shell-v5 .monitor-panel-toolbar {
  min-height: 38px;
  padding: 7px 10px;
}
.monitor-panel-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.monitor-alarm-center-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #c7d0d4;
  border-radius: 3px;
  background: #f6f8f8;
  color: #334950;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
}
.monitor-alarm-center-button strong {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 2px;
  background: #e5eaec;
  color: #32474f;
  font-size: 9px;
}
.monitor-panel-shell-v5.has-alarm .monitor-alarm-center-button {
  border-color: #ca434d;
  background: #fff5f5;
  color: #a72832;
}
.monitor-panel-shell-v5.has-alarm .monitor-alarm-center-button strong {
  background: #d63d48;
  color: #fff;
}
.monitor-alarm-center[hidden] { display: none !important; }
.monitor-alarm-center {
  position: absolute;
  z-index: 80;
  top: 40px;
  right: 10px;
  width: min(520px, calc(100% - 20px));
  max-height: min(68vh, 620px);
  display: flex;
  flex-direction: column;
  border: 1px solid #c8d1d5;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(10,27,35,.18);
  overflow: hidden;
}
.monitor-alarm-center-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid #dce3e6;
  background: #eef2f3;
}
.monitor-alarm-center-head > div { display: grid; gap: 2px; }
.monitor-alarm-center-head strong { color: #263b43; font-size: 13px; }
.monitor-alarm-center-head button {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd4d7;
  border-radius: 3px;
  background: #fff;
  color: #52676f;
  cursor: pointer;
}
.monitor-alarm-center-list {
  overflow: auto;
  padding: 7px;
  background: #f7f9f9;
}
.monitor-alarm-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto 30px;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 0;
  border-bottom: 1px solid #e0e6e8;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.monitor-alarm-item:last-child { border-bottom: 0; }
.monitor-alarm-item:hover { background: #fdf3f4; }
.monitor-alarm-item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: #d63d48;
  color: #fff;
}
.monitor-alarm-item-copy { min-width: 0; display: grid; gap: 2px; }
.monitor-alarm-item-copy small { color: #73848a; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.monitor-alarm-item-copy strong { color: #243940; font-size: 11px; overflow-wrap: anywhere; }
.monitor-alarm-item-copy em { color: #b32d36; font-size: 9px; font-style: normal; font-weight: 700; }
.monitor-alarm-item-time { color: #77888e; font-size: 8px; white-space: nowrap; }
.monitor-alarm-item-action { color: #51676f; }
.monitor-alarm-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #6c7f86;
  text-align: center;
}
.monitor-alarm-empty i { color: #1aa56f; font-size: 22px; }
.monitor-alarm-empty strong { color: #324950; font-size: 12px; }
.monitor-alarm-empty span { font-size: 9px; }
.monitor-alert-ticker .more {
  margin-left: auto;
  font-size: 9px;
  font-weight: 900;
}
.monitor-fullscreen-header { display: none; }
.monitor-panel-shell-v5.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  background: #e7ebed;
}
.monitor-panel-shell-v5.is-fullscreen .monitor-fullscreen-header {
  flex: 0 0 58px;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(260px, 1.4fr) auto minmax(140px, .8fr) 38px;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  border-bottom: 1px solid #bdc8cc;
  background: #f5f7f7;
}
.monitor-fullscreen-brand {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
}
.monitor-fullscreen-brand img {
  display: block;
  max-width: 190px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.monitor-fullscreen-brand-client { justify-content: flex-end; }
.monitor-fullscreen-brand-client strong,
.monitor-brand-fallback {
  color: #283e46;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.monitor-fullscreen-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}
.monitor-fullscreen-title strong {
  color: #1e333b;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.monitor-fullscreen-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6a7c83;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.monitor-fullscreen-clock {
  color: #364d55;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.monitor-fullscreen-exit {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #c5d0d4;
  border-radius: 3px;
  background: #fff;
  color: #344b53;
  cursor: pointer;
}
.monitor-panel-shell-v5.is-fullscreen .monitor-panel-toolbar { flex: 0 0 auto; }
.monitor-panel-shell-v5.is-fullscreen .monitor-section-stack {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px;
  gap: 8px;
}
.monitor-panel-shell-v5.is-fullscreen .monitor-runtime-section {
  flex: 1 1 500px;
  min-width: 440px;
}
.monitor-panel-shell-v5.is-fullscreen .monitor-widget-grid {
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
}
.monitor-panel-shell-v5.is-fullscreen .monitor-widget-card {
  max-width: 230px;
}
.monitor-panel-shell-v5.is-fullscreen .monitor-alarm-center {
  position: fixed;
  top: 103px;
  right: 10px;
}
.monitor-panel-shell-v5.is-fullscreen .monitor-alert-ticker { flex: 0 0 auto; }

@media (min-width: 1500px) {
  .monitor-panel-shell-v5 .monitor-runtime-section { flex-basis: 470px; }
  .monitor-panel-shell-v5 .monitor-section-stack { gap: 8px; }
}
@media (max-width: 1100px) {
  .monitor-panel-shell-v5 .monitor-runtime-section { flex-basis: 100%; min-width: 0; }
  .monitor-panel-shell-v5 .monitor-widget-card { max-width: 240px; }
}
@media (max-width: 760px) {
  .monitor-panel-toolbar,
  .monitor-panel-toolbar-actions { align-items: flex-start; }
  .monitor-panel-toolbar-actions { width: 100%; justify-content: space-between; }
  .monitor-panel-shell-v5 .monitor-status-list { grid-template-columns: 1fr; }
  .monitor-panel-shell-v5 .monitor-widget-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .monitor-panel-shell-v5 .monitor-widget-card { max-width: none; }
  .monitor-alarm-item { grid-template-columns: 30px minmax(0,1fr) 26px; }
  .monitor-alarm-item-time { display: none; }
}
@media (max-width: 520px) {
  .monitor-panel-shell-v5 .monitor-widget-grid { grid-template-columns: 1fr; }
  .monitor-panel-shell-v5 .monitor-widget-card { aspect-ratio: auto; min-height: 230px; }
  .monitor-panel-shell-v5 .monitor-panel-mode-hint { display: none; }
}

/* ==========================================================================
   Monitoramento v6 — operação contínua, telão, thresholds globais e histórico
   ========================================================================== */
.monitor-panel-shell-v6 {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: none;
  border: 1px solid #cbd4d7;
  border-radius: 6px;
  overflow: hidden;
  background: #e9edef;
  box-shadow: none;
}
.monitor-panel-shell-v6 .monitor-panel-toolbar {
  min-height: 38px;
  padding: 7px 10px;
  border-bottom: 1px solid #cfd7da;
  background: #f5f7f7;
}
.monitor-scroll-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  background: #e9edef;
}
.monitor-panel-shell-v6 .monitor-section-stack {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  align-items: start;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 9px;
  transform-origin: top left;
}
.monitor-panel-shell-v6 .monitor-runtime-section {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  border: 1px solid #cbd5d8;
  border-radius: 4px;
  background: #f8fafa;
  overflow: hidden;
  box-shadow: none;
}
.monitor-panel-shell-v6 .monitor-runtime-section > header {
  min-height: 42px;
  padding: 7px 10px;
  border-bottom: 1px solid #c8d1d4;
  background: #dce2e4;
}
.monitor-panel-shell-v6 .monitor-runtime-section > header h2 {
  margin: 0;
  color: #17313a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .025em;
}
.monitor-panel-shell-v6 .monitor-section-summary {
  min-height: 25px;
  padding: 0 8px;
  border-radius: 2px;
  background: #f7faf9;
  color: #147252;
  border: 1px solid #c8dad3;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}
.monitor-panel-shell-v6 .monitor-section-summary.has-warning {
  border-color: #ead79a;
  background: #fff9e8;
  color: #85620b;
}
.monitor-panel-shell-v6 .monitor-section-summary.has-alarm {
  border-color: #df9fa4;
  background: #fff1f2;
  color: #a92731;
}
.monitor-panel-shell-v6 .monitor-section-body { padding: 8px; }
.monitor-panel-shell-v6 .monitor-status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.monitor-panel-shell-v6 .monitor-status-row {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 62px;
  border: 1px solid #cbd4d7;
  border-radius: 3px;
  overflow: hidden;
  background: #fff;
}
.monitor-panel-shell-v6 .monitor-status-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7px 9px;
  background: #6d7579;
  color: #fff;
}
.monitor-panel-shell-v6 .monitor-status-label .eyebrow {
  margin: 0 0 3px;
  color: rgba(255,255,255,.72);
  font-size: 7px;
  line-height: 1;
}
.monitor-panel-shell-v6 .monitor-status-label strong {
  color: #fff;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.monitor-panel-shell-v6 .monitor-status-badge {
  display: grid;
  place-items: center;
  padding: 6px;
  background: var(--status-color, #77858b);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.monitor-status-actions,
.monitor-widget-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: #f4f7f7;
}
.monitor-history-icon,
.monitor-item-config-button {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd5d8;
  border-radius: 2px;
  background: #fff;
  color: #31505b;
  font-size: 9px;
  cursor: pointer;
}
.monitor-history-icon:hover,
.monitor-item-config-button:hover { background: #eaf0f1; color: #112e38; }
.monitor-item-config-button { color: #6f5b20; }
.monitor-panel-shell-v6 .monitor-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 7px;
  width: 100%;
  margin-top: 7px;
}
.monitor-panel-shell-v6 .monitor-status-list + .monitor-widget-grid { margin-top: 7px; }
.monitor-panel-shell-v6 .monitor-widget-card {
  width: 100%;
  min-width: 0;
  min-height: 205px;
  max-width: none;
  display: grid;
  grid-template-rows: auto minmax(118px, 1fr) auto;
  border: 1px solid #cbd5d8;
  border-top: 3px solid var(--metric-state-color, #15a46d);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}
.monitor-panel-shell-v6 .monitor-widget-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 8px 7px;
  border-bottom: 1px solid #dce3e5;
  background: #f3f6f6;
}
.monitor-panel-shell-v6 .monitor-widget-head > div:first-child { min-width: 0; }
.monitor-panel-shell-v6 .monitor-widget-head .eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #63777f;
  font-size: 7px;
  line-height: 1;
  text-transform: uppercase;
}
.monitor-panel-shell-v6 .monitor-widget-head h2 {
  margin: 0;
  color: #17313a;
  font-size: 9px;
  line-height: 1.28;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.monitor-panel-shell-v6 .monitor-widget-tools { flex: 0 0 auto; background: transparent; }
.monitor-panel-shell-v6 .monitor-widget-visual {
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 6px 8px 8px;
  overflow: hidden;
}
.monitor-panel-shell-v6 .dashboard-value-main {
  max-width: 100%;
  color: #172f38;
  font-family: "Roboto Mono", Consolas, monospace;
  font-size: clamp(24px, 2.8vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.055em;
  text-align: center;
  overflow-wrap: anywhere;
}
.monitor-panel-shell-v6 .dashboard-value-main small {
  margin-left: 5px;
  color: #6b7f87;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.monitor-panel-shell-v6 .dashboard-value-main.is-text {
  max-width: 100%;
  font-family: Inter, sans-serif;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.12;
  letter-spacing: -.025em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.monitor-panel-shell-v6 .monitor-widget-footer {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-top: 1px solid #e1e6e8;
  color: #6e8087;
  font-size: 7px;
}
.monitor-panel-shell-v6 .monitor-widget-state {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--state-color, #15a46d) 12%, white);
  color: var(--state-color, #15a46d);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}
.dashboard-gauge-v6 {
  display: block;
  width: min(100%, 220px);
  height: auto;
  overflow: visible;
}
.dashboard-gauge-v6 .dashboard-gauge-needle {
  stroke: #273b42;
  stroke-width: 3.2;
  stroke-linecap: round;
}
.dashboard-gauge-v6 .dashboard-gauge-center { stroke: #fff; stroke-width: 2; }
.dashboard-gauge-v6 .dashboard-gauge-tick { stroke: #829198; stroke-width: 1; }
.dashboard-gauge-v6 .dashboard-gauge-value-text {
  fill: #172e37;
  font: 700 26px/1 "Roboto Mono", Consolas, monospace;
  text-anchor: middle;
}
.dashboard-gauge-v6 .dashboard-gauge-unit {
  fill: #677a82;
  font: 700 10px/1 Inter, sans-serif;
  text-anchor: middle;
}
.dashboard-gauge-v6 .dashboard-gauge-bound {
  fill: #87969c;
  font: 700 8px/1 Inter, sans-serif;
}
.dashboard-gauge-v6 .dashboard-gauge-threshold-source {
  fill: #97a4a9;
  font: 600 6px/1 Inter, sans-serif;
  text-anchor: middle;
  text-transform: uppercase;
}
.monitor-panel-shell-v6 .monitor-alarm-center {
  z-index: 140;
  top: 42px;
  right: 10px;
  width: min(620px, calc(100% - 20px));
  max-height: min(76vh, 720px);
}
.monitor-alarm-filters {
  display: flex;
  gap: 5px;
  padding: 7px;
  border-bottom: 1px solid #dce3e5;
  background: #f6f8f8;
}
.monitor-alarm-filters button {
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid #cbd4d7;
  border-radius: 2px;
  background: #fff;
  color: #556a72;
  font: inherit;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}
.monitor-alarm-filters button.active { background: #203943; border-color: #203943; color: #fff; }
.monitor-panel-shell-v6 .monitor-alarm-item {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto auto 30px;
  gap: 8px;
  border-left: 3px solid var(--event-color, #d63d48);
}
.monitor-panel-shell-v6 .monitor-alarm-item-icon { background: var(--event-color, #d63d48); }
.monitor-alarm-item-severity {
  min-width: 62px;
  padding: 4px 6px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--event-color, #d63d48) 12%, white);
  color: var(--event-color, #d63d48);
  font-size: 8px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}
.monitor-alarm-item-action {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd4d7;
  background: #fff;
  color: #3b5964;
  cursor: pointer;
}
.monitor-panel-shell-v6 .monitor-alert-ticker { min-height: 30px; padding: 6px 10px; }

/* fullscreen */
.monitor-panel-shell-v6 .monitor-fullscreen-header { display: none; }
.monitor-panel-shell-v6.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  display: grid;
  grid-template-rows: 62px auto minmax(0,1fr) auto;
  overflow: hidden;
  background: #e6ebed;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-header {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(130px,.85fr) minmax(260px,1.55fr) auto auto minmax(130px,.85fr) 34px;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-bottom: 1px solid #bfc9cd;
  background: #f5f7f7;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-brand { height: 46px; min-width: 0; display: flex; align-items: center; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-brand img { max-width: 180px; max-height: 42px; object-fit: contain; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-brand-client { justify-content: flex-end; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-brand-client strong,
.monitor-panel-shell-v6.is-fullscreen .monitor-brand-fallback { color: #293e46; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-title { min-width: 0; display: grid; gap: 2px; text-align: center; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-title strong { color: #19313a; font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: .035em; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-title span { min-width: 0; color: #667980; font-size: 9px; font-weight: 750; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-clock { color: #3d545d; font-size: 9px; font-weight: 800; white-space: nowrap; }
.monitor-fullscreen-zoom {
  display: flex;
  align-items: center;
  gap: 2px;
}
.monitor-fullscreen-zoom button {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #c6d0d3;
  border-radius: 2px;
  background: #fff;
  color: #334d56;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}
.monitor-fullscreen-zoom .monitor-zoom-value { min-width: 48px; }
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-exit { width: 30px; height: 30px; }
.monitor-panel-shell-v6.is-fullscreen .monitor-scroll-viewport { min-height: 0; height: 100%; overflow: auto; }
.monitor-panel-shell-v6.is-fullscreen .monitor-section-stack { grid-template-columns: repeat(auto-fit, minmax(390px, 1fr)); }
.monitor-panel-shell-v6.is-fullscreen .monitor-alarm-center { position: fixed; top: 104px; right: 10px; }

/* history in fullscreen root */
.monitor-panel-shell-v6 .panel-history-modal,
.monitor-panel-shell-v6 .panel-item-config-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 18px;
}
.monitor-panel-shell-v6 .panel-history-modal[hidden],
.monitor-panel-shell-v6 .panel-item-config-modal[hidden] { display: none !important; }
.panel-history-dialog-v6 {
  position: relative;
  width: min(1120px, 96vw);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #c8d1d4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
.panel-history-dialog-v6 > header,
.panel-item-config-dialog > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #dce3e5;
  background: #f5f7f7;
}
.panel-history-dialog-v6 > header h2,
.panel-item-config-dialog > header h2 { margin: 2px 0 0; font-size: 17px; color: #213940; }
.panel-history-dialog-v6 > header p,
.panel-item-config-dialog > header p { margin: 4px 0 0; color: #73858c; font-size: 9px; }
.panel-history-header-actions { display: flex; align-items: center; gap: 6px; }
.panel-download-button { min-height: 34px; }
.panel-history-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #dce3e5;
  background: #fafbfb;
}
.panel-history-tabs button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid #dce3e5;
  background: transparent;
  color: #5d727a;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.panel-history-tabs button.active { background: #fff; color: #172f38; box-shadow: inset 0 -2px 0 #01013b; }
.panel-history-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid #e3e8ea;
}
.panel-history-range { display: flex; gap: 4px; padding: 0; }
.panel-history-range button { min-height: 30px; padding: 0 10px; border-radius: 2px; }
.panel-history-custom-range { display: flex; align-items: end; gap: 6px; flex-wrap: wrap; }
.panel-history-custom-range label { display: grid; gap: 3px; color: #647980; font-size: 8px; font-weight: 750; }
.panel-history-custom-range input { height: 30px; min-width: 170px; border: 1px solid #cbd4d7; border-radius: 2px; padding: 0 7px; font: inherit; font-size: 9px; }
.panel-history-view { min-height: 0; padding: 12px 14px; overflow: auto; }
.panel-history-view[hidden] { display: none !important; }
.panel-history-chart { height: min(52vh, 470px); }
.panel-history-axis-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 10px;
  color: #687b82;
  font-size: 9px;
}
.panel-history-axis-tools > span { font-weight: 850; color: #314951; }
.panel-history-axis-tools label { display: inline-flex; align-items: center; gap: 5px; }
.panel-history-axis-tools input { width: 95px; height: 29px; border: 1px solid #cbd4d7; border-radius: 2px; padding: 0 6px; }
.panel-trend-summary {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 12px;
  border: 1px solid #dce3e5;
  background: #f8fafa;
}
.panel-trend-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--trend-color) 12%, white);
  color: var(--trend-color);
  font-size: 24px;
}
.panel-trend-summary > div { display: grid; gap: 2px; }
.panel-trend-summary strong { font-size: 18px; }
.panel-trend-summary span { font: 700 14px/1 "Roboto Mono", Consolas, monospace; color: #4f646c; }
.panel-trend-chart { height: 220px; margin-top: 12px; }
.panel-trend-explanation { margin-top: 10px; color: #61757d; font-size: 10px; line-height: 1.5; }
.panel-history-note { padding: 8px 14px 12px; margin: 0; border-top: 1px solid #e4e9eb; background: #fafbfb; }

/* global item config */
.panel-item-config-dialog {
  position: relative;
  width: min(920px, 96vw);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #c8d1d4;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
.panel-item-config-dialog form { overflow: auto; padding: 14px; }
.panel-item-config-section { padding: 12px 0; border-bottom: 1px solid #e3e8ea; }
.panel-item-config-section:first-child { padding-top: 0; }
.panel-item-config-section-title { display: grid; gap: 3px; margin-bottom: 10px; }
.panel-item-config-section-title strong { color: #263f47; font-size: 11px; }
.panel-item-config-section-title span { color: #75878e; font-size: 9px; }
.panel-item-config-check { display: inline-flex; align-items: center; gap: 7px; color: #405861; font-size: 10px; font-weight: 750; }
.panel-item-config-check input { width: 15px; height: 15px; }
.panel-state-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.panel-state-map-card { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 10px; border: 1px solid #dce3e5; background: #fafbfb; }
.panel-state-map-card > strong { grid-column: 1 / -1; color: #263f47; font-size: 10px; }
.panel-state-map-card label,
.panel-item-threshold-grid label,
.panel-item-color-grid label { display: grid; gap: 4px; color: #657980; font-size: 8px; font-weight: 750; }
.panel-state-map-card input[type="text"],
.panel-state-map-card select,
.panel-item-threshold-grid input,
.panel-item-threshold-grid select { height: 32px; min-width: 0; border: 1px solid #cbd4d7; border-radius: 2px; padding: 0 7px; font: inherit; font-size: 9px; background: #fff; }
.panel-state-map-card input[type="color"],
.panel-item-color-grid input[type="color"] { width: 100%; height: 32px; padding: 2px; border: 1px solid #cbd4d7; background: #fff; }
.panel-item-threshold-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.panel-item-color-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.panel-item-config-message { margin-top: 10px; padding: 8px 10px; border: 1px solid #d7e0e3; background: #f6f8f8; color: #405861; font-size: 9px; }
.panel-item-config-message.success { border-color: #bfdfd2; background: #eef9f5; color: #176d51; }
.panel-item-config-message.error { border-color: #efc3c7; background: #fff2f3; color: #a82731; }
.panel-item-config-dialog footer { display: flex; align-items: center; gap: 7px; padding-top: 12px; }
.panel-item-config-spacer { flex: 1 1 auto; }

@media (min-width: 1700px) {
  .monitor-panel-shell-v6 .monitor-section-stack { grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); }
  .monitor-panel-shell-v6 .monitor-status-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1120px) {
  .monitor-panel-shell-v6 .monitor-section-stack { grid-template-columns: 1fr; }
  .monitor-panel-shell-v6 .monitor-widget-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-header { grid-template-columns: 120px minmax(220px,1fr) auto auto 120px 32px; gap: 7px; }
}
@media (max-width: 820px) {
  .monitor-panel-shell-v6 .monitor-status-list { grid-template-columns: 1fr; }
  .monitor-panel-shell-v6 .monitor-widget-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .monitor-panel-shell-v6 .monitor-alarm-item { grid-template-columns: 30px minmax(0,1fr) auto 28px; }
  .monitor-alarm-item-severity { display: none; }
  .monitor-alarm-item-time { display: none; }
  .panel-item-threshold-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-header { grid-template-columns: 90px minmax(180px,1fr) auto 32px; }
  .monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-clock,
  .monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-zoom { display: none; }
}
@media (max-width: 620px) {
  .monitor-panel-shell-v6 .monitor-widget-grid { grid-template-columns: 1fr; }
  .monitor-panel-shell-v6 .monitor-status-row { grid-template-columns: minmax(0,1fr) 74px 58px; }
  .panel-state-map-grid { grid-template-columns: 1fr; }
  .panel-state-map-card { grid-template-columns: 1fr; }
  .panel-item-color-grid { grid-template-columns: 1fr; }
  .panel-history-controls { display: block; }
  .panel-history-custom-range { margin-top: 8px; }
  .panel-history-custom-range label,
  .panel-history-custom-range input { width: 100%; }
}

/* ==========================================================================
   Monitoramento v7 — composição responsiva e controles administrativos discretos
   ========================================================================== */
.monitor-panel-shell-v6 {
  --monitor-gap: 14px;
  --monitor-section-min: 500px;
  --monitor-card-min: 220px;
  background: #e9eef0;
}
.monitor-panel-shell-v6 .monitor-scroll-viewport {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.monitor-panel-shell-v6 .monitor-section-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--monitor-section-min)), 1fr));
  gap: var(--monitor-gap);
  align-items: start;
  width: 100%;
  max-width: none;
  padding: var(--monitor-gap);
  box-sizing: border-box;
}
.monitor-panel-shell-v6 .monitor-runtime-section {
  min-width: 0;
  width: 100%;
  container-type: inline-size;
  border-radius: 6px;
  background: #f5f7f8;
  border-color: #cbd5d9;
  box-shadow: none;
}
.monitor-panel-shell-v6 .monitor-runtime-section > header {
  min-height: 46px;
  padding: 9px 12px;
  background: #dce3e6;
}
.monitor-panel-shell-v6 .monitor-runtime-section > header h2 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  letter-spacing: .025em;
}
.monitor-panel-shell-v6 .monitor-section-body {
  padding: 10px;
  min-width: 0;
}
.monitor-panel-shell-v6 .monitor-status-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  min-width: 0;
}
.monitor-panel-shell-v6 .monitor-status-row {
  grid-template-columns: minmax(0, 1fr) 92px 38px;
  min-width: 0;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
}
.monitor-panel-shell-v6 .monitor-status-row > div {
  min-height: 48px;
}
.monitor-panel-shell-v6 .monitor-status-label {
  min-width: 0;
  padding: 7px 9px;
}
.monitor-panel-shell-v6 .monitor-status-label .eyebrow {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
  line-height: 1.15;
}
.monitor-panel-shell-v6 .monitor-status-label strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
}
.monitor-panel-shell-v6 .monitor-status-badge {
  padding: 0 8px;
  font-size: 10px;
  white-space: nowrap;
}
.monitor-panel-shell-v6 .monitor-status-actions {
  width: 38px;
  min-width: 38px;
  padding: 0;
  background: #f8fafb;
}
.monitor-panel-shell-v6 .monitor-status-actions .monitor-history-icon,
.monitor-panel-shell-v6 .monitor-widget-tools .monitor-history-icon {
  width: 30px;
  height: 30px;
  border-radius: 3px;
}
.monitor-panel-shell-v6 .monitor-item-config-button {
  display: none !important;
}
.monitor-panel-shell-v6 .monitor-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--monitor-card-min)), 1fr));
  gap: 9px;
  min-width: 0;
}
.monitor-panel-shell-v6 .monitor-widget-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 208px;
  aspect-ratio: auto;
  border-radius: 4px;
}
.monitor-panel-shell-v6 .monitor-widget-head {
  min-height: 53px;
  padding: 8px 9px;
}
.monitor-panel-shell-v6 .monitor-widget-head > div:first-child {
  min-width: 0;
}
.monitor-panel-shell-v6 .monitor-widget-head .eyebrow {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
}
.monitor-panel-shell-v6 .monitor-widget-head h2 {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.monitor-panel-shell-v6 .monitor-widget-tools {
  flex: 0 0 auto;
}
.monitor-panel-shell-v6 .monitor-widget-visual {
  min-height: 118px;
  padding: 5px 8px;
}
.monitor-panel-shell-v6 .dashboard-value-main {
  max-width: 100%;
  font-size: clamp(28px, 2.5vw, 42px);
  line-height: 1.02;
  text-align: center;
  overflow-wrap: anywhere;
}
.monitor-panel-shell-v6 .dashboard-value-main.is-text {
  max-width: 100%;
  padding: 0 8px;
  font-size: clamp(18px, 1.8vw, 28px);
  line-height: 1.08;
}
.monitor-panel-shell-v6 .dashboard-value-main small {
  font-size: 10px;
}
.monitor-panel-shell-v6 .monitor-widget-footer {
  min-height: 28px;
  padding: 5px 8px;
}
.monitor-panel-shell-v6 .dashboard-gauge-v6 {
  width: min(100%, 210px);
  height: auto;
  max-height: 148px;
}
.monitor-panel-shell-v6 .dashboard-gauge-value-text {
  font-size: 22px;
}
.monitor-panel-shell-v6 .dashboard-gauge-unit,
.monitor-panel-shell-v6 .dashboard-gauge-bound {
  font-size: 8px;
}

/* Configuração administrativa fica dentro do modal de gráfico/tendência. */
.panel-history-config-button[hidden] { display: none !important; }
.panel-history-config-button {
  border-color: #c9d3d6;
  background: #fff;
  color: #314a53;
}
.panel-history-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Regras de densidade por largura real de cada subgrupo. */
@container (min-width: 650px) {
  .monitor-panel-shell-v6 .monitor-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .monitor-panel-shell-v6 .monitor-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (min-width: 980px) {
  .monitor-panel-shell-v6 .monitor-widget-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Telão: ocupa toda a largura e mantém scroll natural sem distorcer os grupos. */
.monitor-panel-shell-v6.is-fullscreen {
  --monitor-section-min: 520px;
  --monitor-card-min: 210px;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-scroll-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-section-stack {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--monitor-section-min)), 1fr));
  align-content: start;
  width: 100%;
  min-width: 100%;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-widget-card {
  max-width: none;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-fullscreen-header {
  position: sticky;
  top: 0;
  z-index: 40;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-panel-toolbar {
  position: sticky;
  top: 64px;
  z-index: 35;
}

@media (min-width: 1900px) {
  .monitor-panel-shell-v6 { --monitor-section-min: 560px; }
  .monitor-panel-shell-v6.is-fullscreen { --monitor-section-min: 570px; }
}
@media (max-width: 1180px) {
  .monitor-panel-shell-v6 { --monitor-section-min: 440px; }
}
@media (max-width: 760px) {
  .monitor-panel-shell-v6 { --monitor-section-min: 100%; --monitor-card-min: 100%; }
  .monitor-panel-shell-v6 .monitor-section-stack { padding: 8px; gap: 8px; }
  .monitor-panel-shell-v6 .monitor-widget-grid { grid-template-columns: 1fr; }
  .monitor-panel-shell-v6 .monitor-status-row { grid-template-columns: minmax(0,1fr) 78px 36px; }
  .monitor-panel-shell-v6 .monitor-status-label strong { font-size: 9px; }
  .monitor-panel-shell-v6 .dashboard-value-main { font-size: 30px; }
  .panel-history-header-actions .button { min-height: 32px; padding-inline: 9px; font-size: 9px; }
}

/* ==========================================================================
   Monitoramento v9 — layout persistente, arrastável e medidores D3 robustos
   ========================================================================== */
.monitor-panel-shell-v6 .monitor-section-stack {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 12px;
  align-items: start;
  width: 100%;
  max-width: none;
  padding: 12px;
  box-sizing: border-box;
}
.monitor-panel-shell-v6 .monitor-runtime-section {
  grid-column: span var(--layout-span, 6);
  min-width: 0;
  width: 100%;
  align-self: start;
}
.monitor-panel-shell-v6 .monitor-status-list,
.monitor-panel-shell-v6 .monitor-widget-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 8px;
  min-width: 0;
}
.monitor-panel-shell-v6 .monitor-status-row,
.monitor-panel-shell-v6 .monitor-widget-card {
  grid-column: span var(--item-span, 6);
  min-width: 0;
  width: 100%;
  max-width: none;
}
.monitor-panel-shell-v6 .monitor-status-row {
  align-self: stretch;
}
.monitor-panel-shell-v6 .monitor-widget-card {
  min-height: 210px;
}
.monitor-panel-shell-v6 .monitor-widget-visual {
  min-height: 128px;
  overflow: hidden;
}

/* Gauge: sem distorção ao redimensionar os cards. */
.monitor-panel-shell-v6 .dashboard-gauge-v9 {
  display: block;
  width: min(100%, 250px);
  height: auto;
  max-height: none;
  margin: 0 auto;
  overflow: visible;
}
.monitor-panel-shell-v6 .dashboard-gauge-track {
  fill: #dfe6e8;
}
.monitor-panel-shell-v6 .dashboard-gauge-needle {
  stroke: #263a42;
  stroke-width: 3;
  stroke-linecap: round;
}
.monitor-panel-shell-v6 .dashboard-gauge-center {
  stroke: #fff;
  stroke-width: 2;
}
.monitor-panel-shell-v6 .dashboard-gauge-tick {
  stroke: #8b999e;
  stroke-width: 1;
}
.monitor-panel-shell-v6 .dashboard-gauge-tick.is-major {
  stroke: #52666e;
  stroke-width: 1.5;
}
.monitor-panel-shell-v6 .dashboard-gauge-threshold-mark {
  stroke: #233941;
  stroke-width: 1.25;
  stroke-dasharray: 2 2;
}
.monitor-panel-shell-v6 .dashboard-gauge-value-text {
  fill: #172f38;
  font-size: 24px;
  font-weight: 800;
  text-anchor: middle;
}
.monitor-panel-shell-v6 .dashboard-gauge-unit {
  fill: #5f747c;
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
}
.monitor-panel-shell-v6 .dashboard-gauge-bound {
  fill: #6d7f86;
  font-size: 8px;
  font-weight: 700;
}

/* Edição visual do layout. */
.monitor-layout-editor[hidden] { display: none !important; }
.monitor-layout-editor {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid #bfcbd0;
  background: #fff;
  box-shadow: 0 4px 14px rgba(8, 27, 36, .08);
}
.monitor-layout-editor-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.monitor-layout-editor-copy strong {
  color: #203740;
  font-size: 12px;
}
.monitor-layout-editor-copy span {
  color: #6a7d84;
  font-size: 9px;
}
.monitor-layout-editor-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}
.monitor-layout-drag-handle,
.monitor-layout-resize-handle {
  display: none;
}
.layout-editing .monitor-layout-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border: 1px solid #bfcbd0;
  border-radius: 4px;
  background: #fff;
  color: #4e646c;
  cursor: grab;
}
.layout-editing .monitor-layout-drag-handle:active { cursor: grabbing; }
.layout-editing .monitor-runtime-section,
.layout-editing .monitor-status-row,
.layout-editing .monitor-widget-card {
  position: relative;
  outline: 1px dashed rgba(1, 1, 59, .24);
  outline-offset: -2px;
}
.layout-editing .monitor-runtime-section.is-dragging,
.layout-editing .monitor-status-row.is-dragging,
.layout-editing .monitor-widget-card.is-dragging {
  opacity: .48;
}
.layout-editing .monitor-layout-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #aebdc2;
  border-radius: 3px;
  background: rgba(255,255,255,.94);
  color: #334e58;
  cursor: ew-resize;
  box-shadow: 0 1px 4px rgba(10, 30, 38, .10);
}
.layout-editing .is-resizing {
  user-select: none;
  box-shadow: 0 0 0 2px rgba(1,1,59,.14);
}
.layout-editing .monitor-runtime-section > header {
  padding-left: 7px;
}
.layout-editing .monitor-runtime-section > header > div {
  min-width: 0;
  flex: 1 1 auto;
}
.layout-editing .monitor-status-actions,
.layout-editing .monitor-widget-tools {
  gap: 4px;
}

/* Mais previsível no telão: a organização salva é respeitada. */
.monitor-panel-shell-v6.is-fullscreen .monitor-section-stack {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  width: 100%;
  min-width: 100%;
}
.monitor-panel-shell-v6.is-fullscreen .monitor-runtime-section {
  grid-column: span var(--layout-span, 6);
}
.monitor-panel-shell-v6.is-fullscreen .monitor-status-row,
.monitor-panel-shell-v6.is-fullscreen .monitor-widget-card {
  grid-column: span var(--item-span, 6);
}

@media (max-width: 1180px) {
  .monitor-panel-shell-v6 .monitor-runtime-section,
  .monitor-panel-shell-v6.is-fullscreen .monitor-runtime-section {
    grid-column: span 12 !important;
  }
}
@media (max-width: 760px) {
  .monitor-panel-shell-v6 .monitor-section-stack { padding: 8px; gap: 8px; }
  .monitor-panel-shell-v6 .monitor-status-row,
  .monitor-panel-shell-v6 .monitor-widget-card,
  .monitor-panel-shell-v6.is-fullscreen .monitor-status-row,
  .monitor-panel-shell-v6.is-fullscreen .monitor-widget-card {
    grid-column: span 12 !important;
  }
  .monitor-layout-editor { align-items: flex-start; flex-direction: column; }
  .monitor-layout-editor-actions { width: 100%; }
  .monitor-layout-editor-actions .button { flex: 1 1 auto; }
}

/* ==========================================================================
   Monitoramento v10 — maior aproveitamento horizontal fora do modo telão
   Não altera o layout do elemento quando ele está em fullscreen.
   ========================================================================== */
@media (min-width: 1280px) {
  .content-shell:has(.monitor-panel-shell-v6) {
    width: min(calc(100% - 24px), 1880px);
  }
}

/* ==========================================================================
   Exportação — marketplace de integrações
   ========================================================================== */
.integration-marketplace {
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid #dce5e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(12, 32, 40, .035);
}
.integration-marketplace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.integration-marketplace-head h2 {
  margin: 3px 0 4px;
  color: #20363e;
  font-size: 18px;
}
.integration-marketplace-head p {
  margin: 0;
  color: #718188;
  font-size: 11px;
  line-height: 1.55;
}
.integration-marketplace-counter {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #c8e8da;
  border-radius: 999px;
  background: #edf9f4;
  color: #147351;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.integration-marketplace-section + .integration-marketplace-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #edf1f2;
}
.integration-marketplace-section-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 10px;
}
.integration-marketplace-section-title strong {
  color: #263d46;
  font-size: 12px;
}
.integration-marketplace-section-title span {
  color: #89979c;
  font-size: 10px;
}
.integration-marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.integration-marketplace-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  grid-template-areas:
    "logo copy"
    "logo action";
  column-gap: 11px;
  row-gap: 7px;
  align-items: center;
  min-height: 96px;
  padding: 11px;
  border: 1px solid #dfe7e9;
  border-radius: 9px;
  background: #fbfcfc;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.integration-marketplace-card:hover {
  transform: translateY(-1px);
  border-color: #cbd8dc;
  box-shadow: 0 4px 12px rgba(11, 37, 46, .055);
}
.integration-marketplace-card.is-active {
  border-color: #d4e9df;
  background: linear-gradient(180deg, #fff, #fbfefd);
}
.integration-marketplace-logo {
  grid-area: logo;
  width: 68px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e3e9eb;
  border-radius: 7px;
  background: #fff;
}
.integration-marketplace-logo img {
  display: block;
  max-width: 60px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.integration-marketplace-copy {
  grid-area: copy;
  min-width: 0;
  align-self: end;
}
.integration-marketplace-copy strong {
  display: block;
  overflow: hidden;
  color: #213740;
  font-size: 11.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.integration-marketplace-copy span {
  display: block;
  margin-top: 3px;
  color: #7a8c92;
  font-size: 9.5px;
  line-height: 1.35;
}
.integration-marketplace-state,
.integration-marketplace-request {
  grid-area: action;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: start;
  font-size: 9.5px;
  font-weight: 750;
}
.integration-marketplace-state.active {
  color: #157552;
}
.integration-marketplace-request {
  padding: 4px 7px;
  border: 1px solid #d5dfe2;
  border-radius: 5px;
  background: #fff;
  color: #38545f;
  text-decoration: none;
}
.integration-marketplace-request:hover {
  border-color: #bfcdd1;
  background: #f2f6f7;
  color: #203942;
}
@media (max-width: 720px) {
  .integration-marketplace-head { flex-direction: column; }
  .integration-marketplace-grid { grid-template-columns: 1fr; }
}

/* Chico: ações adicionais e formulários assistidos. */
@media (min-width: 761px) {
  .chico-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.chico-action-service .chico-action-icon {
  background: #eef8f3;
  color: #16845a;
}
.chico-action-service:hover .chico-action-icon {
  background: #16845a !important;
  color: #ffffff !important;
}
.chico-request-modal { z-index: 5020; }
.chico-request-dialog {
  width: min(92vw, 680px);
  max-width: 680px;
  overflow: hidden;
  border-radius: 14px;
}
.chico-request-header {
  align-items: flex-start;
  padding: 15px 18px 13px;
  background: #ffffff;
}
.chico-request-header h2 {
  margin: 2px 0 3px;
  font-size: 17px;
  color: #183746;
}
.chico-request-header p {
  margin: 0;
  color: #71838d;
  font-size: 10px;
}
.chico-request-form {
  padding: 16px 18px 18px;
  background: #f7f9fa;
}
.chico-request-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid #d8e5eb;
  border-radius: 8px;
  background: #ffffff;
  color: #607681;
  font-size: 10px;
  line-height: 1.45;
}
.chico-request-notice i { margin-top: 1px; color: #597b8d; }
.chico-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chico-request-form .field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.chico-request-form .field > span {
  color: #516a77;
  font-size: 9.5px;
  font-weight: 700;
}
.chico-request-form .field > span b { color: #b83b3b; }
.chico-request-form input,
.chico-request-form select,
.chico-request-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cddbe2;
  border-radius: 7px;
  background: #ffffff;
  color: #233f4d;
  font: inherit;
  font-size: 11px;
}
.chico-request-form input,
.chico-request-form select { padding: 0 10px; }
.chico-request-form textarea {
  min-height: 112px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.45;
}
.chico-request-form input:focus,
.chico-request-form select:focus,
.chico-request-form textarea:focus {
  outline: none;
  border-color: #188fff;
  box-shadow: 0 0 0 2px rgba(24,143,255,.10);
}
.chico-form-full { grid-column: 1 / -1; }
.chico-request-feedback {
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid #d6e2e7;
  border-radius: 8px;
  background: #ffffff;
  color: #546b76;
  font-size: 10px;
  line-height: 1.45;
}
.chico-request-feedback strong { display: block; margin-bottom: 5px; }
.chico-request-feedback ul { margin: 5px 0 0 16px; padding: 0; }
.chico-request-feedback.is-pending { color: #506b78; }
.chico-request-feedback.is-success { border-color: #bfe2cf; background: #f4fbf7; color: #256345; }
.chico-request-feedback.is-error { border-color: #edc4c4; background: #fff7f7; color: #9c3737; }
.chico-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dce5e9;
}
@media (max-width: 760px) {
  .chico-form-grid { grid-template-columns: 1fr; }
  .chico-form-full { grid-column: auto; }
  .chico-request-dialog { width: 100%; max-width: none; border-radius: 14px 14px 0 0; }
}


/* Chico - formulários de atendimento e-Jay */
.chico-request-ejay {
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-color: #cfe0e8;
  background: #f8fbfc;
}
.chico-request-ejay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
  background: #eef5f8;
  color: #183f52;
}
.chico-request-ejay > span:last-child { display: grid; gap: 2px; }
.chico-request-ejay strong { color: #183746; font-size: 10.5px; }
.chico-request-ejay small { color: #6d818b; font-size: 9.5px; line-height: 1.4; }
.chico-request-actions .btn-primary { min-width: 142px; }

/* Portal Cliente: Chico de orientação flutuante, sem bloqueio do conteúdo. */
#client-chico-modal.client-chico-floating { position:fixed; inset:auto 18px 82px auto; width:min(530px,calc(100vw - 28px)); height:min(690px,calc(100dvh - 115px)); z-index:5010; display:block; padding:0; background:transparent; pointer-events:none; }
#client-chico-modal.client-chico-floating[hidden] { display:none!important; }
#client-chico-modal.client-chico-floating .chico-dialog { pointer-events:auto; position:relative; width:100%; height:100%; max-width:none; max-height:none; margin:0; box-shadow:0 14px 48px rgba(3,22,45,.22); }
#client-chico-modal .chico-quick-actions [data-help-topic].is-help-selected { border-color:#1683e8; background:#ecf6ff; box-shadow:inset 3px 0 #1683e8; }
@media(max-width:600px){#client-chico-modal.client-chico-floating {inset:auto 8px 74px 8px;width:auto;height:min(620px,calc(100dvh - 95px));}}
/* Modal de chamados: centralizado e limitado à área visível, inclusive no portal Cliente. */
.ticket-detail-modal.ticket-detail-v14 { position:fixed; inset:0; display:grid; place-items:center; padding:10px; }
.ticket-detail-modal.ticket-detail-v14 .ticket-detail-dialog { position:relative; margin:0 auto; left:auto; right:auto; top:auto; transform:none; width:min(1880px,calc(100vw - 20px)); max-width:calc(100vw - 20px); height:min(1040px,calc(100dvh - 20px)); max-height:calc(100dvh - 20px); min-width:0; }
.ticket-detail-modal.ticket-detail-v14 .ticket-cmms-content, .ticket-detail-modal.ticket-detail-v14 .ticket-cmms-main { min-width:0; }
@media(max-width:700px){.ticket-detail-modal.ticket-detail-v14 {padding:0}.ticket-detail-modal.ticket-detail-v14 .ticket-detail-dialog {width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}}

/* Gemelo: assinatura do login com tipografia discreta e quebra adaptativa. */
.login-brand span { font-size: 8px; font-weight: 600; letter-spacing: .025em; line-height: 1.4; white-space: normal; max-width: 175px; }
@media (max-width: 620px) { .login-brand span { font-size: 7px; max-width: 145px; } }
