:root {
  --blue-950: #07111f;
  --blue-900: #0b1f3a;
  --blue-850: #0d2d5e;
  --blue-800: #0f3f7a;
  --blue-700: #1558df;
  --blue-600: #1d7ff2;
  --blue-500: #20a7f7;
  --blue-100: #dcecff;
  --blue-50: #f0f7ff;
  --ink: #102033;
  --text: #102033;
  --text-soft: #40556f;
  --muted: #6f8199;
  --line: #dce8f7;
  --white: #ffffff;
  --danger: #d94a61;
  --danger-soft: #ffe9ee;
  --success: #16a76b;
  --success-soft: #e4f8ee;
  --warning: #d9971e;
  --warning-soft: #fff4dc;
  --shadow: 0 20px 60px rgba(15, 63, 122, .12);
  --soft-shadow: 0 12px 34px rgba(15, 63, 122, .055);
  --radius: 16px;
  --radius-lg: 24px;
  --font-body: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Manrope", "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: #eaf1fb; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 90% -10%, rgba(32, 167, 247, .16), transparent 36%),
    radial-gradient(circle at 8% 100%, rgba(21, 88, 223, .12), transparent 34%),
    linear-gradient(180deg, #f4f8fd 0%, #eaf1fb 62%, #dfeaf7 100%);
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.ambient-a { top: -300px; right: -120px; background: radial-gradient(circle, rgba(32, 167, 247, .18), transparent 68%); }
.ambient-b { bottom: -360px; left: -170px; background: radial-gradient(circle, rgba(21, 88, 223, .13), transparent 68%); }

.app-shell { min-height: 100vh; }
.shell {
  width: min(1450px, calc(100% - 42px));
  margin: 0 auto;
}
.workspace { padding: 22px 0 70px; }
.main-content { min-width: 0; }

.topbar,
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  padding: 0 4vw;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(220, 232, 247, .86);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(20px);
}
.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  box-shadow: 0 9px 20px rgba(21, 88, 223, .24);
}
.brand-mark svg { width: 42px; height: 42px; }
.brand h1 {
  margin: 0;
  color: var(--blue-950);
  font: 800 18px/1 var(--font-display);
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.header-meta,
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.generated,
.connection-pill {
  display: inline-flex;
  min-height: 36px;
  padding: 0 10px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, .92);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
}
.generated svg { width: 15px; height: 15px; color: var(--blue-700); }
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 5px var(--blue-100), 0 0 16px rgba(29, 127, 242, .4);
}
.connection-pill.online .status-dot,
.connection-pill.is-online .status-dot { background: var(--success); box-shadow: 0 0 0 5px var(--success-soft), 0 0 16px rgba(22, 167, 107, .35); }
.connection-pill.error .status-dot,
.connection-pill.is-error .status-dot { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft), 0 0 16px rgba(217, 74, 97, .35); }
.connection-pill.loading .status-dot,
.connection-pill.is-loading .status-dot { animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 50% { transform: scale(.72); opacity: .55; } }

.tab-nav {
  display: grid;
  margin-bottom: 10px;
  padding: 5px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 30px rgba(15, 63, 122, .05);
}
.tab-button,
.side-tab {
  display: flex;
  min-height: 43px;
  padding: 0 13px;
  gap: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
  transition: transform .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}
.tab-button > span,
.side-tab > span {
  color: #9aadbf;
  font-size: 7px;
  letter-spacing: .08em;
}
.tab-button:hover,
.side-tab:hover { color: var(--blue-800); background: var(--blue-50); transform: translateY(-1px); }
.tab-button.active,
.side-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  box-shadow: 0 7px 17px rgba(15, 63, 122, .18);
}
.tab-button.active > span,
.side-tab.active > span { color: rgba(255, 255, 255, .55); }

.button,
.primary-button,
.ghost-button,
.quiet-button,
.icon-button {
  display: inline-flex;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.button:hover,
.primary-button:hover,
.ghost-button:hover,
.quiet-button:hover,
.icon-button:hover { transform: translateY(-1px); }
.button:disabled,
.primary-button:disabled,
.ghost-button:disabled,
.quiet-button:disabled,
.icon-button:disabled { cursor: wait; opacity: .62; transform: none; }
.button svg,
.primary-button svg,
.ghost-button svg,
.quiet-button svg,
.icon-button svg { width: 15px; height: 15px; }
.button-primary,
.primary-button {
  border-color: rgba(255, 255, 255, .25);
  color: white;
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  box-shadow: 0 8px 20px rgba(21, 88, 223, .18);
}
.button-ghost,
.ghost-button,
.quiet-button {
  border-color: var(--line);
  color: var(--blue-900);
  background: white;
}
.quiet-button { color: var(--muted); }
.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-color: var(--line);
  color: var(--blue-800);
  background: white;
}
.header-icon-action { white-space: nowrap; }

