:root {
  --theme-primary: #5b3df5;
  --theme-primary-dark: #3f24cf;
  --theme-primary-deep: #25146f;
  --theme-primary-soft: #ede8ff;
  --theme-primary-soft-2: #f6f2ff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #fbf9ff;
  --theme-surface-soft-2: #f7f4ff;
  --theme-background: #f6f3ff;
  --theme-sidebar-start: #2a1179;
  --theme-sidebar-end: #160c4a;
  --theme-sidebar-soft: rgba(255, 255, 255, 0.08);
  --theme-text: #101529;
  --theme-muted: #6c7188;
  --theme-border: rgba(81, 61, 245, 0.12);
  --theme-shadow: rgba(30, 17, 95, 0.14);
  --theme-shadow-strong: rgba(30, 17, 95, 0.22);
  --theme-hover: rgba(91, 61, 245, 0.12);
  --theme-highlight: rgba(91, 61, 245, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--theme-text);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(91, 61, 245, 0.18), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(126, 87, 255, 0.14), transparent 26%),
    radial-gradient(circle at 80% 84%, rgba(24, 18, 76, 0.06), transparent 32%),
    linear-gradient(180deg, #f9f7ff 0%, var(--theme-background) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
    radial-gradient(circle at 20% 20%, rgba(91, 61, 245, 0.08), transparent 18%),
    radial-gradient(circle at 80% 30%, rgba(91, 61, 245, 0.05), transparent 20%);
  opacity: 0.9;
}

.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 0;
}

.sidebar {
  width: 300px;
  flex: 0 0 300px;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(42, 17, 121, 0.99), rgba(22, 12, 74, 0.99)),
    var(--theme-sidebar-end);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 18px 0 50px rgba(13, 8, 44, 0.16);
}

/* A barra da lateral não deve competir visualmente com a página. */
.sidebar {
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.sidebar::before {
  inset: 10% auto auto -96px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(2px);
}

.sidebar::after {
  inset: auto -80px 12% auto;
  width: 180px;
  height: 180px;
  background: rgba(120, 87, 255, 0.16);
  filter: blur(2px);
}

.sidebar .brand {
  position: relative;
  z-index: 1;
  padding: 14px 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.sidebar .brand h1 {
  margin: 0 0 4px;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.sidebar .brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.notification {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
}

.notification:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  transform: none;
}

.notification svg {
  width: 20px;
  height: 20px;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #a78bfa;
  color: #1f1148;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.sidebar nav .small {
  margin: 8px 8px 0;
  padding: 0 !important;
  color: rgba(255, 255, 255, 0.52) !important;
  font-size: 10px;
}

.sidebar nav > a,
.logout-button,
.menu-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.sidebar nav > a:hover,
.logout-button:hover,
.menu-toggle:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.sidebar nav > a.is-active,
.submenu a.is-active,
.menu-toggle.is-active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.34), rgba(91, 61, 245, 0.5));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 30px rgba(19, 10, 70, 0.24);
}

.menu-group {
  display: grid;
  gap: 10px;
}

.menu-toggle {
  justify-content: space-between;
  cursor: pointer;
}

.submenu {
  padding: 0 2px 0 8px;
  display: grid;
  gap: 8px;
}

.submenu a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.submenu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  transform: translateX(2px);
}

.submenu a .icon {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.78);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.92);
}

.icon-dark {
  color: #39415a;
}

.icon svg,
.auth-mark svg,
.notification svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-button {
  cursor: pointer;
  text-align: left;
}

main {
  flex: 1;
  min-width: 0;
  padding: 22px;
}

.workspace {
  position: relative;
  max-width: 1540px;
  margin: 0 auto;
}

.workspace::before {
  content: "";
  position: absolute;
  inset: 30px 0 auto auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 61, 245, 0.1), transparent 70%);
  filter: blur(16px);
  pointer-events: none;
}

.content-shell {
  position: relative;
  z-index: 1;
}

.page-title {
  margin-bottom: 10px;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 32px;
  letter-spacing: 0.2px;
}

.text-muted,
.small.text-muted,
.page-subtitle {
  color: var(--theme-muted) !important;
}

.card,
.modal-content {
  border: 1px solid rgba(91, 61, 245, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.84));
  box-shadow: 0 20px 50px var(--theme-shadow);
  backdrop-filter: blur(14px);
}

.card:hover {
  border-color: rgba(91, 61, 245, 0.15);
  box-shadow: 0 22px 56px var(--theme-shadow-strong);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(91, 61, 245, 0.08);
}

.table-responsive {
  border-radius: 20px;
  border: 1px solid rgba(91, 61, 245, 0.09);
}

.table {
  margin-bottom: 0;
  overflow: hidden;
  background: transparent;
}

