/* New interface: page components (mockup-nova-interface/styles.css, same class
   names). Loaded after ui.css by every customer page and by /sys. */

h1, h2, h3, p { margin-top: 0; }
table, time, .kpi-value { font-variant-numeric: tabular-nums; }
button, input, select, textarea, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); }
[hidden] { display: none !important; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 4px 8px;
  border-radius: 999px; background: var(--ok-soft); color: var(--ok);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .65; }
.badge-neutral { background: var(--neutral-soft); color: var(--muted-strong); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-plain { border: 1px solid var(--line-strong); background: transparent; color: var(--muted-strong); font-weight: 600; }
.badge-plain::before { display: none; }
.badge-plain.is-bridge { border-color: var(--bridge-line); background: var(--bridge-soft); color: var(--bridge-strong); }
.badge-plain.is-write { border-color: var(--amber-line); color: var(--amber); }

/* Panels and links */
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-head {
  min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.1px; }
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 20px; }
.inline-link { color: var(--accent-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; margin-bottom: 16px; color: var(--muted-strong); font-size: 13px; font-weight: 600; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 15px; height: 15px; }

.inline-link:focus-visible, .back-link:focus-visible, .input:focus-visible, .select:focus-visible,
.textarea:focus-visible, input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible, a.row-name:focus-visible,
.recent-row:focus-visible, .shortcuts a:focus-visible, .row-menu-item:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Section head: a titled block inside a page (20px), with an optional lead
   line and actions at the right. */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; margin-bottom: 12px; }
.section-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.section-lead { margin: 2px 0 0; color: var(--muted); }
.panel-title-spaced { margin-bottom: 12px; }

/* Page head */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-title { margin: 0; font-size: 28px; line-height: 1.14; letter-spacing: -0.6px; }
.page-description { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-head > .head-actions { flex: none; }
.page-head > div:first-child { min-width: 0; }

/* Attention: urgency drives the visual weight */
.attention { margin-bottom: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.attention-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 18px 20px 14px; }
.attention-title { margin: 0; font-size: 20px; }
.attention-count { color: var(--muted); font-size: 13px; }
.attention-list { margin: 0; padding: 0; list-style: none; }
.attention-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 20px 14px 16px; border-top: 1px solid var(--line-soft); border-left: 4px solid transparent;
}
.attention-item.is-danger { border-left-color: var(--danger); border-top-color: transparent; background: var(--danger-soft); }
.attention-item.is-warning { border-left-color: var(--amber); }
.attention-item.is-info { border-left-color: var(--blue); }
.attention-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.attention-icon svg { width: 18px; height: 18px; stroke-width: 1.9; }
.is-danger .attention-icon { background: var(--surface); color: var(--danger); }
.is-warning .attention-icon { background: var(--amber-soft); color: var(--amber); }
.is-info .attention-icon { background: var(--blue-soft); color: var(--blue); }
.attention-name { margin: 0; font-size: 16px; font-weight: 600; }
.attention-detail { margin: 2px 0 0; color: var(--muted-strong); font-size: 13px; line-height: 1.45; }
.empty-row { margin: 0; padding: 32px 20px; color: var(--muted); text-align: center; }

/* Indicator band */
.kpi-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.kpi-band.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-band.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 18px 20px; border-left: 1px solid var(--line-soft); }
.kpi:first-child { border-left: 0; }
.kpi-label { margin: 0; color: var(--muted-strong); font-size: 13px; font-weight: 600; }
.kpi-value { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi-unit { color: var(--muted); font-size: 14px; font-weight: 500; }
.kpi-delta { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted-strong); font-size: 13px; }
.kpi-delta svg { width: 15px; height: 15px; stroke-width: 2; }
.kpi-value.is-warn { color: var(--amber); }
/* A KPI that is also a filter: clicking it selects what it counts
   (Recebimentos, Mensagens agendadas). */
