:root {
  --brand: #00b9ad;
  --brand-strong: #009e94;
  --brand-soft: #eaf9f7;
  --ink: #15252b;
  --ink-strong: #08171c;
  --muted: #65757c;
  --muted-2: #87949a;
  --line: #e1e8ea;
  --line-strong: #cfd9dc;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --surface-3: #eef3f4;
  --header: #07171b;
  --header-2: #0b2025;
  --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: 80;
  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: brightness(0) invert(1); 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 { 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: #10282e; 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: #008b82; border-color: #008b82; }
.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; }

/* 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; }
.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: #70c8c1; box-shadow: 0 0 0 2px rgba(0,185,173,.08); }
.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: #68c6bf; background: #f3fbfa; box-shadow: inset 3px 0 0 var(--brand); }
.method-selector input:checked + span > i { background: #dff5f2; 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: 200; 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: #70c8c1;
  box-shadow: 0 0 0 2px rgba(0,185,173,.08);
}
.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.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: #061419;
}
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: #061419;
}
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: #071a20;
  color: #fff;
}
body.alarm-wallboard .wallboard-bar > div:first-child { display: flex; align-items: baseline; gap: 16px; }
.wallboard-brand { color: #63d8d0; 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: #071a20; }
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: only the Virtual TI logo is shown. */
.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: #edf8f7; color: #087b73; 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: brightness(0) invert(1); 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: #0c2329; 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: #0c2329; color: #bfd0d3; }
.refresh-menu-dark button:hover { background: #123039; color: #fff; }
.refresh-menu-dark button.active { background: #123a3a; color: #74ddd5; }

@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: #10282e;
  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-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: #10282e; color: #e7f0f1; font-size: 30px; font-weight: 700;
}

@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 #009e94; }
.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: #087c74;
}
.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: #071a20; 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: #071a20; }
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: #70c8c1; box-shadow: 0 0 0 2px rgba(0,185,173,.08); }
.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: #07171b; 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-virtual img { filter: brightness(0) invert(1); }
.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: #7fd5cf; 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: #70c8c1;
  box-shadow: 0 0 0 2px rgba(0,185,173,.08);
}
.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: #70c8c1; box-shadow: 0 0 0 2px rgba(0,185,173,.08); }
.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: #0b2025;
  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(0,185,173,.09); }
.nav-primary .nav-dropdown a.active > i { border-color: rgba(0,185,173,.22); color: #53d3cb; }
.nav-dropdown-disabled { opacity: .48; cursor: default; }

/* 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-menu-toggle 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-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(0,185,173,.24); 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(0,185,173,.22); 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: #087c74; 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: #087c74; 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: #087c74; 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; }
}