.table thead th {
  padding-top: 16px;
  padding-bottom: 16px;
  background: rgba(91, 61, 245, 0.04);
  border-bottom: 1px solid rgba(91, 61, 245, 0.08);
  color: var(--theme-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table td {
  padding-top: 14px;
  padding-bottom: 14px;
  border-color: rgba(91, 61, 245, 0.06);
  color: #1c2438;
}

.table > :not(caption) > * > * {
  padding-right: 16px;
  padding-left: 16px;
}

.table.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(91, 61, 245, 0.025);
  color: #1c2438;
}

.table-actions {
  white-space: nowrap;
}

.table-actions .btn + .btn {
  margin-left: 6px;
}

.table tbody tr:hover {
  background: rgba(91, 61, 245, 0.04);
}

.btn {
  border-radius: 14px;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.btn-primary,
.btn-success {
  border: none;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
  box-shadow: 0 14px 24px rgba(91, 61, 245, 0.24);
}

.btn-primary:hover,
.btn-success:hover {
  background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary-deep));
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success {
  color: var(--theme-muted);
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(91, 61, 245, 0.12);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-success:hover {
  color: var(--theme-text);
  background: rgba(91, 61, 245, 0.06);
}

.form-control,
.form-select,
.form-control-color {
  border-radius: 14px;
  border-color: rgba(91, 61, 245, 0.14);
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(91, 61, 245, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(91, 61, 245, 0.12);
}

.form-check-input:checked {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(91, 61, 245, 0.12);
}

.nav-tabs {
  border-bottom-color: rgba(91, 61, 245, 0.1);
}

.nav-tabs .nav-link {
  border-radius: 14px 14px 0 0;
  color: var(--theme-muted);
}

.nav-tabs .nav-link.active {
  color: var(--theme-primary);
  background: #fff;
  border-color: rgba(91, 61, 245, 0.12) rgba(91, 61, 245, 0.12) #fff;
}

.alert {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(30, 17, 95, 0.08);
}

.badge {
  border-radius: 999px;
  padding: 0.45em 0.75em;
}

.code-block {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.field-inline {
  display: flex;
  gap: 12px;
  align-items: end;
}

.assistant-chat-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1050;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
  box-shadow: 0 18px 34px rgba(91, 61, 245, 0.36);
}


.assistant-chat-button svg {
  width: 27px;
  height: 27px;
}

.assistant-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 1050;
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 128px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(91, 61, 245, 0.09);
  box-shadow: 0 24px 50px var(--theme-shadow-strong);
  backdrop-filter: blur(16px);
}

.assistant-chat-panel.is-open {
  display: flex;
}

.assistant-chat-header {
  color: #fff;
  background: linear-gradient(135deg, var(--theme-sidebar-start), var(--theme-sidebar-end));
}

.assistant-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(91, 61, 245, 0.06), transparent 34%),
    #f8f8ff;
}

.assistant-chat-message {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  white-space: pre-wrap;
  box-shadow: 0 8px 16px rgba(30, 17, 95, 0.06);
}

.assistant-chat-message.bot {
  background: #fff;
  color: var(--theme-text);
}

.assistant-chat-message.user {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
}

.assistant-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.assistant-chat-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Bolha "digitando" enquanto o assistente processa a acao. */
.assistant-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 14px 14px;
}

.assistant-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-primary);
  opacity: 0.35;
  animation: assistant-typing-dot 1.2s infinite ease-in-out;
}

.assistant-chat-typing span:nth-child(2) {
  animation-delay: 0.18s;
}

.assistant-chat-typing span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes assistant-typing-dot {
  0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-chat-typing span {
    animation: none;
    opacity: 0.55;
  }
}

.assistant-chat-preview {
  font-size: 13px;
  background: #fff;
  border: 1px solid rgba(91, 61, 245, 0.1);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}

.theme-color-swatch {
  width: 100%;
  height: 10px;
  border-radius: 16px;
  border: 1px solid rgba(91, 61, 245, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(460px, 100%);
  padding: 28px;
}

.auth-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
  box-shadow: 0 16px 28px rgba(91, 61, 245, 0.26);
}

.auth-subtitle {
  margin-top: 8px;
  color: var(--theme-muted);
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.page-toolbar .search-form {
  display: flex;
  flex: 1 1 360px;
  gap: 10px;
  justify-content: flex-end;
}

.page-toolbar .search-form .form-control {
  max-width: 520px;
}

/* Catálogo de produtos */
.product-page {
  display: grid;
  gap: 22px;
}

.product-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 4px 0;
}

.page-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--theme-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.product-create-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding-right: 18px;
  padding-left: 16px;
}

.button-icon,
.product-search-icon {
  display: inline-flex;
  width: 19px;
  height: 19px;
}

.button-icon svg,
.product-search-icon svg {
  width: 100%;
  height: 100%;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-command-bar {
  padding: 12px;
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 12px 35px rgba(30, 17, 95, .07);
  backdrop-filter: blur(12px);
}

.product-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-search-icon {
  position: absolute;
  left: 15px;
  z-index: 2;
  color: var(--theme-muted);
  pointer-events: none;
}

.product-search .form-control {
  min-height: 46px;
  padding-right: 44px;
  padding-left: 46px;
  border: 0;
  background: transparent;
}

.product-search .form-control:focus {
  background: var(--theme-surface);
}

.product-search-clear {
  position: absolute;
  right: 104px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--theme-muted);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
}

