:root {
  --sidebar-width: 268px;
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --surface: #ffffff;
  --canvas: #eef1f7;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --sidebar: #1a2740;
  --radius: 0.9rem;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-hover-color: #4338ca;
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--canvas);
  --bs-border-radius: 0.75rem;
  --bs-border-radius-sm: 0.55rem;
  --bs-border-radius-lg: 1rem;
  --bs-border-color: var(--line);
  --bs-tertiary-bg: #f8fafc;
  --bs-secondary-rgb: 100, 116, 139;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body,
.app-body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  letter-spacing: -0.04em;
  font-weight: 700;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-content {
  flex: 1;
  padding: 1.15rem 1.15rem 2rem;
}

@media (min-width: 768px) {
  .app-content {
    padding: 1.6rem 1.85rem 2.4rem;
  }
}

.sidebar,
.sidebar-offcanvas {
  width: var(--sidebar-width);
  background:
    radial-gradient(1200px 400px at -10% -10%, rgba(99, 102, 241, 0.22), transparent 52%),
    linear-gradient(180deg, #2a3a58 0%, var(--sidebar) 100%);
  color: #e8eef8;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand {
  padding: 1.15rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.brand-logo {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.7rem;
  object-fit: contain;
  background: #fff;
  padding: 0.12rem;
  flex-shrink: 0;
}

.brand-logo-preview {
  max-height: 3.5rem;
  max-width: 8rem;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #f8fafc;
  padding: 0.25rem;
  border: 1px solid var(--border, #e2e8f0);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  color: #c5d0e3;
  font-size: 0.72rem;
  font-weight: 500;
}

.sidebar-nav {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.85rem 0.7rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

.sidebar-offcanvas .sidebar-nav {
  flex: none;
  min-height: 0;
  overflow: visible;
}

.nav-hover-pill {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  top: 0;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: transform 0.2s ease, height 0.2s ease, opacity 0.16s ease;
  z-index: 0;
}

.sidebar .nav-link,
.sidebar-offcanvas .nav-link,
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-radius: 999px;
  padding: 0.58rem 0.75rem;
  color: #dbe4f0;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 42px;
  position: relative;
  z-index: 1;
}

.sidebar .nav-link:focus,
.sidebar-offcanvas .nav-link:focus,
.nav-group-toggle:focus {
  outline: none;
}

.sidebar .nav-link:focus-visible,
.sidebar-offcanvas .nav-link:focus-visible,
.nav-group-toggle:focus-visible {
  outline: none;
}

.sidebar .nav-link > i:first-child,
.sidebar-offcanvas .nav-link > i:first-child,
.nav-group-toggle > i:first-child {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.sidebar .nav-link i,
.sidebar-offcanvas .nav-link i,
.nav-group-toggle i {
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
}

.sidebar .nav-link > i:first-child,
.sidebar-offcanvas .nav-link > i:first-child,
.nav-group-toggle > i:first-child {
  width: 1.7rem;
}

.sidebar .nav-link:hover > i:first-child,
.sidebar-offcanvas .nav-link:hover > i:first-child,
.nav-group-toggle:hover > i:first-child,
.sidebar .nav-link:focus-visible > i:first-child,
.sidebar-offcanvas .nav-link:focus-visible > i:first-child,
.nav-group-toggle:focus-visible > i:first-child,
.sidebar .nav-link.active > i:first-child,
.sidebar-offcanvas .nav-link.active > i:first-child {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.22);
}

.sidebar .nav-link:hover,
.sidebar-offcanvas .nav-link:hover,
.nav-group-toggle:hover {
  background: transparent;
  color: #fff;
}

.sidebar .nav-link.active,
.sidebar-offcanvas .nav-link.active {
  background: rgba(99, 102, 241, 0.34);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.28);
  border-radius: 999px;
}

.nav-group {
  margin: 0.1rem 0;
}

.nav-group-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.nav-group-toggle::-webkit-details-marker,
.nav-group-toggle::marker {
  display: none;
  content: "";
}

.nav-group-toggle span {
  flex: 1;
}

.nav-caret {
  margin-left: auto;
  width: 0.9rem;
  font-size: 0.75rem;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.nav-group[open] > .nav-group-toggle .nav-caret {
  transform: rotate(180deg);
}

.nav-group.is-current > .nav-group-toggle,
.nav-group[open] > .nav-group-toggle {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-group-body {
  padding: 0.1rem 0 0.25rem;
}

.nav-group-body .nav-link {
  min-height: 38px;
  padding-left: 1.05rem;
  font-size: 0.86rem;
}

.sidebar-footer {
  padding: 0.9rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-tenant {
  font-size: 0.75rem;
  color: #c5d0e3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-offcanvas {
  --bs-offcanvas-width: min(86vw, 300px);
  --bs-offcanvas-bg: var(--sidebar);
  --bs-offcanvas-color: #e8eef8;
}

.sidebar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-offcanvas .offcanvas-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-weight: 650;
  font-size: 0.95rem;
}

.empresa-switch {
  min-width: 0;
}

.empresa-switch .form-select {
  max-width: min(52vw, 280px);
  border: 1px solid var(--line);
  background-color: #fff;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.7rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.7rem 0.25rem 0.28rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.86rem;
}

.user-chip::after {
  margin-left: 0.15rem;
}

.user-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.page-header h1,
.app-content > h1.h4,
.app-content > .h4 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  margin: 0;
}

.page-header .text-muted,
.page-lede {
  color: var(--muted) !important;
  font-size: 0.9rem;
}

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.card-header {
  background: transparent;
  border-bottom-color: var(--line);
  font-weight: 650;
}

.card-footer {
  background: #fbfcfe;
  border-top-color: var(--line);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f8fafc;
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.table-compact {
  font-size: 0.86rem;
}

.table-compact thead th {
  padding: 0.45rem 0.7rem;
}

.table-compact td {
  padding: 0.42rem 0.7rem;
}

.table-compact .badge {
  padding: 0.28em 0.55em;
  font-size: 0.72rem;
}

.table-compact .btn-sm {
  padding: 0.18rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
}

.grid-primary {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.grid-meta {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
  margin-top: 0.08rem;
}

.grid-tomador {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-compact .table-select {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}

.table-compact .text-end {
  font-variant-numeric: tabular-nums;
}

.badge {
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 0.4em 0.7em;
}

.btn {
  font-weight: 650;
  letter-spacing: -0.01em;
  border-radius: 0.7rem;
}

.btn-primary {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-color: #4338ca;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #4338ca;
  border-color: #3730a3;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
  background: #fff;
}

.form-control,
.form-select {
  border-color: #e2e8f0;
  border-radius: 0.7rem;
  min-height: 42px;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

label,
.form-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: #475569;
  margin-bottom: 0.35rem;
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
  color: #dc2626;
  font-size: 0.8rem;
}

.pagination {
  --bs-pagination-border-radius: 0.6rem;
  --bs-pagination-color: var(--ink);
  --bs-pagination-active-bg: var(--accent);
  --bs-pagination-active-border-color: var(--accent);
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 576px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 992px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  box-shadow: var(--shadow);
  min-height: 108px;
}

a.kpi-card {
  text-decoration: none;
  color: inherit;
}

a.kpi-card:hover {
  border-color: var(--accent);
}

.kpi-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 1.15rem;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-top: 0.15rem;
}

.kpi-indigo .kpi-icon { background: #eef2ff; color: #4f46e5; }
.kpi-sky .kpi-icon { background: #e0f2fe; color: #0284c7; }
.kpi-emerald .kpi-icon { background: #ecfdf5; color: #059669; }
.kpi-amber .kpi-icon { background: #fffbeb; color: #d97706; }
.kpi-rose .kpi-icon { background: #fff1f2; color: #e11d48; }
.kpi-slate .kpi-icon { background: #f1f5f9; color: #475569; }
.kpi-emerald .kpi-value { color: #047857; }
.kpi-rose .kpi-value { color: #be123c; }
.kpi-amber .kpi-value { color: #d97706; }
.kpi-sky .kpi-value { color: #0369a1; }
.kpi-indigo .kpi-value { color: #4338ca; }
.kpi-slate .kpi-value { color: #475569; }

.page-header-compact {
  margin-bottom: 0.75rem;
}

.filter-bar-compact {
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.85rem;
}

.dash-section {
  margin-bottom: 0.85rem;
}

.dash-section-title {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}

.kpi-grid-compact {
  gap: 0.5rem;
}

.kpi-grid-compact .kpi-card {
  gap: 0.55rem;
  min-height: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
  box-shadow: none;
}

.kpi-grid-compact .kpi-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
}

.kpi-grid-compact .kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
}

.kpi-grid-compact .kpi-value {
  font-size: 1.02rem;
  margin-top: 0.05rem;
}

.row-cols-4.kpi-grid-compact .kpi-card {
  gap: 0.35rem;
  padding: 0.5rem;
  min-height: 0;
}

.row-cols-4.kpi-grid-compact .kpi-label {
  line-height: 1.2;
}

.kpi-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.kpi-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(9.4rem, 1fr));
}

@media (min-width: 992px) {
  .kpi-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 16rem));
  }

  .kpi-grid-compact.kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-grid-auto {
    grid-template-columns: repeat(5, 1fr);
  }
}

.status-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.auth-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 10% 10%, rgba(99, 102, 241, 0.28), transparent 55%),
    radial-gradient(700px 380px at 90% 90%, rgba(14, 165, 233, 0.16), transparent 50%),
    linear-gradient(160deg, #0b1220, #111827 55%, #0f172a);
  color: var(--ink);
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.auth-brand {
  display: none;
  color: #e2e8f0;
  padding: 3rem;
}

.auth-brand .brand-link {
  margin-bottom: 1.25rem;
}

.auth-brand h1 {
  color: #fff;
  font-size: 2.1rem;
  max-width: none;
  white-space: nowrap;
}

.auth-brand p {
  color: #94a3b8;
  max-width: none;
  margin: 0.85rem 0 0;
  white-space: nowrap;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-card,
.onboarding-card,
.auth-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 1.15rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-card {
  max-width: 420px;
}

.onboarding-card {
  max-width: 860px;
}

.auth-card .card-body,
.login-card .card-body,
.onboarding-card .card-body {
  padding: 1.6rem;
}

.auth-card-heading {
  text-align: center;
}

.login-card .auth-card-heading h1 {
  white-space: nowrap;
}

.auth-shell--login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  gap: 1.5rem;
}

.auth-shell--login .auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  max-width: min(42rem, 100%);
}

.auth-shell--login .auth-brand .brand-link {
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-shell--login .auth-brand h1 {
  max-width: none;
  font-size: clamp(1.2rem, 3.6vw, 2rem);
  line-height: 1.25;
  white-space: nowrap;
}

.auth-shell--login .auth-brand p {
  max-width: none;
  font-size: clamp(0.82rem, 2.2vw, 1rem);
  white-space: nowrap;
}

.auth-shell--login .auth-panel {
  width: 100%;
  max-width: 420px;
  padding: 0;
}

@media (min-width: 992px) {
  .auth-shell {
    grid-template-columns: 1fr 1fr;
  }

  .auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .auth-panel {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
  }

  .auth-shell--login {
    display: flex;
    grid-template-columns: none;
    gap: 1.75rem;
    padding: 2.5rem 1.5rem;
  }

  .auth-shell--login .auth-panel {
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (max-width: 575.98px) {
  .page-header .btn {
    width: 100%;
  }

  .table td,
  .table th {
    font-size: 0.9rem;
  }

  .kpi-value {
    font-size: 1.28rem;
  }

  .kpi-grid-compact .kpi-value {
    font-size: 1.02rem;
  }
}

.toast-container {
  z-index: 1100;
}

.toast {
  border-radius: 0.85rem;
}

.busca-combo {
  position: relative;
  z-index: 2;
}

.busca-combo.is-open {
  z-index: 1050;
}

.busca-combo-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.busca-combo-list {
  position: absolute;
  z-index: 1050;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 16rem;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.busca-combo-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.8rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.busca-combo-item:hover,
.busca-combo-item.is-active {
  background: #eef2ff;
}

.busca-combo-nome {
  font-weight: 600;
}

.busca-combo-doc {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.busca-combo-empty {
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}
.htmx-request .label-idle {
  display: none;
}

.kpi-hint {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.12rem;
}

.row.kpi-grid-compact > [class*="col-"] > .kpi-card {
  min-height: 0;
}

.pdv {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 992px) {
  .pdv {
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: 1.25rem;
  }
}

.pdv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.pdv-toolbar h1 {
  font-size: 1.35rem;
  margin: 0;
}

.pdv-search {
  padding: 0.9rem 1rem 1rem;
  position: relative;
  z-index: 5;
  margin-bottom: 0.85rem;
  overflow: visible;
}

.pdv-search-field {
  position: relative;
}

.pdv-search-field .form-control {
  position: relative;
  z-index: 6;
  background: #fff;
}

.pdv-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 5;
  max-height: min(18rem, 45vh);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.pdv-search-results[hidden] {
  display: none !important;
}

tr.linha-clicavel {
  cursor: pointer;
}

.pdv-item-cat {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdv-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pdv-qty span {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
}

.pdv-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdv-totais {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pdv-total {
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
}

.pdv-pay {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.pdv-pay-btn {
  width: 100%;
  border: 0;
  border-radius: 0.85rem;
  color: #fff;
  padding: 0.85rem 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pdv-pay-btn:disabled {
  opacity: 0.45;
}

.pdv-pay-dinheiro { background: #15803d; }
.pdv-pay-cartao { background: #1d4ed8; }
.pdv-pay-pix { background: #0f766e; }
.ordem-botoes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ordem-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #fff;
}

.ordem-preview {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  color: #fff;
  font-weight: 600;
}

.ordem-item:has(input[type="checkbox"]:not(:checked)) .ordem-preview {
  opacity: 0.4;
}

.ordem-acoes {
  display: inline-flex;
  gap: 0.25rem;
}

.pdv-pay-prazo { background: #b45309; }
.pdv-pay-boleto { background: #475569; }
.pdv-pay-transferencia { background: #6d28d9; }
.pdv-pay-outro { background: #334155; }

.pdv-outras summary {
  cursor: pointer;
  list-style: none;
}

.pdv-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdv-cliente,
.pdv-cliente .card-body {
  overflow: visible;
}

.pdv-cart {
  overflow: visible;
}

.fluxo-charts {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.fluxo-charts-hero,
.fluxo-charts-split {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .fluxo-charts-hero {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
}

@media (min-width: 768px) {
  .fluxo-charts-split {
    grid-template-columns: 1fr 1fr;
  }
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 0.9rem 0.7rem;
  min-width: 0;
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.chart-card-head h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.chart-card-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 650;
}

.chart-canvas-wrap {
  position: relative;
  height: 210px;
}

.chart-canvas-wrap--lg {
  height: 230px;
}

.chart-canvas-wrap--bar {
  height: 200px;
}

@media (min-width: 768px) {
  .chart-canvas-wrap {
    height: 240px;
  }

  .chart-canvas-wrap--lg {
    height: 280px;
  }

  .chart-canvas-wrap--bar {
    min-height: 220px;
  }
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 1rem;
}

.chart-card.is-empty .chart-canvas-wrap canvas {
  visibility: hidden;
}

.fluxo-charts-hint {
  margin: -0.25rem 0 0;
}

.caixa-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

@media (min-width: 768px) {
  .caixa-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}

.caixa-kpi {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  align-items: center;
  isolation: isolate;
}

.caixa-kpi > * {
  position: relative;
  z-index: 1;
}

.caixa-kpi::after {
  content: "";
  position: absolute;
  right: -1.4rem;
  top: -1.6rem;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.caixa-kpi .kpi-icon {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.25rem;
}

.caixa-kpi .kpi-value {
  font-variant-numeric: tabular-nums;
  font-size: 1.55rem;
}

.caixa-kpi-hint {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.caixa-kpi-in {
  background: linear-gradient(165deg, #ecfdf5 0%, #ffffff 62%);
  border-color: #a7f3d0;
}

.caixa-kpi-in .kpi-icon {
  background: #d1fae5;
  color: #047857;
}

.caixa-kpi-in .kpi-value {
  color: #047857;
}

.caixa-kpi-in::after {
  background: rgba(16, 185, 129, 0.18);
}

.caixa-kpi-out {
  background: linear-gradient(165deg, #fff1f2 0%, #ffffff 62%);
  border-color: #fecdd3;
}

.caixa-kpi-out .kpi-icon {
  background: #ffe4e6;
  color: #be123c;
}

.caixa-kpi-out .kpi-value {
  color: #be123c;
}

.caixa-kpi-out::after {
  background: rgba(244, 63, 94, 0.16);
}

.caixa-kpi-saldo {
  background: linear-gradient(165deg, #eef2ff 0%, #ffffff 62%);
  border-color: #c7d2fe;
}

.caixa-kpi-saldo .kpi-icon {
  background: #e0e7ff;
  color: #4338ca;
}

.caixa-kpi-saldo .kpi-value {
  color: #3730a3;
}

.caixa-kpi-saldo::after {
  background: rgba(79, 70, 229, 0.16);
}

.caixa-kpi-saldo.is-neg {
  background: linear-gradient(165deg, #fff7ed 0%, #ffffff 62%);
  border-color: #fed7aa;
}

.caixa-kpi-saldo.is-neg .kpi-icon {
  background: #ffedd5;
  color: #c2410c;
}

.caixa-kpi-saldo.is-neg .kpi-value {
  color: #c2410c;
}

.caixa-kpi-saldo.is-neg::after {
  background: rgba(234, 88, 12, 0.14);
}

.filter-bar-caixa {
  padding: 0.9rem 1rem 1rem;
}

.filter-bar-caixa-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.filter-bar-caixa-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.money-in,
.money-out,
.money-zero {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money-in {
  color: #047857 !important;
}

.money-out {
  color: #be123c !important;
}

.money-zero {
  color: var(--muted);
}

.badge-mov {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-mov-in {
  background: #ecfdf5;
  color: #047857;
}

.badge-mov-out {
  background: #fff1f2;
  color: #be123c;
}

.table-caixa tbody tr.mov-in td:first-child {
  box-shadow: inset 3px 0 0 #34d399;
}

.table-caixa tbody tr.mov-out td:first-child {
  box-shadow: inset 3px 0 0 #fb7185;
}

.table-caixa tbody tr.mov-estorno {
  color: var(--muted);
}

.emissao-rtc-bloco {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 1rem 1.15rem 0.85rem;
  margin-bottom: 0.85rem;
  background: #fff;
}

.emissao-rtc-bloco h2 {
  color: #1b7a4e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

.emissao-rtc-bloco h2 .bi {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 0.15rem;
  cursor: help;
}

.emissao-rtc-pergunta {
  margin: 0 0 0.5rem;
  font-weight: 500;
}

@media (max-width: 575.98px) {
  .caixa-kpi .kpi-value {
    font-size: 1.32rem;
  }
}
