/* Arquivo: src/index.css  (colar o conteúdo INTEGRAL no Code Mode)
   Design system do Dash Engenharia (porta fiel do app local):
   paleta slate + brand #2563EB + navy corporativo #002856, Inter + JetBrains Mono. */

*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

/* ! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com */

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

a {
  color: inherit;
  text-decoration: inherit;
}

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/

dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/

:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */

[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
.\!visible {
  visibility: visible !important;
}
.visible {
  visibility: visible;
}
.static {
  position: static;
}
.flex {
  display: flex;
}
.table {
  display: table;
}
.hidden {
  display: none;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

:root {
  --slate-50: #F8FAFC; --slate-100: #F1F5F9; --slate-150: #E9EFF5; --slate-200: #E2E8F0;
  --slate-300: #CBD5E1; --slate-400: #94A3B8; --slate-500: #64748B; --slate-600: #475569;
  --slate-700: #334155; --slate-800: #1E293B; --slate-900: #0F172A;
  --brand-blue: #2563EB; --brand-blue-dark: #1D4ED8; --brand-blue-soft: #EFF6FF;
  --brand-navy: #002856; --navy-bg: #001A38;
  --emerald: #059669; --emerald-soft: #ECFDF5; --emerald-text: #065F46; --accent-emerald: #00A86B;
  --rose: #DC2626; --rose-soft: #FEF2F2; --rose-text: #991B1B;
  --amber: #D97706; --amber-soft: #FFFBEB; --amber-text: #92400E;
  --border: #E2E8F0; --border-hover: #CBD5E1;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --header-height: 64px; --max-content-width: 1600px;
}

* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans); font-size: 14px; color: var(--slate-900);
  background: var(--slate-50); -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 9999px; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-height);
  background: var(--brand-navy); border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  box-shadow: 0 2px 10px rgba(0,40,86,0.35);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.logo-pill {
  background: #fff; color: var(--brand-navy); font-weight: 800; letter-spacing: 0.02em;
  border-radius: 9999px; padding: 7px 18px; font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px;
}
.logo-emblem { width: 20px; height: 20px; border-radius: 6px; background: var(--brand-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.tagline { color: rgba(255,255,255,0.72); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.header-right { display: flex; align-items: center; gap: 10px; }
.btn-sync {
  display: inline-flex; align-items: center; gap: 7px; background: var(--brand-blue); color: #fff;
  border: none; border-radius: 10px; padding: 9px 15px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-sans);
}
.btn-sync:hover:not(:disabled) { background: var(--brand-blue-dark); transform: translateY(-1px); }
.btn-sync:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-copilot-header {
  display: inline-flex; align-items: center; gap: 7px; background: linear-gradient(135deg,#1E293B,#0F172A);
  color: #fff; border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 9px 15px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font-sans);
}
.btn-copilot-header:hover { background: linear-gradient(135deg,var(--brand-blue),var(--brand-blue-dark)); }
.ia-badge { background: linear-gradient(135deg,#60A5FA,#A78BFA); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 9999px; letter-spacing: 0.06em; }
.user-badge { display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: 9999px; padding: 5px 6px 5px 12px; }
.user-email { color: rgba(255,255,255,0.88); font-family: var(--font-mono); font-size: 10.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { background: rgba(220,38,38,0.16); color: #FCA5A5; border: none; border-radius: 9999px; padding: 6px 13px; font-size: 11px; font-weight: 600; cursor: pointer; }
.btn-logout:hover { background: rgba(220,38,38,0.28); }

/* ---------- Estrutura ---------- */
.app-main { max-width: var(--max-content-width); margin: 0 auto; padding: 18px 28px 40px; }
.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px 2px; }
.status-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--brand-blue); flex: none; }
.status-dot.err { background: #DC2626; }
.status-msg { font-size: 12.5px; color: var(--brand-blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-msg.err { color: #DC2626; }
.job-status { font-size: 11.5px; color: var(--slate-500); font-family: var(--font-mono); white-space: nowrap; }

.tabs { display: flex; gap: 4px; background: var(--slate-200); border-radius: 12px; padding: 4px; margin: 14px 0; width: -moz-fit-content; width: fit-content; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--slate-600);
  font-family: var(--font-sans); transition: all 0.18s;
}
.tab:hover { background: rgba(255,255,255,0.55); }
.tab.active { background: #fff; color: var(--slate-900); box-shadow: 0 1px 3px rgba(15,23,42,0.12); }
.tab.active svg { color: var(--brand-blue); }

.filters-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-500); }
select, input[type="date"], .text-input {
  height: 38px; border: 1px solid var(--border); background: var(--slate-50); border-radius: 10px;
  padding: 0 12px; font-size: 13px; color: var(--slate-900); font-family: var(--font-sans); outline: none; min-width: 190px;
}
select:focus, input:focus, .text-input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.filter-sep { align-self: center; color: var(--slate-400); padding-bottom: 9px; }
.btn-primary {
  height: 38px; padding: 0 18px; background: var(--brand-blue); color: #fff; border: none; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s;
}
.btn-primary:hover { background: var(--brand-blue-dark); }
.btn-ghost { height: 38px; padding: 0 16px; background: #fff; color: var(--slate-600); border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--slate-800); }
.btn-secondary { height: 32px; padding: 0 13px; background: #fff; color: var(--slate-600); border: 1px solid var(--border); border-radius: 8px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.btn-secondary:hover { border-color: var(--border-hover); color: var(--slate-800); }
.btn-page { height: 30px; padding: 0 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 11.5px; cursor: pointer; color: var(--slate-600); }
.btn-page:disabled { opacity: 0.45; cursor: not-allowed; }

.page-view { display: none; animation: fadeIn 0.25s ease; }
.page-view.active { display: block; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; transition: all 0.18s; }
.kpi-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-title { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-500); }
.kpi-icon { width: 26px; height: 26px; border-radius: 8px; background: var(--slate-100); display: inline-flex; align-items: center; justify-content: center; color: var(--slate-500); flex: none; }
.kpi-value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; }
.kpi-sub { font-size: 11px; color: var(--slate-400); margin-top: 4px; }
.value-negative { color: var(--rose) !important; }
.value-positive { color: var(--emerald) !important; }
.kpi-pill { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 9999px; }
.kpi-pill.ok { background: var(--emerald-soft); color: var(--emerald-text); }
.kpi-pill.warn { background: var(--amber-soft); color: var(--amber-text); }
.kpi-pill.bad { background: var(--rose-soft); color: var(--rose-text); }
.kpi-pill.muted { background: var(--slate-100); color: var(--slate-500); }

/* ---------- Painéis / gráficos ---------- */
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 14px; margin-bottom: 16px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
.panel-full { grid-column: 1 / -1; }
.panel-title { font-size: 13.5px; font-weight: 600; color: var(--slate-900); }
.panel-sub { font-size: 11px; color: var(--slate-500); margin-top: 2px; }
.panel-head { margin-bottom: 14px; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.hbar-label { width: 140px; text-align: right; font-size: 11px; color: var(--slate-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.hbar-track { flex: 1; height: 8px; background: var(--slate-100); border-radius: 9999px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 9999px; transition: width 0.35s ease; }
.hbar-value { width: 74px; text-align: right; font-family: var(--font-mono); font-size: 10.5px; color: var(--slate-600); flex: none; }
.chart-empty { display: flex; align-items: center; justify-content: center; min-height: 120px; color: var(--slate-400); font-size: 12px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--slate-600); }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- Tabelas ---------- */
.table-wrapper { overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead th {
  position: sticky; top: 0; z-index: 10; background: var(--slate-50); text-align: left;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate-500);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--slate-100); }
.data-table tbody tr:hover td { background: var(--slate-50); }
.data-table tfoot td { background: var(--slate-150); border-top: 2px solid var(--slate-200); font-weight: 700; }
.text-right { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--slate-400); }
.num-positive { color: var(--emerald) !important; }
.num-negative { color: var(--rose) !important; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.search-box { position: relative; }
.search-box input { height: 36px; min-width: 240px; padding-left: 34px; font-size: 12.5px; border-radius: 9px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }
.tree-info { margin-left: auto; font-size: 11px; color: var(--slate-500); font-family: var(--font-mono); }

.tree-row { cursor: pointer; }
.tree-row .nivel-1 td { background: #FAFBFD; border-top: 1px solid var(--slate-150); font-weight: 700; }
.tree-row .nivel-1 { padding-left: 14px; }
.nivel-2 { font-weight: 600; }
.cell-nivel-1 { padding-left: 14px !important; }
.cell-nivel-2 { padding-left: 36px !important; }
.cell-nivel-3 { padding-left: 58px !important; }
.cell-nivel-4 { padding-left: 80px !important; }
.tree-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; color: var(--slate-400); font-size: 10px; transition: transform 0.15s; margin-right: 6px; }
.tree-icon.closed { transform: rotate(-90deg); }
.tree-code { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--slate-600); min-width: 52px; display: inline-block; }
.tree-name { color: var(--slate-800); }
.tree-row.selected td { background: var(--brand-blue-soft) !important; }

.col-origin { text-align: center; }
.origin-badge { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--slate-100); color: var(--slate-600); }
.origin-badge.me { background: var(--emerald-soft); color: var(--emerald-text); }
.origin-badge.ac { background: var(--brand-blue-soft); color: var(--brand-blue-dark); }
.origin-badge.cp { background: var(--amber-soft); color: var(--amber-text); }

.trend-status { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 9999px; }
.trend-status.ok { background: var(--emerald-soft); color: var(--emerald-text); }
.trend-status.warn { background: var(--amber-soft); color: var(--amber-text); }
.trend-status.bad { background: var(--rose-soft); color: var(--rose-text); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; }
.pagination-info { font-size: 11.5px; color: var(--slate-500); }
.pagination-buttons { display: flex; gap: 8px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; color: var(--slate-400); font-size: 12.5px; text-align: center; }
.loading-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--slate-500); font-size: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--slate-200); border-top-color: var(--brand-blue); border-radius: 9999px; animation: spin 0.7s linear infinite; }

.aviso-box { background: var(--amber-soft); border: 1px solid #FDE68A; color: var(--amber-text); border-radius: 10px; padding: 10px 14px; font-size: 11.5px; margin-bottom: 14px; }
.aviso-box ul { margin: 4px 0 0 16px; padding: 0; }

.insumos-panel { margin-top: 14px; }

/* ---------- Footer ---------- */
.footer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px 26px; max-width: var(--max-content-width); margin: 0 auto; }
.footer-text { font-size: 11px; color: var(--slate-400); }
.run-badge { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate-500); background: #fff; border: 1px solid var(--border); padding: 6px 12px; border-radius: 9999px; }

/* ---------- Login gate ---------- */
.login-overlay { position: fixed; inset: 0; z-index: 9999; background: var(--navy-bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 38px 36px 30px; max-width: 410px; width: 100%; text-align: center; box-shadow: 0 25px 50px -12px rgba(0,15,38,0.45); }
.login-logo { max-width: 195px; margin: 0 auto 18px; }
.login-title { color: var(--brand-navy); font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.login-sub { color: var(--slate-500); font-size: 13px; margin: 0 0 22px; }
.btn-login { width: 100%; height: 44px; background: var(--brand-navy); color: #fff; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-login:hover { background: #001F44; }
.login-error { background: var(--rose-soft); border: 1px solid #FCA5A5; color: var(--rose-text); border-radius: 10px; padding: 9px 12px; font-size: 12px; margin-bottom: 14px; animation: shake 0.3s; }
.login-footer { margin-top: 18px; font-size: 11px; color: var(--slate-400); }
.login-card.shake-card { animation: shake 0.35s; }
.field-wrap { position: relative; margin-bottom: 12px; text-align: left; }
.field-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--slate-400); }
.login-input {
  width: 100%; height: 44px; background: #F8FAFC; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 40px 0 36px; font-size: 13.5px; color: var(--slate-900); font-family: var(--font-sans); outline: none;
}
.login-input:focus { border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgba(0,40,86,0.12); }
.field-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; cursor: pointer; font-size: 14px; color: var(--slate-400); }
.login-hint {
  margin-top: 14px; padding: 8px 12px; border-radius: 10px; background: rgba(37,99,235,0.08);
  color: #1E3A8A; font-size: 11.5px; text-align: center;
}

/* ---------- Copilot drawer ---------- */
.fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 400; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--brand-navy), #0F172A); color: #fff;
  border-radius: 9999px; padding: 14px 20px; font-size: 13px; font-weight: 700;
  box-shadow: 0 10px 24px rgba(0,40,86,0.4); display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-sans);
}
.drawer-backdrop { position: fixed; inset: 0; z-index: 500; background: rgba(2,8,23,0.45); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 96vw; z-index: 501;
  background: #0b1324; color: #E2E8F0; display: flex; flex-direction: column;
  animation: fadeIn 0.25s ease; box-shadow: -18px 0 50px rgba(2,8,23,0.5);
}
.drawer-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #0f1b33; border-bottom: 1px solid rgba(255,255,255,0.08); }
.drawer-title { font-size: 14px; font-weight: 700; color: #fff; }
.drawer-sub { font-size: 11px; color: #94A3B8; }
.drawer-pill { background: rgba(5,150,105,0.18); color: #34D399; font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; }
.drawer-close { margin-left: auto; background: transparent; border: none; color: #94A3B8; font-size: 18px; cursor: pointer; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg,#1D4ED8,#2563EB); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #131d33; color: #E2E8F0; border-bottom-left-radius: 4px; }
.msg.bot table { border-collapse: collapse; margin: 6px 0; font-size: 11px; }
.msg.bot td, .msg.bot th { border: 1px solid rgba(148,163,184,0.25); padding: 4px 7px; }
.msg.bot code { background: rgba(148,163,184,0.15); padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #131f37; border: 1px solid rgba(148,163,184,0.2); color: #CBD5E1; border-radius: 9999px; padding: 7px 13px; font-size: 11px; cursor: pointer; text-align: left; }
.chip:hover { border-color: #2563EB; color: #fff; }
.drawer-input { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.08); background: #0f1b33; }
.drawer-input textarea {
  flex: 1; resize: none; background: #0b1324; color: #E2E8F0; border: 1px solid rgba(148,163,184,0.25);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-family: var(--font-sans); max-height: 120px; outline: none;
}
.drawer-send { background: var(--brand-blue); border: none; color: #fff; border-radius: 10px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.drawer-disclaimer { padding: 0 18px 12px; background: #0f1b33; font-size: 10px; color: #64748B; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 9999px; background: #64748B; animation: fadeIn 0.6s infinite alternate; }

@media (max-width: 1024px) {
  .app-main { padding: 14px 16px 30px; }
  .app-header { padding: 0 16px; }
  .tagline { display: none; }
  .charts-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tree-info { display: none; }
}