.product-search-clear:hover {
  color: var(--theme-text);
  background: var(--theme-hover);
}

.product-search .btn {
  min-width: 94px;
  min-height: 46px;
}

.product-catalog {
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 20px 50px var(--theme-shadow);
  backdrop-filter: blur(16px);
}

.product-catalog-head,
.product-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.55fr) minmax(180px, 1.15fr) minmax(110px, .65fr) minmax(135px, .75fr) 94px;
  gap: 20px;
  align-items: center;
}

.product-catalog-head {
  min-height: 54px;
  padding: 0 22px;
  color: var(--theme-muted);
  background: var(--theme-surface-soft);
  border-bottom: 1px solid var(--theme-border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.product-catalog-list {
  display: grid;
}

.product-row {
  min-height: 82px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--theme-border);
  transition: background 160ms ease, transform 160ms ease;
}

.product-row:last-child {
  border-bottom: 0;
}

.product-row:hover {
  position: relative;
  z-index: 1;
  background: var(--theme-surface-soft);
}

.product-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.product-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 14px;
  color: var(--theme-primary-dark);
  background: linear-gradient(135deg, var(--theme-primary-soft), var(--theme-primary-soft-2));
  font-size: 15px;
  font-weight: 800;
}

.product-main-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.product-main-copy strong {
  overflow: hidden;
  color: var(--theme-text);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-main-copy span,
.product-identifiers span,
.product-price small {
  color: var(--theme-muted);
  font-size: 11px;
}

.product-identifiers {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.product-identifiers span {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-identifiers .product-empty-value {
  font-family: inherit;
  font-style: italic;
}

.product-price {
  display: grid;
  gap: 3px;
}

.product-price strong {
  color: var(--theme-text);
  font-size: 14px;
}

.product-price small {
  display: none;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.stock-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.stock-pill.is-available {
  color: #087443;
  background: #e8f8f0;
}

.stock-pill.is-available i {
  background: #10a765;
}

.stock-pill.is-empty {
  color: #a04b19;
  background: #fff1e8;
}

.stock-pill.is-empty i {
  background: #ed7a2d;
}

.product-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.product-action {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  color: var(--theme-muted);
  background: var(--theme-surface);
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.product-action:hover {
  color: var(--theme-primary);
  background: var(--theme-primary-soft-2);
  border-color: var(--theme-primary-soft);
  transform: translateY(-1px);
}

.product-action svg {
  width: 17px;
  height: 17px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-empty {
  display: grid;
  justify-items: center;
  padding: 64px 24px;
  color: var(--theme-muted);
  text-align: center;
}

.product-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 20px;
  color: var(--theme-primary);
  background: var(--theme-primary-soft-2);
}

.product-empty-icon svg {
  width: 31px;
  height: 31px;
}

.product-empty strong {
  color: var(--theme-text);
}

.product-empty p {
  margin: 5px 0 0;
  font-size: 13px;
}

.product-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--theme-muted);
  font-size: 12px;
}

.product-pagination nav {
  display: flex;
  gap: 6px;
}

.product-page-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--theme-border);
  border-radius: 11px;
  color: var(--theme-muted);
  background: var(--theme-surface);
  font-weight: 700;
  text-decoration: none;
}

.product-page-button:hover,
.product-page-button.is-current {
  color: #fff;
  background: var(--theme-primary);
  border-color: var(--theme-primary);
}

.product-page-button.is-disabled {
  opacity: .45;
}

/* Diretórios: clientes e demais cadastros */
.directory-page {
  display: grid;
  gap: 26px;
}

.directory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  color: var(--theme-muted);
  font-size: 12px;
}

.page-breadcrumb a {
  color: var(--theme-muted);
  text-decoration: none;
}

.page-breadcrumb strong {
  color: var(--theme-primary);
}

