.nyx-readonly {
  background-color: #f3f4f6 !important;
  cursor: not-allowed;
}

.nyx-btn-readonly {
  opacity: 0.6;
}

#nyxPinModal {
  z-index: 2000;
}

#nyxPinModal .modal-dialog {
  z-index: 2001;
}

/* ============================
   NYX PIN MODAL – COMPACT CARD
============================ */
#nyxPinModal .modal-dialog {
  width: 260px;
  max-width: 260px;
}

#nyxPinModal .modal-content {
background: #f9fafb;
border: 4px solid #d1d5db;
  border-radius: 12px;
  padding: 14px;
}

#nyxPinModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 👈 ISTO */
  padding: 0 0 6px 0 !important;
  border: none;
}

#nyxPinModal .modal-title {
  font-size: 15px;
  font-weight: 600;
}

#nyxPinModal .btn-close {
  margin: 0;
  padding: 0;
  transform: scale(0.85);
}

#nyxPinModal .modal-body {
  padding: 6px 0 10px 0 !important;
}

#nyxPinModal #nyxPinInput {
  height: 38px;
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 10px;
  padding: 4px;
}

#nyxPinModal .modal-footer {
  padding: 0 !important;
  border: none;
  justify-content: center;
}

#nyxPinModal #nyxPinConfirm {
  height: 32px;           /* botão mais compacto */
  padding: 0 14px;
  font-size: 14px;
  border-radius: 6px;     /* consistente com o modal */
}

/* ===============================
   BASE
================================*/
:root {
  --bg-body: #f3f4f6;
  --text-main: #111827;
  --border-soft: #e5e7eb;
  --shadow-soft: 0 2px 6px rgba(15,23,42,0.08);
  --radius-ui: 10px;
  --accent-blue: #556CF6;
}

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

body {
  background: var(--bg-body);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text-main);
  margin: 0;
}

button {
  cursor: pointer;
}

/* ===============================
   TOPBAR ELEGANTE
================================*/
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);

  
}

.topbar-center {
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}


.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tb-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 4px 10px;
  border-radius: var(--radius-ui) !important;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  color: #374151;
}

.tb-btn:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
  transform: translateY(-0.5px);
}

/* Título principal do sistema */
.topbar-title {
  font-size: 0.95rem;     /* 👈 ligeiramente maior */
  font-weight: 600;
  opacity: 1;
  color: #111827;
}

/* Info secundária (connected file) */
.topbar-meta {
  font-size: 0.7rem;      /* 👈 mais pequeno */
  opacity: 0.7;
  color: #6b7280;
}

/* Autosave + connection */
.autosave-indicator {
  font-size: 12px;
  opacity: 0;
  transition: opacity .3s;
}
.autosave-indicator.show { opacity: 1; }
.autosave-saving { color: #e6a500; }
.autosave-saved  { color: #22c55e; }
.autosave-error  { color: #e74c3c; }


/* Reserva espaço para evitar layout shift */
#lastEdit {
  display: inline-block;
  min-width: 220px;   /* 👈 ajustável */
  white-space: nowrap;
  font-size: 0.7rem;
  opacity: 0.65;
  color: #6b7280;
}

#fileIndicator {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

#fileIndicator.connected {
  background: none;
  border: none;
  color: #059669;
  font-weight: 500;
}

#fileIndicator.connected * {
  color: #059669;
}


/* ===============================
   NYX SEARCH TOP BAR
================================*/
.nyx-topbar {
  background: #f1f3f5;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-ui);

  /* 🔥 obedecer ao container */
  width: 100%;
  margin-bottom: 6px;

  padding: 10px 14px;
}

.nyx-topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nyx-topbar-inner input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-ui) !important;
  font-size: 0.85rem;
}

/* === NYX RIGHT GROUP (Filters / Month / Dashboard) === */
.nyx-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* === NYX FILTER BUTTON — ACTIVE STATE === */
#nyxFiltersBtn.nyx-filters-active {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #6d28d9;
  font-weight: 600;
}


/* === DASHBOARD SELECTOR === */
.nyx-dashboard-select {
  position: relative;
}

.nyx-dashboard-btn {
  width: 150px;          /* 🔒 largura fixa */
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* dropdown */
.nyx-dashboard-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;

  width: 200px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  z-index: 50;
  overflow: hidden;
}

.nyx-dashboard-option {
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.nyx-dashboard-option:hover {
  background: #f1f5f9;
}


/* ===============================
   DASHBOARD CARDS
================================*/
.order-card {
  background: #ffffff;
  border-radius: var(--radius-ui) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  margin-bottom: 0px !important; /* quase colados */
  border-radius: var(--radius-ui) !important; /* ligeiramente mais compacto */
  transition: box-shadow 0.2s, transform 0.1s;
}

.order-card:hover {
  box-shadow: 0 4px 10px rgba(15,23,42,0.16);
  transform: translateY(-1px);
}

.po-card-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* LINHA 1 */
.po-line1 {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0;
  line-height: 1.2;
}

.po-line1-left span,
.po-line1-left strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* LINHA 2 (totals) */
.po-line2 {
  font-size: 0.80rem;
  color: #4b5563;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.2;
}

/* LINHA 3 (badges + actions) */
.po-line3 {
  margin-top: 2px;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.2;
}

/* CATEGORY CHIPS */
.cat-chip {
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.70rem;
  padding: 2px 6px;
  border-radius: var(--radius-ui) !important;
  border: 1px solid #e0e7ff;
  font-weight: 500;
  margin-right: 2px;
}

/* ===============================
   STATUS PILLS (premium)
================================*/
.order-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #f9fafb;
  color: #111827;
  box-shadow: 0 2px 6px rgba(15,23,42,0.12);
  white-space: nowrap;
}

/* EMPTY */
.status-empty {
  background: rgba(148,163,184,0.12);
  color: #475569;
  border-color: rgba(148,163,184,0.4);
}

/* PENDING */
.status-pending {
  background: #f9fafb;
  color: #4b5563;
  border-color: #d1d5db;
}

/* PARTIAL */
.status-partial {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

/* DELIVERED */
.status-delivered {
  background: #f0fdf4;
  color: #047857;
  border-color: #bbf7d0;
}

/* READY TO INVOICE */
.status-ready {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* LATE */
.status-late {
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
  border-color: rgba(239,68,68,0.45);
}

/* INVOICED 100 */
.status-inv100 {
  background: rgba(129,140,248,0.20);
  color: #4c1d95;
  border-color: rgba(129,140,248,0.70);
}

/* INVOICED 50 */
.status-inv50 {
  background: rgba(196,181,253,0.20);
  color: #6d28d9;
  border-color: rgba(196,181,253,0.70);
}

/* CANCELED */
.po-cancelled {
  background: rgba(220, 38, 38, 0.08);
  border-left: 4px solid #dc2626;
}

.product-card-cancelled {
  opacity: 0.55;
  text-decoration: line-through;
  background: rgba(107,114,128,0.08);
}


/* Card background by status */
.order-card.status-empty {
  background: #faf5ff;
  border-color: #e9d5ff;
}
.order-card.status-pending {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.order-card.status-partial {
  background: #fffbeb;
  border-color: #fde68a;
}
.order-card.status-delivered {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.order-card.status-ready {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.order-card.status-late {
  background: #fef2f2;
  border-color: #fecaca;
}
.order-card.status-inv100 {
  background: #ede9fe;
  border-color: #c4b5fd;
}
.order-card.status-inv50 {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

/* ===============================
   RENEWAL BADGES
================================*/
.renewal-pill {
  display: inline-block;
  font-size: 0.70rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
}

.renewal-expired {
  background: rgba(248,113,113,0.18);
  border-color: rgba(220,38,38,0.5);
  color: #b91c1c;
}

.renewal-soon {
  background: rgba(252,211,77,0.18);
  border-color: rgba(217,119,6,0.5);
  color: #92400e;
}

.renewal-active {
  background: rgba(52,211,153,0.18);
  border-color: rgba(5,150,105,0.5);
  color: #047857;
}

/* ===============================
   DETAILS PANEL & PRODUCT CARDS
================================*/
.order-expanded {
  margin-top: 6px;
  border-top: 1px dashed #e5e7eb;
  padding-top: 8px;
}

.order-expanded-card {
  font-size: 0.78rem;
}

.product-card {
  background: #f9fafb;
  border-radius: var(--radius-ui) !important;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  transition: background 0.2s;
}

.product-card:hover {
  background: #f3f4f6;
}

.product-card-header .fw-semibold {
  font-size: 0.80rem;
}

.product-card-body {
  font-size: 0.76rem;
  margin-top: 6px;
}

.product-card-footer {
  font-size: 0.76rem;
  margin-top: 8px;
}

.order-totals {
  border-top: 1px dashed #e5e7eb;
  padding-top: 6px;
  font-size: 0.80rem;
}

/* ===============================
   BUTTONS / TABLE / INPUTS
================================*/
.btn-sm {
  font-size: 0.70rem !important;
  padding: 2px 8px !important;
}

/* Overwrite Bootstrap defaults slightly */
.btn-success {
  background: #059669;
  border-color: #059669;
  color: white;
}
.btn-outline-success {
  border-color: #059669;
  color: #059669;
}
.btn-outline-success:hover {
  background: #059669;
  color: white;
}

.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}
.btn-outline-primary {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.btn-outline-primary:hover {
  background: var(--accent-blue);
  color: white;
}

.table td {
  vertical-align: middle;
  font-size: 0.78rem;
}

.is-invalid {
  border-color: #dc2626 !important;
}

input {
  font-size: 0.85rem;
}

/* ===============================
   FILTERS KPI BAR – 1 LINHA
================================*/

/* Container principal dos filtros */
#filtersBar.filters-bar {
  width: 100%;
  max-width: 1100px !important;
  margin: 20px auto -4px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Row que contém todos os grupos (STATUS / BILLING / RENEWALS / CLEAR) */
.filters-groups-row {
  display: flex;
  flex-wrap: nowrap;         /* não quebrar linha */
  justify-content: center;
  gap: 14px;
}

/* Caixa de cada grupo */
.filter-group-box {
  display: inline-flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-ui) !important;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
  white-space: nowrap;
}

.filter-group-clear {
  background: #fdfdfd;
}

/* NYX Filters — Active (Filtered view) */
.nyx-filters-active {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-color: #c4b5fd;
  font-weight: 500;
}


/* KPI individual */
.filter-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  width: 120px;
  min-width: 110px;
  max-width: 110px;

  padding: 6px 6px;
  border-radius: var(--radius-ui) !important;
  background: #f1f3f5 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);

  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.filter-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15,23,42,0.16);
}

/* Label (Pending, Late, etc.) */
.filter-label {
  font-size: 0.70rem;
  font-weight: 500;
  line-height: 1.1;
}

/* Número grande */
.filter-count {
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Ícone opcional */
.filter-icon {
  margin-right: 2px;
}

/* Estado activo */
.filter-pill-active {
  background: #e0ecff !important;               /* fundo azul suave */
  border-color: #1d4ed8 !important;             /* azul forte */
  color: #1e40af !important;                    /* texto azul escuro */
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);    /* glow premium */
}

.filter-pill-active .filter-icon {
  color: #1e40af !important;
}

/* Clear filters igual aos outros em largura */
.filter-pill-clear {
  width: 120px;
  min-width: 110px;
  max-width: 110px;
  opacity: 0.9;
}

/* Encostar a barra NYX logo abaixo dos filtros */
.nyx-topbar {
  background: #f1f3f5;
  border: 1px solid #d1d5db;
  padding: 10px 14px;
  margin-top: 0 !important;
  margin-bottom: 12px;
  border-radius: var(--radius-ui) !important;
}

/* ===============================
   UTILITIES
================================*/
.small {
  font-size: 0.78rem;
}


/* === NYX FINAL PREMIUM FILTER BUTTON OPTIMIZATIONS === */

/* 1. Increase icon/number size */
.filter-pill .filter-value {
    font-size: 1.45rem !important;
    font-weight: 700;
    opacity: 0.9;
    margin-top: 0px;
    line-height: 1.2;
}

/* 2. Slightly raise labels for better alignment */
.filter-pill .filter-label {
    margin-top: -2px !important;
}

/* 3. Normalize padding for symmetrical feel */
.filter-pill {
    padding: 6px 16px !important;
}

/* 4. Optional: normalize width for perfectly aligned dashboard */
.filter-pill {
    min-width: 110px;
}

/* 5. Softer shadow and rounded styling for the search bar row */
.search-row {
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border-radius: var(--radius-ui) !important;
}

/* 6. Adjust spacing between filter buttons */
.filters-bar {
    gap: 16px !important;
}


/* === NYX SPECIAL FILTER BUTTONS (with second line icons) === */
.filter-pill-special {
    min-width: 110px !important;
    text-align: center !important;
}

.filter-pill-special .filter-special-icon {
  display: block !important;
  font-size: 1.20rem !important;
  line-height: 1.2 !important;
  margin-top: 2px !important;
  opacity: 0.9 !important;
}

.tb-eq{min-width:120px;text-align:center;}


/* Fix title */
.topbar-title {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  position: relative;
  top: -1px;
}
/* Fix New PO */
#btnNewPO {
  padding: 6px 14px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-ui) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important;
}
/* Conn status */



.file-indicator {
  color: #6b7280;
  font-size: 0.82rem;
  position: relative;
  top: -1px;
}
.file-indicator.connected {
  color: #22c55e !important;
  font-weight: 600 !important;
}

/* flatten line3 */ .po-line2{align-items:center;}
/* BOTÕES MAIS FINOS NOS CARTÕES */
.po-buttons-right .btn.btn-sm {
    padding: 2px 8px !important;
    font-size: 0.72rem !important;
    height: 22px !important;
    line-height: 1rem !important;
    display: flex;
    align-items: center;
}

/* Mantém todas as cores e bordas originais */
.po-buttons-right .btn-outline-secondary,
.po-buttons-right .btn-outline-danger {
    border-width: 1px !important;
}

/* AJUSTE: Subir ligeiramente a status-pill */
.po-line1-right .order-status-pill {
    position: relative;
    top: -3px;
}

#ordersList {
    gap: 10px !important; /* muito mais compacto */
}

