/* Alumifix UI — inspirado no Mantis Free (CodedThemes)
   https://mantisdashboard.com/free/
*/
@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap");

:root {
  --primary: #4680ff;
  --primary-hover: #3a6ce0;
  --primary-soft: rgba(70, 128, 255, 0.12);
  --success: #52c41a;
  --success-soft: rgba(82, 196, 26, 0.12);
  --warning: #faad14;
  --warning-soft: rgba(250, 173, 20, 0.14);
  --danger: #ff4d4f;
  --danger-soft: rgba(255, 77, 79, 0.12);
  --info: #13c2c2;
  --bg: #f5f6fa;
  --bg-soft: #eef2f6;
  --paper: #ffffff;
  --paper2: #fafbfc;
  --border: #e6ebf1;
  --border-strong: #d5dbe3;
  --text: #1d2630;
  --text-secondary: #5b6b79;
  --muted: #8c9aa8;
  --shadow: 0 1px 2px rgba(29, 38, 48, 0.04), 0 8px 24px rgba(29, 38, 48, 0.06);
  --shadow-sm: 0 1px 3px rgba(29, 38, 48, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: #1d2630;
  --ok: var(--success);
  --accent: var(--primary);
  --warn: var(--warning);
  --panel: var(--paper);
  --panel2: var(--bg-soft);
  /* Bootstrap 5 theme bridge */
  --bs-primary: #4680ff;
  --bs-primary-rgb: 70, 128, 255;
  --bs-success: #52c41a;
  --bs-warning: #faad14;
  --bs-danger: #ff4d4f;
  --bs-body-bg: #f5f6fa;
  --bs-body-color: #1d2630;
  --bs-border-color: #e6ebf1;
  --bs-border-radius: 8px;
  --bs-border-radius-sm: 6px;
  --bs-font-sans-serif: "Public Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Public Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Top bar —— */
.app-header, header.mantis-header, body > header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

header h1, .app-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
header h1 span, .brand-accent { color: var(--primary); }

.header-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link, a.nav {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.nav-link:hover, a.nav:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

/* —— Layout —— */
main, .app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.15rem; }

/* —— Cards / panels —— */
.panel, .card, .summary-card, .charge-card, .session-card, .sd-chart-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel { overflow: hidden; }

.panel-head {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--paper);
}
.panel-head h2, .panel-head h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.panel-body { padding: 1rem 1.15rem; }

/* —— Tables —— */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--paper2);
}
tr:hover td { background: rgba(70, 128, 255, 0.03); }
.mono {
  font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  color: var(--primary);
  font-size: 0.82rem;
}

.online, .status-active { color: var(--success); font-weight: 600; }
.offline, .status-completed { color: var(--text-secondary); }

/* —— Badges / chips —— */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.badge.ok {
  background: var(--success-soft);
  border-color: transparent;
  color: #389e0d;
}
.badge.off {
  background: var(--bg-soft);
  color: var(--muted);
}
.badge.warn {
  background: var(--warning-soft);
  border-color: transparent;
  color: #d48806;
}