a.kpi-filter { color: inherit; text-decoration: none; border-radius: var(--radius-md); }
a.kpi-filter:hover { background: var(--surface-soft); }
a.kpi-filter.is-current { background: var(--bridge-soft); box-shadow: inset 0 -3px 0 var(--bridge); }
a.kpi-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.kpi-filter .kpi-label, .kpi-filter .kpi-value, .kpi-filter .kpi-delta { display: block; }
@media (max-width: 1280px) {
  .kpi-band.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-band.six .kpi:nth-child(4) { border-left: 0; }
  .kpi-band.six .kpi:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 1080px) {
  .kpi-band.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-band.six .kpi:nth-child(4) { border-left: 1px solid var(--line-soft); }
  .kpi-band.six .kpi:nth-child(5) { border-left: 0; }
}
@media (max-width: 520px) {
  .kpi-band.six { grid-template-columns: 1fr; }
  .kpi-band.six .kpi { border-left: 0; }
}
.kpi-delta.is-warning { color: var(--amber); }
.kpi-foot { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* State meter: colour never works alone (full / 45° hatch / hollow + text). */
.state-meter { display: flex; gap: 2px; height: 8px; margin-top: 6px; }
.state-meter .seg { flex: 1; min-width: 8px; border-radius: 4px; }
.seg.is-ok, .key.is-ok { background: var(--ok); }
.seg.is-danger, .key.is-danger { background: repeating-linear-gradient(45deg, var(--danger) 0 3px, var(--danger-line) 3px 5px); }
.seg.is-wait, .key.is-wait { background: var(--surface); box-shadow: inset 0 0 0 2px var(--blue); }
.seg.is-off, .key.is-off { background: var(--line-strong); }
.state-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; padding: 0; list-style: none; color: var(--muted-strong); font-size: 12px; }
.state-legend li { display: inline-flex; align-items: center; gap: 6px; }
.state-legend .key { display: inline-block; width: 12px; height: 8px; border-radius: 4px; }
.ratio-bar { display: block; height: 8px; margin-top: 6px; border-radius: 4px; background: var(--bridge-soft); box-shadow: inset 0 0 0 1px var(--bridge-line); }
.ratio-bar span { display: block; height: 100%; border-radius: 4px; background: var(--bridge); }
.ratio-bar.small { height: 6px; margin-top: 4px; }

/* Sparkline (ui_spark.js) */
.spark { position: relative; height: 36px; margin-top: 4px; }
.spark svg { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--muted); stroke-width: 2; }
.spark-now { fill: var(--bridge); stroke: var(--surface); stroke-width: 2; }
.spark-hover { fill: var(--muted-strong); stroke: var(--surface); stroke-width: 2; }
.spark-guide { stroke: var(--line-strong); stroke-width: 1; }
.spark-hit { fill: transparent; stroke: none; cursor: crosshair; }
.spark-tip {
  position: absolute; top: -28px; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px;
  background: var(--ink); color: var(--ink-inverse); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
}