.action-bar {
  display: flex;
  margin-bottom: 12px;
  padding: 11px 13px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 30px rgba(15, 63, 122, .05);
}
.quick-actions,
.table-controls,
.form-actions,
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-search,
.search-box {
  display: flex;
  min-height: 42px;
  min-width: min(360px, 100%);
  padding: 0 13px;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--blue-700);
}
.inline-search input,
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}
.inline-search svg { width: 16px; height: 16px; }

.filters-panel {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 30px rgba(15, 63, 122, .05);
}
label { min-width: 0; }
.filters-panel label,
.supervisor-toolbar label,
.table-controls label,
.form-grid label {
  display: grid;
  gap: 6px;
}
.filters-panel label {
  min-height: 54px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--blue-50);
}
.filters-panel span,
.supervisor-toolbar span,
.table-controls span,
.form-grid label > span,
.entry-card label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
select, input { min-height: 36px; padding: 0 10px; font-size: 10px; font-weight: 700; }
textarea { min-height: 90px; padding: 11px 12px; resize: vertical; font-size: 11px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(21, 88, 223, .45);
  box-shadow: 0 0 0 4px rgba(21, 88, 223, .09);
}
.filters-panel .quiet-button { min-height: 54px; align-self: stretch; }

.view-page[hidden] { display: none !important; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric-grid::before {
  content: "ACOMPANHAMENTO OPERACIONAL\A Ofensores N2";
  white-space: pre-line;
  display: grid;
  min-height: 160px;
  padding: 34px 38px;
  grid-column: 1 / -1;
  align-content: center;
  border-radius: var(--radius-lg);
  color: white;
  background: linear-gradient(125deg, var(--blue-950), var(--blue-800) 62%, #20a7f7);
  box-shadow: 0 24px 60px rgba(15, 63, 122, .20);
  font: 800 clamp(28px, 4vw, 48px)/1.08 var(--font-display);
  letter-spacing: -.045em;
}
.metric-card,
.panel,
.table-panel,
.overview-panel,
.modal-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--soft-shadow);
}
.metric-card {
  display: flex;
  min-height: 136px;
  padding: 20px;
  gap: 15px;
  align-items: flex-start;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.metric-card:hover { transform: translateY(-2px); border-color: #bad7f8; box-shadow: var(--shadow); }
.metric-card.wide { grid-column: span 2; }
.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--blue-800);
  background: var(--blue-100);
}
.metric-icon svg { width: 19px; height: 19px; }
.metric-icon.success { color: var(--success); background: var(--success-soft); }
.metric-icon.danger { color: var(--danger); background: var(--danger-soft); }
.metric-icon.warning { color: var(--warning); background: var(--warning-soft); }
.metric-card span,
.metric-card strong,
.metric-card small { display: block; }
.metric-card span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.metric-card strong {
  margin: 7px 0 3px;
  color: var(--blue-900);
  font: 800 clamp(21px, 2vw, 30px) var(--font-display);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.metric-card small { color: #8ca0b9; font-size: 9px; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
  opacity: .9;
}
.panel-heading {
  display: flex;
  min-height: 38px;
  margin-bottom: 18px;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.panel-heading h2 {
  margin: 0;
  color: var(--blue-950);
  font: 800 14px var(--font-display);
  letter-spacing: -.025em;
}
.panel-heading span,
.panel-heading p {
  display: inline-flex;
  min-height: 24px;
  padding: 0 8px;
  align-items: center;
  border-radius: 999px;
  color: var(--blue-800);
  background: var(--blue-50);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.panel canvas {
  display: block;
  width: 100% !important;
  min-height: 275px;
  max-height: 340px;
}
#chartPolo,
#chartFeedback {
  width: 230px !important;
  height: 230px !important;
  min-height: 230px !important;
  margin: 6px auto 0;
}
.panel:nth-child(1),
.panel:nth-child(2),
.panel:nth-child(7),
.panel:nth-child(8) { grid-column: span 1; }

.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-header {
  display: flex;
  padding: 18px 20px;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(240, 247, 255, .9), rgba(255, 255, 255, .9));
}
.table-header h2 {
  margin: 0;
  color: var(--blue-950);
  font: 800 17px var(--font-display);
  letter-spacing: -.03em;
}
.table-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 10px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--blue-50);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: rgba(240, 247, 255, .75); }
.empty-row td { padding: 36px 14px; color: var(--muted); text-align: center; font-weight: 800; }
.sort-button {
  display: inline-flex;
  padding: 0;
  cursor: pointer;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
.sort-button.active { color: var(--blue-800); }
.sort-button.active::after { content: " ↓"; }
.sort-button.active.asc::after { content: " ↑"; }
.cell-token,
.polo-pill,
.reason-badge {
  display: inline-flex;
  max-width: 220px;
  min-height: 26px;
  padding: 0 8px;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}
.cell-token { color: var(--blue-900); background: var(--blue-50); }
.polo-pill { color: var(--blue-800); background: var(--blue-100); }
.reason-badge { color: #77540c; background: #fff4dc; }
.cell-ellipsis {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.cell-email { color: var(--blue-800); }
.pagination {
  display: flex;
  padding: 14px 16px;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  background: rgba(240, 247, 255, .58);
}

.supervisor-panel { overflow: visible; }
.supervisor-toolbar {
  display: grid;
  grid-template-columns: 180px 180px minmax(220px, 1fr);
  gap: 8px;
  align-items: end;
}
.supervisor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.supervisor-summary article {
  min-height: 82px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.supervisor-summary span,
.supervisor-summary strong { display: block; }
.supervisor-summary span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.supervisor-summary strong { margin-top: 8px; color: var(--blue-900); font: 800 24px var(--font-display); letter-spacing: -.04em; }
.supervisor-scroll { max-height: 62vh; }

.feedback-switch {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  gap: 4px;
  align-items: center;
}
.feedback-switch button {
  display: inline-flex;
  min-height: 28px;
  padding: 0 8px;
  gap: 4px;
  cursor: pointer;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  font-size: 9px;
  font-weight: 900;
}
.feedback-switch button.is-active.yes { border-color: rgba(22, 167, 107, .25); color: #087a4c; background: var(--success-soft); }
.feedback-switch button.is-active.no { border-color: rgba(217, 74, 97, .25); color: #b83449; background: var(--danger-soft); }
.feedback-switch button.is-active.blank { color: var(--blue-800); background: var(--blue-50); }
.feedback-by {
  grid-column: 1 / -1;
  color: #8ca0b9;
  font-size: 8px;
  font-weight: 800;
}
.feedback-by.muted { color: #a2b1c1; }

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at top right, rgba(32, 167, 247, .22), transparent 34%),
    linear-gradient(135deg, rgba(7, 17, 31, .88), rgba(15, 63, 122, .82));
  backdrop-filter: blur(16px);
}
.entry-gate[hidden] { display: none !important; }
.entry-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 24px;
  color: white;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .22);
  backdrop-filter: blur(20px);
}
.entry-mark {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--blue-700), var(--blue-500));
  box-shadow: 0 15px 34px rgba(0, 0, 0, .2);
}
.entry-mark span { position: absolute; width: 6px; border-radius: 10px; background: white; }
.entry-mark span:nth-child(1) { height: 15px; transform: translate(-11px, 7px); }
.entry-mark span:nth-child(2) { height: 29px; transform: translate(0, 0); }
.entry-mark span:nth-child(3) { height: 22px; transform: translate(11px, 4px); }
.entry-card p { margin: 0 0 8px; color: #9ed7ff; font-size: 10px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.entry-card h1 { margin: 0; font: 800 36px/1.05 var(--font-display); letter-spacing: -.05em; }
.entry-card small { display: block; margin: 12px 0 22px; color: rgba(255, 255, 255, .72); font-size: 12px; line-height: 1.6; }
.entry-card label { display: grid; gap: 8px; margin-bottom: 14px; }
.entry-card input { min-height: 45px; border-color: rgba(255, 255, 255, .26); color: white; background: rgba(255, 255, 255, .12); }
.entry-card input::placeholder { color: rgba(255, 255, 255, .48); }
.entry-card > strong { display: block; margin-top: 18px; color: rgba(255, 255, 255, .55); font-size: 10px; }

.modal.hidden { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 24px;
  place-items: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 31, .56);
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: rgba(255, 255, 255, .96);
}
.modal-card.compact { width: min(590px, 100%); }
.modal-heading {
  display: flex;
  padding: 22px 24px;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  color: white;
  background: linear-gradient(125deg, var(--blue-950), var(--blue-800) 64%, var(--blue-500));
}
.modal-heading h2 { margin: 0; font: 800 22px var(--font-display); letter-spacing: -.035em; }
.modal-heading p { margin: 6px 0 0; color: rgba(255, 255, 255, .72); font-size: 11px; }
.modal-heading .icon-button { border-color: rgba(255, 255, 255, .18); color: white; background: rgba(255, 255, 255, .12); }
.form-grid {
  display: grid;
  padding: 22px 24px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.lookup-result,
.summary-box {
  display: grid;
  min-height: 44px;
  padding: 12px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--blue-50);
  font-size: 10px;
  font-weight: 800;
}
.import-box { display: grid; padding: 24px; gap: 14px; }
.modal-card > .form-actions { padding: 0 24px 24px; justify-content: flex-end; }
.details-list {
  display: grid;
  padding: 22px 24px 24px;
  gap: 10px;
}
.details-list article,
.details-list div {
  min-width: 0;
}
.details-list dt,
.details-list span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.details-list dd,
.details-list strong {
  margin: 4px 0 0;
  color: var(--blue-950);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--blue-950);
  background: white;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 800;
}
.toast.error { border-color: rgba(217, 74, 97, .25); color: #b83449; background: #fff5f7; }
.toast.success { border-color: rgba(22, 167, 107, .25); color: #087a4c; background: #f2fbf6; }

.credit-footer {
  display: flex;
  margin-top: 26px;
  padding: 16px 4px 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(220, 232, 247, .75);
  color: var(--muted);
  font-size: 9px;
}
.credit-footer span { font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.credit-footer strong { color: var(--blue-900); }

@media (max-width: 1180px) {
  .filters-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supervisor-toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar, .app-header { position: static; min-height: auto; padding: 14px 18px; align-items: flex-start; flex-direction: column; }
  .header-meta { justify-content: flex-start; }
  .shell { width: calc(100% - 24px); }
  .tab-nav { display: flex; overflow-x: auto; }
  .tab-button, .side-tab { min-width: max-content; flex: 1 0 auto; }
  .action-bar { align-items: stretch; flex-direction: column; }
  .inline-search { min-width: 0; }
  .filters-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid { grid-template-columns: 1fr; }
  .metric-card.wide { grid-column: auto; }
  .table-header { align-items: flex-start; flex-direction: column; }
  .supervisor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .brand p, .generated:not(.user-pill), .header-icon-action span { display: none; }
  .filters-panel, .metric-grid, .supervisor-summary, .form-grid { grid-template-columns: 1fr; }
  .metric-grid::before { min-height: 140px; padding: 28px 24px; }
  .panel, .metric-card { padding: 16px; }
  .modal { padding: 12px; }
  .modal-heading, .form-grid, .import-box, .details-list { padding-left: 18px; padding-right: 18px; }
  .quick-actions { align-items: stretch; flex-direction: column; }
  .quick-actions > * { width: 100%; }
}


/* --------------------------------------------------------------------------
   PULSE UI BLUE V2 — menu lateral + gráficos menos poluídos
   Mantém IDs/funções e altera somente apresentação.
-------------------------------------------------------------------------- */

.shell.workspace,
.workspace.shell {
  display: grid;
  width: min(1540px, calc(100% - 44px));
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workspace > :not(.side-nav) {
  grid-column: 2;
}

.side-nav.tab-nav {
  position: sticky;
  top: 94px;
  z-index: 9;
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 30;
  min-height: calc(100vh - 120px);
  margin: 0;
  padding: 14px;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 9px;
  border: 1px solid rgba(188, 213, 244, .72);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(245,250,255,.86)),
    radial-gradient(circle at 30% 0%, rgba(32, 167, 247, .12), transparent 35%);
  box-shadow: 0 18px 44px rgba(15, 63, 122, .08);
}

.side-nav.tab-nav::before {
  content: "SUB ABAS";
  display: block;
  margin: 2px 4px 7px;
  color: #7d91aa;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .16em;
}

.tab-button,
.side-tab {
  justify-content: flex-start;
}

.side-tab {
  min-height: 52px;
  padding: 0 13px;
  border-radius: 16px;
  color: #415a78;
  font-size: 11px;
  letter-spacing: .01em;
  background: rgba(255, 255, 255, .46);
}

.side-tab > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  color: #7e95b0;
  background: #edf5ff;
  font-size: 9px;
  letter-spacing: 0;
}

.side-tab:hover {
  transform: translateX(2px);
  color: var(--blue-800);
  background: #eff7ff;
}

.side-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-950), var(--blue-700));
  box-shadow: 0 13px 28px rgba(21, 88, 223, .18);
}

