/* =========================================================
   RIZHORT NEXUS - CSS GLOBAL
   ========================================================= */

/* =========================
   RESET / BASE
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  background: #000000;
  color: #ffffff;
  font-family: "Rajdhani", "Segoe UI", Arial, sans-serif;
  line-height: 1.4;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

/* =========================
   VARIÁVEIS
   ========================= */
:root {
  --nx-bg: #000000;
  --nx-bg-soft: #05070b;
  --nx-bg-panel: #07090d;
  --nx-bg-panel-2: #0a0f1c;
  --nx-bg-panel-3: #0d121b;

  --nx-primary: #00f2ff;
  --nx-primary-2: #00b8ff;
  --nx-accent: #cc3366;
  --nx-accent-hover: #b72b5a;

  --nx-text: #ffffff;
  --nx-text-soft: rgba(255, 255, 255, 0.76);
  --nx-text-muted: rgba(255, 255, 255, 0.46);
  --nx-text-dim: rgba(255, 255, 255, 0.24);

  --nx-success: #00ff88;
  --nx-danger: #ff3b3b;
  --nx-warning: #ffb020;

  --nx-border: rgba(255, 255, 255, 0.06);
  --nx-border-strong: rgba(0, 242, 255, 0.32);
  --nx-border-accent: rgba(204, 51, 102, 0.42);

  --nx-shadow-soft:
    0 0 0 1px rgba(0, 242, 255, 0.06), 0 0 18px rgba(0, 242, 255, 0.06);

  --nx-font-title: "Orbitron", "Rajdhani", Arial, sans-serif;
  --nx-font-body: "Rajdhani", "Segoe UI", Arial, sans-serif;

  --nx-header-height: 64px;
  --nx-page-gap: 14px;
}

/* =========================
   SCROLLBAR
   ========================= */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 255, 0.26) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 255, 0.22);
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 255, 0.4);
  border: 2px solid transparent;
  background-clip: content-box;
}

/* =========================
   APP / SHELL
   ========================= */
.nx-app,
.nx-shell {
  min-height: 100vh;
  background:
    linear-gradient(to bottom, rgba(0, 242, 255, 0.03), transparent 90px),
    linear-gradient(to right, rgba(0, 242, 255, 0.02), transparent 180px),
    #000000;
}

.nx-shell {
  display: flex;
  flex-direction: column;
}

.nx-header {
  height: var(--nx-header-height);
  min-height: var(--nx-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--nx-border-strong);
  background: rgba(0, 0, 0, 0.94);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.nx-header-left,
.nx-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.nx-brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nx-brand-name {
  font-family: var(--nx-font-title);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--nx-primary);
  text-transform: uppercase;
  white-space: nowrap;
}

.nx-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--nx-text-soft);
  font-size: 0.8rem;
  white-space: nowrap;
}

.nx-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nx-success);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.55);
}

/* =========================
   MENU HORIZONTAL
   ========================= */
.nx-nav-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.nx-nav {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nx-nav::-webkit-scrollbar {
  display: none;
}

.nx-nav-item,
.nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--nx-header-height);
  padding: 0 16px;
  color: var(--nx-text-muted);
  font-family: var(--nx-font-title);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
  cursor: pointer;
}

.nx-nav-item:hover,
.nav-btn:hover {
  color: var(--nx-primary);
  background: rgba(0, 242, 255, 0.04);
}

.nx-nav-item.is-active,
.nav-btn.active {
  color: var(--nx-primary);
  border-bottom-color: var(--nx-primary);
}

.nx-nav-item.is-active::after,
.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 1px;
  background: var(--nx-primary);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.24);
}

/* =========================
   MAIN / VIEWPORT
   ========================= */
.nx-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 16px;
  min-height: 0;
}

#NEXUS_VIEWPORT {
  flex: 1;
  min-height: calc(100vh - var(--nx-header-height) - 32px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nx-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.nx-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.72);
  box-shadow: var(--nx-shadow-soft);
}

/* =========================
   TIPOGRAFIA
   ========================= */
.nx-page-title {
  margin: 0;
  color: var(--nx-primary);
  font-family: var(--nx-font-title);
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.nx-page-subtitle {
  margin: 8px 0 0;
  color: var(--nx-text-dim);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nx-panel-title,
.nx-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--nx-border);
  color: var(--nx-primary);
  font-family: var(--nx-font-title);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nx-label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--nx-text-muted);
  font-family: var(--nx-font-title);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nx-text-soft {
  color: var(--nx-text-soft);
}

.nx-text-muted {
  color: var(--nx-text-muted);
}

