:root {
  --inv-bg: #f4f6f9;
  --inv-card: #ffffff;
  --inv-border: #e1e4e8;
  --inv-text: #1a1a1a;
  --inv-muted: #5c6370;
  --inv-primary: #1b84ff;
  --inv-primary-hover: #166fd4;
  --inv-danger: #c62828;
  --inv-sidebar: #f0f2f5;
  --inv-sidebar-w: 260px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  color: var(--inv-text);
  background: var(--inv-bg);
}

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

.inv-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.inv-sidebar {
  width: var(--inv-sidebar-w);
  background: var(--inv-sidebar);
  border-right: 1px solid var(--inv-border);
  padding: 1.25rem 0;
  flex-shrink: 0;
}

.inv-sidebar-brand {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--inv-border);
  margin-bottom: 1rem;
  line-height: 1.35;
}

.inv-nav a {
  display: block;
  padding: 0.55rem 1.25rem;
  color: var(--inv-text);
  font-weight: 500;
  text-decoration: none;
}
.inv-nav a:hover {
  background: rgba(27, 132, 255, 0.08);
  text-decoration: none;
}

.inv-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.inv-topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--inv-card);
  border-bottom: 1px solid var(--inv-border);
}

.inv-topbar-user {
  margin-right: auto;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.inv-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -0.25rem 0.25rem -0.25rem -0.35rem;
  padding: 0;
  border: 1px solid var(--inv-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--inv-text);
  cursor: pointer;
  flex-shrink: 0;
}

.inv-menu-btn:hover {
  background: #f4f6f9;
}

.inv-menu-icon {
  display: block;
}

.inv-content {
  padding: 1.5rem;
  flex: 1;
}

.kt-card {
  background: var(--inv-card);
  border: 1px solid var(--inv-border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.kt-card-content {
  padding: 1.5rem;
}

.kt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.kt-btn:hover {
  text-decoration: none;
  opacity: 0.95;
}

.kt-btn-primary {
  background: var(--inv-primary);
  color: #fff;
  border-color: var(--inv-primary);
}
.kt-btn-primary:hover {
  background: var(--inv-primary-hover);
  color: #fff;
}

.kt-btn-outline {
  background: #fff;
  border-color: var(--inv-border);
  color: var(--inv-text);
}

.kt-btn-danger {
  background: var(--inv-danger);
  color: #fff;
  border-color: var(--inv-danger);
}

.kt-form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--inv-muted);
}

.kt-input,
select.kt-input,
textarea.kt-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--inv-border);
  border-radius: 0.375rem;
  font: inherit;
  background: #fff;
}

textarea.kt-input {
  min-height: 88px;
  resize: vertical;
}

.kt-table-wrap {
  overflow-x: auto;
}

table.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.inv-table th,
table.inv-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--inv-border);
  text-align: left;
}
table.inv-table th {
  font-weight: 600;
  color: var(--inv-muted);
  background: #fafbfc;
}

.inv-muted {
  color: var(--inv-muted);
  font-size: 0.875rem;
}

.inv-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.inv-row > * {
  flex: 1 1 200px;
}

.inv-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #eef2f7 0%, #e3e9f2 100%);
}

.inv-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e8f1ff;
  color: #0d47a1;
}

.inv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inv-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
}

.inv-filter-field--sm {
  max-width: 120px;
}

.inv-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .inv-filter-actions {
    grid-column: auto;
    align-self: end;
  }
}

.inv-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
  padding: 0.75rem 0;
}

.inv-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--inv-primary);
  border: 1px solid var(--inv-border);
  background: var(--inv-card);
  text-decoration: none;
}

.inv-page-link:hover {
  background: #f0f6ff;
  text-decoration: none;
}

.inv-page-link--current {
  background: var(--inv-primary);
  color: #fff;
  border-color: var(--inv-primary);
  pointer-events: none;
}

.inv-page-ellipsis {
  padding: 0 0.25rem;
  color: var(--inv-muted);
  user-select: none;
}

.inv-dashboard-head {
  margin-bottom: 1.25rem;
}

.inv-dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.inv-kpi .kt-card-content {
  padding: 1rem 1.15rem;
}

.inv-kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.inv-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--inv-text);
}

.inv-kpi-sub {
  font-size: 0.75rem;
  color: var(--inv-muted);
  margin-top: 0.25rem;
}

.inv-dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.inv-chart-card--wide {
  grid-column: 1 / -1;
}

@media (min-width: 1100px) {
  .inv-dashboard-charts {
    grid-template-columns: repeat(3, 1fr);
  }
  .inv-chart-card--wide {
    grid-column: 1 / -1;
  }
}

.inv-chart-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--inv-text);
}

.inv-chart-desc {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--inv-muted);
  line-height: 1.4;
}

.inv-chart-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}

.inv-chart-wrap--tall {
  height: 320px;
}

/* ——— Overlay + menu mobile (sidebar fora da tela) ——— */
.inv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inv-foto-np-mobile {
  display: none;
}

@media (max-width: 900px) {
  .inv-foto-np-desktop {
    display: none !important;
  }

  .inv-foto-np-mobile {
    display: block;
  }
}

.inv-foto-np-mobile-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inv-foto-np-mobile-btns .kt-btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}

.inv-nav-overlay {
  display: none;
}

@media (max-width: 900px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  .inv-menu-btn {
    display: inline-flex;
  }

  .inv-topbar-user {
    max-width: calc(100% - 52px);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .inv-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .inv-layout.inv-nav-open .inv-nav-overlay {
    display: block;
  }

  .inv-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 88vw);
    max-width: 100%;
    z-index: 1001;
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateX(-105%);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .inv-layout.inv-nav-open .inv-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  }

  .inv-main {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .inv-content {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  body.inv-nav-open {
    overflow: hidden;
  }

  .kt-input,
  select.kt-input,
  textarea.kt-input {
    font-size: 16px;
  }

  .kt-card-content {
    padding: 1rem;
  }

  .kt-table-wrap {
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  table.inv-table {
    font-size: 0.8125rem;
  }

  table.inv-table th,
  table.inv-table td {
    padding: 0.5rem 0.45rem;
  }

  .inv-filter-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  @media (min-width: 400px) {
    .inv-filter-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .inv-filter-actions {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
  }

  .inv-filter-actions .kt-btn {
    width: 100%;
    justify-content: center;
  }

  .inv-dashboard-head h1 {
    font-size: 1.2rem;
  }

  .inv-dashboard-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .inv-chart-wrap {
    height: 200px;
  }

  .inv-chart-wrap--tall {
    height: 260px;
  }

  .inv-page-head {
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }

  .inv-page-head h1 {
    font-size: 1.2rem !important;
  }

  .inv-page-head-actions {
    max-width: none !important;
    justify-content: flex-start !important;
  }

  .inv-page-head-actions .kt-btn,
  .inv-page-head-actions span.kt-btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }

  .inv-pagination {
    gap: 0.25rem;
  }

  .inv-page-link {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8125rem;
  }
}

@media (min-width: 901px) {
  .inv-nav-overlay {
    display: none !important;
  }

  .inv-sidebar {
    position: relative;
    transform: none !important;
    box-shadow: none !important;
  }

  .inv-topbar {
    padding: 0 1.5rem;
  }
}