.order-card {
    margin-bottom: 0 !important;
    border-radius: var(--radius-ui) !important; /* mais flat, menos espaço visual */
}


/* NYX MONTH SELECTOR MODAL */
.nyx-month-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.nyx-month-modal.d-none {
  display: none;
}
.nyx-month-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.35);
}
.nyx-month-dialog {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-ui);
  box-shadow: 0 10px 30px rgba(15,23,42,0.25);
  padding: 14px 16px 12px 16px;
  width: 320px;
  max-width: 92%;
  z-index: 1;
}
.nyx-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.nyx-month-title {
  font-size: 0.9rem;
  font-weight: 600;
}
.nyx-month-close {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.7;
}
.nyx-month-close:hover {
  opacity: 1;
}
.nyx-month-body {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 2px;
  margin-bottom: 10px;
}
.nyx-year-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.nyx-year-select {
  width: 100%;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 10px;
}
.nyx-month-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nyx-month-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 8px;
  border-radius: var(--radius-ui);
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.8rem;
}
.nyx-month-option-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nyx-month-option input[type="checkbox"] {
  cursor: pointer;
}
.nyx-month-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.nyx-btn-primary,
.nyx-btn-secondary {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-ui);
  border: 1px solid transparent;
  cursor: pointer;
}
.nyx-btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}
.nyx-btn-secondary {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #374151;
}

.nyx-month-list {
  overflow: visible !important;
}

.nyx-month-dialog {
  height: auto !important;
}

/* ===== NYX YEAR PILLS (multi-year month selector) ===== */
.nyx-year-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.nyx-year-pill {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.nyx-year-pill-active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

.nyx-year-pill-marked {
  border-color: var(--accent-blue);
  color: #1d4ed8;
}

.nyx-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #f1f5f9;
  border-radius: var(--radius-ui);
  border: 1px solid #e2e8f0;
  font-size: 0.80rem;
  cursor: pointer;
}


/* FIX: prevent clipping on topbar */
.nyx-topbar { overflow: visible !important; height: auto !important; }

/* NYX Premium Buttons */


.nyx-btn:hover {
    background: #f3f3f3;
}

.nyx-btn:active {
    transform: scale(0.97);
}



/* NYX Premium Buttons */
.nyx-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-ui);
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    min-width: 110px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    box-shadow: none;
}
.nyx-btn:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
    transform: translateY(-0.5px);
}

/* NYX FILTERS PREMIUM 2.0 */
.nyx-filters-dialog {
  width: 900px !important;      /* ⬅️ mais largo */
  max-width: 98vw !important;   /* ⬅️ nunca ultrapassa o ecrã */
  border-radius: var(--radius-ui) !important;
  box-shadow: 0 10px 30px rgba(15,23,42,0.25) !important;
  padding: 14px 16px 12px 16px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important; /* ⬅️ mata o scroll horizontal */
}

@media (min-width: 1200px) {
  .nyx-filters-dialog {
    width: 1000px !important;
  }
}


.nyx-filters-box {
  background: #f9fafb !important;
  border: 1px solid #e5e7eb !important;
  border-radius: var(--radius-ui) !important;
  padding: 12px !important;
  height: auto !important;
  max-height: 200px !important;
}

.nyx-filters-box h6 {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
}

.nyx-filters-close {
  border: none !important;
  background: transparent !important;
  font-size: 1rem !important;
  cursor: pointer;
  opacity: .7;
}

.nyx-filters-row {
  gap: 12px !important;
}

.other-row {
  gap: 18px !important;
}

.nyx-filters-list label {
  margin-bottom: 4px !important;
  font-size: 0.80rem !important;
}

.nyx-filters-footer {
  gap: 10px !important;
}

/* LINE1 horizontal fixed alignment */
.l1-hbox {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    white-space: nowrap;
}
.po-ord {
    display: inline-block;
    min-width: 150px;
    text-align: right;
}
.po-eta {
    display: inline-block;
    min-width: 100px;
    text-align: right;
}

/* FINAL aligned Ordered + ETA */
.po-line1-right { display:flex !important; gap:12px !important; align-items:center !important; white-space:nowrap !important; }
.po-ord { display:inline-block !important; width:160px !important; text-align:right !important; white-space:nowrap !important; }
.po-eta { display:inline-block !important; width:120px !important; text-align:right !important; white-space:nowrap !important; }


/* === GRID LAYOUT FOR LINE 1 (Option B) === */
.po-line1 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 300px auto;
  column-gap: 16px;
  align-items: center;
}

.po-line1-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.po-line1-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.95rem;
}

.po-line1-right {
  text-align: right;
}



/* === NYX FIX — UNIFORM STATUS PILLS (APPLIED) === */
.order-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 24px;
    min-width: 125px;
    max-width: 125px;

    padding: 0 10px !important;

    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;

    text-overflow: ellipsis;
    overflow: hidden;
}



/* === NYX FIX — Linha 1 mais elegante & alinhada com a pill (APPLIED) === */
.po-line1 {
    margin-top: -2px !important;
    line-height: 1.1 !important;
}

.po-line1,
.po-line1-left strong,
.po-line1-left span {
    font-weight: 500 !important;
    font-size: 0.82rem !important;
}

.po-line1-left strong {
    font-weight: 600 !important;
}

.po-line1-dates {
    position: relative;
    top: -1px;
    font-size: 0.80rem !important;
}

.po-line1-right .order-status-pill {
    position: relative;
    top: -1px !important;
}



/* === NYX FIX — Status Pills Mais Finas (como renewals & categorias) === */
.order-status-pill {
    height: 20px !important;          /* mais fino */
    padding: 1px 8px !important;      /* igual às renew/categorias */
    font-size: 0.70rem !important;    /* mais elegante e discreto */
    border-radius: 999px !important;
    min-width: 125px !important;      /* mantém o alinhamento */
    max-width: 125px !important;
    line-height: 1 !important;
}