.side-tab.active > span {
  color: rgba(255, 255, 255, .82);
  background: rgba(255, 255, 255, .13);
}

.action-bar,
.filters-panel,
.metric-grid,
.charts-grid,
.table-panel {
  min-width: 0;
}

.action-bar {
  margin-bottom: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 32px rgba(15, 63, 122, .055);
}

.filters-panel {
  margin-bottom: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .9);
}

.metric-card,
.panel,
.table-panel,
.overview-panel {
  border-color: rgba(188, 213, 244, .78);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 38px rgba(15, 63, 122, .058);
}

.panel {
  min-height: 318px;
  padding: 20px 22px 22px;
}

.panel::before {
  height: 2px;
  background: linear-gradient(90deg, var(--blue-900), var(--blue-700), var(--blue-500));
  opacity: .85;
}

.panel-heading {
  min-height: 34px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  font-size: 14px;
}

.panel-heading span,
.panel-heading p {
  min-height: 26px;
  padding: 0 11px;
  background: #edf6ff;
  color: var(--blue-800);
  font-size: 7px;
  letter-spacing: .09em;
}

.pulse-chart {
  display: grid;
  min-height: 230px;
  align-items: center;
}

.pie-content {
  display: flex;
  width: 100%;
  min-height: 230px;
  gap: 38px;
  align-items: center;
  justify-content: center;
}