.directory-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.directory-create {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.directory-search {
  position: relative;
  flex: 1 1 auto;
}

.directory-search > span {
  position: absolute;
  top: 50%;
  left: 17px;
  z-index: 2;
  width: 19px;
  height: 19px;
  color: var(--theme-muted);
  transform: translateY(-50%);
}

.directory-search svg {
  width: 100%;
  height: 100%;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directory-search .form-control {
  min-height: 48px;
  padding-left: 48px;
  background: rgba(255, 255, 255, .86);
}

.directory-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.directory-stat {
  display: flex;
  min-width: 0;
  min-height: 126px;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 28px rgba(29, 21, 89, .055);
}

.directory-stat-icon {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 15px;
}

.directory-stat-icon svg {
  width: 27px;
  height: 27px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directory-stat > div {
  display: grid;
  min-width: 0;
}

.directory-stat small,
.directory-stat span {
  overflow: hidden;
  color: var(--theme-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-stat strong {
  margin: 3px 0;
  color: var(--theme-text);
  font-size: 22px;
}

.directory-stat.is-purple .directory-stat-icon { color: #6838ec; background: #eee8ff; }
.directory-stat.is-green .directory-stat-icon { color: #11975c; background: #e6f7ef; }
.directory-stat.is-blue .directory-stat-icon { color: #247cf0; background: #e8f1ff; }
.directory-stat.is-orange .directory-stat-icon { color: #f07816; background: #fff0e2; }

.directory-table {
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
}

.directory-table-head,
.directory-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(180px, 1fr) minmax(180px, 1fr) 130px;
  gap: 18px;
  align-items: center;
}

.directory-table-head {
  min-height: 52px;
  padding: 0 22px;
  color: var(--theme-muted);
  background: var(--theme-surface-soft);
  border-bottom: 1px solid var(--theme-border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.directory-row {
  min-height: 82px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--theme-border);
}

.directory-row:last-child {
  border-bottom: 0;
}

.directory-row:hover {
  background: var(--theme-surface-soft);
}

.directory-person {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.directory-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--theme-primary-dark);
  background: var(--theme-primary-soft);
  font-size: 14px;
  font-weight: 800;
}

.directory-person > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.directory-person strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-person small {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 7px;
  color: var(--theme-primary-dark);
  background: var(--theme-primary-soft-2);
  font-size: 9px;
}

.directory-value {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--theme-text);
  font-size: 12px;
}

.directory-value svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--theme-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directory-actions {
  display: flex;
  justify-content: flex-end;
}

.directory-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.directory-actions .button-icon {
  width: 15px;
  height: 15px;
}

.directory-empty {
  padding: 54px 24px;
  color: var(--theme-muted);
  text-align: center;
  font-size: 13px;
}

.directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--theme-muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .directory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-table-head {
    display: none;
  }

  .directory-table {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 0;
    background: transparent;
  }

  .directory-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: #fff;
  }

  .directory-person {
    grid-column: 1 / -1;
  }

  .directory-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  .product-catalog-head {
    display: none;
  }

  .product-catalog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
  }

  .product-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-content: start;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--theme-border);
    border-radius: 18px;
  }

  .product-row:last-child {
    border-bottom: 1px solid var(--theme-border);
  }

  .product-main {
    grid-column: 1 / -1;
  }

  .product-identifiers {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--theme-border);
  }

  .product-price small {
    display: block;
  }

  .product-stock {
    align-self: end;
  }

  .product-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-basis: auto;
    height: auto;
    position: relative;
    overflow: visible;
  }

  main {
    padding: 16px;
  }
}