/* === NYX FINAL — CENTRAR TEXTO DAS PILLS === */
.order-status-pill {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


/* === NYX ULTRA FIX — centrar texto VERTICAL e HORIZONTAL nas pills === */
.order-status-pill {
    display: flex !important;
    align-items: center !important;      
    justify-content: center !important;  

    height: 20px !important;             
    line-height: 20px !important;        
    padding: 0 8px !important;           
}

.order-status-pill > * {
    line-height: 1 !important;           
    display: inline-flex !important;
    align-items: center !important;
}

/* monospace only for numeric parts in PO and Quote */
.ghost-num {
    font-family: Menlo, Consolas, "Courier New", monospace !important;
    letter-spacing: 0.5px;
}

/* === NYX SORT DROPDOWN PREMIUM === */
.nyx-sort-dropdown {
  position: absolute;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  padding: 6px 0;
  min-width: 160px;
  z-index: 6000;
  transform: translateX(-50%);
}

.nyx-sort-dropdown.d-none { display: none; }

.nyx-sort-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nyx-sort-option:hover {
  background: #f3f4f7;
}



/* === NYX EDITOR LAYOUT PREMIUM (Option A) === */

.nyx-editor-section h6.text-uppercase {
  margin-bottom: 10px;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: #6b7280;
}

.nyx-editor-header .row + .row,
.nyx-editor-invoices .row + .row,
.nyx-editor-products .row + .row {
  margin-top: 8px;
}

.nyx-editor-table .mb-3 {
  margin-bottom: 12px !important;
}

@media (min-width: 992px) {
  #editorView .card-body {
    padding: 20px 24px;
  }
}


/* === NYX PALETTE A — FROST BLUE PREMIUM === */

.nyx-editor-section h6.text-uppercase {
  color: #1e40af !important;
  opacity: 0.75;
}

.nyx-editor-section input,
.nyx-editor-section select,
.nyx-editor-section textarea {
  border: 1px solid #c7d7f8 !important;
}

.nyx-editor-section input:focus,
.nyx-editor-section select:focus,
.nyx-editor-section textarea:focus {
  border-color: #1d4ed8 !important;
  box-shadow: 0 0 0 2px rgba(29,78,216,0.20) !important;
}

.nyx-editor-section:hover {
  box-shadow: 0 2px 8px rgba(29,78,216,0.08) !important;
}


/* === NYX FINAL PREMIUM TOUCHES === */
.nyx-editor-section input,
.nyx-editor-section select,
.nyx-editor-section textarea {
  border-radius: 8px !important;
}

.nyx-editor-section:hover {
  box-shadow: 0 3px 10px rgba(29,78,216,0.12) !important;
  transition: box-shadow 0.2s ease;
}

.nyx-editor-header > h6::before {
  content: "📄 ";
}
.nyx-editor-invoices > h6::before {
  content: "💼 ";
}
.nyx-editor-products > h6::before {
  content: "📦 ";
}

#btnSaveOrder {
  box-shadow: 0 3px 8px rgba(16,185,129,0.25) !important;
  font-weight: 600 !important;
  padding: 6px 16px !important;
  border-radius: 8px !important;
}

#btnBackToDashboard {
  border-radius: 8px !important;
}

#productsTableBody tr:hover {
  background: rgba(29,78,216,0.06) !important;
  transition: background 0.15s;
}

/* Add Product button premium */
#btnAddProduct {
  border-radius: 8px !important;
  padding: 6px 14px !important;
  box-shadow: 0 2px 6px rgba(29,78,216,0.25) !important;
}

/* NYX Minimalistic Icon Buttons */
.nyx-ico-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  margin:0 4px;
  cursor:pointer;
  font-size:14px;
  color:#1e40af;
  border-radius:6px;
  transition:background 0.15s, color 0.15s;
}
.nyx-ico-btn:hover {
  background:rgba(29,78,216,0.12);
  color:#1d4ed8;
}
.nyx-ico-del { color:#b91c1c; }
.nyx-ico-del:hover { background:rgba(239,68,68,0.15); color:#b91c1c; }


#filtersBar {
  position: sticky;
  top: 60px;
  z-index: 20;
}

.po-line2 > div:first-child {
    /* permite quebrar categorias e renews para baixo sem afetar os botões */
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

/* === NYX ULTRA FIX — Linha 2 com botões sempre à direita === */

.po-line2 {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;

    /* Anular completamente o bootstrap que está a estragar tudo */
    flex-wrap: unset !important;
    justify-content: unset !important;
    gap: 0 !important;
}

.po-line2 > div:first-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
}

.po-buttons-right {
    justify-self: end !important;
    align-self: center !important;
    white-space: nowrap !important;
}



/* === NYX RENEWALS CENTER === */
#renewalsCenterView {
  margin-top: 12px;
}

.nyx-renew-section {
  margin-bottom: 18px;
}

.nyx-renew-header {
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.nyx-renew-header .nyx-arrow {
  font-size: 1rem;
}

.nyx-renew-body {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid #e5e7eb;
}

.nyx-renew-month-group {
  margin-bottom: 10px;
}

.nyx-renew-month-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 4px;
}