/* Overview footer */
.overview-foot { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.recent-list { padding: 8px 20px 12px; }
.recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover .row-name { color: var(--accent-strong); text-decoration: underline; }
.shortcuts-title { margin: 0 0 10px; color: var(--muted-strong); font-size: 13px; font-weight: 600; }
.shortcuts ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.shortcuts a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600;
}
.shortcuts .is-disabled {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px dashed var(--line-strong);
  border-radius: 10px; color: var(--muted-strong); font-size: 13px; font-weight: 600;
}
.shortcuts .is-disabled .badge { font-weight: 600; }
.shortcuts a:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.shortcuts svg { width: 16px; height: 16px; color: var(--muted); }
.setup-compact { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; padding: 18px 20px; }
.setup-compact-title { margin: 0; font-size: 16px; }
.setup-compact-text p { margin: 4px 0 0; color: var(--muted-strong); font-size: 13px; }
.setup-compact-actions { grid-row: 1; grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; }
.setup-compact-actions form { margin: 0; }
.setup-progress { grid-column: 1 / -1; display: flex; gap: 2px; height: 6px; }
.setup-progress span { flex: 1; border-radius: 4px; background: var(--bridge-soft); box-shadow: inset 0 0 0 1px var(--bridge-line); }
.setup-progress span.done { background: var(--bridge); box-shadow: none; }
.setup-steps { grid-column: 1 / -1; }
.setup-steps > summary { width: fit-content; color: var(--accent-strong); font-size: 13px; font-weight: 600; cursor: pointer; }
.setup-steps ol { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.setup-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.setup-step .marker { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.setup-step.is-done .marker { border-color: var(--bridge); background: var(--bridge); color: var(--ink-inverse); }
.setup-step.is-done .marker svg { width: 14px; height: 14px; stroke-width: 2.4; }
.setup-step strong { display: block; font-size: 14px; }
.setup-step.is-done strong { color: var(--muted-strong); font-weight: 500; }
.setup-step span.detail { color: var(--muted); }

/* Lists: toolbar, segments, tables */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.toolbar .search { width: min(350px, 100%); }
/* Tabs: the page's main level, at most one row per page; anything below it
   (sub-views, filters, periods, dialogs) uses .segments. ui_tabs.js. */
.tabs { display: flex; gap: 4px; margin: 0 0 20px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab {
  flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 0 14px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted-strong);
  font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.tab svg { width: 16px; height: 16px; }
.tab span { color: var(--muted); font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"], .tab[aria-current="page"] { border-bottom-color: var(--bridge); color: var(--bridge-strong); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.segments[data-tabs] { margin: 0 0 20px; }
.table-panel { position: relative; overflow-x: auto; }
/* Filter bar above a list: search, optional selects and segments (ui_lists.js). */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 12px; }
.list-toolbar .search { flex: 1 1 260px; max-width: 380px; }
.list-toolbar .input, .list-toolbar .select { height: 40px; }
.list-toolbar .select { width: auto; min-width: 160px; }
.list-toolbar .segments { margin: 0; }
.filter-none { margin: 0; padding: 20px; color: var(--muted-strong); font-size: 14px; text-align: center; }
.table-panel + .table-panel { margin-top: 20px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table[hidden] { display: none; }
.data-table th {
  padding: 12px 16px; background: var(--surface-soft); color: var(--muted); font-size: 12px;
  font-weight: 700; letter-spacing: .7px; text-align: left;
}
.data-table td { padding: 16px; border-top: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.data-table tbody tr:hover { background: var(--surface-subtle); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr.is-danger td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.data-table tr.is-inactive .row-name { color: var(--muted-strong); }
.data-table .group-row th { padding: 20px 16px 8px; border-top: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.data-table tbody:first-of-type .group-row th { border-top: 0; }
.group-row a:hover { color: var(--accent-strong); text-decoration: underline; }
.group-row span { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
.row-name { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
a.row-name:hover { color: var(--accent-strong); text-decoration: underline; }
.row-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.row-sub.warning { color: var(--amber); font-weight: 600; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.row-actions form { margin: 0; }
.table-foot { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.state-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 12px; }

/* Row actions menu (ui_lists.js) */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { border-color: var(--accent); color: var(--accent-strong); }
.row-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 280px; padding: 4px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); text-align: left;
}
.row-menu-list[popover] {
  position: fixed; inset: auto; margin: 0; overflow-y: auto; width: 280px;
  min-width: min(280px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
}
.row-menu-list form { margin: 0; }
.row-menu-list hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line-soft); }
.row-menu-label { margin: 0; padding: 8px 12px 4px; color: var(--muted-strong); font-size: 12px; font-weight: 600; }
.row-menu-note { margin: 0; padding: 0 12px 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.row-menu-item {
  width: 100%; min-height: 36px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 14px; text-align: left; cursor: pointer;
}
.row-menu-item > svg { width: 16px; height: 16px; color: var(--muted-strong); }
.row-menu-item .badge { margin-left: auto; }
.row-menu-item:hover, .row-menu-item:focus-visible { background: var(--neutral-soft); }
.row-menu-item.danger, .row-menu-item.danger > svg { color: var(--danger); }

/* Forms and settings cards */
.settings-stack { display: grid; gap: 16px; }
.settings-card { overflow: hidden; }
.settings-body { padding: 20px; }
.form-stack { display: grid; gap: 16px; }
.form-grid, .data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.data-grid { margin: 0; }
.data-grid > div { min-width: 0; }
.data-grid dt { color: var(--muted-strong); font-size: 13px; }
.data-grid dd { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.settings-actions form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0; }
.settings-actions .field { min-width: 180px; }
.option-row { display: grid; gap: 8px; }
.radio { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.radio input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.radio:has(input:checked) { border-color: var(--bridge-line); background: var(--accent-soft); }
.radio small { grid-column: 2; color: var(--muted); font-size: 12px; font-weight: 400; }
.check-field { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.check-field input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.check-field small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 400; }
.def-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 24px; margin: 0; }
.def-list dt { color: var(--muted); font-size: 12px; }
.def-list dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.def-list code { font-size: 13px; font-weight: 500; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 20px; }
.danger-zone form { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0; }
.inline-form .input { height: 36px; font-size: 13px; }

/* Error pages (routes/error_pages.py, pattern from mockup estados.html) */
.empty-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--neutral-soft); color: var(--muted-strong); }
.empty-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.empty-icon.danger { background: var(--danger-soft); color: var(--danger); }
.error-page { width: min(560px, 100%); margin: clamp(24px, 8vh, 96px) auto; padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.error-page .empty-icon { width: 48px; height: 48px; margin-bottom: 16px; }
.error-page .empty-icon svg { width: 24px; height: 24px; }
.error-code { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.error-page h1 { margin: 0; font-size: 28px; letter-spacing: -0.35px; line-height: 1.2; }
.error-text { margin: 10px 0 24px; color: var(--muted-strong); font-size: 14px; line-height: 1.55; }
.error-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Activity list (automation executions, scheduled messages): one bordered list with
   dividers, fixed columns, status pill with a dot and quiet bordered actions. */
/* One bordered list with dividers, not a card per row. */
.ax-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
/* Fixed middle and action columns keep the track and status aligned across rows. */
.ax-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 170px minmax(0, 1.5fr) 260px; align-items: center; gap: 8px 20px; padding: 14px 16px; }
.ax-row + .ax-row { border-top: 1px solid var(--line); }
.ax-row > * { min-width: 0; }
.ax-who { display: flex; flex-direction: column; }
.ax-contact { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); text-decoration: none; }
.ax-contact:hover { color: var(--bridge-strong); text-decoration: underline; }
.ax-rule-label { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ax-source { color: var(--muted); font-size: 12px; }
.ax-what { display: flex; flex-direction: column; gap: 4px; }
.ax-sentence { margin: 0; font-size: 13px; color: var(--ink); }
.ax-when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ax-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ax-actions form { margin: 0; }
.ax-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; align-self: flex-start; }
.ax-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ax-pill--ok { color: var(--ok); background: var(--ok-soft); }
.ax-pill--progress { color: var(--bridge-strong); background: var(--bridge-soft); }
.ax-pill--warn { color: var(--amber); background: var(--amber-soft); }
.ax-pill--danger { color: var(--danger); background: var(--danger-soft); }
.ax-pill--off { color: var(--muted); background: var(--surface-soft); }

@media (max-width: 992px) {
  .ax-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ax-actions { justify-content: flex-start; }
}
@media (max-width: 576px) {
  .ax-row { grid-template-columns: minmax(0, 1fr); }
}

/* Account pages */
.login-card { width: min(440px, 100%); margin-inline: auto; padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -0.35px; }
.login-intro { margin: 8px 0 24px; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 16px; }
.login-card .notice { margin: 0 0 16px; }
.login-form .button-primary { width: 100%; margin-top: 4px; }
.auth-card--wide { width: min(520px, 100%); }
.auth-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.auth-icon svg { width: 22px; height: 22px; }
.auth-email { margin: 6px 0 0; color: var(--muted-strong); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.auth-wide { width: 100%; }
.auth-switch { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 20px 0 0; font-size: 13px; }
.auth-switch.is-centered { justify-content: center; }
.optional { color: var(--muted); font-weight: 400; }
.phone-pair { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 8px; }
.reveal-group { display: flex; }
.reveal-group > .input { min-width: 0; flex: 1 1 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.reveal-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface); color: var(--muted-strong); cursor: pointer; }
.reveal-button:hover { background: var(--surface-soft); color: var(--ink); }
.reveal-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-turnstile { min-height: 65px; }
.error-summary { padding: 12px 14px; border: 1px solid var(--danger); border-left-width: 4px; border-radius: 10px; background: var(--danger-soft); color: var(--ink); }
.error-summary:focus { outline: 2px solid var(--danger); outline-offset: 2px; }
.error-summary h2 { margin: 0 0 6px; font-size: 14px; }
.error-summary p { margin: 0; font-size: 13px; line-height: 1.5; }

@media (max-width: 1080px) {
  .overview-foot { grid-template-columns: 1fr; }
  .kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .kpi-band.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-band.three .kpi:nth-child(3) { border-left: 1px solid var(--line-soft); border-top: 0; }
}
@media (max-width: 980px) {
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .search { width: 100%; }
}
@media (max-width: 760px) {
  .error-page { padding: 24px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head > .button { width: 100%; }
  .page-title { font-size: 28px; }
  .form-grid, .data-grid { grid-template-columns: 1fr; }
  .input, .select, .textarea { font-size: 16px; }
  .attention-item { grid-template-columns: auto 1fr; }
  .attention-item .button, .attention-item form { grid-column: 2; justify-self: start; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .setup-compact { grid-template-columns: 1fr; }
  .setup-compact-actions { grid-row: auto; grid-column: auto; }
  .segments { width: 100%; }
  .segment { flex: 1 1 auto; justify-content: center; }
  .kpi-band.three { grid-template-columns: 1fr; }
  .kpi-band.three .kpi { border-left: 0; }
  .kpi-band.three .kpi + .kpi { border-top: 1px solid var(--line-soft); }
  /* Tables become cards: each cell carries its label (data-label). */
  .table-panel.stack { overflow: visible; }
  .data-table.stack thead { display: none; }
  .data-table.stack, .data-table.stack tbody, .data-table.stack tr, .data-table.stack td, .data-table.stack th { display: block; }
  .data-table.stack tr[hidden], .data-table.stack tbody[hidden] { display: none; }
  .data-table.stack tr.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 14px 16px; border-top: 1px solid var(--line-soft); }
  .data-table.stack tr.row > td:first-child, .data-table.stack tr.row > td.actions, .data-table.stack tr.row > td.wide { grid-column: 1 / -1; }
  .data-table.stack td { padding: 0; border: 0; }
  .data-table.stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
  .data-table.stack td.num { text-align: left; }
  .data-table.stack td.actions .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .data-table.stack tr.is-danger td:first-child { box-shadow: none; }
  .data-table.stack tr.row.is-danger { box-shadow: inset 4px 0 0 var(--danger); }
  .data-table.stack .group-row span { display: block; margin: 2px 0 0; }
  .data-table.stack tr.row:has(td.compact) { position: relative; }
  .data-table.stack tr.row > td.compact { position: absolute; top: 10px; right: 12px; }
  .data-table.stack tr.row:has(td.compact) > td:first-child { padding-right: 48px; }
  .row-menu-list { right: 0; left: auto; max-width: calc(100vw - 32px); }
}
@media (max-width: 520px) {
  .kpi-band { grid-template-columns: 1fr; }
  .kpi { border-left: 0; }
  .kpi + .kpi { border-top: 1px solid var(--line-soft); }
  .login-card { padding: 24px; }
}

/* Dialogs shared by customer pages and Sys Admin. */
/* Notifications: bell in the topbar and the notifications page. */
.notif-bell { position: relative; }
.notif-bell.active { border-color: var(--line-strong); background: var(--surface-soft); }
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: var(--ink-inverse); font-size: 12px; font-weight: 700;
  line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.notif-badge[hidden] { display: none; }
.notif-item.is-unread .attention-name::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%;
  background: var(--blue); vertical-align: middle;
}
.notif-filter { margin-bottom: 16px; }
.notif-meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.notif-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.notif-actions form { margin: 0; }
.attention-dismiss { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.attention-dismiss form { margin: 0; }
.button-link { padding: 0; border: 0; background: none; color: var(--muted-strong); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.button-link:hover { color: var(--ink); }
@media (max-width: 760px) {
  .notif-actions { grid-column: 2; justify-content: flex-start; }
}

/* Saúde da conexão (docs/connection_health_v2_plan.md §5; prévia aprovada
   em mockup-nova-interface/saude.html). O estado muda o próprio cartão:
   faixa lateral e cabeçalho no tom do estado, sempre com ícone e texto. */
.health-card { margin-bottom: 20px; overflow: hidden; border-left: 4px solid var(--line-strong); }
.health-card.is-danger { border-color: var(--danger-line); border-left-color: var(--danger); }
.health-card.is-warning { border-left-color: var(--amber); }
.health-card.is-ok { border-left-color: var(--ok); }
.health-head { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px; padding: 18px 20px; }
.health-card.is-danger .health-head { background: var(--danger-soft); }
.health-card.is-warning .health-head { background: var(--amber-soft); }
.health-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--surface); }
.health-icon svg { width: 20px; height: 20px; stroke-width: 1.9; }
.health-card.is-danger .health-icon { color: var(--danger); }
.health-card.is-warning .health-icon { color: var(--amber); }
.health-card.is-ok .health-icon { background: var(--ok-soft); color: var(--ok); }
.health-card.is-empty .health-icon { background: var(--neutral-soft); color: var(--muted-strong); }
.health-kicker { margin: 0 0 2px; color: var(--muted-strong); font-size: 13px; font-weight: 600; }
.health-state { margin: 0; font-size: 20px; font-weight: 600; }
.health-card.is-danger .health-state { color: var(--danger); }
.health-card.is-warning .health-state { color: var(--amber); }
.health-lead { margin: 6px 0 0; max-width: 68ch; color: var(--ink); font-size: 14px; line-height: 1.5; }
.health-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.health-updated { margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.health-section { padding: 16px 20px; border-top: 1px solid var(--line-soft); }
.health-section-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.health-reasons { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.health-reason { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14px; line-height: 1.45; }
.health-reason svg { width: 18px; height: 18px; margin-top: 1px; stroke-width: 1.9; }
.health-reason.is-danger svg { color: var(--danger); }
.health-reason.is-warning svg { color: var(--amber); }
.health-reason.is-info svg { color: var(--blue); }
.health-reason small { display: block; color: var(--muted-strong); font-size: 13px; }
.health-card .kpi-band { margin: 0; border-top: 1px solid var(--line-soft); }
.health-card .kpi-value { font-variant-numeric: tabular-nums; }
.health-steps { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.health-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--surface-soft); }

/* Valor contra a referência: a barra mostra o valor, a marca mostra o
   esperado, e os dois aparecem também em texto. */
.ref-bar { position: relative; height: 8px; margin-top: 6px; border-radius: 4px; background: var(--neutral-soft); }
.ref-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--muted-strong); }
.ref-bar.is-danger .ref-fill { background: var(--danger); }
.ref-bar.is-warning .ref-fill { background: var(--amber); }
.ref-bar.is-ok .ref-fill { background: var(--ok); }
.ref-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.ref-legend { margin: 0; color: var(--muted-strong); font-size: 12px; }

/* Fase do aquecimento: semanas cumpridas cheias, a atual hachurada, as
   próximas vazadas; sempre com o texto da fase. */
.phase-meter { display: flex; gap: 2px; height: 8px; margin-top: 6px; }
.phase-meter span { flex: 1; border-radius: 4px; }
.phase-meter .done { background: var(--bridge); }
.phase-meter .now { background: repeating-linear-gradient(45deg, var(--bridge) 0 3px, var(--bridge-soft) 3px 5px); }
.phase-meter .next { background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }

/* Linha de saúde no cartão da lista de conexões. */
.conn-health { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.conn-health span:last-child:not(.badge) { color: var(--muted-strong); }

@media (max-width: 760px) {
  .health-head { grid-template-columns: auto 1fr; }
  .health-head-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .health-foot .button { width: 100%; }
}

/* Explicação sob demanda: o ⓘ ao lado do nome abre uma dica curta
   (templates/app/_ui.html info_tip, static/js/ui_info_tip.js). Botão de
   verdade, para teclado e toque; o guia completo fica num ui-dialog. */
.info-tip { position: relative; display: inline-flex; vertical-align: middle; }
.info-tip > button { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -4px 0 -4px 2px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.info-tip > button:hover, .info-tip > button[aria-expanded="true"] { background: var(--neutral-soft); color: var(--ink); }
.info-tip > button:focus-visible { outline: 2px solid var(--bridge); outline-offset: 1px; }
.info-tip > button svg { width: 15px; height: 15px; }
.tip-bubble { position: absolute; z-index: 20; top: calc(100% + 6px); left: -8px; width: 260px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); color: var(--ink); font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; }
.tip-bubble[hidden] { display: none; }

/* Métricas da conexão (prévia aprovada: mockup-nova-interface/metricas-conexao.html). */
.metrics-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.metric-panel { margin-bottom: 20px; }
.filter-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: -8px 0 16px; color: var(--muted-strong); font-size: 13px; }
.health-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 20px; padding: 14px 20px; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius-lg); background: var(--amber-soft); }
.health-strip.is-danger { border-color: var(--danger-line); border-left-color: var(--danger); background: var(--danger-soft); }
.health-strip > svg { width: 20px; height: 20px; color: var(--amber); }
.health-strip.is-danger > svg, .health-strip.is-danger strong { color: var(--danger); }
.health-strip p { margin: 0; font-size: 14px; line-height: 1.45; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.section-sub { display: flex; align-items: center; margin: 0; padding: 14px 20px 6px; border-top: 1px solid var(--line-soft); font-size: 14px; font-weight: 600; }
.window-bars { display: grid; gap: 14px; padding: 6px 20px 18px; }
.window-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 150px; align-items: center; gap: 12px; font-size: 13px; }
.window-bar .ref-bar { margin: 0; }
.window-bar .wb-label { color: var(--muted-strong); font-weight: 600; }
.window-bar .wb-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.window-bar .wb-value small { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.compact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; margin: 0; padding: 0 20px 6px; border-top: 1px solid var(--line-soft); }
.compact-list > div { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.compact-list dt { display: flex; align-items: center; color: var(--muted-strong); font-size: 13px; }
.compact-list dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.more-details { border-top: 1px solid var(--line-soft); }
.more-details > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px; color: var(--bridge); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary svg { width: 15px; height: 15px; }
.more-details[open] > summary svg { transform: rotate(90deg); }
.more-details > summary:focus-visible { outline: 2px solid var(--bridge); outline-offset: -2px; }
.more-details .table-scroll { margin: 0 20px 16px; }
.hour-strip { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; align-items: end; height: 72px; padding: 0 20px; }
.hour-strip span { min-height: 2px; border-radius: 4px 4px 0 0; background: var(--bridge); }
.hour-strip span.is-night { background: repeating-linear-gradient(45deg, var(--amber) 0 3px, var(--amber-soft) 3px 5px); }
.hour-axis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; padding: 4px 20px 0; color: var(--muted); font-size: 12px; }
.hour-axis span { text-align: center; }
.hour-legend { margin: 8px 20px 16px; color: var(--muted-strong); font-size: 12px; }
.page-foot-note { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 20px; color: var(--muted); font-size: 12px; }
/* Help texts (docs/frontend_guidelines.md §6 "Textos de ajuda"): the
   "Como funciona" link in the head of a block or page and its dialog body. */
.how-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 6px; background: none; color: var(--bridge); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.how-link:hover { background: var(--bridge-soft); }
.how-link:focus-visible { outline: 2px solid var(--bridge); outline-offset: 1px; }
.how-link svg { width: 16px; height: 16px; flex: none; }
.how-body h3 { margin: 16px 0 6px; font-size: 14px; }
.how-body h3:first-child { margin-top: 0; }
.how-body p, .how-body li { margin: 0 0 8px; color: var(--muted-strong); font-size: 14px; line-height: 1.5; }
.how-body ul { margin: 0 0 8px; padding-left: 20px; }
.how-body pre { max-width: 100%; margin: 0 0 8px; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); font-size: 12px; white-space: pre-wrap; word-break: break-all; }@media (max-width: 760px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat-row .kpi { border-left: 0; border-top: 1px solid var(--line-soft); }
  .stat-row .kpi:first-child { border-top: 0; }
  .compact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .window-bar { grid-template-columns: 76px minmax(0, 1fr); }
  .window-bar .wb-value { grid-column: 2; }
  .health-strip { grid-template-columns: auto 1fr; }
  .health-strip .button { grid-column: 2; justify-self: start; }
  .hour-axis span:nth-child(odd) { visibility: hidden; }
  .tip-bubble { width: min(260px, calc(100vw - 48px)); }
}

/* Overview agenda, connection rows and today's automations (dashboard.html).
   Manual schedule = bridge blue, automation = violet; the status is always
   written on the badge, never carried by colour alone. */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 20px; }
.overview-side { display: grid; gap: 16px; min-width: 0; }
.agenda { min-width: 0; }
.agenda-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 16px 20px 0; }
.agenda-daybtn {
  display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
}
.agenda-daybtn:hover { background: var(--surface-soft); }
.agenda-daybtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.agenda-daybtn[aria-pressed="true"] { border-color: var(--bridge); box-shadow: inset 0 0 0 1px var(--bridge); background: var(--bridge-soft); }
.agenda-daybtn.is-empty .agenda-num, .agenda-daybtn.is-empty .agenda-count { color: var(--muted); }
.agenda-dow { color: var(--muted-strong); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.agenda-num { font-size: 20px; font-weight: 600; line-height: 1.1; }
.agenda-bars { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin: 4px 0 2px; }
.agenda-bars span { width: 8px; border-radius: 4px 4px 0 0; }
.agenda .panel-head { flex-wrap: wrap; }
.agenda .segments { flex-wrap: nowrap; }
.bar-manual, .agenda-legend .key.is-manual { background: var(--bridge); }
.bar-automation, .agenda-legend .key.is-automation { background: var(--violet); }
.agenda-count { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-flag {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: var(--ink-inverse); font-size: 12px; font-weight: 700;
}
.agenda-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; padding: 0 20px; list-style: none; color: var(--muted-strong); font-size: 12px; }
.agenda-legend li { display: inline-flex; align-items: center; gap: 6px; }
.agenda-legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 4px; }
.agenda-day { padding: 16px 20px 4px; }
.agenda-day[aria-busy="true"] { opacity: .6; }
.agenda-day-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.agenda-day-title { margin: 0; font-size: 14px; font-weight: 600; }
.agenda-day-title::first-letter { text-transform: uppercase; }
.agenda-day-sum { margin: 0; color: var(--muted); font-size: 13px; }
.agenda-blocked {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--danger-soft);
}
.agenda-blocked > svg { width: 18px; height: 18px; color: var(--danger); }
.agenda-blocked p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.agenda-list { margin: 0; padding: 0; list-style: none; }
.agenda-item {
  display: grid; grid-template-columns: 48px auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line-soft);
}
.agenda-item:first-child { border-top: 0; }
.agenda-item.is-sent .agenda-name, .agenda-item.is-sent .agenda-time { color: var(--muted); }
.agenda-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-kind { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.agenda-kind svg { width: 15px; height: 15px; }
.agenda-kind.is-manual { background: var(--bridge-soft); color: var(--bridge-strong); }
.agenda-kind.is-automation { background: var(--violet-soft); color: var(--violet); }
.agenda-what { min-width: 0; }
.agenda-name { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
a.agenda-name:hover { color: var(--accent-strong); text-decoration: underline; }
.agenda-what > span { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-empty, .agenda-more { margin: 0; padding: 16px 0; color: var(--muted); font-size: 13px; }
.agenda-more { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; }
.agenda-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); font-size: 13px; }

.conn-rows { margin: 0; padding: 4px 0; list-style: none; }
.conn-rows-empty { margin: 0; padding: 16px 20px 20px; }
.conn-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 20px; }
.conn-row + .conn-row { border-top: 1px solid var(--line-soft); }
.conn-row-state { width: 10px; height: 10px; border-radius: 50%; }
.conn-row-state.is-ok { background: var(--ok); }
.conn-row-state.is-down { background: repeating-linear-gradient(45deg, var(--danger) 0 2px, var(--danger-line) 2px 4px); }
.conn-row-state.is-wait { box-shadow: inset 0 0 0 2px var(--blue); }
.conn-row-state.is-off { background: var(--line-strong); }
.conn-row.is-off .conn-row-name { color: var(--muted); }
.conn-row-name { display: block; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.conn-row-name:hover { color: var(--accent-strong); text-decoration: underline; }
.conn-row-text > span, .conn-row-num span { display: block; color: var(--muted); font-size: 12px; }
.conn-row.is-down .conn-row-text > span { color: var(--danger); }
.conn-row-num { text-align: right; }
.conn-row-num strong { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }

.auto-today { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border-radius: 0 0 14px 14px; background: var(--line-soft); overflow: hidden; }
.auto-today > div { padding: 14px 20px; background: var(--surface); }
.auto-today dt { color: var(--muted-strong); font-size: 12px; font-weight: 600; }
.auto-today dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.auto-today .is-warning dd { color: var(--amber); }
.auto-today .is-danger dd { color: var(--danger); }

@media (max-width: 1080px) {
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .agenda .panel-head { flex-direction: column; align-items: flex-start; }
  .agenda-week { gap: 4px; padding: 12px 16px 0; }
  .agenda-legend { padding: 0 16px; }
  .agenda-day { padding: 12px 16px 4px; }
  .agenda-item { grid-template-columns: 44px minmax(0, 1fr); }
  .agenda-kind { display: none; }
  .agenda-item .badge { grid-column: 2; justify-self: start; white-space: normal; }
  .agenda-blocked { grid-template-columns: auto 1fr; }
  .agenda-blocked .button { grid-column: 2; justify-self: start; }
  .agenda-foot { padding: 12px 16px 16px; }
  .conn-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 10px 16px; }
  .conn-row .badge { grid-column: 2 / -1; justify-self: start; }
}
@media (max-width: 520px) {
  .agenda-daybtn { padding: 8px 2px; }
  .agenda-num { font-size: 16px; }
  .agenda-dow { font-size: 12px; }
  .agenda-bars span { width: 6px; }
  .auto-today { grid-template-columns: 1fr; }
}