@media (max-width: 576px) {
  main {
    padding: 12px;
  }

  .product-page-header {
    align-items: flex-start;
  }

  .product-page-header .page-title {
    font-size: 28px;
  }

  .product-create-button {
    width: 46px;
    min-width: 46px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .product-command-bar {
    padding: 8px;
  }

  .product-search {
    gap: 7px;
  }

  .product-search .btn {
    min-width: 0;
    padding-right: 13px;
    padding-left: 13px;
  }

  .product-search-clear {
    display: none;
  }

  .product-catalog-list {
    grid-template-columns: 1fr;
  }

  .product-pagination {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .assistant-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 88px;
    height: min(72vh, 560px);
  }

  .assistant-chat-button {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 720px) {
  .page-toolbar .search-form {
    flex-basis: 100%;
  }

  .page-toolbar .search-form .form-control {
    max-width: none;
  }

  /* So a tabela que vira cartoes (.responsive-list) dispensa a rolagem. As
     demais precisam rolar dentro do proprio quadro: sem isso elas vazavam e
     a pagina inteira ganhava rolagem lateral no celular. */
  .table-responsive:has(> .responsive-list) {
    overflow: visible;
    border: 0;
  }

  .responsive-list thead {
    display: none;
  }

  .responsive-list,
  .responsive-list tbody,
  .responsive-list tr,
  .responsive-list td {
    display: block;
    width: 100%;
  }

  .responsive-list tr {
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(91, 61, 245, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 20px rgba(30, 17, 95, 0.05);
  }

  .responsive-list td {
    position: relative;
    min-height: 28px;
    padding: 5px 0 5px 44% !important;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .responsive-list td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 40%;
    color: var(--theme-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .responsive-list td.table-actions {
    padding-left: 0 !important;
    padding-top: 10px !important;
    text-align: left;
  }

  .responsive-list td.table-actions::before {
    display: none;
  }
}

/* -----------------------------------------------------------------
   Design system 2026 — padrão visual compartilhado por todo o sistema
   ----------------------------------------------------------------- */
body {
  background:
    radial-gradient(circle at 88% 8%, var(--theme-primary-soft-2), transparent 28%),
    linear-gradient(180deg, #fafbff 0%, var(--theme-background) 100%);
}

.sidebar {
  width: 320px;
  flex-basis: 320px;
  padding: 24px 18px;
  background:
    radial-gradient(circle at 100% 58%, rgba(115, 78, 255, .18), transparent 22%),
    linear-gradient(180deg, var(--theme-sidebar-start), var(--theme-sidebar-end));
}

.sidebar .brand {
  padding: 8px 6px 20px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .13);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.sidebar .brand h1 {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: 25px;
  font-weight: 700;
}

.sidebar .auth-mark {
  border-radius: 12px !important;
  background: linear-gradient(135deg, #7959ff, var(--theme-primary));
  box-shadow: 0 10px 24px rgba(91, 61, 245, .35);
}

.sidebar .auth-mark svg {
  width: 27px;
  height: 27px;
}

.sidebar nav {
  display: flex;
  min-height: calc(100vh - 118px);
  margin-top: 14px;
  gap: 4px;
  flex-direction: column;
}

.nav-section-label {
  margin: 18px 10px 7px;
  color: rgba(255, 255, 255, .52);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar nav > a,
.logout-button {
  position: relative;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  color: rgba(255, 255, 255, .88);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.sidebar nav > a::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -18px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}

.sidebar nav > a:hover,
.logout-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
  transform: none;
}

.sidebar nav > a.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(121, 84, 255, .64), rgba(121, 84, 255, .34));
  border: 0;
  box-shadow: 0 12px 28px rgba(18, 8, 69, .18);
}

.sidebar nav > a.is-active::before {
  background: #9f7cff;
}

.sidebar nav > a .icon,
.logout-button .icon {
  width: 20px;
  height: 20px;
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 20px;
}

.sidebar-logout .logout-button {
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .07);
}

.sidebar-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.sidebar-mobile-toggle svg {
  width: 21px;
  height: 21px;
  stroke-linecap: round;
}

main {
  padding: 22px 24px 48px;
}

.workspace {
  width: 100%;
  max-width: none;
}

.content-shell {
  min-height: calc(100vh - 44px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 26px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 55px rgba(29, 21, 89, .09);
  backdrop-filter: blur(18px);
}

.page-title,
.content-shell h2 {
  color: var(--theme-text);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-weight: 750;
  letter-spacing: -.04em;
}

.page-title {
  font-size: clamp(28px, 3vw, 36px);
}

.content-shell h3,
.content-shell h4,
.content-shell h5,
.content-shell h6 {
  color: var(--theme-text);
  font-weight: 700;
}

.card,
.modal-content {
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 35px rgba(29, 21, 89, .06);
}

.card:hover {
  border-color: var(--theme-border);
  box-shadow: 0 14px 40px rgba(29, 21, 89, .08);
}

.btn {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 13px;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 11px;
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
  box-shadow: 0 10px 22px var(--theme-highlight);
}

.form-label {
  margin-bottom: 7px;
  color: var(--theme-text);
  font-size: 12px;
  font-weight: 700;
}

.form-control,
.form-select {
  min-height: 45px;
  padding: 10px 13px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  color: var(--theme-text);
}

textarea.form-control {
  min-height: 110px;
}

.form-text,
.helptext {
  color: var(--theme-muted);
  font-size: 11px;
}

.table-responsive {
  border-radius: 16px;
}

.table thead th {
  height: 50px;
  padding: 13px 16px;
  background: var(--theme-surface-soft);
  font-size: 10px;
}

.table td {
  padding: 14px 16px;
  font-size: 12px;
  vertical-align: middle;
}

.table.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: transparent;
}

.table tbody tr:hover > * {
  --bs-table-bg-state: var(--theme-surface-soft);
}

.pagination {
  gap: 6px;
}

.page-link {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--theme-border);
  border-radius: 10px !important;
  color: var(--theme-muted);
  background: #fff;
}

.active > .page-link,
.page-link.active {
  color: #fff;
  background: var(--theme-primary);
  border-color: var(--theme-primary);
}

.nav-tabs {
  gap: 5px;
  padding: 5px;
  border: 0;
  border-radius: 14px;
  background: var(--theme-surface-soft);
}

.nav-tabs .nav-link {
  border: 0;
  border-radius: 10px;
  font-size: 12px;
}

.nav-tabs .nav-link.active {
  border: 0;
  box-shadow: 0 6px 15px rgba(29, 21, 89, .08);
}

.system-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 4px;
}

.form-page {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.form-surface {
  overflow: hidden;
}

.form-surface form > .row,
.form-surface .tab-pane > .row {
  row-gap: 18px !important;
}

.form-surface .errorlist {
  margin: 6px 0 0;
  padding: 0;
  color: #bb2b3b;
  font-size: 11px;
  list-style: none;
}

.company-logo-field {
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-logo-field > img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: contain;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  background: var(--theme-surface-soft);
}

.dashboard-stat {
  position: relative;
  min-height: 118px;
  justify-content: center;
  overflow: hidden;
}

.dashboard-stat::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--theme-primary-soft-2);
}

.dashboard-stat .h4,
.dashboard-stat .h5 {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--theme-text);
  font-size: 22px;
  font-weight: 750;
}

.system-panel {
  overflow: hidden;
}

.system-list-page {
  display: grid;
  gap: 20px;
}

.system-filter-panel {
  background: rgba(255, 255, 255, .78);
}

.system-summary-bar {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 4px 3px;
}