.detail-pie {
  position: relative;
  display: grid;
  width: 166px;
  height: 166px;
  flex: 0 0 auto;
  place-content: center;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 63, 122, .06);
}

.detail-pie::after {
  position: absolute;
  inset: 28px;
  content: "";
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(188, 213, 244, .7);
}

.detail-pie span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.detail-pie strong {
  color: var(--blue-950);
  font: 800 25px/1 var(--font-display);
  letter-spacing: -.05em;
}

.detail-pie small {
  margin-top: 4px;
  color: #7b90ab;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pie-legend {
  display: grid;
  width: min(310px, 42%);
  gap: 12px;
  align-content: center;
}

.pie-legend span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #657b96;
  font-size: 10px;
}

.pie-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.pie-legend b {
  min-width: 0;
  overflow: hidden;
  color: #40556f;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-legend strong {
  color: var(--blue-950);
  font-size: 10px;
  font-weight: 900;
}

.bar-chart {
  display: grid;
  gap: 13px;
  align-content: center;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-row.is-compact {
  gap: 6px;
}

.bar-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
}

.bar-meta span {
  min-width: 0;
  overflow: hidden;
  color: #17283e;
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-meta strong {
  color: var(--blue-950);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.bar-meta strong em {
  margin-left: 3px;
  color: #6f8199;
  font-style: normal;
  font-weight: 800;
}

.bar-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f1fb;
}

.bar-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  box-shadow: 0 5px 12px rgba(21, 88, 223, .18);
}