.nx-text-dim {
  color: var(--nx-text-dim);
}

/* =========================
   DIVIDER / SPACING
   ========================= */
.nx-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 242, 255, 0.32) 12%,
    rgba(0, 242, 255, 0.12)
  );
  margin: 10px 0 14px;
}

/* =========================
   BOTÕES
   ========================= */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  text-align: center;
  font-family: var(--nx-font-title);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
}

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

.nx-btn:active {
  transform: translateY(0);
}

.nx-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.nx-btn-primary {
  background: var(--nx-primary);
  color: #000000;
  box-shadow:
    0 0 0 1px rgba(0, 242, 255, 0.12),
    0 0 24px rgba(0, 242, 255, 0.12);
}

.nx-btn-primary:hover {
  background: var(--nx-accent);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(204, 51, 102, 0.14),
    0 0 24px rgba(204, 51, 102, 0.14);
}

.nx-btn-secondary {
  background: transparent;
  color: var(--nx-text-soft);
  border-color: rgba(255, 255, 255, 0.1);
}

.nx-btn-secondary:hover {
  border-color: var(--nx-border-strong);
  color: var(--nx-primary);
  background: rgba(0, 242, 255, 0.05);
}

.nx-btn-lg {
  min-height: 44px;
  padding: 0 22px;
}

.nx-btn-sm {
  min-height: 32px;
  padding: 0 14px;
  font-size: 0.66rem;
}

.nx-w-full {
  width: 100%;
}

/* =========================
   FORMULÁRIOS
   ========================= */
.nx-form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.nx-form-row.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nx-form-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nx-field {
  width: 100%;
  min-width: 0;
}

.nx-input,
.nx-select,
.nx-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.72);
  color: var(--nx-text);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.nx-input,
.nx-select {
  min-height: 36px;
  padding: 0 12px;
}

.nx-textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.nx-input::placeholder,
.nx-textarea::placeholder {
  color: rgba(255, 255, 255, 0.24);
}

.nx-input:hover,
.nx-select:hover,
.nx-textarea:hover {
  border-color: rgba(0, 242, 255, 0.22);
}

.nx-input:focus,
.nx-select:focus,
.nx-textarea:focus {
  border-color: var(--nx-border-strong);
  box-shadow:
    0 0 0 1px rgba(0, 242, 255, 0.12),
    0 0 18px rgba(0, 242, 255, 0.08);
}

.nx-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--nx-primary) 50%),
    linear-gradient(135deg, var(--nx-primary) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.nx-help {
  margin-top: 6px;
  color: var(--nx-text-dim);
  font-size: 0.72rem;
}

/* =========================
   PAINÉIS / CARDS
   ========================= */
.nx-panel {
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.76);
  padding: 14px;
  min-height: 100%;
  min-width: 0;
}

.nx-panel-soft {
  background: rgba(7, 9, 13, 0.85);
  box-shadow: var(--nx-shadow-soft);
}

.nx-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   GRID DE CADASTRO
   ========================= */
.nx-entry-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.nx-entry-side,
.nx-entry-main,
.nx-entry-extra {
  min-width: 0;
}

/* =========================
   UPLOAD / MÍDIA
   ========================= */
.nx-media-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nx-media-preview {
  width: 100%;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(to bottom, rgba(0, 242, 255, 0.02), transparent 70px),
    rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.nx-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nx-media-preview.nx-media-preview-contain img {
  object-fit: contain;
}

.nx-media-empty {
  color: var(--nx-text-dim);
  font-size: 0.75rem;
  text-align: center;
  padding: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nx-upload-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nx-upload-inline input[type="file"] {
  display: none;
}

.nx-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(204, 51, 102, 0.45);
  background: #cc3366;
  color: #ffffff;
  font-family: var(--nx-font-title);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.nx-upload-btn:hover {
  background: #b72b5a;
  border-color: rgba(204, 51, 102, 0.75);
  box-shadow: 0 0 16px rgba(204, 51, 102, 0.18);
}

.nx-upload-note {
  margin-top: 6px;
  color: var(--nx-text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* =========================
   LISTAGENS / TABELAS
   ========================= */
.nx-list-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.nx-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.nx-search {
  width: 100%;
}

.nx-search .nx-input {
  min-height: 42px;
  font-size: 0.9rem;
}

.nx-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.48);
  min-width: 0;
}

.nx-table {
  min-width: 860px;
}

.nx-table thead th {
  padding: 14px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--nx-primary);
  font-family: var(--nx-font-title);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.015);
}

.nx-table thead th:last-child {
  border-right: 0;
}