.nyx-renew-card {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.nyx-renew-card-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.nyx-renew-meta {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #4b5563;
}

.nyx-renew-chips {
  margin-top: 4px;
}

.nyx-renew-chip {
  display: inline-block;
  background: #e5edff;
  color: #1e3a8a;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-right: 4px;
  margin-bottom: 2px;
}

.nyx-renew-footer {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .nyx-renew-footer {
    justify-content: flex-start;
  }
}


.nyx-renew-month-body {
  margin-top: 6px;
}

/* =============== RENEWALS CENTER — SLIM PREMIUM =============== */

/* ==== SECÇÃO (Expired / Soon / Active) ==== */
.renew-section-header {
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  margin: 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Cores das secções com marcador mais fino (3px) */
.section-expired {
  background: #fff5f5;
  border-left: 3px solid #ef4444;
}

.section-soon {
  background: #fff7ed;
  border-left: 3px solid #f97316;
}

.section-active {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
}

/* ==== CARDS ==== */
.renew-card {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 3px solid transparent;
}

/* Marcador lateral */
.card-expired { border-left-color: #ef4444; }
.card-soon    { border-left-color: #f97316; }
.card-active  { border-left-color: #22c55e; }

/* Título do card */
.renew-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Meta */
.renew-card-meta {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.35;
}

/* ===========================
   NYX FINAL — MONTH HEADER FIX
=========================== */
.renew-month-header {
  cursor: pointer;
  padding: 4px 10px;
  background: #f9fafb;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px; /* ↓ reduzimos para encostar melhor */
  width: fit-content;
  font-size: 0.80rem;
  font-weight: 600;
  color: #374151;
  margin: 4px 0 10px 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.renew-month-header:hover {
  background: #f3f4f6;
}

/* seta */
.renew-month-arrow {
  font-size: 0.75rem;
  width: 12px;
  text-align: center;
  opacity: 0.8;
  position: relative;
  top: -1px;
}

/* mês */
.renew-month-title {
  font-weight: 600;
  margin-right: 0;
}

/* contador */
.renew-month-count {
  font-size: 0.80rem;
  color: #6b7280;
  margin-left: 0; /* tiramos o espaço extra */
  opacity: 0.9;
}

/* separador premium entre mês e itens */
.renew-month-count::before {
  content: "• ";
  font-weight: 700;
  color: #6b7280;
  margin-right: 2px;
}

/* Cards dentro do mês */
.renew-month-body {
  margin-top: 4px;
  margin-left: 16px;
}

/* ================================
   NYX FINAL FIX — RENEW BADGES
================================ */

.renew-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    height: 20px !important;
    padding: 0 8px !important;

    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    border-radius: 999px !important;

    gap: 4px !important;
    vertical-align: middle !important;
}

/* softer premium colors */
.badge-expired { 
    background: #fee2e2 !important;  /* rosa clarinho */
    color: #b91c1c !important;        /* vermelho escuro */
    border: 1px solid #fecaca !important;
}

.badge-soon { 
    background: #fef9c3 !important;   /* amarelo suave */
    color: #92400e !important;        /* laranja escuro */
    border: 1px solid #fde68a !important;
}

.badge-active { 
    background: #dcfce7 !important;   /* verde menta */
    color: #166534 !important;        /* verde escuro */
    border: 1px solid #bbf7d0 !important;
}

/* Dias (ex: 4d, today, 2d ago) */
.renew-days {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    height: 100% !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* NYX PREMIUM BACK BUTTON */
.nyx-back-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.nyx-back-btn:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.nyx-back-btn:active {
  transform: scale(0.97);
}

/* Renewal text highlight */
.renew-card-meta {
    color: #374151 !important; /* cinza forte premium */
    font-weight: 500;
}

.renew-card-meta strong {
    color: #111827 !important; /* quase preto, forte e limpo */
}

/* ===== NYX ALERT BOX – caixa premium ===== */
/* Caixa mais baixa e compacta */
.nyx-alertbox {
    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.25;
}

/* Quando existe CRÍTICO → caixa ganha tom rosado */
.nyx-alertbox-critical {
    background: #fff5f5 !important;
    border-color: #e07a7a !important;
}

/* Ícones uniformes */
.nyx-alertbox .icon {
    font-size: 15px;
    line-height: 1;
    vertical-align: -1px;
    margin-right: 4px;
}

/* Ponto de exclamação consistente */
.exclaim {
    color: #d10f0f !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    vertical-align: -1px;
    margin-left: 4px;
    margin-right: 8px;  /* espaço da borda */
}

/* Linha crítica pisca (texto apenas) */
.nyx-alert-critical-active {
    color: #d10f0f !important;
    font-weight: 600 !important;
    animation: nyxCriticalBlink 1.2s ease-in-out infinite;
}

/* Animação suave baseada em opacidade */
@keyframes nyxCriticalBlink {
    0%   { opacity: 1; }
    50%  { opacity: 0.45; }
    100% { opacity: 1; }
}

/* ❗ mantém cor e não pisca */
.nyx-alert-critical-active .exclaim {
    color: #d10f0f !important;
}

/* ===== FIX NYX ALERT BOX CLIPPING ===== */

#nyxAlertBox,
.nyx-alertbox {
    overflow: visible !important;
}

.nyx-alertbox > div {
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Espaço à direita para evitar sensação de corte */
#nyxAlertBox {
    padding-right: 20px !important;
}

/* Ponto de alerta premium */
.alert-dot {
    color: #d10f0f;           /* vermelho suave premium */
    font-size: 10px;          /* pequeno e elegante */
    margin-left: 6px;         /* espaço depois do texto */
    vertical-align: 1px;      /* alinhamento perfeito com texto */
}




/* ===== Renewals Center – Quote UI (Fase 1.5) ===== */
.renew-card-quotearea {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
}

.renew-quote-input {
  width: 70px;
  padding: 2px 4px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.renew-quote-status {
  padding: 2px 4px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
}

.renew-create-btn {
  margin-top: 4px;
  margin-left: auto;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #10b981;
  color: #10b981;
  background: #ffffff;
  cursor: pointer;
}


/* === Renewals Center – Histórico === */
.renew-historico-card {
  background: #f5f5f5;
  border: 1px solid #d4d4d4;
  border-left: 4px solid #9ca3af;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.renew-section-header.section-renewed {
  background: #ecfdf3;
  border-color: #22c55e;
  color: #166534;
}

.renew-section-header.section-notrenewed {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

/* === HISTÓRICO – LISTA SIMPLES === */
.section-historic {
  background: #f3f4f6;
  border-left: 4px solid #9ca3af;
  color: #444;
}

.historic-body {
  padding: 8px 6px;
}

.historic-item {
  background: #fafafa;
  border: 1px solid #ddd;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 11px;
  border-radius: 5px;
}

.historic-po {
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.historic-meta {
  color: #555;
}

.hist-ok {
  color: #15803d;
  font-weight: 600;
}

.hist-no {
  color: #b91c1c;
  font-weight: 600;
}

.historic-product {
  font-size: 10px;
  color: #666;
}



/* === RENEWALS CENTER GROUP HEADER PREMIUM === */
.renew-group-header {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.renew-group-header .arrow {
    font-size: 13px;
    opacity: 0.9;
}
.renew-group-body {
    padding: 10px 0;
}


/* === RENEWALS CENTER — SLIM PREMIUM HEADERS v8 === */
.renew-section-header {
    padding: 4px 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
}
.renew-section-header .arrow {
    font-size: 14px !important;
    opacity: 0.75 !important;
}


/* === RENEWALS CENTER — SLIM HEADERS v9 === */
.renew-section-header {
    padding: 4px 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    line-height: 1.3 !important;
}

.renew-section-header .arrow {
    font-size: 14px !important;
    opacity: 0.75 !important;
}

/* MONTH HEADER SLIM */
.renew-month-header {
    padding: 3px 8px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.renew-month-arrow {
    font-size: 12px !important;
    opacity: 0.8 !important;
}


/* Renewals section arrow icon */
.renew-sec-arrow {
    font-size: 14px !important;
    opacity: 0.75 !important;
}


/* === SLIM HEADERS v11 === */
.renew-section-header {
    padding: 4px 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
}
.renew-section-header .arrow,
.renew-month-header .arrow {
    font-size: 14px !important;
    opacity: 0.8 !important;
}

.renew-sec-arrow,
.renew-month-arrow {
    font-weight: 700;
    font-size: 15px;
    width: 16px;
    display: inline-block;
    text-align: center;
    opacity: 0.7;
}

.nyx-accept-icon {
  width: 34px;
  height: 34px;
  background: #e9f9ee;
  color: #0f9d58;
  font-weight: 700;
  font-size: 18px;
}

.nyx-reject-icon {
  width: 36px;
  height: 36px;
  background: #fde7e7;
  color: #d93025;
  font-weight: 700;
  font-size: 18px;
}

.nyx-info-icon {
  width: 36px;
  height: 36px;
  background: #e8f2ff;
  color: #2b6cb0;
  font-weight: 700;
  font-size: 18px;
}

.nyx-delete-icon {
  width: 36px;
  height: 36px;
  background: #fde7e7;
  color: #d93025;
  font-weight: 700;
  font-size: 18px;
}

/* =========================================
   NYX – PREMIUM RENEWALS CENTER FILTERS
   ========================================= */

.rc-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 0;
}

.rc-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  font-size: 13px;
  cursor: pointer;
  transition: 0.25s;
  margin-right: 4px;
}

.rc-pill:hover {
  background: #e5e7eb;
}

.rc-pill.active {
  background: #e0ecff !important;
  border-color: #1d4ed8 !important;
  color: #1e40af !important;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

/* Dropdown flutuante dos filtros */

.rc-dropdown {
  position: absolute;
  z-index: 9999;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  width: 220px;
  max-height: 500px;
  overflow-y: auto;
  font-size: 13px;
  display: none;
  box-shadow: 0 8px 20px rgba(15,23,42,0.18);
}

.rc-dropdown label {
  display: block;
  padding: 2px 0;
  cursor: pointer;
}

.rc-dropdown input[type="checkbox"] {
  margin-right: 6px;
}

/* Botão clear */

.rc-pill.rc-clear {
  background: #fff5f5;
  border-color: #ef4444;
  color: #b91c1c;
}
.rc-pill.rc-clear:hover {
  background: #fee2e2;
}

.rc-dropdown-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #e5e7eb;
}

.rc-btn-clear,
.rc-btn-apply {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.rc-btn-clear {
  background: #fff5f5;
  border: 1px solid #f87171;
  color: #b91c1c;
}

.rc-btn-clear:hover {
  background: #fee2e2;
}

.rc-btn-apply {
  background: #1d4ed8;
  border: 1px solid #1d4ed8;
  color: white;
}

.rc-btn-apply:hover {
  background: #1e40af;
}




/* ============================================
   NYX PO EDITOR — PREMIUM & COMPACT FINAL
   ============================================ */

/* Card spacing */
#editorView .card-body {
  padding: 14px 18px !important;
}

/* Section titles (if added later) */
.nyx-editor-section h6 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 8px;
  text-transform: uppercase;
  color: #4f46e5;
}

/* Labels */
.nyx-editor-section .form-label-sm {
  margin-bottom: 2px !important;
  font-size: 0.72rem !important;
  font-weight: 500;
  color: #555;
}

/* Inputs compact */
.nyx-editor-section .form-control-sm,
.nyx-editor-section .form-select-sm {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  font-size: 0.78rem !important;
  height: 28px !important;
}

/* Row spacing */
.nyx-editor-section .row.g-2 {
  margin-bottom: 6px !important;
}

/* Reduce checkbox spacing */
.nyx-editor-section .form-check-input {
  margin-top: 0 !important;
}

.nyx-editor-section .form-check-label {
  font-size: 0.78rem !important;
}

/* Products table spacing */
#productsTableBody td {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

.table-sm th {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 0.75rem !important;
}

.table-sm td {
  font-size: 0.78rem !important;
}

/* Summary bar */
#productsSummary {
  font-size: 0.78rem !important;
}

/* Buttons */
#editorView .btn-sm {
  padding: 2px 8px !important;
  font-size: 0.78rem !important;
  border-radius: 4px !important;
}

/* Align checkbox on products line */
.nyx-editor-products .form-check-input {
  margin-right: 6px !important;
}

/* Make sections breathe slightly but stay compact */
.nyx-editor-section .row > div {
  display: flex;
  flex-direction: column;
}

/* Improve input border contrast */
.nyx-editor-section .form-control-sm,
.nyx-editor-section .form-select-sm {
  border-color: #cdd3e0;
}

/* Hover focus premium */
.nyx-editor-section .form-control-sm:focus,
.nyx-editor-section .form-select-sm:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.4) !important;
}

/* Checkbox alignment on compact vertical spacing */
.nyx-editor-products .d-flex.align-items-center {
  margin-top: 2px !important;
}

/* Inputs curtinhos para Quote / PO / Client PO */
.nyx-input-short {
  width: 18ch !important;  /* antes 8ch */
}

/* Inputs pequenos para Ordered / Tax */
.nyx-input-sm {
  width: 18ch !important;  /* antes 12ch */
}

/* Para col-auto não esticar e manter alinhado */
.nyx-editor-header .col-auto {
  flex: 0 0 auto;
}

/* Ajuste fino para alinhar o checkbox de Renewable product */
.nyx-renewable-align {
  padding-top: 22px !important; /* ajusta se quiseres mais para cima/baixo */
}

.nyx-renewable-align .form-check-input {
  margin-top: 0 !important;
}

.nyx-editor-products .form-control-sm,
.nyx-editor-products .form-select-sm {
    width: 100% !important;
}

.nyx-editor-products input[type="date"] {
    min-width: 140px; /* garante que ETA e Vendor Inv Date têm a mesma base */
}

/* ----- ALTURA UNIFORME (Versão Compacta Premium) ----- */

.nyx-editor-section .form-control-sm,
.nyx-editor-section .form-select-sm {
  height: 32px !important;
  padding: 2px 6px !important;
  font-size: 0.8rem !important;
  line-height: 1.2 !important;
}

/* Corrigir datas para não saltarem de altura */
.nyx-editor-section input[type="date"] {
  height: 32px !important;
}


/* Títulos das secções */
.nyx-editor-section-title {
  font-weight: 600;
  font-size: 14px;
  margin: 4px 0 6px 2px;
  color: #2f3a4c;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Caixa premium unificada */
.nyx-editor-section {
  background: #e7ebf3 !important;
  border: 1px solid #d3d9e4 !important;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* Inputs sempre brancos */
.nyx-editor-section .form-control-sm,
.nyx-editor-section .form-select-sm {
  background: #ffffff !important;
}

/* Fundo do Editor de PO */
#editorView .card {
  background: #f4f5f7 !important;
  border: 1px solid rgba(0,0,0,0.04) !important; /* quase invisível */
  border-radius: 12px;
}

/* Texto dos inputs mais perceptível */
.nyx-editor-section .form-control-sm,
.nyx-editor-section .form-select-sm {
  color: #1f2937 !important;       /* cinza escuro */
  font-size: 0.82rem !important;   /* ligeiramente maior */
  font-weight: 500 !important;     /* mais definido */
  letter-spacing: 0.1px !important; /* mais nítido */
}

.po-new-highlight {
  animation: nyxNewPOFlash 1.6s ease-out forwards;
}

@keyframes nyxNewPOFlash {
  0%   { background-color: #fff7c2; }
  40%  { background-color: #fff4b0; }
  100% { background-color: transparent; }
}

.nyx-po-summary {
  font-size: 13px;
  color: #6b7280;
  text-align: right;
  margin: 4px 4px 10px 0;
}


/* NYX SUMMARY INLINE */
.nyx-summary-inline {
  margin-left: 20px;
  font-size: 0.80rem;
  color: #475569;
  white-space: nowrap;
  flex-grow: 1;
  text-align: center;
}
#nyxSearch {
  width: 260px !important;
}

#nyxSummaryInSearch strong {
    font-weight: 700 !important;
}

.ghost-num {
    position: relative;
    top: 1px;   /* desce o número ligeiramente */
}

/* FIX: Allow required fields to show error state */
.nyx-editor-section input.is-invalid,
.nyx-editor-section select.is-invalid,
.nyx-editor-section textarea.is-invalid {
  border-color: #dc2626 !important;
  background-color: #ffecec !important; /* opcional, só para ficar mais visível */
}

/* === PREMIUM OUTLINE TOPBAR BUTTON (Results) — Azul Indigo === */
.nyx-topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    background: #F3F6FF;
    color: #3E4CC7;
    border: 1px solid #BFC8FF;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.nyx-topbar-btn:hover {
    background: #E8ECFF;
    border-color: #A9B7FF;
}

.nyx-topbar-btn:active {
    background: #EEF1F5;
}

/* Distância entre botões na topbar */
.topbar-right > *:not(:last-child) {
    margin-right: 10px;
}

/* === PRIMARY TOPBAR BUTTON (New PO) === */
.nyx-topbar-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    background: #556CF6;
    color: #ffffff;
    border: 1px solid #556CF6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.nyx-topbar-btn-primary:hover {
    background: #4456d6;
    border-color: #4456d6;
}

.nyx-topbar-btn-primary:active {
    background: #3a48bb;
}

/* === RESULTS BUTTON ACTIVE STATE === */
.nyx-topbar-btn.active {
    background: #E5EBFF !important;
    border-color: #A9B7FF !important;
    color: #3E4CC7 !important;
}

/* === Force topbar utility buttons to match filter typography === */
.topbar-left button {
  font-size: 0.78rem !important;
  font-weight: 500 !important;
}

/* ============================================================
   RESULTS CENTER — CUSTOMER ANALYSIS HEADER
============================================================ */

.rc-header-container {
  background: #f8f9fb;
  border-bottom: 1px solid #ddd;
  padding: 10px 16px;
  margin-bottom: 10px;
}

.rc-header-row {
  align-items: flex-end;
  gap: 12px;
  padding: 6px 0;   /* 👈 ESTE É O GANHO REAL */
}

.rc-field {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
}

.rc-field label {
  color: #666;
  margin-bottom: 2px;
  font-size: 11px;
}

.rc-select {
  height: 32px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.rc-years {
  min-width: 200px;
}

.rc-year-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rc-chip {
  border: 1px solid #ccc;
  background: #fff;
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 0.75rem;
  cursor: pointer;
}

.rc-chip.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

.rc-month-dropdown {
  position: relative;
}

.rc-month-btn {
  height: 32px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.rc-month-menu {
  display: none;
  position: absolute;
  top: 36px;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}

.rc-month-menu.open {
  display: block;
}

.rc-month-item {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  cursor: pointer;
}

.rc-btn-disabled {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #ccc;
  background: #eee;
  color: #888;
  cursor: not-allowed;
}

/* PLACEHOLDER */

.rc-placeholder {
  padding: 40px;
  text-align: center;
}

.rc-placeholder-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.rc-placeholder-text {
  color: #666;
}

/* ============================================================
   RESULTS CENTER — FULL WIDTH MODE
============================================================ */


body.results-mode #resultsCenterView {
  padding-left: 0;
  padding-right: 0;
}

/* Results Center – balanced width */
#rcBody {
  max-width: 1320px;   /* ou 1400px se preferires mais ar */
  margin: 0 auto;
  padding: 12px 16px;
  box-sizing: border-box;
}

/* 🔥 Hide Dashboard filters when in Results Center */
body.results-mode #filtersBar {
  display: none !important;
}

/* 🔥 Compact Results Center layout */
body.results-mode .results-center-view,
body.results-mode #resultsCenterView {
  margin-top: 0 !important;
  padding-top: 12px !important;
}



.rc-select,
.rc-month-btn,
.rc-btn-secondary,
.rc-btn-disabled {
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
}

body.results-mode #resultsCenterView {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.results-mode .container {
  margin-top: 0;
}