.no-chart-data {
  margin: 0;
  color: #7b90ab;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

/* Canvas continua visível como fallback caso o navegador mantenha JS antigo em cache.
   Quando o JS novo roda, ele substitui cada canvas por .pulse-chart. */

.supervisor-summary article {
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f5faff);
}

.table-scroll {
  border-radius: 18px;
}

@media (max-width: 1180px) {
  .shell.workspace,
  .workspace.shell {
    width: min(100% - 28px, 1180px);
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .pie-content {
    gap: 22px;
  }

  .pie-legend {
    width: 44%;
  }
}

@media (max-width: 900px) {
  .shell.workspace,
  .workspace.shell {
    display: block;
    width: calc(100% - 24px);
  }

  .workspace > :not(.side-nav) {
    grid-column: auto;
  }

  .side-nav.tab-nav {
    position: sticky;
    top: 76px;
    display: grid;
    min-height: auto;
    margin: 0 0 12px;
    padding: 8px;
    grid-template-columns: repeat(4, minmax(max-content, 1fr));
    overflow-x: auto;
    border-radius: 18px;
  }

  .side-nav.tab-nav::before {
    display: none;
  }

  .side-tab {
    min-width: max-content;
    min-height: 44px;
    justify-content: center;
  }

  .side-tab:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 720px) {
  .panel {
    min-height: auto;
    padding: 17px;
  }

  .pie-content {
    min-height: 250px;
    flex-direction: column;
    gap: 18px;
  }

  .pie-legend {
    width: 100%;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}



/* V3: proteção anti-card vazio e altura consistente dos gráficos */
.charts-grid .panel {
  min-height: 330px;
}

.charts-grid .panel .pulse-chart {
  min-height: 238px;
  width: 100%;
}

.charts-grid .panel:has(.pie-pulse) {
  min-height: 330px;
}

@supports not selector(:has(*)) {
  .charts-grid .panel {
    min-height: 330px;
  }
}