.nx-table tbody td {
  padding: 14px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--nx-text-soft);
  vertical-align: top;
}

.nx-table tbody td:last-child {
  border-right: 0;
}

.nx-table tbody tr:hover {
  background: rgba(0, 242, 255, 0.03);
}

.nx-table-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--nx-text-dim);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nx-thumb-sm {
  display: block;
  box-sizing: border-box;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.02);
}

.nx-cell-image {
  width: 96px;
  min-width: 96px;
  padding: 10px 8px;
  text-align: center;
}

.nx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nx-media-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nx-gallery-picker-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, 0.78); }
.nx-gallery-picker-dialog { width: min(900px, 100%); max-height: 85vh; overflow: auto; padding: 18px; border: 1px solid var(--nx-border); background: var(--nx-bg, #080b10); }
.nx-gallery-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.nx-gallery-picker-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px; border: 1px solid var(--nx-border); background: rgba(255,255,255,.02); color: var(--nx-text); cursor: pointer; }
.nx-gallery-picker-item img { display: block; width: 100%; height: 130px; object-fit: contain; }
.nx-gallery-picker-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================
   DASHBOARD
   ========================= */
.nx-dashboard-cards,
.nx-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.nx-card,
.nx-metric-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.nx-card::before,
.nx-metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: var(--nx-primary);
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.28);
}

.nx-card-label,
.nx-metric-label {
  display: block;
  padding-left: 10px;
  font-size: 0.72rem;
  color: var(--nx-text-soft);
}

.nx-card-value,
.nx-metric-value {
  display: block;
  padding-left: 10px;
  margin-top: 4px;
  font-size: 1.28rem;
  line-height: 1.1;
  color: #ffffff;
}

.nx-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.nx-dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.nx-dashboard-chart {
  min-height: 300px;
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.48);
}

.nx-report-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.nx-report-result {
  min-height: 300px;
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.42);
}

/* =========================
   PDV
   ========================= */
.nx-pdv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.nx-pdv-left,
.nx-pdv-right {
  min-width: 0;
}

.nx-pdv-toolbar {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.nx-pdv-product-preview {
  width: 82px;
  height: 82px;
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nx-text-dim);
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.015);
}

.nx-pdv-list {
  min-height: 520px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.55);
}

.nx-pdv-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.nx-pdv-table th,
.nx-pdv-table td {
  overflow-wrap: break-word;
  word-break: break-word;
}

.nx-pdv-side-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 520px;
}

.nx-pdv-side-box {
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.58);
  padding: 12px;
  margin-bottom: 8px;
}

.nx-pdv-side-box:last-child {
  margin-bottom: 0;
}

.nx-pdv-side-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.nx-pdv-total {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nx-pdv-total-value {
  color: var(--nx-text);
  font-size: 2.2rem;
  font-weight: 700;
  text-align: right;
}

.nx-pay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.nx-pay-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--nx-text-muted);
  font-family: var(--nx-font-title);
  font-size: 0.66rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nx-pay-btn:hover,
.nx-pay-btn.is-active {
  background: var(--nx-primary);
  color: #000000;
  border-color: transparent;
}

.nx-pdv-footer-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 6px 0 0;
  color: var(--nx-text-muted);
  font-family: var(--nx-font-title);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.nx-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid rgba(0, 242, 255, 0.4);
  background: rgba(0, 242, 255, 0.08);
  color: #00f2ff;
  font-family: var(--nx-font-title);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  margin-right: 6px;
}

/* =========================
   O.S.
   ========================= */
.nx-os-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.nx-os-full {
  grid-column: 1 / -1;
}

/* =========================
   SPLITS / AJUDA / ETIQUETAS / IMPORTADOR
   ========================= */
.nx-split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.nx-help-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  min-width: 0;
}

.nx-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nx-accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
}

.nx-accordion-head {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--nx-text-soft);
  text-align: left;
  cursor: default;
}

/* =========================
   GALERIA
   ========================= */
.nx-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.nx-media-card {
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.52);
  padding: 10px;
}

.nx-media-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--nx-border);
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.nx-media-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nx-media-card-meta {
  color: var(--nx-text-muted);
  font-size: 0.72rem;
  margin-bottom: 10px;
  word-break: break-word;
}

/* =========================
   BADGES
   ========================= */
.nx-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--nx-font-title);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nx-badge-primary {
  color: var(--nx-primary);
  border-color: rgba(0, 242, 255, 0.24);
  background: rgba(0, 242, 255, 0.05);
}

.nx-badge-success {
  color: var(--nx-success);
  border-color: rgba(0, 255, 136, 0.24);
  background: rgba(0, 255, 136, 0.05);
}