body.results-mode .rc-page {
  padding-top: 8px;
}

body.results-mode .container,
body.results-mode .container-fluid {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ===============================
   RESULTS CENTER – TOP COMMAND BAR
================================ */

#resultsCenterView .card-header {
  padding: 6px 12px !important;
  min-height: auto !important;
}

.rc-command-bar {
  background: #f8f9fb;
  border-bottom: none !important;
  padding-top: 2px;      /* 👈 sobe visualmente */
  padding-bottom: 6px;   /* mantém equilíbrio */
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  flex-wrap: nowrap;   /* 🔥 ISTO É O FIX */
  position: relative;
  z-index: 10;
}

.rc-command-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
line-height: 1;
}

.rc-title {
  font-weight: 600;
  font-size: 15px;
margin: 0;              /* 🔥 MUITO IMPORTANTE */
  line-height: 0.95;         /* 🔥 alinha com inputs */
}

.rc-command-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;          /* 🔥 só o centro pode adaptar */
  min-width: 0;            /* 🔥 MUITO importante */
}

.rc-filter,
.rc-filter select {
  background: #f8f9fb;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  height: 32px;
  padding: 2px 8px;
  font-size: 13px;
  color: #111827;
}

.rc-filter select {
  appearance: none;
  outline: none;
  box-shadow: none;
  padding-right: 24px;
}

.rc-filter-fixed {
  width: 120px;
  text-align: center;
  flex: 0 0 120px;
}

.rc-filter-wide {
  width: 220px;
  flex: 0 0 220px;
}

.rc-command-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
white-space: nowrap;
}

.rc-command-actions button {
   height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
  line-height: 30px;       /* 🔥 chave */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-sizing: border-box;
}

/* evitar alturas fantasmas */
.rc-command-bar,
.rc-command-title,
.rc-command-filters,
.rc-command-actions {
  line-height: 1.2;
}

/* APPLY – primary */
.rc-btn-primary {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
  font-weight: 500;
}

.rc-btn-primary:hover {
  background: #1d4ed8;
}

/* CLEAR – neutral */
.rc-btn-secondary {
  background: #fff;
  color: #111827;
  border: 1px solid #cbd5e1;
}

.rc-btn-secondary:hover {
  background: #f9fafb;
}

/* BACK – ghost */
.rc-btn-ghost::before {
  content: "←";
  margin-right: 6px;
}
.rc-btn-ghost:hover {
  background: #f3f4f6;
}

/* Botões pequenos (command bar) */
.nyx-btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
  line-height: 30px;
}

/* ===============================
   COMMAND BAR – DROPDOWNS
================================ */

.rc-filter,
.rc-filter select {
  height: 30px;
  font-size: 0.8rem;
  border-radius: 6px;
  background: #f8f9fb;
  border: 1px solid #d1d5db;
  color: #111827;
}

/* remove estilo default */
.rc-filter select {
  appearance: none;
  outline: none;
  box-shadow: none;
  padding: 0 26px 0 10px;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* larguras fixas */
.rc-filter-fixed {
  width: 120px;
}

.rc-filter-wide {
  width: 220px;
}

/* ===============================
   RC CUSTOM DROP BOX (Customer)
================================*/
.rc-drop {
  position: relative;
  min-width: 0; /* 🔑 CRÍTICO para flex funcionar */
}

/* CUSTOMER — pode encolher, mas é o último a sofrer */
#rcCustomerDrop {
  min-width: 180px;
  max-width: 260px;
  flex: 1 1 220px;   /* cresce, encolhe, base 220px */
}

/* YEARS / MONTHS — encolhem primeiro */
#rcYearsDrop,
#rcMonthsDrop {
  min-width: 90px;
  max-width: 140px;
  flex: 0 1 120px;
}

.rc-drop.d-none {
  display: none !important;
}

.rc-drop-box {
  background: #f8f9fb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rc-drop-box:hover {
  background: #f9fafb;
}

.rc-drop-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-drop-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 2000;
}

.rc-drop-panel.d-none {
  display: none !important;
}

.rc-drop-search {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-bottom: 6px;
}

.rc-drop-list {
  max-height: 220px;
  overflow-y: auto;
}

.rc-drop-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
}

.rc-drop-item:hover {
  background: #f3f4f6;
}

/* ===============================
   RC DROP CLEAR BUTTON
================================*/
.rc-drop-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.rc-drop-clear {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.rc-drop-clear:hover {
  background: #e5e7eb;
}


/* ============================================================
   RESULTS CENTER — INSIGHT SUMMARY (CARD STYLE)
============================================================ */


.rc-summary-line-main {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #064e3b;
}

.rc-summary-line-sub {
  margin-top: 0px;
  font-size: 12.5px;
  line-height: 1.35;
  color: #166534;
  opacity: 0.8;
}

.rc-summary-narrative strong {
  font-weight: 700;
  color: #065f46;
}

/* ============================================================
   RESULTS CENTER — FINAL SPACING SYSTEM (SINGLE SOURCE)
============================================================ */

.rc-content-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;   /* 👈 ÚNICO CONTROLO VERTICAL */
}

.rc-kpi-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px; /* ritmo base */
}



/* ===============================
   RESULTS CENTER — HARD RESET
=============================== */

.rc-content-stack > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* ===============================
   RESULTS CENTER — KPI UNIFIED
=============================== */

body.results-mode #resultsCenterView {
  padding-top: 0 !important;
}

/* 🔥 RESULTS CENTER — FIRST BLOCK TIGHT */
.rc-content-stack > :first-child {
  margin-top: -10px;   /* ajusta: -8px / -12px se quiseres */
}

/* 🔥 RESULTS CENTER — REMOVE GAP BETWEEN COMMAND BAR AND KPIs */
body.results-mode #resultsCenterView .card-body {
  padding-top: 0 !important;}


/* 🔥 RESULTS CENTER — ULTRA TIGHT GAP FIX */
.rc-command-bar {
  padding-bottom: 0 !important;
}

body.results-mode #resultsCenterView .card-body {
  padding-top: 0px !important; /* antes estava 0, damos só 2px de ar */
}



.rc-sot-wrap{
  display:flex;
  gap:16px;
  align-items:stretch;
}


.rc-sot-kpis .kpi .label{
  font-size:0.75rem;
  color:#6b7280;
}

.rc-sot-kpis .kpi .value{
  font-size:1.1rem;
  font-weight:700;
  color:#111827;
}


/* ============================================================
   RC — Header command bar FIX (Titles & Customer)
============================================================ */