/* —— Buttons —— */
button:not(.btn) {
  font-family: inherit;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
button.danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: #cf1322;
}
button.danger:hover:not(:disabled) {
  background: rgba(255, 77, 79, 0.2);
  border-color: transparent;
  color: #cf1322;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* —— Forms —— */
label, .field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
input:not(.form-control):not(.form-select):not(.form-check-input),
select:not(.form-select),
textarea:not(.form-control) {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.875rem;
  font-family: inherit;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:not(.form-control):not(.form-select):not(.form-check-input):focus,
select:not(.form-select):focus,
textarea:not(.form-control):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* —— Modal (app-modal: evita conflito com .modal do Bootstrap) —— */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(29, 38, 48, 0.45);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.app-modal {
  display: block;
  position: relative;
  z-index: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.35rem;
}
.app-modal h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.app-modal.app-modal-wide { max-width: 760px; }
.cfg-sub { font-size: 0.82rem; color: var(--muted); margin: -0.5rem 0 0.75rem; }
.cfg-toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.cfg-toolbar .form-control { flex: 1; }
.cfg-table-wrap { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.cfg-table { margin: 0; font-size: 0.82rem; }
.cfg-table thead th { position: sticky; top: 0; background: var(--paper); z-index: 1; }
.cfg-table td { vertical-align: middle; }
.cfg-table .cfg-key { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.cfg-table .cfg-value { min-width: 9rem; }
.cfg-table tr.cfg-highlight td { background: rgba(70, 128, 255, 0.08); }
.cfg-table .cfg-ro { font-size: 0.7rem; color: var(--muted); }
.cfg-table .cfg-status { display: block; font-size: 0.72rem; margin-top: 0.15rem; }
.cfg-status.ok { color: #1a7f37; }
.cfg-status.warn { color: #9a6700; }
.cfg-status.err { color: #cf222e; }
.cfg-custom { margin-top: 0.75rem; font-size: 0.85rem; }
.cfg-custom summary { cursor: pointer; color: var(--muted); }
.cfg-custom-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.modal-error { color: #cf1322; font-size: 0.8rem; min-height: 1.2em; }
.modal-error.ok { color: #1a7f37; }
.modal-error.warn { color: #9a6700; }

/* —— Toast —— */
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 4100;
  display: none;
  box-shadow: var(--shadow);
}
.toast.show { display: block; }
.toast.ok {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}
.toast.err {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

/* —— Summary cards —— */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.summary-card { padding: 1rem 1.15rem; }
.summary-card label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}
.summary-card .val {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.summary-card .val.accent { color: var(--primary); }
.summary-card .val.warn { color: #d48806; }
.summary-card .val.ok { color: #389e0d; }

/* —— Tabs —— */
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tab {
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
}
.tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.tab:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

/* —— Sessions / live cards —— */
.sessions-active {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.session-card {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.1rem;
}
.session-card-clickable {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.session-card-clickable:hover,
.session-card-clickable:focus-visible {
  background: #f8fafc;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
  outline: none;
}
.session-card-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary, #6b7280);
}
.session-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.session-card-head h3 { font-size: 0.95rem; font-weight: 600; }
.session-card-head .badge-live {
  background: var(--success-soft);
  border: none;
  color: #389e0d;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.session-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.55rem;
}
.metric {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
}
.metric label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.metric .val {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.metric .val.accent { color: var(--primary); }
.metric .val.ok { color: #389e0d; }
.metric .metric-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}
.metric.metric-amount .val {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.history-title {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.85rem 1.25rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

tr.session-row { cursor: pointer; }

/* Zebrado compatível com Bootstrap 5 (usa box-shadow nas células) */
.table-tx > tbody > tr.session-row-alt > *,
.table-tx > tbody > tr.session-detail-row.session-row-alt > * {
  --bs-table-bg-type: #fafbfc;
  background-color: #fafbfc !important;
  box-shadow: inset 0 0 0 9999px #fafbfc !important;
}
.table-tx > tbody > tr.session-row:hover > * {
  --bs-table-bg-state: #f3f6f9;
  background-color: #f3f6f9 !important;
  box-shadow: inset 0 0 0 9999px #f3f6f9 !important;
}
.table-tx > tbody > tr.session-row.open > * {
  --bs-table-bg-state: rgba(70, 128, 255, 0.08);
  background-color: rgba(70, 128, 255, 0.08) !important;
  box-shadow: inset 0 0 0 9999px rgba(70, 128, 255, 0.08) !important;
  border-bottom-color: transparent;
}
.table-tx.table-mgmt td:first-child,
.table-tx.table-mgmt th:first-child {
  padding-left: 1.85rem;
}
tr.session-row td:first-child { position: relative; }
tr.session-row td:first-child::before {
  content: "▸";
  position: absolute;
  left: 0.7rem;
  color: var(--muted);
  font-size: 0.75rem;
}
tr.session-row.open td:first-child::before {
  content: "▾";
  color: var(--primary);
}
tr.session-detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
  background: var(--paper2) !important;
  box-shadow: none !important;
}
.session-detail { padding: 1rem 1.25rem 1.15rem; animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.session-detail-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.sd-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.4fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .sd-layout { grid-template-columns: 1fr; } }
.sd-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.sd-summary-left h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.sd-summary-left .sub { font-size: 0.8rem; color: var(--text-secondary); }
.sd-summary-stats { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; }
.sd-stat { text-align: right; }
.sd-stat label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
}
.sd-stat .val {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sd-stat .val.money { color: #389e0d; }
.sd-stat .val.energy { color: var(--primary); }
.sd-meta-list { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.84rem; }
.sd-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.sd-meta-row span:first-child { color: var(--text-secondary); }
.sd-meta-row span:last-child { font-weight: 600; text-align: right; }
.sd-chart-card { padding: 0.85rem; }
.sd-chart-card h4 { font-size: 0.88rem; margin-bottom: 0.5rem; font-weight: 600; }
.sd-chart-legend {
  display: flex;
  gap: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.sd-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.sd-chart-wrap { width: 100%; overflow: hidden; }
.sd-chart-wrap svg { width: 100%; height: auto; display: block; }
.sd-chart-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 2rem 0.5rem;
  text-align: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

/* —— Transações: filtros (Bootstrap grid) —— */
.tx-panel .card-header { background: var(--paper); }
.tx-panel.panel-mgmt .panel-mgmt-head { padding-bottom: 1rem !important; }
.tx-filters .form-select,
.tx-filters .form-control { font-size: 0.8125rem; }
.tx-filters .input-group-text { font-size: 0.8125rem; color: var(--muted); background: var(--paper); }
.table-tx.table-mgmt {
  table-layout: auto;
  min-width: 960px;
}
.table-tx.table-mgmt tbody tr:nth-child(even) > * {
  background: transparent;
}
.table-tx.table-mgmt th,
.table-tx.table-mgmt td {
  text-align: center;
  vertical-align: middle;
}
.table-tx.table-mgmt td:first-child,
.table-tx.table-mgmt th:first-child {
  padding-left: 1.85rem;
  padding-right: 0.75rem;
}
.table-tx .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
}
.table-tx .status-completed {
  text-transform: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.table-tx .pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* —— Date range picker (dois meses) —— */
.drp { position: relative; width: 100%; min-width: 15.5rem; }
.drp-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.42rem 0.7rem;
  font-size: 0.8125rem;
  color: var(--text);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
}
.drp-trigger:hover { border-color: var(--primary); }
.drp.is-open .drp-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.drp-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drp-ico { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.drp-pop {
  position: fixed;
  z-index: 2400;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(29, 38, 48, 0.16);
  padding: 0.85rem 0.85rem 0.7rem;
  min-width: min(560px, calc(100vw - 2rem));
}
.drp-pop::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 1.4rem;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.drp-cals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.drp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  min-height: 28px;
}
.drp-cal-head strong {
  font-size: 0.92rem;
  font-weight: 700;
}
.drp-nav {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}
.drp-nav:hover { background: var(--bg-soft); }
.drp-nav[hidden] { visibility: hidden; }
.drp-week, .drp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.drp-week span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.25rem 0 0.4rem;
}
.drp-day {
  appearance: none;
  border: 0;
  background: transparent;
  height: 34px;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  border-radius: 0;
  position: relative;
}
.drp-day.is-out { color: #c5ced6; }
.drp-day.is-in { background: #fde6d8; }
.drp-day.is-start { border-radius: 6px 0 0 6px; }
.drp-day.is-end { border-radius: 0 6px 6px 0; }
.drp-day.is-start.is-end { border-radius: 6px; }
.drp-day.is-edge {
  background: #f08a4b;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  z-index: 1;
}
.drp-day.is-today:not(.is-edge) { font-weight: 700; }
.drp-day:hover:not(.is-edge) { background: #f8dccb; }
.drp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.drp-foot-range {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.drp-actions { display: flex; align-items: center; gap: 0.65rem; margin-left: auto; }
.drp-cancel {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0.35rem 0.4rem;
}
.drp-apply {
  border: 0;
  background: #1d2630;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  font-family: inherit;
}
.drp-apply:hover { background: #111820; }
@media (max-width: 700px) {
  .drp-cals { grid-template-columns: 1fr; }
}

.br-date .form-control {
  padding-right: 2.1rem;
  font-variant-numeric: tabular-nums;
}
.br-date-native {
  position: absolute;
  top: 0;
  right: 0;
  width: 2rem;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  z-index: 2;
}
.br-date::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238c9aa8' stroke-width='1.6'%3E%3Crect x='2' y='3' width='10' height='9' rx='1.5'/%3E%3Cpath d='M2 6h10M5 1.5v3M9 1.5v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pay-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pay-badge.pay-pending { background: var(--warning-soft); color: #d48806; }
.pay-badge.pay-paid { background: var(--success-soft); color: #389e0d; }
.pay-badge.pay-waived { background: var(--bg-soft); color: var(--text-secondary); }

/* —— Caixa —— */
.charge-list { display: flex; flex-direction: column; gap: 0.85rem; }
.charge-card {
  border-left: 4px solid var(--warning);
  padding: 1rem 1.15rem;
}
.charge-card.paid { border-left-color: var(--success); }
.charge-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.charge-head h3 { font-size: 1rem; font-weight: 600; }
.charge-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }
.amount-big {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
  letter-spacing: -0.02em;
}
.amount-big small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}
.pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.pay-row .field { flex: 1; min-width: 140px; }
.paid-info { font-size: 0.84rem; color: #389e0d; }

/* —— Login —— */
body.login-page {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(70, 128, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(19, 194, 194, 0.12), transparent 50%),
    var(--bg);
}
.login-card.card { border-radius: 16px; }
.login-card .subtitle { color: var(--text-secondary); font-size: 0.9rem; }
.login-card .demo code {
  color: var(--primary);
  font-size: 0.75rem;
  background: var(--primary-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.quick-login button.btn-posto {
  background: var(--success-soft);
  border-color: transparent;
  color: #389e0d;
}
.quick-login button.btn-posto:hover {
  background: rgba(82, 196, 26, 0.22);
  color: #389e0d;
}
.quick-login button.btn-alumifix {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}
.quick-login button.btn-alumifix:hover {
  background: rgba(70, 128, 255, 0.2);
  color: var(--primary);
}

.currency-input { font-variant-numeric: tabular-nums; }

/* —— Admin —— */
body.admin-page .tabs {
  max-width: 1400px;
  margin: 0.85rem auto 0;
  padding: 0 1.5rem;
}
body.admin-page main {
  max-width: 1400px;
  padding-top: 0.85rem;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }
#logs-panel pre,
.logs-pre {
  font-size: 0.78rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow: auto;
  max-height: 60vh;
  white-space: pre-wrap;
  color: var(--text);
}
.log-entry {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.log-time { font-size: 0.72rem; color: var(--muted); }
.monitor-cp-select { width: auto; min-width: 16rem; max-width: 24rem; }
.monitor-cp-select-lg { max-width: 28rem; }
.hint { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.5rem; }

/* —— OCPP monitor (index) —— */
:root {
  --recv: #4680ff;
  --send: #faad14;
  --sys: #8c9aa8;
}
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 1680px;
  margin: 0 auto;
}
.main-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.filters label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  margin: 0;
  color: var(--text-secondary);
}
#messages {
  max-height: 42vh;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.msg {
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--border);
  background: var(--bg-soft);
  padding: 0.65rem 0.85rem;
  animation: fadeIn 0.2s ease;
}
.msg.recv { border-left-color: var(--recv); }
.msg.send { border-left-color: var(--send); }
.msg.system { border-left-color: var(--sys); }
.msg.command { border-left-color: var(--primary); }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.msg-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.msg-time { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.msg-dir {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.msg.recv .msg-dir { background: var(--primary-soft); color: var(--recv); }
.msg.send .msg-dir { background: var(--warning-soft); color: #d48806; }
.msg.system .msg-dir { background: var(--bg-soft); color: var(--sys); }
.msg.command .msg-dir { background: var(--primary-soft); color: var(--primary); }
.msg-action { font-weight: 600; font-size: 0.9rem; }
.msg-id { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.msg-summary { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.msg pre {
  font-size: 0.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.ocpp-aside { display: flex; flex-direction: column; }
.stat-grid { display: grid; gap: 0.6rem; }
.stat {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.stat label { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 0.15rem; }
.stat value, .stat .val { font-weight: 600; word-break: break-all; }
.stat value.big, .stat .val.big { font-size: 1.1rem; color: var(--primary); }
.connector-list { display: flex; flex-direction: column; gap: 0.4rem; }
.connector {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: var(--bg-soft);
  border-radius: 6px;
  font-size: 0.8rem;
}
.status-Available { color: var(--success); }
.status-Charging { color: var(--primary); }
.status-Preparing, .status-Finishing { color: #d48806; }
button.warn {
  background: var(--warning-soft);
  border-color: transparent;
  color: #d48806;
}
button.sm { padding: 0.25rem 0.5rem; font-size: 0.72rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.form-row.full { grid-template-columns: 1fr; }
.field label { margin-bottom: 0.2rem; }
.field input, .field select { margin-bottom: 0; }
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.btn-grid .full { grid-column: 1 / -1; }
#command-feedback {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  display: none;
}
#command-feedback.ok {
  display: block;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}
#command-feedback.err {
  display: block;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}
.tags-table-wrap { overflow-x: auto; }
.tag-mono { font-family: ui-monospace, Consolas, monospace; color: var(--primary); }
.filters input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* —— App shell + left nav (Mantis-like) —— */
:root {
  --nav-width: 240px;
}

body.has-sidebar {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-width);
  background: #f8f9fa;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1045;
}

/* Bootstrap offcanvas-lg: sidebar fixo em desktop */
@media (min-width: 992px) {
  .offcanvas-lg.app-sidebar {
    transform: none !important;
    visibility: visible !important;
    position: fixed;
    border-right: 1px solid var(--border);
    width: var(--nav-width) !important;
  }
}
@media (max-width: 991.98px) {
  .offcanvas.app-sidebar { width: min(280px, 85vw) !important; }
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem 0.85rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
  border-bottom: 1px solid transparent;
}
.app-sidebar-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.app-sidebar-brand span { color: var(--primary); }

.app-sidebar-scope {
  padding: 0.85rem 0.85rem 0.65rem;
}
.app-sidebar-scope .scope-group {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.app-sidebar-scope .form-select {
  font-size: 0.82rem;
}

.app-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  color: #5b6b79;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.app-nav-item:hover {
  background: rgba(29, 38, 48, 0.05);
  color: var(--text);
  text-decoration: none;
}
.app-nav-item.active {
  background: #eceff1;
  color: var(--text);
  font-weight: 600;
}
.app-nav-item .nav-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
  display: grid;
  place-items: center;
}
.app-nav-item .nav-ico svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-nav-item.active .nav-ico { opacity: 1; color: var(--primary); }

.app-nav-section {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.35rem;
  padding: 0.85rem 0.85rem 0.35rem;
  border-top: 1px solid var(--border);
}

.app-sidebar-foot {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.app-sidebar .offcanvas-body {
  padding: 0.5rem 0.65rem 1rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
@media (min-width: 992px) {
  .app-sidebar .offcanvas-header { display: none !important; }
}

.app-content {
  flex: 1;
  margin-left: var(--nav-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (max-width: 991.98px) {
  .app-content { margin-left: 0; }
}

body.has-sidebar > header,
body.has-sidebar .app-content > header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0.85rem 1.5rem;
}

body.has-sidebar main,
body.has-sidebar .app-content > main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1.25rem 1.5rem 2rem;
}

.app-topbar {
  padding: 0.85rem 1.5rem !important;
  gap: 0.75rem;
}

#tenant-select {
  min-width: 160px;
  max-width: 240px;
  width: auto;
}

.app-main-pane {
  padding: 1.25rem 1.5rem 2rem !important;
  width: 100%;
  max-width: none;
}

/* —— Tabelas de gestão (Tags / Estações) —— */
.panel-mgmt {
  overflow: hidden;
}
.panel-mgmt-head {
  padding: 0.95rem 1.25rem !important;
  border-bottom: 1px solid var(--border);
}
.table-mgmt {
  table-layout: fixed;
  width: 100%;
  --tbl-pad-x: 1.25rem;
}
.table-mgmt > :not(caption) > * > * {
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  border-bottom-color: var(--border);
}
.table-mgmt thead th {
  background: var(--paper2) !important;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.table-mgmt tbody tr:nth-child(even) > * {
  background: #fafbfc;
}
.table-mgmt tbody tr:hover > * {
  background: #f3f6f9;
}
.table-mgmt tbody tr:last-child > * {
  border-bottom: 0;
}
.table-mgmt td:first-child,
.table-mgmt th:first-child {
  padding-left: var(--tbl-pad-x);
}
.table-mgmt td:last-child,
.table-mgmt th:last-child {
  padding-right: var(--tbl-pad-x);
}
.table-mgmt .mono,
.table-mgmt .tag-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--text);
}
.table-mgmt .tag-name {
  font-weight: 500;
}
.table-mgmt .tag-date,
.table-mgmt .text-secondary {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.table-mgmt .btn-group {
  display: inline-flex;
  flex-wrap: nowrap;
  vertical-align: middle;
}
.table-mgmt .col-tag { width: 10rem; }
.table-mgmt .col-date { width: 8.5rem; }
.table-mgmt .col-actions { width: 12rem; }
.table-mgmt.table-stations .col-actions { width: 22rem; }
.table-mgmt .col-serial { width: 11rem; }
.table-mgmt .col-status { width: 7rem; }
.table-mgmt .col-model { width: 18%; }
.table-mgmt .col-name { width: auto; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.online {
  background: var(--success-soft);
  color: #389e0d;
}
.status-pill.offline {
  background: var(--bg-soft);
  color: var(--muted);
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.role-pill.role-group_admin { background: var(--primary-soft); color: var(--primary); }
.role-pill.role-posto_manager { background: var(--warning-soft); color: #ad6800; }
.role-pill.role-posto_operator { background: rgba(19, 194, 194, 0.12); color: #08979c; }

@media (max-width: 767.98px) {
  .app-topbar,
  .app-main-pane {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  body.has-sidebar .app-content > header { padding: 0.6rem 0.75rem; }
  body.has-sidebar .app-content > main { padding: 0.85rem 0.75rem 1.5rem; }
  .app-topbar #ws-badge { display: none; }
  .app-topbar #user-badge {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .modal-overlay { padding: 0.5rem; align-items: flex-start; }
  .app-modal { padding: 1rem; max-height: calc(100vh - 1rem); }
  .cp-type-field { flex-wrap: wrap; }
  .cp-type-field .form-select { flex: 1 1 100%; width: 100%; max-width: none; }
  .toast { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
  .table td .btn + .btn { margin-top: 0.25rem; }
  .tag-expand-dl > div,
  .cp-expand-dl > div { grid-template-columns: 5.5rem 1fr; }
  .table-mgmt {
    table-layout: auto;
  }
  .table-mgmt .col-tag,
  .table-mgmt .col-date,
  .table-mgmt .col-actions,
  .table-mgmt .col-serial,
  .table-mgmt .col-status,
  .table-mgmt .col-model {
    width: auto;
  }
}

.view-pane { display: none !important; }
.view-pane.active { display: flex !important; flex-direction: column; gap: 1.1rem; }
.tab-pane.view-pane { display: none !important; }
.tab-pane.view-pane.active { display: flex !important; flex-direction: column; gap: 1.1rem; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(29, 38, 48, 0.35);
  z-index: 55;
}
.sidebar-backdrop.open { display: block; }

.btn-menu {
  display: none;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.btn-menu svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Legacy .primary → Bootstrap btn */
button.primary:not(.btn),
.btn.primary:not(.btn-primary) {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
  background-color: var(--bs-primary);
  border: 1px solid var(--bs-primary);
  border-radius: var(--bs-border-radius);
  cursor: pointer;
}
button.primary.sm, .btn.primary.sm { padding: 0.25rem 0.5rem; font-size: 0.8125rem; }
button.danger:not(.btn) {
  color: #cf1322;
  background: var(--danger-soft);
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.card.summary-card { border-color: var(--border); box-shadow: var(--shadow-sm); }
.card.summary-card label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}
.card.summary-card .val {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card .table { margin-bottom: 0; }
.card .table thead th {
  background: var(--paper2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge.ok, .badge.rounded-pill.ok { background: var(--success-soft) !important; color: #389e0d !important; }
.badge.off, .badge.rounded-pill.off { background: var(--bg-soft) !important; color: var(--muted) !important; }

/* Cabeçalhos ordenáveis (Relatórios) */
th.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.th-sortable:hover {
  color: var(--primary, #1677ff);
}
th.th-sortable::after {
  content: " ↕";
  font-size: 0.7em;
  opacity: 0.35;
  font-weight: 400;
}
th.th-sortable.sort-asc::after {
  content: " ↑";
  opacity: 1;
  color: var(--primary, #1677ff);
}
th.th-sortable.sort-desc::after {
  content: " ↓";
  opacity: 1;
  color: var(--primary, #1677ff);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

/* Alertas (tela dedicada) */
.alert-sum-btn {
  cursor: pointer;
  background: var(--paper, #fff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.alert-sum-btn:hover {
  border-color: var(--primary, #1677ff) !important;
}
.alert-sum-btn.active {
  border-color: var(--primary, #1677ff) !important;
  box-shadow: 0 0 0 1px var(--primary, #1677ff);
}
.alert-kind-badge,
.alert-sev-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.alert-kind-offline {
  background: #fff7e6;
  color: #d48806;
}
.alert-kind-unpaid {
  background: #fff1f0;
  color: #cf1322;
}
.alert-sev-warn {
  background: #fffbe6;
  color: #d48806;
}
.alert-sev-danger {
  background: #fff2f0;
  color: #cf1322;
}
/* Colunas só do perfil Alumifix */
.master-col { display: none; }
body.is-master .master-col { display: table-cell; }

/* Auditoria — detalhe de preços */
.audit-det-head { font-weight: 600; margin-bottom: 0.25rem; }
.audit-det-list { list-style: none; margin: 0; padding: 0; }
.audit-det-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.2rem;
  border-left: 3px solid var(--border, #e5e7eb);
  border-radius: 3px;
}
.audit-det-row.changed { border-left-color: var(--primary, #1677ff); background: #f5f9ff; }
.audit-det-row .audit-det-mode { flex-basis: 100%; font-size: 0.72rem; color: var(--text-secondary, #6b7280); }
.audit-det-bico { font-weight: 600; min-width: 3.4rem; }
.audit-det-old { color: #cf1322; text-decoration: line-through; }
.audit-det-new { color: #237804; font-weight: 700; }
.audit-det-tag {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #e6f4ff;
  color: #0958d9;
}
.audit-det-tag.muted { background: #f3f4f6; color: #6b7280; }
.audit-det-tag.danger { background: #fff1f0; color: #cf1322; }
.audit-det-note { font-size: 0.7rem; color: var(--text-secondary, #6b7280); font-style: italic; }

.alert-row { cursor: pointer; }
.alert-row:not(.alert-unseen) td { color: var(--text-secondary, #6b7280); }
.alert-row.alert-unseen td { font-weight: 600; }
.alert-row.alert-unseen { background: #f5f9ff; }
.alert-unseen-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: transparent;
  vertical-align: middle;
}
.alert-row.alert-unseen .alert-unseen-dot { background: var(--primary, #1677ff); }
.app-nav-item .nav-badge {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}
.app-nav-item .nav-label {
  flex: 1;
  min-width: 0;
}

/* Estações — tabela expansível + conectores */
.table-stations-expand tbody tr.cp-row {
  cursor: pointer;
}
.table-stations-expand tbody tr.cp-row:hover > * {
  background: rgba(0, 0, 0, 0.02);
}
.table-stations-expand tbody tr.cp-row-open > * {
  background: rgba(22, 119, 255, 0.06);
}
.cp-name-cell strong { font-size: 0.92rem; }
.cp-stat-recargas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #f6ffed;
  color: #389e0d;
  font-weight: 700;
  font-size: 0.82rem;
}
.cp-conn-pills {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}
.cp-conn-pill {
  position: relative;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: default;
  color: #fff;
  background: #bfbfbf;
  flex-shrink: 0;
  box-shadow: none;
}
.cp-conn-pill-available { background: #52c41a !important; }
.cp-conn-pill-preparing { background: #1677ff !important; }
.cp-conn-pill-charging { background: #faad14 !important; }
.cp-conn-pill-off { background: #bfbfbf !important; }
.cp-conn-pill .cp-type-ico {
  width: 1.15rem;
  height: 1.15rem;
  /* ícone branco sobre o círculo colorido */
  filter: brightness(0) invert(1);
}
.cp-conn-pill-soc {
  position: absolute;
  bottom: -0.15rem;
  right: -0.35rem;
  background: #fff;
  color: #ad6800;
  border: 1px solid #ffe58f;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.12rem 0.25rem;
}
.cp-conn-pill[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap;
  background: #1f1f1f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.cp-expand-row > td {
  background: #fafafa !important;
  padding: 1rem 1.25rem !important;
  border-top: none !important;
}
.cp-expand-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 1199.98px) {
  .cp-expand-grid { grid-template-columns: 1fr 1fr; }
  .cp-expand-grid .cp-expand-info { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .cp-expand-grid { grid-template-columns: 1fr; }
}
.cp-expand-h {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 0.65rem;
}
.cp-expand-serial {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}
.cp-expand-dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}
.cp-expand-dl > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
}
.cp-expand-dl dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cp-expand-dl dd { margin: 0; font-size: 0.85rem; font-weight: 600; }
.cp-event-list,
.cp-tx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
}
.cp-event {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border, #eee);
  font-size: 0.82rem;
}
.cp-event-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-top: 0.35rem;
  flex-shrink: 0;
  background: #1677ff;
}
.cp-event-ok .cp-event-dot { background: #52c41a; }
.cp-event-off .cp-event-dot { background: #bfbfbf; }
.cp-event-tx .cp-event-dot { background: #1677ff; }
.cp-event-end .cp-event-dot { background: #ff4d4f; }
.cp-tx-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border, #eee);
  font-size: 0.8rem;
  font-weight: 600;
}
.cp-tx-metric { display: flex; align-items: center; gap: 0.35rem; }
.cp-tx-ico {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  display: block;
}
.cp-tx-ico.energy { color: #1677ff; }
.cp-tx-ico.time { color: #fa8c16; }
.cp-tx-ico.money { color: #52c41a; }
/* badges de tipo (editar / expand) */
.cp-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.55rem 0.25rem 0.35rem;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
}
.cp-type-ico {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
.cp-type-badge .cp-type-ico {
  filter: none;
}
.cp-conn-pill .cp-type-ico {
  width: 1.15rem;
  height: 1.15rem;
  filter: brightness(0) invert(1);
}
.cp-type-ccs2 { background: #e6f4ff; color: #0958d9; }
.cp-type-gbt { background: #f6ffed; color: #389e0d; }
.cp-type-chademo { background: #fff7e6; color: #d48806; }
.cp-type-none { background: #f5f5f5; color: #8c8c8c; }

/* Linha select + preview: larguras fixas (não saltam com CCS2/CHAdeMO) */
.cp-type-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.cp-type-field .form-select {
  flex: 0 0 11rem;
  width: 11rem;
  max-width: 11rem;
}
.cp-type-field-preview {
  flex: 0 0 8.5rem;
  width: 8.5rem;
  display: flex;
  align-items: center;
}
.cp-type-field-preview .cp-type-badge {
  width: 100%;
  min-height: 2rem;
  box-sizing: border-box;
  justify-content: flex-start;
}
.cp-type-field-preview .cp-type-badge > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Wizard nova estação */
.cp-wizard-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cp-wizard-step {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #8c8c8c);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-soft, #f5f5f5);
}
.cp-wizard-step.active {
  color: #0958d9;
  background: #e6f4ff;
}
.cp-wizard-step.done {
  color: #389e0d;
  background: #f6ffed;
}
.cp-wizard-sep {
  flex: 0 0 1.25rem;
  height: 2px;
  background: var(--border, #e5e7eb);
}
#modal-back[hidden] { display: none !important; }

/* Tags RFID — filtros + tabela expansível */
.table-tags-expand tbody tr.tag-row { cursor: pointer; }
.table-tags-expand tbody tr.tag-row:hover > * { background: rgba(0, 0, 0, 0.02); }
.table-tags-expand tbody tr.tag-row-open > * { background: rgba(22, 119, 255, 0.06); }
.tag-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #f5f5f5;
  color: #595959;
}
.tag-charging-yes {
  color: #389e0d;
  font-weight: 600;
  font-size: 0.85rem;
}
.tag-expand-row > td {
  background: #fafafa !important;
  padding: 1rem 1.25rem !important;
  border-top: none !important;
}
.tag-expand-dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
  max-width: 520px;
}
.tag-expand-dl > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
}
.tag-expand-dl dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.tag-expand-dl dd {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.cp-conn-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cp-conn-available { background: var(--success-soft, #f6ffed); color: #389e0d; }
.cp-conn-charging { background: #e6f4ff; color: #0958d9; }
.cp-conn-busy { background: #fff7e6; color: #d48806; }
.cp-conn-fault { background: #fff1f0; color: #cf1322; }
.cp-conn-idle { background: var(--bg-soft, #f5f5f5); color: var(--muted, #8c8c8c); }

/* Endere�o (cadastro de posto + ViaCEP) */
.addr-block {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e5e7eb);
}
.addr-block-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.55rem;
}
.addr-block label {
  margin-top: 0.15rem;
}

/* Indicadores */
.ind-card .card-body { padding: 1rem 1.1rem; }
.ind-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text, #1f2937);
}
.ind-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  min-height: 130px;
  padding: 0.35rem 0.15rem 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.ind-bars-hours {
  min-height: 110px;
  gap: 0.2rem;
  overflow-x: auto;
}
.ind-bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  height: 100%;
  min-height: 120px;
}
.ind-bars-hours .ind-bar-col {
  min-width: 22px;
  min-height: 100px;
}
.ind-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.25s ease;
}
.ind-bars-hours .ind-bar { max-width: 18px; }
.ind-bar-label {
  font-size: 0.62rem;
  color: var(--text-secondary, #6b7280);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ind-bars-hours .ind-bar-label { font-size: 0.55rem; }
.ind-bar-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text, #1f2937);
  line-height: 1;
  min-height: 0.85rem;
}
.ind-mini-table { font-size: 0.8rem; }
.ind-mini-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  border-bottom-width: 1px;
}
.ind-mini-table td { padding-top: 0.35rem; padding-bottom: 0.35rem; }