.nx-badge-danger {
  color: #ff6b92;
  border-color: rgba(204, 51, 102, 0.26);
  background: rgba(204, 51, 102, 0.07);
}

.nx-badge-muted {
  color: var(--nx-text-muted);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

/* =========================
   UTILITÁRIOS
   ========================= */
.nx-flex {
  display: flex;
}

.nx-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nx-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nx-gap-8 {
  gap: 8px;
}
.nx-gap-12 {
  gap: 12px;
}
.nx-gap-16 {
  gap: 16px;
}

.nx-mt-8 {
  margin-top: 8px;
}
.nx-mt-12 {
  margin-top: 12px;
}
.nx-mt-16 {
  margin-top: 16px;
}
.nx-mt-20 {
  margin-top: 20px;
}
.nx-mt-24 {
  margin-top: 24px;
}

.nx-text-right {
  text-align: right;
}
.nx-text-center {
  text-align: center;
}
.nx-hidden {
  display: none !important;
}

/* =========================
   RESPONSIVIDADE
   ========================= */
@media (max-width: 1440px) {
  .nx-entry-grid {
    grid-template-columns: 250px minmax(0, 1fr) minmax(0, 1fr);
  }

  .nx-dashboard-cards,
  .nx-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  #NEXUS_VIEWPORT {
    min-height: auto;
  }

  .nx-dashboard-grid,
  .nx-pdv,
  .nx-help-grid,
  .nx-split,
  .nx-entry-grid,
  .nx-os-grid,
  .nx-report-toolbar {
    grid-template-columns: 1fr;
  }

  .nx-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nx-pdv-side-column,
  .nx-pdv-list {
    min-height: 420px;
  }
}

@media (max-width: 860px) {
  .nx-header {
    flex-wrap: wrap;
    height: auto;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 10px;
  }

  .nx-nav-wrap {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .nx-nav {
    width: 100%;
  }

  .nx-dashboard-cards,
  .nx-metric-grid,
  .nx-form-row.cols-2,
  .nx-form-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .nx-page-title {
    font-size: 1.35rem;
  }

  .nx-pdv-toolbar {
    grid-template-columns: 1fr;
  }

  .nx-pdv-product-preview {
    width: 92px;
    height: 92px;
  }
}

@media (max-width: 560px) {
  .nx-main {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 12px;
  }

  .nx-section,
  .nx-panel {
    padding: 12px;
  }

  .nx-btn,
  .nx-btn-lg,
  .nx-btn-sm {
    width: 100%;
  }

  .nx-list-head,
  .nx-flex-between,
  .nx-panel-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nx-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* =========================
   ESTOQUE - LISTAGEM
   ========================= */
.nx-table--estoque {
  --nx-stock-line-height: 1.18rem;
  --nx-stock-line-gap: 4px;
  --nx-stock-lines: 5;
  --nx-stock-image-pad: 8px;
  --nx-stock-image-limit: calc((var(--nx-stock-line-height) * var(--nx-stock-lines)) + (var(--nx-stock-line-gap) * (var(--nx-stock-lines) - 1)));
}

.nx-table--estoque tbody td {
  vertical-align: middle;
}

.nx-table--estoque .nx-cell-image {
  width: calc(var(--nx-stock-image-limit) + (var(--nx-stock-image-pad) * 2) + 8px);
  min-width: calc(var(--nx-stock-image-limit) + (var(--nx-stock-image-pad) * 2) + 8px);
  padding: 10px 8px;
}

.nx-stock-image-box {
  width: var(--nx-stock-image-limit);
  height: var(--nx-stock-image-limit);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.nx-thumb-estoque {
  display: block;
  box-sizing: border-box;
  width: var(--nx-stock-image-limit);
  height: var(--nx-stock-image-limit);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.02);
}

.nx-stock-product-info {
  display: flex;
  flex-direction: column;
  gap: var(--nx-stock-line-gap);
}

.nx-stock-product-line {
  min-height: var(--nx-stock-line-height);
  line-height: var(--nx-stock-line-height);
}


/* Controle de navegação horizontal do menu principal */
.nx-nav-shell {
  gap: 4px;
}

.nx-menu-scroll-btn {
  width: 30px;
  min-width: 30px;
  height: var(--nx-header-height);
  border: 0;
  background: rgba(0, 242, 255, 0.06);
  color: var(--nx-primary);
  font-family: var(--nx-font-title);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}

.nx-menu-scroll-btn:hover {
  background: rgba(0, 242, 255, 0.14);
  color: #FFFFFF;
}