.rc-command-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main title (Results Center / Customer) */
.rc-command-title .rc-title {
  font-weight: 600 !important;
  color: #111827;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

/* Context text (Analyze by / Customer label) */
.rc-command-title .rc-context {
  font-weight: 500;
  color: #6b7280;
  font-size: 0.85rem;
  margin-left: 6px;
}

/* Analyze by select — keep it quiet */
.rc-command-title select.rc-filter {
  font-weight: 600;
  font-size: 0.85rem;
}


.rc-sot-chart{
  flex:1;
  min-width:0;
position: relative;

}

if (!hoverLayer) {
  console.warn("Hover layer not found");
  return;
}


/* =========================
   SOT — KPI LEFT POLISH
========================= */

.rc-sot-kpis{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;     /* 🔥 centra horizontal */
  gap:16px;
  min-width:160px;
opacity:0.95;
}

/* Bloco individual */
.rc-sot-kpis .kpi{
  text-align:center;
}

/* Labels */
.rc-sot-kpis .label{
  font-size:0.7rem;
  color:#6b7280;
  text-transform:uppercase;
  letter-spacing:0.04em;
  margin-bottom:4px;
}

/* Valor principal (Sales) */
.rc-sot-kpis .value{
  font-size:1.15rem;      /* ↓ ligeiramente menor */
  font-weight:600;        /* ↓ menos pesado */
  color:#111827;
}

/* YoY */
.kpi-yoy{
  font-size:0.95rem;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  margin-top:2px;
}

.kpi-yoy.up{ color:#16a34a; }
.kpi-yoy.down{ color:#dc2626; }
.kpi-yoy.neutral{ color:#9ca3af; }

/* ============================================================
   RESULTS CENTER — VENDORS (YoY COMPARISON)
   CLEAN + FINAL VERSION
============================================================ */

/* ---------- LIST WRAPPER ---------- */
/* Vendor list scroll — sempre 10 visíveis */
.rc-vendor-scroll {
  max-height: 600px;     /* 🔥 10 rows */
  overflow-y: auto;
  padding-right: 6px;   /* evita colar à scrollbar */
}

/* cada vendor */
.rc-vendor-item {
  margin-bottom: 10px;
}

/* ---------- ROW LAYOUT ---------- */
.rc-vendor-row {
  display: grid;
  grid-template-columns: 34px 220px 1fr 160px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.rc-vendor-row:hover {
  background: #f9fafb;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ---------- TOGGLE (+ / −) ---------- */
.rc-vendor-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  color: #2563eb;
}

/* ---------- VENDOR NAME ---------- */
.rc-vendor-name {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---------- VENDOR HORIZONTAL BARS (FINAL) ---------- */

/* container */
.rc-vendor-bars {
  position: relative;
  height: 14px;
  width: 100%;
}

/* wrapper */
.rc-vendor-bar-wrap {
  position: relative;
  height: 100%;
}

/* 2025 — barra principal */
.rc-vendor-bar-wrap .bar-cur {
  position: absolute;
  left: 0;
  top: 0;
  height: 10px;
  min-width: 6px;
  border-radius: 999px;
  background: #2563eb;
  opacity: 0.85;              /* 👈 CONSISTENTE com gráficos */
  z-index: 2;
  transition: opacity 0.15s ease;
}

/* 2024 — barra secundária */
.rc-vendor-bar-wrap .bar-prev {
  position: absolute;
  left: 1px;
  top: 8px;                  /* desfasamento elegante */
  height: 6px;
  min-width: 6px;
  border-radius: 999px;
  background: #2563eb;
  opacity: 0.35;             /* 👈 discreto como legendas */
  z-index: 1;
}

.bar-cur,
.bar-prev {
  min-width: 6px;
}

/* Vendor legend */
.rc-vendor-legend .dot-cur {
 background: #2563eb;
  opacity: 0.8;
}

.rc-vendor-legend .dot-prev {
 background: #2563eb;
  opacity: 0.45;
}

.rc-vendor-legend {
  color: #6b7280; /* cinza elegante */
  font-size: 12px;
}

.rc-vendor-row:hover .bar-cur {
  opacity: 1;
}

.rc-vendor-row:hover .bar-prev {
  opacity: 0.45;
}

/* ---------- VENDOR MINI BAR HOVER ---------- */

/* estado normal */
.rc-vendor-ts-chart rect.rc-bar {
  fill-opacity: 0.8;
  transition: fill-opacity 0.15s ease;
}

/* quando o gráfico está em hover */
.rc-vendor-ts-chart.is-hover .rc-bar {
  fill-opacity: 0.45;
}

/* barra ativa */
.rc-vendor-ts-chart .rc-bar.is-active {
  fill-opacity: 0.95;
}



/* ---------- VALUE ---------- */
.rc-vendor-value {
  text-align: right;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

/* ---------- YoY ---------- */
.rc-vendor-yoy {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rc-vendor-yoy.up {
  color: #16a34a;
}

.rc-vendor-yoy.down {
  color: #dc2626;
}

.rc-vendor-yoy.neutral {
  color: #6b7280;
}

/* ---------- DETAILS ---------- */
.rc-vendor-details {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
}

/* GRID REAL VIVE AQUI */

.rc-vendor-detail-separator {
  height: 1px;
  background: #e5e7eb;
  margin: 12px 0;
}

.rc-vendor-left,
.rc-vendor-right {
  min-width: 0;
}

.rc-vendor-details-body > * {
  align-self: flex-start;
}

/* ---------- CREDIT (VENDOR DETAILS) ---------- */

.rc-credit-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.rc-credit-label {
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 8px;
  user-select: none;
}

.rc-credit-bar {
  width: 8px;
  height: 72px;          /* ⬅️ maior */
  margin-top: 18px;     /* ⬅️ desce a barra */
  margin-bottom: 8px;   /* ⬅️ mantém ar em baixo */
  background: #e5e7eb;
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.rc-credit-fill {
  width: 100%;
  height: 0%; /* depois vem do JS */
  background: var(--rc-credit-color, #d1d5db);
  border-radius: 999px;
  transition: height 0.25s ease;
}

.rc-vendor-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rc-vendor-chart-summary {
  white-space: normal;
  overflow: hidden;
 max-width: 100%;
}

.rc-vendor-ts-wrap {
  width: 100%;
  min-width: 0;
}

.rc-credit-limit-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rc-credit-edit {
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}

.rc-credit-edit input {
  margin-right: 4px;
}


/* ---------- LEGEND ---------- */
.rc-vendor-legend {
  display: flex;
  gap: 16px;
  margin: 10px 0 10px 2px;
  font-size: 0.75rem;
  color: #6b7280;
}

.rc-vendor-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rc-vendor-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot-cur {
  background: #4f5df6;
}

.dot-prev {
  background: #c7cdfc;
}

.rc-vendor-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.rc-vendor-value .cur-val {
  font-weight: 600;
}

.rc-vendor-value .prev-val {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* ===============================
   CREDIT TOOLTIP
================================ */

.rc-credit-col {
  position: relative;
}

.rc-credit-col::after {
  content:
    "Limit: " attr(data-limit) "\A"
    "Used: " attr(data-used) "\A"
    "Available: " attr(data-available);

  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 10px;

  white-space: pre;
  pointer-events: none;

  background: rgba(17, 24, 39, 0.85);
     backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #f9fafb;
  font-size: 11px;
  line-height: 1.4;

  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);

  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.rc-credit-col:hover::after {
  opacity: 1;
}

/* ---------- CREDIT MODAL (PREMIUM, ISOLATED) ---------- */

.rc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* MODAL */
.rc-modal {
  width: 420px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  font-size: 13px;
  font-family: Inter, system-ui, sans-serif;
}

/* HEADER */
.rc-modal-header {
  padding: 14px 18px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

/* BODY */
.rc-modal-body {
  padding: 14px 18px;
}

/* ROWS */
.rc-credit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.rc-credit-row.editable {
  grid-template-columns: 1fr 180px;
}

.rc-credit-row label {
  color: #6b7280;
  font-size: 13px;
}

/* INPUTS */
.rc-credit-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}

.rc-credit-input[readonly] {
  background: #f9fafb;
  font-weight: 500;
}

/* VALUES */
.rc-credit-value {
  font-weight: 600;
  color: #111827;
}

.rc-credit-value.strong {
  font-weight: 700;
}

/* LIMIT EDIT */
.rc-credit-limit-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rc-credit-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
}

.rc-credit-edit input {
  margin: 0;
}

/* FOOTER */
.rc-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* BUTTONS */
.rc-btn-primary {
  background: #556CF6;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.rc-btn-primary:hover {
  background: #4457d6;
}

.rc-btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.rc-btn-secondary {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.rc-btn-secondary:hover {
  background: #e5e7eb;
}


/* ===============================
   KPI YoY COLORS (Vendor + Customer)
================================ */

.rc-kpi-value.up {
  color: #16a34a;          /* green-600 */
  font-weight: 600;
}

.rc-kpi-value.down {
  color: #dc2626;          /* red-600 */
  font-weight: 600;
}

.rc-kpi-value.neutral {
  color: #6b7280;          /* gray-500 */
}

.rc-vendor-item:hover {
  background: #f9fafb;
}

.rc-vendor-products {
  margin-top: 16px;
}

.rc-vendor-product-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 0.85rem;
}

.rc-vendor-product-row .values {
  display: flex;
  gap: 12px;
  color: #374151;
}

.rc-vendor-product-row .pct {
  color: #6b7280;
}



/* ===============================
   BODY (PRODUCTS | CHART)
================================ */

.rc-vendor-details-body {
  display: grid;
  grid-template-columns: 52px 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
  align-items: stretch;
}


/* PRODUCTS LIST — DENSE MODE */
.rc-vendor-products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.rc-vendor-product-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  padding: 2px 0;
  border-bottom: 1px dashed #f1f5f9;
}

/* LABEL */
.rc-vp-label {
  color: #374151;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* VALUE (€) */
.rc-vp-value {
  min-width: 70px;
  text-align: right;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* QTY */
.rc-vp-qty {
  min-width: 36px;
  text-align: right;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* PERCENTAGE */
.rc-vp-pct {
  min-width: 42px;
  text-align: right;
  color: #2563eb;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}


/* ===============================
   RIGHT — CHART
================================ */
.rc-vendor-right {
  border-left: 1px dashed #e5e7eb;
  padding-left: 14px;
}

.rc-vendor-chart {
  padding-top: 4px;
}

.rc-vendor-chart .rc-section-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #111827;
}

.rc-vendor-chart-summary strong {
  font-weight: 600;
}

.rc-vendor-chart-summary .yoy.up {
  color: #16a34a;
}

.rc-vendor-chart-summary .yoy.down {
  color: #dc2626;
}

/* ===============================
   Vendor products toggle (+ / −)
================================ */

.rc-vendor-products-toggle {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.rc-products-toggle-btn {
  background: none;
  border: none;
  padding: 2px 6px;

  font-size: 16px;
  font-weight: 500;
  line-height: 1;

  color: #2563eb;          /* azul Nyx */
  cursor: pointer;
  opacity: 0.55;

  transition: opacity 0.15s ease, transform 0.15s ease;
}

.rc-products-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.rc-products-toggle-btn:focus {
  outline: none;
}


/* ===============================
   RC DROP FOOTER BUTTONS
=============================== */
.rc-drop-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.rc-drop-footer button {
  flex: 1;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
}

.rc-drop-footer button:hover {
  background: #f3f4f6;
}

/* destaque subtil para Select All */
.rc-drop-footer .rc-drop-all {
  font-weight: 600;
}


.rc-chart-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rc-chart-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
}

.rc-brand-row {
  cursor: pointer;
}

.rc-brand-row:hover {
  background: #f8fafc;
  border-radius: 6px;
}

/* ===============================
   BRANDS OVERVIEW
================================ */

.rc-brands-overview {
  margin-top: 32px;
}

/* lista */
.rc-brands-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rc-brands-item {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.rc-brands-rank {
  font-weight: 600;
  color: #6b7280;
}

.rc-brands-name {
  font-weight: 500;
}

.rc-brands-value {
  font-weight: 600;
}

.rc-brands-perc {
  color: #6b7280;
  font-size: 12px;
}

/* ===============================
   BRAND OVERVIEW
================================ */
.rc-brands-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: center;
}

.rc-brands-donut {
  display: flex;
  justify-content: center;
  align-items: center;
}

.rc-brands-donut svg {
  width: 260px;
  height: 260px;
}

/* ===============================
   BRAND LIST
================================ */
.rc-brands-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rc-brand-row {
  display: grid;
  grid-template-columns: 32px 1fr 140px;
  align-items: center;
  gap: 12px;
}

.rc-brand-row .rank {
  font-size: 13px;
  color: #9ca3af;
}

.rc-brand-row .name {
  font-weight: 500;
}

.rc-brand-row .value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rc-brand-row .pct {
  font-size: 12px;
  color: #6b7280;
}

.rc-brand-bar {
  grid-column: 2 / -1;
  height: 6px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
}

.rc-brand-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 6px;
}


/* ===============================
   RESULTS CENTER — KPI (SINGLE SOURCE)
=============================== */

.rc-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.rc-kpi {
  background: #f8fafc;                 /* cinza claro consistente */
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  padding: 8px 12px;
  min-height: 78px;

  box-shadow: 0 2px 6px rgba(15,23,42,0.06);

  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.rc-kpi-label {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.rc-kpi-value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  color: #0f172a;
}

.rc-kpi-sub {
  font-size: 12px;
  margin-top: 2px;
  color: #9ca3af;
}

/* ===============================
   RESULTS CENTER — PIE / DONUT (SINGLE SOURCE)
=============================== */

.rc-pies-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.rc-pie-block {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);

  display: flex;
  flex-direction: column;
}

.rc-chart-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 4px;
}

.rc-chart-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.rc-pie-layout {
  display: grid;
  grid-template-columns: 1fr 180px; /* labels | donut */
  gap: 20px;
  align-items: flex-start;
}

.rc-pie-svg {
  width: 160px;
  height: 160px;
  margin-top: 6px;
  margin-left: auto;   /* 🔥 empurra para a direita */
  margin-right: 0;
  display: block;
}


.rc-pie-labels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.rc-pie-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;       /* 🔥 não quebra */
}

.rc-pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.8;
}

.rc-pie-text {
  max-width: 220px;          /* controla largura */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-pie-pct {
  color: #6b7280;
  font-size: 0.75rem;
  opacity: 0.8;
}


.rc-tooltip {
 pointer-events: none;
  position: fixed;
  background: rgba(15,23,42,0.95);
  color: #f9fafb;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
 opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 9999;
  max-width: 320px;
}


/* ===============================
   RESULTS CENTER — SALES OVER TIME (SINGLE SOURCE)
=============================== */

.rc-chart-block {
  background: #fbfdff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px 28px;
}

/* wrapper geral */
.rc-sot-wrap {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

/* gráfico */
.rc-sot-chart {
  flex: 1;
  min-width: 0;
  position: relative;
}

.rc-line-chart {
  width: 100%;
  height: 240px;
  display: block;
}

/* labels meses */
.rc-line-labels {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 0.75rem;
  color: #374151;
}

.rc-line-label {
  text-align: center;
}

/* legenda */
.rc-line-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #374151;
}

.rc-line-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.rc-line-dot.blue  { background: #2563eb; }
.rc-line-dot.gray  { background: #9ca3af; }
.rc-line-dot.green { background: #16a34a; }


/* ===============================
   TOOLTIP — TIME SERIES
=============================== */

.rc-sot-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  z-index: 10;
  min-width: 160px;
}

.rc-sot-tooltip .tt-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 6px;
}

.rc-sot-tooltip .tt-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rc-sot-tooltip .tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.rc-sot-tooltip .tt-cur  { background: #2563eb; }
.rc-sot-tooltip .tt-prev { background: #9ca3af; }

.rc-sot-tooltip .tt-yoy {
  margin-top: 4px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tt-arrow.up { color: #22c55e; }
.tt-arrow.down { color: #ef4444; }
.tt-arrow.neutral { color: #9ca3af; }

.rc-line-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}


.rc-line-dot.dashed {
  background: none;
  border: 2px dashed #6b7280;
}

.rc-line-labels > div { text-align: center; min-width: 0; }
.rc-line-month{ font-weight: 600; }
.rc-line-value{ color:#6b7280; }

.rc-line-context {
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.rc-line-labels{
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(12, 1fr); /* ✅ 12 meses = 12 colunas */
  gap: 0;
  font-size: 0.75rem;
  color: #374151;
}

.rc-line-label{
  text-align: center;
}

/* ===============================
   RESULTS CENTER — SUMMARY (SINGLE SOURCE)
=============================== */

.rc-summary {
  width: 100%;
  display: block;
}

/* grid dos cards */
.rc-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

/* card individual */
.rc-summary-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
  text-align: center;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* label */
.rc-summary-label {
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}

/* valor */
.rc-summary-value {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.15;
}

/* narrativa */
.rc-summary-narrative {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #f1fdf6;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  color: #374151;
  text-align: center;
}

.rc-summary-narrative strong {
  font-weight: 700;
  color: #065f46;
}

/* responsive */
@media (max-width: 1200px) {
  .rc-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .rc-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   CUSTOMER — SECOND SUMMARY ROW (SAFE TUNING)
   Only affects Customer (NOT Brand)
============================================================ */

.rc-customer .rc-summary-grid {
  margin-top: 0px;          /* 🔥 aproxima da linha de cima */
}

.rc-customer .rc-summary-card {
  padding: 8px 10px;         /* 🔥 menos alto */
  min-height: 56px;          /* 🔥 controla altura */
  display: flex;
  flex-direction: column;
  justify-content: center;

}

.rc-customer .rc-summary-label {
  font-size: 9px;
  margin-bottom: 2px;
}

.rc-customer .rc-summary-value {
  font-size: 12.5px;
  line-height: 1.15;
}

.rc-customer .rc-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rc-brand-item {
  cursor: pointer;
}

.rc-brand-item:hover {
  background: #f9fafb;
}

/* ===============================
   RESULTS CENTER — EMPTY STATE
   (used by showResultsEmptyState)
================================ */

.rc-empty-state {
  min-height: 360px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  padding: 32px;
  margin: 24px auto;

  background: linear-gradient(
    to bottom,
    #ffffff,
    #f9fafb
  );

  border-radius: 14px;
  border: 1px dashed #e5e7eb;
}

.rc-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.rc-empty-state p {
  font-size: 0.9rem;
  color: #6b7280;
  max-width: 520px;
  line-height: 1.45;
}

/* Brand overview — substituir o "+" por uma bolinha centrada */
.rc-brand-item .rc-vendor-toggle {
  background: transparent;   /* remove o quadrado */
  border: none;               /* remove o contorno */
  box-shadow: none;
  width: 34px;                /* mantém alinhamento do grid */
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* bolinha */
.rc-brand-item .rc-vendor-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  background-color: #4f6df5;  /* azul mais escuro (igual ao accent) */
  border-radius: 50%;
  display: block;
}

/* Brand filter active state */
.rc-filter-active .rc-drop-box {
  border-color: #2563eb;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

.rc-drill-clear {
  margin-left: 8px;
  font-weight: 600;
  cursor: pointer;
  color: #2563eb;
}
.rc-drill-clear:hover {
  text-decoration: underline;
}

/* ===============================
   DONUT COLORS BY MODE
=============================== */

:root {
  --rc-donut-main:  rgba(37, 99, 235, 0.8);  /* blue */
  --rc-donut-2:     rgba(22, 163, 74, 0.8);  /* green */
  --rc-donut-3:     rgba(245, 158, 11, 0.8); /* amber */
  --rc-donut-4:     rgba(239, 68, 68, 0.8);  /* red */
  --rc-donut-5:     rgba(139, 92, 246, 0.8); /* violet */
  --rc-donut-other: rgba(156, 163, 175, 0.6);/* gray */
}


/* ============================================
   BORDER GLOW HIGHLIGHT — RESULTS CARD
============================================ */

.rc-border-glow {
  position: relative;
}

.rc-border-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px; /* igual ao card */
  pointer-events: none;

  border: 2px solid rgba(37, 99, 235, 0.45);
  opacity: 0;

  animation: rcBorderGlow 1.2s ease-out;
}

@keyframes rcBorderGlow {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ===============================
   SUMMARY — CUSTOMER CONCENTRATION
   (FINAL)
=============================== */

.rc-summary-premium {
  background: #f7fefb;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 5px;
  text-align: center;
  font-size: 13.8px;
  font-weight: 400;
  color: #065f46;
}

/* Insight sentence */
.rc-summary-main {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: #043d30;
}

/* Primary customer line */
.rc-summary-primary {
  margin-bottom: 6px;
}

/* Aggregated metrics */
.rc-summary-metrics {
  font-size: 12.8px;
  line-height: 1.35;
  margin-bottom: 4px;
}

/* Customer name (bold médio) */
.rc-summary-premium .rc-entity {
  font-weight: 600;
}

/* Numeric values (bold mais forte) */
.rc-summary-premium .rc-value {
  font-weight: 700;
}

/* Scope / footnote */
.rc-summary-scope {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 400;
  opacity: 0.55;
}


#rcCustomersOverview {
  grid-column: 1 / -1; /* 🔥 ocupa a linha inteira */
}

#rcCustomersTreemap {
 height: 420px;          /* 🔥 altura controlada */
  overflow: hidden;       /* 🔥 sem scroll */
}

.rc-customers-treemap {
  width: 100%;
  height: 420px; /* 🔥 importante para a treemap real */
}

/* ============================================================
   YEARS MODE TOGGLE — NYX PREMIUM
   Compare ↔ Sum
============================================================ */

.rc-years-toggle {
  display: inline-flex;
  align-items: center;            /* alinhamento perfeito */
  gap: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

/* checkbox */
.rc-years-toggle input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
  transform: translateY(-0.5px);  /* micro-ajuste cross-browser */
}

/* texto base (ON / ativo) */
.rc-years-toggle span {
  color: #374151;                 /* gray-700 */
  opacity: 1;
  transition: opacity 0.2s ease, color 0.2s ease;
}

/* ===============================
   OFF STATE → SUM MODE
=============================== */

.rc-years-toggle input[type="checkbox"]:not(:checked) + span {
  color: #9ca3af;                 /* gray-400 */
  opacity: 0.55;                  /* claramente inativo */
}

/* hover inteligente */
.rc-years-toggle:hover span {
  opacity: 0.85;
}

/* hover quando OFF (não reativa demais) */
.rc-years-toggle input[type="checkbox"]:not(:checked):hover + span {
  opacity: 0.7;
}

/* ===============================
   YEARS MODE INDICATOR
   "Sum of 2025–2026"
=============================== */

.rc-years-mode {
  margin-left: 8px;
  font-size: 0.72rem;
  color: #6b7280;                 /* gray-500 */
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ===============================
   RESULTS CENTER — ALL (KPIs YoY)
   Isolado. Não afeta outros módulos.
================================*/

.rc-scope[data-mode="all"] .rc-kpi-sub {
  font-size: 0.72rem;
  opacity: 0.75;
}

.rc-scope[data-mode="all"] .rc-kpi-sub.up {
  color: #047857;
  font-weight: 600;
}

.rc-scope[data-mode="all"] .rc-kpi-sub.down {
  color: #b91c1c;
  font-weight: 600;
}

/* ============================================================
   RESULTS CENTER — ALL KPIs (WOW / FINAL)
============================================================ */

.rc-all .rc-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ============================================================
   KPI CARD
============================================================ */

.rc-all .kpi {
  background: #f8fafc;                 /* gray-100 */
  border: 1px solid #e5e7eb;           /* gray-200 */
  border-radius: 14px;
  padding: 14px 18px;
  min-height: 132px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  transition: 
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

/* subtle hover = UAU adulto */
.rc-all .kpi:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* ============================================================
   LABEL (eyebrow)
============================================================ */

.rc-all .kpi-label {
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #6b7280;                      /* gray-500 */
  margin-bottom: 4px;
}

/* ============================================================
   MAIN VALUE
============================================================ */

.rc-all .kpi-main-strong {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
}

.rc-all .kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;                      /* gray-900 */
  line-height: 1.1;
}

/* ============================================================
   DELTA (vs previous year)
============================================================ */

.rc-all .kpi-delta-below {
  font-size: 0.75rem;
  font-weight: 500;
}

.rc-all .kpi-delta-below.up {
  color: #059669;                      /* green-600 */
}

.rc-all .kpi-delta-below.down {
  color: #dc2626;                      /* red-600 */
}


/* ============================================================
   SUB INFO (previous year / margin %)
============================================================ */

.rc-all .kpi-sub {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #374151;                      /* gray-700 */
}

.rc-all .kpi-sub-muted {
  margin-top: 2px;
  font-size: 0.7rem;
  color: #9ca3af;                      /* gray-400 */
}

.rc-chart-legend {
  display: flex;
  gap: 16px;
  margin: 8px 0 12px;
}

.rc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #374151;
}

.rc-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* =========================
   ALL SUMMARY — PREMIUM
========================= */

#rcAllSummary .rc-summary-premium {
  padding: 14px 18px;
}

#rcAllSummary .rc-summary-headline {
  font-size: 0.95rem;
  font-weight: 600;
  color: #065f46; /* green-800 */
  line-height: 1.35;
  margin-bottom: 6px;
}

#rcAllSummary .rc-summary-sub {
  font-size: 0.85rem;
  color: #064e3b;
  opacity: 0.9;
  line-height: 1.4;
 margin-top: 2px;
}

#rcAllSummary .rc-summary-headline strong {
  font-size: 1.05em;
}

#rcAllSummary .rc-summary-premium strong {
  font-weight: 600;
  color: #047857;
}

.nyx-lock-icon {
  font-size: 24px;
  line-height: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  user-select: none;

  margin: 0 11px 0 3px;

  -webkit-font-smoothing: antialiased;

  position: relative;
  top: -1.5px;   /* 👈 ajuste fino FINAL */
}

.vendor-inv-ok {
  font-size: 14px;
  cursor: default;
  opacity: 0.85;
}

.nyx-editor-products .apply-inv-inline {
  margin-left: -40px;
}

.nyx-editor-products input[type="date"] {
  position: relative;
  z-index: 5;
}

.vendor-inv-pill {
  display: inline-block;
  margin-left: 6px;

  padding: 1px 6px;          /* ⬅️ menos alto */
  font-size: 11.5px;         /* ⬅️ ligeiramente menor */
  line-height: 1.4;

  border-radius: 999px;
  background: #e5e7eb;       /* mantém */
  color: #374151;            /* mantém */

  box-shadow: none;          /* ⬅️ tira a sombra */
}

.nyx-track-icon {
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nyx-track-icon:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* === FIX TOP BAR === */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

/* espaço exato abaixo da topbar */
body {
  padding-top: 56px; /* ajusta 34–40 se quiseres */
}

/* ===============================
   PIPELINE KPI LAYOUT (SCOPED)
=============================== */
#rcPipelineKpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* ✅ agora 4 colunas */
  gap: 16px;
  align-items: stretch;
}

/* QUOTES BIG (coluna 1 a ocupar 2 linhas) */
#rcPipelineKpis .rc-kpi.rc-kpi-pipe-quotes-big {
  grid-row: span 2;            /* ✅ ocupa 2 linhas */
  min-height: 172px;           /* ✅ dá presença sem ficar “gritante” */
}

/* um bocadinho mais “premium” no número principal */
#rcPipelineKpis .rc-kpi-value-xl {
  font-size: 34px;
  font-weight: 650;
  line-height: 1.05;
}

/* sub info do big quotes em 2 linhas bem clean */
#rcPipelineKpis .rc-kpi-sub-split {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* mini labels/values dentro do big quotes */
#rcPipelineKpis .rc-kpi-mini-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-right: 6px;
}

#rcPipelineKpis .rc-kpi-mini-value {
  font-weight: 600;
  color: #0f172a;
}

/* reasons do Canceled — não deixa aquilo “gritar” nem partir layout */
#rcPipelineKpis .rc-kpi-sub-reasons {
  font-size: 11px;
  line-height: 1.25;
  max-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsivo só para pipeline */
@media (max-width: 1100px) {
  #rcPipelineKpis {
    grid-template-columns: repeat(2, 1fr);
  }

  /* em ecrãs menores, deixa de forçar o span (para não ficar weird) */
  #rcPipelineKpis .rc-kpi.rc-kpi-pipe-quotes-big {
    grid-row: auto;
    min-height: 78px;
  }

  #rcPipelineKpis .rc-kpi-value-xl {
    font-size: 26px;
  }
}

@media (max-width: 700px) {
  #rcPipelineKpis {
    grid-template-columns: 1fr;
  }
}

/* PIPELINE — enable hover on SVG bars */
.rc-bar-pipeline {
  pointer-events: all;
  cursor: pointer;
}

/* ===============================
   PIPELINE TOOLTIP (ENHANCED)
=============================== */
.rc-tooltip .tt-title {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.rc-tooltip .tt-metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.rc-tooltip .tt-label {
  color: #cbd5f5;
}

.rc-tooltip .tt-footnote {
  margin-top: 6px;
  font-size: 0.7rem;
  color: #94a3b8;
}

/* ===============================
   PIPELINE — TABLE
=============================== */
.rc-quotes .rc-pipeline-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #6b7280;
}

.rc-quotes .rc-pipeline-table td {
  font-size: 0.85rem;
  vertical-align: middle;
}

.rc-quotes .font-mono {
  font-family: Menlo, Consolas, monospace;
}

.rc-quotes .rc-pipeline-table th.sortable {
  cursor: pointer;
}

.rc-quotes .rc-pipeline-table th.sortable:hover {
  color: #2563eb;
}

/* Pipeline dropdown should not stretch */
.rc-pipeline-table select.form-select {
  width: auto !important;
  max-width: 100% !important;
  display: inline-block;
}

/* Pipeline Action column — SAFE layout */
.rc-action-cell {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  vertical-align: middle;
  overflow: hidden;
}

/* Extra safety */
.rc-action-cell select {
  max-width: 100%;
}

/* Read-only text */
.rc-action-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* General alignment */
.rc-pipeline-table td {
  vertical-align: middle;
}

/* Center ACTION column header */
.rc-pipeline-table th:nth-child(2) {
  text-align: center;
}

/* Center ACTION column content */
.rc-action-cell {
  text-align: center;
}

/* ===============================
   PIPELINE — LAST UPLOAD FOOTER
=============================== */
.rc-pipeline-last-upload {
  margin-top: 14px;
  padding-top: 6px;
  font-size: 11px;
  color: #6b7280; /* cinza discreto */
  text-align: right;
  border-top: 1px dashed rgba(0,0,0,0.08);
}

/* NYX PT DATE INPUT */
.nyx-date-wrap{
  position:relative;
}

.nyx-date-native{
  position:absolute;
  inset:0;
  opacity:0;
  pointer-events:auto;
}

.nyx-date-pt{
  background:#fff;
}

.po-notes {
  margin-top: 16px;        /* duas linhas abaixo */
  padding-top: 6px;
  border-top: 1px dashed #ddd;
  font-size: 0.85rem;
  color: #555;
}

.filter-pill-hold {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
  color: #1e40af !important;
}

.filter-pill-hold .filter-count,
.filter-pill-hold .filter-value {
  color: #1e40af !important;
}