.system-summary-bar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-summary-bar small {
  color: var(--theme-muted);
  font-size: 11px;
}

.system-summary-bar strong {
  color: var(--theme-text);
  font-size: 15px;
}

.system-summary-total {
  padding-left: 28px;
  border-left: 1px solid var(--theme-border);
}

.summary-visibility {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  color: var(--theme-muted);
  background: #fff;
}

.summary-visibility svg {
  width: 16px;
  height: 16px;
}

.system-table-card {
  overflow: hidden;
}

.system-table-card .table-responsive {
  border: 0;
  border-radius: 0;
}

.sale-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
}

.sale-detail-summary > div {
  display: grid;
  gap: 5px;
  padding: 17px 20px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .84);
}

.sale-detail-summary small {
  color: var(--theme-muted);
  font-size: 10px;
}

.sale-detail-summary strong {
  color: var(--theme-text);
  font-size: 18px;
}

.pdv-cart-panel,
.pdv-summary-panel {
  min-height: 180px;
}

.pdv-summary-panel {
  position: sticky;
  top: 22px;
}

.pdv-summary-panel #cart-total {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.04em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.status-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.is-success { color: #087443; background: #e8f8f0; }
.status-badge.is-success i { background: #10a765; }
.status-badge.is-warning { color: #9a5a0d; background: #fff4db; }
.status-badge.is-warning i { background: #efa92f; }
.status-badge.is-neutral { color: #596174; background: #eff1f5; }
.status-badge.is-neutral i { background: #8991a3; }

.security-page {
  max-width: 760px;
}

.security-success {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid #bce8d2;
  border-radius: 16px;
  color: #087443;
  background: #effbf5;
}

.security-success > span,
.security-lock {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border-radius: 15px;
  color: var(--theme-primary);
  background: var(--theme-primary-soft-2);
}

.security-success svg,
.security-lock svg {
  width: 26px;
  height: 26px;
}

.security-success p {
  margin: 3px 0 0;
  color: #438066;
  font-size: 12px;
}

.security-details {
  padding: 12px 14px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  color: var(--theme-muted);
  font-size: 11px;
}

.security-details summary {
  cursor: pointer;
  font-weight: 700;
}

.security-details p {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}

.security-code-input {
  max-width: 260px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: .35em;
  text-align: center;
}

.security-verify {
  width: min(440px, 100%);
  margin: 8vh auto 0;
  padding: 36px;
  border: 1px solid var(--theme-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 22px 55px var(--theme-shadow);
  text-align: center;
}

.security-lock {
  margin: 0 auto 18px;
}

.security-verify .security-code-input {
  max-width: none;
  margin-top: 22px;
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  margin-top: 10px;
  border-top: 1px solid var(--theme-border);
  color: var(--theme-muted);
  font-size: 11px;
}

@media (max-width: 1100px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100%;
    padding: 10px 14px;
    border-right: 0;
    box-shadow: 0 8px 28px rgba(13, 8, 44, .18);
  }

  .sidebar .brand {
    align-items: center !important;
    padding: 0;
    border: 0;
  }

  .sidebar .auth-mark {
    width: 40px !important;
    height: 40px !important;
  }

  .sidebar .brand h1 {
    font-size: 18px;
  }

  .sidebar .brand p {
    display: none;
  }

  .notification {
    display: none;
  }

  .sidebar-mobile-toggle {
    display: grid;
  }

  .sidebar nav {
    display: none;
    min-height: auto;
    max-height: calc(100vh - 70px);
    padding: 8px 0 14px;
    overflow-y: auto;
  }

  .sidebar nav.is-open {
    display: flex;
  }

  .sidebar-logout {
    margin-top: 12px;
  }

  main {
    padding: 14px;
  }

  .content-shell {
    min-height: calc(100vh - 86px);
    padding: 24px;
  }
}

@media (max-width: 576px) {
  main {
    padding: 8px;
  }

  .content-shell {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .card {
    border-radius: 16px;
  }

  .system-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-summary-bar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .system-summary-total {
    padding: 0;
    border: 0;
  }

  .audit-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .sale-detail-summary {
    grid-template-columns: 1fr 1fr;
  }

  .pdv-summary-panel {
    position: static;
  }

  .directory-header {
    display: block;
  }

  .page-breadcrumb {
    display: none;
  }

  .directory-toolbar {
    flex-wrap: wrap;
  }

  .directory-create {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
  }

  .directory-search {
    order: 1;
    flex-basis: 100%;
  }

  .directory-toolbar > .btn-outline-secondary {
    order: 3;
  }

  .directory-stats {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .directory-stat {
    min-height: 104px;
    padding: 12px;
  }

  .directory-stat-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .directory-stat-icon svg {
    width: 21px;
    height: 21px;
  }

  .directory-stat strong {
    font-size: 18px;
  }

  .directory-row {
    grid-template-columns: 1fr;
  }

  .directory-person,
  .directory-actions {
    grid-column: auto;
  }

  .directory-footer {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
}

/* -----------------------------------------------------------------
   Menu lateral — tema "midnight" (navy escuro com destaque azul)
   Ajuste as variáveis abaixo para calibrar o visual do menu.
   ----------------------------------------------------------------- */
:root {
  --menu-bg-top: #0d1740;
  --menu-bg-bottom: #070d28;
  --menu-border: rgba(255, 255, 255, 0.06);
  --menu-label: #6b7c9f;
  --menu-item: #b7c4dd;
  --menu-item-icon: #90a2c6;
  --menu-item-hover-bg: rgba(255, 255, 255, 0.05);
  --menu-item-hover: #e8eefc;
  --menu-active-bg: linear-gradient(90deg, rgba(38, 74, 176, 0.55), rgba(21, 40, 108, 0.22));
  --menu-active-text: #ffffff;
  --menu-accent: #3b82f6;
  --menu-scroll-thumb: rgba(126, 156, 219, 0.35);
}

.sidebar {
  width: 288px;
  flex: 0 0 288px;
  flex-basis: 288px;
  padding: 18px 12px 22px;
  background: linear-gradient(180deg, var(--menu-bg-top), var(--menu-bg-bottom));
  border-right: 1px solid var(--menu-border);
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: var(--menu-scroll-thumb) transparent;
}

/* O visual novo é plano: sem os halos decorativos do tema antigo. */
.sidebar::before,
.sidebar::after {
  display: none;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--menu-scroll-thumb);
}

.sidebar .brand {
  padding: 6px 8px 16px;
  border-bottom: 1px solid var(--menu-border);
}

.sidebar .brand h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.sidebar .brand p {
  font-size: 12px;
  color: var(--menu-label) !important;
}

.sidebar .auth-mark {
  border-radius: 12px !important;
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  box-shadow: none;
}

.sidebar nav {
  gap: 2px;
  margin-top: 10px;
}

.nav-section-label {
  margin: 16px 12px 8px;
  color: var(--menu-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.sidebar nav > a,
.logout-button,
.menu-toggle {
  gap: 14px;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  color: var(--menu-item);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 150ms ease, color 150ms ease;
}

.sidebar nav > a .icon,
.logout-button .icon,
.menu-toggle .icon {
  width: 20px;
  height: 20px;
  color: var(--menu-item-icon);
}

.sidebar nav > a svg,
.logout-button svg,
.menu-toggle svg,
.submenu a svg {
  stroke-width: 1.6;
}

.sidebar nav > a:hover,
.logout-button:hover,
.menu-toggle:hover {
  color: var(--menu-item-hover);
  background: var(--menu-item-hover-bg);
  box-shadow: none;
  transform: none;
}

.sidebar nav > a:hover .icon,
.logout-button:hover .icon,
.menu-toggle:hover .icon {
  color: var(--menu-item-hover);
}

.sidebar nav > a.is-active,
.menu-toggle.is-active {
  color: var(--menu-active-text);
  background: var(--menu-active-bg);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(120, 160, 255, 0.16);
}

.sidebar nav > a.is-active .icon,
.menu-toggle.is-active .icon {
  color: var(--menu-active-text);
}

/* Barra de destaque colada na borda esquerda do item ativo. */
.sidebar nav > a::before,
.menu-toggle::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.sidebar nav > a.is-active::before,
.menu-toggle.is-active::before {
  background: var(--menu-accent);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.65);
}

/* Itens com submenu ganham a setinha à direita, como no modelo. */
.menu-toggle {
  position: relative;
  justify-content: flex-start;
}

.menu-toggle::after {
  content: "";
  margin-left: auto;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--menu-label);
  transition: transform 150ms ease;
}

.menu-toggle[aria-expanded="true"]::after,
.menu-toggle.is-open::after {
  transform: rotate(90deg);
}

.menu-group {
  gap: 2px;
}

.submenu {
  gap: 2px;
  padding: 0 0 0 22px;
}

.submenu a {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--menu-item);
  font-size: 13px;
  font-weight: 500;
}

.submenu a:hover {
  color: var(--menu-item-hover);
  background: var(--menu-item-hover-bg);
  transform: none;
}

.submenu a.is-active {
  color: var(--menu-active-text);
  background: var(--menu-active-bg);
  border: 0;
  box-shadow: none;
}

.submenu a .icon {
  color: var(--menu-item-icon);
}

.sidebar-logout {
  padding-top: 16px;
  border-top: 1px solid var(--menu-border);
}

.sidebar-logout .logout-button {
  border: 0;
  background: transparent;
}

.notification:hover {
  background: var(--menu-item-hover-bg);
}

.notification-badge {
  background: var(--menu-accent);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.sidebar-mobile-toggle {
  border-color: var(--menu-border);
  background: var(--menu-item-hover-bg);
}

@media (max-width: 1100px) {
  .sidebar {
    width: 100%;
    flex-basis: auto;
    padding: 10px 14px;
    border-right: 0;
  }

  .sidebar .brand {
    padding: 0;
    border-bottom: 0;
  }
}

/* -----------------------------------------------------------------
   Paginas de erro (400/403/404/500). Independem de sessao e de dados,
   entao trazem o proprio visual, sem depender do base.html.
   ----------------------------------------------------------------- */
.erro-pagina {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: linear-gradient(180deg, #fafbff 0%, var(--theme-background, #f2f4fb) 100%);
}

.erro-cartao {
  max-width: 460px;
  padding: 44px 40px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(29, 21, 89, .1);
  text-align: center;
}

.erro-codigo {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--theme-primary, #5b3df5);
  opacity: .22;
}

.erro-cartao h1 {
  margin: 12px 0 8px;
  font-size: 22px;
  color: var(--theme-text, #0f172a);
}

.erro-cartao p {
  margin: 0 0 24px;
  color: var(--theme-muted, #667085);
  font-size: 15px;
}

/* Aviso de preco ajustado na sugestao do assistente. Discreto, mas visivel:
   quem confirma a venda precisa perceber que a etiqueta mudou. */
.assistant-chat-ajuste {
  margin: -2px 0 4px 10px;
  color: var(--theme-primary, #5b3df5);
  font-size: 11px;
}

/* -----------------------------------------------------------------
   Monitores de 19" a 22" (1280-1600px de largura, ou ate 900px de
   altura). Sem este bloco o menu de 288px, a moldura e o card interno
   somavam quase 1/4 da largura em espaco vazio, e em 768px de altura o
   menu cortava Etiquetas, Usuarios e Sair.
   ----------------------------------------------------------------- */
@media (min-width: 1101px) and (max-width: 1600px), (min-width: 1101px) and (max-height: 900px) {
  html {
    font-size: 15px;
  }

  .sidebar {
    width: 236px;
    flex: 0 0 236px;
    flex-basis: 236px;
    padding: 12px 10px 14px;
  }

  .sidebar .brand {
    padding: 2px 6px 10px;
  }

  .sidebar .auth-mark {
    width: 38px !important;
    height: 38px !important;
  }

  .sidebar .brand h1 {
    font-size: 18px;
  }

  .sidebar nav {
    min-height: calc(100vh - 80px);
    margin-top: 6px;
    gap: 1px;
  }

  .nav-section-label {
    margin: 10px 10px 4px;
  }

  .sidebar nav > a,
  .logout-button,
  .menu-toggle {
    gap: 10px;
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
  }

  .sidebar nav > a .icon,
  .logout-button .icon,
  .menu-toggle .icon {
    width: 18px;
    height: 18px;
  }

  .sidebar-logout {
    padding-top: 10px;
  }

  main {
    padding: 12px 14px 24px;
  }

  .content-shell {
    min-height: calc(100vh - 36px);
    padding: 22px;
    border-radius: 20px;
  }

  /* Cards dentro da moldura: o padding grande do Bootstrap somava com o dela. */
  .content-shell .p-lg-5 {
    padding: 1.5rem !important;
  }

  .content-shell .p-4 {
    padding: 1.25rem !important;
  }

  .page-title {
    font-size: 26px;
  }

  .content-shell h2 {
    font-size: 24px;
  }

  .product-row {
    min-height: 64px;
    padding: 9px 18px;
  }

  .product-catalog-head {
    min-height: 44px;
    padding: 0 18px;
  }

  .assistant-chat-button {
    width: 52px;
    height: 52px;
  }

  /* Com menos largura os botoes de acao quebravam o rotulo em duas linhas. */
  .content-shell .btn {
    white-space: nowrap;
  }
}

/* Telas baixas (768px): o menu precisa caber inteiro sem rolagem. */
@media (min-width: 1101px) and (max-height: 800px) {
  .nav-section-label {
    margin: 7px 10px 2px;
  }

  .sidebar nav > a,
  .logout-button,
  .menu-toggle {
    min-height: 32px;
    padding: 5px 12px;
  }
}


/* Painel de avisos do sininho. Fixo na tela para escapar da rolagem da
   barra lateral; a posicao e calculada a partir do botao. */
.notification {
  cursor: pointer;
}

.notification-panel {
  position: fixed;
  z-index: 1060;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--theme-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
}

.notification-panel-head {
  padding: 6px 10px 8px;
  color: var(--theme-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px 10px 14px;
  border-left: 3px solid var(--theme-primary);
  border-radius: 10px;
  color: var(--theme-text);
  text-decoration: none;
  font-size: 13px;
}

.notification-item + .notification-item {
  margin-top: 4px;
}

.notification-item:hover {
  background: var(--theme-surface-soft);
  color: var(--theme-text);
}

.notification-item span {
  color: var(--theme-muted);
  font-size: 12px;
}

.notification-item.is-danger { border-left-color: #dc2626; }
.notification-item.is-warning { border-left-color: #d97706; }
.notification-item.is-info { border-left-color: #2563eb; }

.notification-empty {
  padding: 14px 12px;
  color: var(--theme-muted);
  font-size: 13px;
}

/* No celular o sininho continua acessivel, ao lado do menu. */
@media (max-width: 1100px) {
  .notification {
    display: inline-flex;
    margin-left: auto;
  }
}
