/* ==========================================================================
   Salsy UI — componentele design system-ului (incarcat global din index.php)
   Culorile vin din salsy_tokens.css. Documentatie: docs/design-system.md
   Toate clasele au prefix (os- / sx-) ca sa nu se loveasca de Metronic.
   ========================================================================== */

/* ---- Pagina ---- */
.sx-page {
  max-width: 1640px; /* aceeasi latime pentru toate paginile noi */
  margin-left: auto;
  margin-right: auto;
  color: var(--os-text);
  font-family: var(--os-font);
  font-size: 13px;
  line-height: 1.45;
}
.sx-page a { color: var(--os-link); text-decoration: none; }
.sx-page a:hover { text-decoration: underline; }
.sx-page a.btn:hover, .sx-page a.os-icon-btn:hover { text-decoration: none; }

.sx-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.sx-page-title {
  margin: 0 !important;
  color: var(--os-text) !important;
  font-size: 20px !important;
  font-weight: 650 !important;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.sx-page-sub { margin-top: 2px; color: var(--os-muted); font-size: 13px; }
.sx-page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.os-muted { color: var(--os-muted) !important; }
.os-subtle { color: var(--os-subtle) !important; }
.os-small { font-size: 12px; }
.os-strong { font-weight: 600; }
.os-num { font-variant-numeric: tabular-nums; }

/* ---- Butoane (pastila) ---- */
.btn.os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 999px !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
  font-family: var(--os-font);
  font-size: 12.5px !important;
  font-weight: 550 !important;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none !important;
  transition: background .12s ease, border-color .12s ease;
}
.btn.os-btn:hover { border-color: #cfcfcf !important; background: var(--os-hover) !important; text-decoration: none; }
.btn.os-btn:active { background: var(--os-press) !important; }
.btn.os-btn i { color: inherit; font-size: 12px; }
.btn.os-btn:disabled { opacity: .55; }
.btn.os-btn.os-btn--sm { height: 28px; padding: 0 12px !important; font-size: 12px !important; }
.btn.os-btn.os-btn--primary { border-color: var(--os-primary) !important; background: var(--os-primary) !important; color: var(--os-primary-text) !important; }
.btn.os-btn.os-btn--primary:hover { border-color: var(--os-primary-hover) !important; background: var(--os-primary-hover) !important; }
.btn.os-btn.os-btn--ghost { border-color: transparent !important; background: transparent !important; color: var(--os-muted) !important; }
.btn.os-btn.os-btn--ghost:hover { background: var(--os-hover) !important; color: var(--os-text) !important; }
.btn.os-btn.os-btn--warning { border-color: transparent !important; background: var(--os-warning-bg) !important; color: var(--os-warning-fg) !important; }

.os-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--os-muted) !important;
  font-size: 12px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.os-icon-btn:hover { background: var(--os-hover); color: var(--os-text) !important; text-decoration: none !important; }

/* ---- Control segmentat (ex. Vanzari / Comenzi) ---- */
.os-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--os-hover);
}
.os-seg button {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--os-muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.os-seg button:hover { color: var(--os-text); }
.os-seg button.is-active { background: var(--os-card); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--os-border); color: var(--os-text); }

/* ---- Pastile de status ---- */
.os-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--os-neutral-bg);
  color: var(--os-neutral-fg);
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
}
.os-pill i { font-size: 10px; }
.os-pill .fa-circle { font-size: 6px; }
.os-pill--xs { height: 18px; padding: 0 6px; font-size: 11px; }
.os-pill--neutral   { background: var(--os-neutral-bg);   color: var(--os-neutral-fg); }
.os-pill--success   { background: var(--os-success-bg);   color: var(--os-success-fg); }
.os-pill--warning   { background: var(--os-warning-bg);   color: var(--os-warning-fg); }
.os-pill--attention { background: var(--os-attention-bg); color: var(--os-attention-fg); }
.os-pill--info      { background: var(--os-info-bg);      color: var(--os-info-fg); }
.os-pill--danger    { background: var(--os-danger-bg);    color: var(--os-danger-fg); }

/* ---- Carduri ---- */
.os-card {
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius);
  background: var(--os-card);
  overflow: hidden;
}
.os-card--pad { padding: 14px 16px; }
.os-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
}
.os-card-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.os-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  color: var(--os-text) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}
.os-card-tools { display: flex; align-items: center; gap: 6px; }
.os-card-body { padding: 0 16px 16px; }
.os-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--os-divider);
  font-size: 12.5px;
}
.os-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--os-neutral-bg);
  color: var(--os-neutral-fg);
  font-size: 11px;
  font-weight: 600;
}
.os-empty { padding: 20px 16px; color: var(--os-muted); font-size: 12.5px; text-align: center; }

/* ---- Bannere ---- */
.os-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--os-radius);
  font-size: 13px;
}
.os-banner > i { font-size: 15px; }
.os-banner > div { flex: 1; min-width: 0; }
.os-banner--danger  { background: var(--os-danger-bg);  color: var(--os-danger-fg); }
.os-banner--warning { background: var(--os-warning-bg); color: var(--os-warning-fg); }
.os-banner--info    { background: var(--os-info-bg);    color: var(--os-info-fg); }

/* ---- Tabele ---- */
.os-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.os-table th {
  padding: 8px 16px;
  background: var(--os-hover);
  color: var(--os-muted);
  font-size: 11.5px;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
}
.os-table td {
  padding: 10px 16px;
  border-top: 1px solid var(--os-divider);
  color: var(--os-text);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.os-table tbody tr:hover td { background: var(--os-hover); }
.os-table tr.is-link { cursor: pointer; }

/* ---- KPI (indicatori cu comparatie) ---- */
.sx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.sx-kpi {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid var(--os-divider);
  background: none;
  text-align: left;
}
.sx-kpi:first-child { border-left: 0; }
.sx-kpi-label { color: var(--os-muted); font-size: 12.5px; font-weight: 550; }
.sx-kpi-value {
  margin-top: 4px;
  color: var(--os-text);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sx-kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--os-subtle); font-size: 11.5px; }
button.sx-kpi { border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
button.sx-kpi:hover { background: var(--os-hover); }
.sx-kpi.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--os-text);
}

.sx-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sx-delta.is-up { color: var(--os-success); }
.sx-delta.is-down { color: var(--os-danger); }
.sx-delta.is-flat { color: var(--os-subtle); }

/* ---- Bare orizontale (distributii) ---- */
.sx-bars { display: flex; flex-direction: column; gap: 12px; }
.sx-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.sx-bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sx-bar-label img { height: 16px; border-radius: 3px; }
.sx-bar-value { color: var(--os-text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sx-bar-value small { margin-left: 6px; color: var(--os-subtle); font-size: 11.5px; font-weight: 500; }
.sx-bar-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--os-hover); }
.sx-bar-fill { height: 100%; border-radius: 999px; background: var(--os-text); transition: width .4s ease; }

/* Bara segmentata (ex. statusuri) */
.sx-stack { display: flex; height: 10px; overflow: hidden; border-radius: 999px; background: var(--os-hover); }
.sx-stack span { height: 100%; transition: width .4s ease; }
.sx-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 14px; font-size: 12.5px; }
.sx-legend-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sx-legend-item i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
.sx-legend-item span { flex: 1; overflow: hidden; color: var(--os-muted); text-overflow: ellipsis; white-space: nowrap; }
.sx-legend-item strong { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Lista de sarcini ("De facut") ---- */
.sx-todo { display: flex; flex-direction: column; }
.sx-todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--os-divider);
  color: var(--os-text) !important;
  text-decoration: none !important;
}
.sx-todo-item:first-child { border-top: 0; }
.sx-todo-item:hover { background: var(--os-hover); }
.sx-todo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--os-hover);
  color: var(--os-muted);
  font-size: 17px;
}
.sx-todo-text { flex: 1; min-width: 0; }
.sx-todo-text strong { display: block; font-size: 13px; font-weight: 600; }
.sx-todo-text small { color: var(--os-muted); font-size: 12px; }
.sx-todo-item > .ti-chevron-right { color: var(--os-subtle); }
.sx-todo-item.is-done { opacity: .55; }

/* ---- Selector interval de date (calendar) ---- */
.sx-drp { position: relative; display: inline-block; }
.sx-drp-btn .ti { font-size: 15px; }
.sx-drp-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1080;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--os-border);
  border-radius: 14px;
  background: var(--os-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
  color: var(--os-text);
  font-family: var(--os-font);
  font-size: 13px;
  animation: sx-drp-in .12s ease-out;
}
.sx-drp-pop[hidden] { display: none; }
.sx-drp.is-left .sx-drp-pop { left: 0; right: auto; }
@keyframes sx-drp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sx-drp-presets {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 170px;
  padding: 8px;
  border-right: 1px solid var(--os-divider);
}
.sx-drp-presets button {
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--os-text);
  font-size: 13px;
  text-align: left;
}
.sx-drp-presets button:hover { background: var(--os-hover); }
.sx-drp-presets button.is-active { background: var(--os-neutral-bg); font-weight: 600; }
.sx-drp-main { display: flex; flex-direction: column; }
.sx-drp-inputs { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.sx-drp-inputs input {
  width: 120px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--os-border);
  border-radius: 8px;
  outline: 0;
  background: var(--os-card);
  color: var(--os-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.sx-drp-inputs input:focus { border-color: var(--os-link); box-shadow: 0 0 0 3px rgba(0, 91, 211, .12); }
.sx-drp-inputs input.is-invalid { border-color: var(--os-danger); }
.sx-drp-inputs span { color: var(--os-subtle); }
.sx-drp-months { display: flex; gap: 20px; padding: 8px 14px 4px; }
.sx-drp-month { width: 238px; }
.sx-drp-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  margin-bottom: 4px;
  font-weight: 650;
}
.sx-drp-month-head .os-icon-btn { font-size: 15px; }
.sx-drp-month-head .is-hidden { visibility: hidden; }
.sx-drp-grid { display: grid; grid-template-columns: repeat(7, 34px); row-gap: 2px; }
.sx-drp-dow { height: 26px; color: var(--os-subtle); font-size: 11.5px; font-weight: 550; line-height: 26px; text-align: center; }
.sx-drp-day {
  position: relative;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--os-text);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.sx-drp-day span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.sx-drp-day:hover span { background: var(--os-hover); }
.sx-drp-day.is-today span { box-shadow: inset 0 0 0 1px var(--os-border); }
.sx-drp-day.is-in-range { background: var(--os-neutral-bg); }
.sx-drp-day.is-start, .sx-drp-day.is-end { background: var(--os-neutral-bg); }
.sx-drp-day.is-start { border-radius: 999px 0 0 999px; }
.sx-drp-day.is-end { border-radius: 0 999px 999px 0; }
.sx-drp-day.is-start.is-end { border-radius: 999px; }
.sx-drp-day.is-start span, .sx-drp-day.is-end span { background: var(--os-primary); color: var(--os-primary-text); font-weight: 600; }
.sx-drp-day.is-disabled { color: var(--os-subtle); opacity: .45; pointer-events: none; }
.sx-drp-day.is-empty { pointer-events: none; }
.sx-drp-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--os-divider);
  margin-top: 6px;
}
.sx-drp-foot .sx-drp-summary { margin-right: auto; color: var(--os-muted); font-size: 12px; }

@media (max-width: 760px) {
  .sx-drp-pop { position: fixed; top: 12px; left: 12px; right: 12px; flex-direction: column; max-height: calc(100vh - 24px); overflow-y: auto; }
  .sx-drp-presets { flex-direction: row; flex-wrap: wrap; width: auto; border-right: 0; border-bottom: 1px solid var(--os-divider); }
  .sx-drp-months { flex-direction: column; align-items: center; }
  .sx-drp-month + .sx-drp-month { display: none; }
}

/* ---- Select in forma de buton (pastila) ---- */
.sx-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin: 0;
  border: 1px solid var(--os-border);
  border-radius: 999px;
  background: var(--os-card);
  color: var(--os-text);
  cursor: pointer;
}
.sx-select:hover { background: var(--os-hover); }
.sx-select > .ti:first-child { position: absolute; left: 12px; color: var(--os-muted); font-size: 15px; pointer-events: none; }
.sx-select select {
  height: 100%;
  padding: 0 32px 0 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-family: var(--os-font);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.sx-select select option { background: var(--os-card); color: var(--os-text); }
.sx-select-caret { position: absolute; right: 12px; color: var(--os-muted); font-size: 13px; pointer-events: none; }
.sx-select:focus-within { box-shadow: 0 0 0 3px rgba(0, 91, 211, .12); border-color: var(--os-link); }

/* ---- Taburi (vederi ale unei liste, ex. Active / Noi / Finalizate) ---- */
.sx-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--os-divider);
  scrollbar-width: none;
}
.sx-tabs::-webkit-scrollbar { display: none; }
.sx-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--os-muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.sx-tabs button:hover { background: var(--os-hover); color: var(--os-text); }
.sx-tabs button.is-active { background: var(--os-neutral-bg); color: var(--os-text); }
.sx-tabs .os-count { height: 18px; min-width: 18px; padding: 0 5px; background: transparent; color: var(--os-subtle); font-size: 11.5px; }
.sx-tabs button.is-active .os-count { color: var(--os-muted); }

/* ---- Bara de filtre + camp de cautare ---- */
.sx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--os-divider);
}
.sx-search-field { position: relative; flex: 1 1 260px; min-width: 200px; max-width: 440px; }
.sx-search-field > .ti { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); color: var(--os-subtle); font-size: 15px; pointer-events: none; }
.sx-search-field input {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 34px;
  border: 1px solid var(--os-border);
  border-radius: 8px;
  outline: 0;
  background: var(--os-card);
  color: var(--os-text);
  font-size: 13px;
}
.sx-search-field input::placeholder { color: var(--os-subtle); }
.sx-search-field input:focus { border-color: var(--os-link); box-shadow: 0 0 0 3px rgba(0, 91, 211, .12); }
.sx-search-field .os-icon-btn { position: absolute; top: 50%; right: 4px; width: 24px; height: 24px; transform: translateY(-50%); }
.sx-search-field .os-icon-btn[hidden] { display: none; }
.sx-toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---- Tabel: coloane sortabile, defilare orizontala ---- */
.sx-table-wrap { overflow-x: auto; }
.os-table th.is-sortable { cursor: pointer; user-select: none; }
.os-table th.is-sortable:hover { color: var(--os-text); }
.os-table th .sx-sort { margin-left: 3px; font-size: 12px; vertical-align: -1px; opacity: 0; }
.os-table th.is-sorted { color: var(--os-text); }
.os-table th.is-sorted .sx-sort { opacity: 1; }

/* ---- Paginare ---- */
.sx-pager { display: flex; align-items: center; gap: 6px; }
.sx-pager .os-icon-btn { width: 30px; height: 30px; border: 1px solid var(--os-border); background: var(--os-card); font-size: 14px; }
.sx-pager .os-icon-btn:disabled { opacity: .4; pointer-events: none; }
.sx-pager-info { color: var(--os-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sx-select--sm { height: 30px; }
.sx-select--sm select { padding-left: 12px; font-size: 12px; }

/* ---- Incarcare: schelet (prima incarcare) si bara de progres (reincarcari) ---- */
.sx-skeleton {
  display: inline-block;
  max-width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--os-hover) 0%, var(--os-press) 45%, var(--os-hover) 90%);
  background-size: 300% 100%;
  vertical-align: middle;
  animation: sx-shimmer 1.4s ease-in-out infinite;
}
.sx-skeleton--block { display: block; }
.sx-skeleton--circle { border-radius: 50%; }
@keyframes sx-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.os-card.is-busy { position: relative; }
.os-card.is-busy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 35%;
  height: 2px;
  border-radius: 2px;
  background: var(--os-link);
  animation: sx-progress 1.1s ease-in-out infinite;
}
@keyframes sx-progress { from { left: -35%; } to { left: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .sx-skeleton { animation: none; }
  .os-card.is-busy::before { width: 100%; animation: none; opacity: .6; }
}
/* In legenda, scheletul nu se intinde (textul legendei are flex: 1) */
.sx-legend-item > .sx-skeleton { flex: 0 0 auto; }
.sx-legend-item i.sx-skeleton { border-radius: 50%; }

/* Inaltimi fixe pentru randurile care primesc date: scheletul si datele ocupa exact acelasi spatiu */
.sx-kpi-value { display: flex; align-items: center; gap: 6px; height: 27px; }
.sx-kpi-foot { height: 18px; }
.sx-bar-label { min-height: 20px; }
.sx-bar-value { line-height: 20px; }
.os-count .sx-skeleton { display: block; }

/* ---- Tabel configurabil: coloane mutate (drag & drop), redimensionate, alese din panou ---- */
.sx-config-table thead th { position: relative; }
.sx-config-table thead th[draggable="true"] { cursor: grab; }
.sx-config-table thead th.is-sortable[draggable="true"] { cursor: pointer; }
.sx-config-table thead th.is-dragging { opacity: .45; }
.sx-config-table thead th.is-drop-before { box-shadow: inset 2px 0 0 var(--os-link); }
.sx-config-table thead th.is-drop-after { box-shadow: inset -2px 0 0 var(--os-link); }
.sx-col-resize {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  z-index: 1;
  width: 8px;
  cursor: col-resize;
}
.sx-col-resize::after {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 3px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}
.sx-config-table thead th:hover .sx-col-resize::after { background: var(--os-border); }
.sx-col-resize:hover::after, body.sx-col-resizing .sx-col-resize::after { background: var(--os-link) !important; }
body.sx-col-resizing, body.sx-col-resizing * { cursor: col-resize !important; user-select: none !important; }

.sx-cols { position: relative; }
.sx-cols-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1080;
  width: 250px;
  padding: 6px;
  border: 1px solid var(--os-border);
  border-radius: 12px;
  background: var(--os-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
  font-size: 13px;
  animation: sx-drp-in .12s ease-out;
}
.sx-cols-pop[hidden] { display: none; }
.sx-cols-head { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 8px; }
.sx-cols-head strong { font-weight: 650; }
.sx-cols-list { display: flex; flex-direction: column; gap: 1px; max-height: 360px; overflow-y: auto; }
.sx-cols-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--os-text);
  cursor: grab;
  user-select: none;
}
.sx-cols-item:hover { background: var(--os-hover); }
.sx-cols-item.is-dragging { opacity: .45; }
.sx-cols-item.is-drop-before { box-shadow: inset 0 2px 0 var(--os-link); }
.sx-cols-item.is-drop-after { box-shadow: inset 0 -2px 0 var(--os-link); }
.sx-cols-grip { color: var(--os-subtle); font-size: 15px; }
.sx-cols-item .form-check-input { width: 16px; height: 16px; margin: 0; border-radius: 4px; cursor: pointer; }
.sx-cols-item .form-check-input:checked { border-color: var(--os-primary); background-color: var(--os-primary); }
.sx-cols-foot { margin-top: 4px; padding: 6px 2px 2px; border-top: 1px solid var(--os-divider); }

/* ---- Dropdown personalizat (salsy_select.js) peste <select> nativ ---- */
.sx-dd-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.sx-dd-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--os-text);
  font-family: var(--os-font);
  text-align: left;
  cursor: pointer;
}
.sx-dd-btn:disabled { opacity: .55; cursor: default; }
.sx-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-dd-caret { color: var(--os-muted); font-size: 13px; transition: transform .15s ease; }
.sx-dd-btn.is-open .sx-dd-caret { transform: rotate(180deg); }
.sx-dd-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(0, 91, 211, .18); }

/* Camp de formular (modale) */
.sx-dd-btn--field {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--os-border);
  border-radius: 8px;
  background: var(--os-card);
  font-size: 13px;
}
.sx-dd-btn--field:hover { border-color: #cfcfcf; }
.sx-dd-btn--field.is-open, .sx-dd-btn--field:focus-visible { border-color: var(--os-link); }

/* In bara de filtre (.sx-select): butonul acopera toata pastila, iconitele raman deasupra */
.sx-dd-btn--bare {
  height: 100%;
  padding: 0 32px 0 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 550;
}
.sx-select--sm .sx-dd-btn--bare { padding-left: 12px; font-size: 12px; }
.sx-select > .ti, .sx-select .sx-select-caret { z-index: 1; }

/* Pastila de status (ex. titlul modalului de editare) */
.sx-dd-btn--pill {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.sx-dd-btn--pill .sx-dd-caret { color: inherit; opacity: .7; font-size: 12px; }

/* Meniul */
.sx-dd-menu {
  position: fixed;
  z-index: 1090;
  max-width: 340px;
  max-height: 300px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--os-border);
  border-radius: 12px;
  background: var(--os-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
  color: var(--os-text);
  font-family: var(--os-font);
  font-size: 13px;
  animation: sx-drp-in .1s ease-out;
}
.sx-dd-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.sx-dd-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-dd-opt.is-active { background: var(--os-hover); }
.sx-dd-opt.is-selected { font-weight: 600; }
.sx-dd-opt.is-disabled { color: var(--os-subtle); cursor: default; }
.sx-dd-check { color: var(--os-text); font-size: 14px; opacity: 0; }
.sx-dd-opt.is-selected .sx-dd-check { opacity: 1; }
.sx-dd-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
.sx-dd-dot.os-pill--neutral { background: var(--os-subtle); }
.sx-dd-dot.os-pill--success { background: var(--os-success); }
.sx-dd-dot.os-pill--warning { background: #e5a000; }
.sx-dd-dot.os-pill--attention { background: #e07b00; }
.sx-dd-dot.os-pill--info { background: #2c6ecb; }
.sx-dd-dot.os-pill--danger { background: var(--os-danger); }
.sx-dd-empty { padding: 10px; color: var(--os-muted); text-align: center; }

/* ---- Celula de comanda (logo canal + #id + linia secundara), folosita in liste ---- */
.sx-ord-id { display: flex; align-items: flex-start; gap: 10px; }
.sx-ord-id a { color: var(--os-text) !important; font-weight: 650; }
.sx-ord-logo { display: inline-flex; flex: 0 0 56px; align-items: center; height: 20px; }
.sx-ord-logo img { height: 16px; max-width: 56px; border-radius: 3px; object-fit: contain; }
.sx-ord-sub { display: block; margin-top: 1px; color: var(--os-subtle); font-size: 11.5px; }
.sx-ord-client { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-ord-icon { color: var(--os-subtle); font-size: 14px; }

/* ==========================================================================
   SweetAlert2 (confirmari, succes, eroare) — acelasi design system, global
   ========================================================================== */
.swal2-container.swal2-backdrop-show { background: rgba(15, 15, 18, .45) !important; backdrop-filter: blur(2px); }
.swal2-popup {
  width: 420px !important;
  max-width: calc(100vw - 24px);
  padding: 24px 24px 20px !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 16px !important;
  background: var(--os-card) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28) !important;
  color: var(--os-text) !important;
  font-family: var(--os-font) !important;
}
.swal2-popup .swal2-title {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--os-text) !important;
  font-size: 17px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
}
.swal2-popup .swal2-html-container {
  margin: 8px 0 0 !important;
  padding: 0 !important;
  color: var(--os-muted) !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
}

/* Iconita: mai mica, in culorile tonurilor */
.swal2-popup .swal2-icon { margin: 4px auto 16px !important; font-size: 11px !important; }
.swal2-popup .swal2-icon.swal2-question,
.swal2-popup .swal2-icon.swal2-info { border-color: #2c6ecb !important; color: #2c6ecb !important; }
.swal2-popup .swal2-icon.swal2-warning { border-color: #e5a000 !important; color: #e5a000 !important; }
.swal2-popup .swal2-icon.swal2-error { border-color: var(--os-danger) !important; color: var(--os-danger) !important; }
.swal2-popup .swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--os-danger) !important; }
.swal2-popup .swal2-icon.swal2-success { border-color: var(--os-success) !important; color: var(--os-success) !important; }
.swal2-popup .swal2-icon.swal2-success .swal2-success-ring { border-color: var(--os-success) !important; opacity: .3; }
.swal2-popup .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--os-success) !important; }
.swal2-popup .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
.swal2-popup .swal2-icon.swal2-success .swal2-success-fix { background-color: var(--os-card) !important; }

/* Butoane: pastila, principal inchis, anulare alb */
.swal2-popup .swal2-actions { gap: 8px; width: 100%; margin: 22px 0 0 !important; }
.swal2-popup .swal2-actions .swal2-styled,
.swal2-popup .swal2-actions .btn {
  height: 34px;
  min-width: 88px;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  font-family: var(--os-font) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.swal2-popup .swal2-actions .swal2-confirm { border-color: var(--os-primary) !important; background: var(--os-primary) !important; color: var(--os-primary-text) !important; }
.swal2-popup .swal2-actions .swal2-confirm:hover { background: var(--os-primary-hover) !important; }
.swal2-popup .swal2-actions .swal2-cancel,
.swal2-popup .swal2-actions .swal2-deny {
  border-color: var(--os-border) !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
}
.swal2-popup .swal2-actions .swal2-cancel:hover,
.swal2-popup .swal2-actions .swal2-deny:hover { background: var(--os-hover) !important; }
/* Confirmarile distructive (confirmButtonColor rosu) raman rosii; cele galbene devin "avertisment" */
.swal2-popup .swal2-actions .swal2-confirm[style*="241, 65, 108"],
.swal2-popup .swal2-actions .swal2-confirm[style*="221, 51, 51"] { border-color: var(--os-danger) !important; background: var(--os-danger) !important; color: #fff !important; }
.swal2-popup .swal2-actions .swal2-confirm[style*="255, 193, 7"] { border-color: transparent !important; background: var(--os-warning-bg) !important; color: var(--os-warning-fg) !important; }
.swal2-popup .swal2-actions .swal2-styled:focus { box-shadow: 0 0 0 3px rgba(0, 91, 211, .2) !important; }

/* Campuri din dialog (ex. input numeric) */
.swal2-popup .swal2-input,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select {
  width: 100%;
  margin: 14px 0 0 !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 8px !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
  font-size: 14px !important;
  box-shadow: none !important;
}
.swal2-popup .swal2-input { height: 38px !important; padding: 0 12px !important; }
.swal2-popup .swal2-input:focus,
.swal2-popup .swal2-textarea:focus { border-color: var(--os-link) !important; box-shadow: 0 0 0 3px rgba(0, 91, 211, .12) !important; }
.swal2-popup .swal2-validation-message { margin: 10px 0 0 !important; border-radius: 8px; background: var(--os-danger-bg) !important; color: var(--os-danger-fg) !important; font-size: 12.5px !important; }
.swal2-popup .swal2-timer-progress-bar { background: var(--os-link) !important; }
.swal2-popup .swal2-close { color: var(--os-subtle) !important; box-shadow: none !important; }
.swal2-popup .swal2-close:hover { color: var(--os-text) !important; }

/* Buton distructiv (ex. Creează comanda de storno) */
.btn.os-btn.os-btn--danger { border-color: var(--os-danger) !important; background: var(--os-danger) !important; color: #fff !important; }
.btn.os-btn.os-btn--danger:hover { filter: brightness(.94); }

/* ==========================================================================
   COMPONENTE PENTRU PAGINILE VECHI (refacerea paginilor Metronic)
   Documentatie: docs/design-system.md, sectiunea "Componente pentru paginile vechi".

   Zone in care se aplica:
     - .sx-page            pagina refacuta (tot ce e in ea)
     - .sx-shell .modal    ORICE modal Bootstrap (body are mereu .sx-shell):
                           rama, campuri, butoanele din subsol, alerte
     - .modal.sx-modal     modal al unei pagini refacute, pus in afara .sx-page:
                           primeste in plus tabelele / insignele / taburile / paginarea
   Campurile folosesc :where(...) -> specificitate mica: castiga in fata Metronic
   (fisierul se incarca dupa style.bundle.css), dar CSS-ul paginii le poate suprascrie usor.
   Paginile vechi (fara .sx-page) nu sunt atinse, cu exceptia modalelor.
   ========================================================================== */

/* ---- Coloane de carduri (spatiere uniforma intre carduri) ---- */
.sx-cards { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sx-cards--2, .sx-cards--3, .sx-cards--aside { display: grid; align-items: start; }
.sx-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sx-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-cards--aside { grid-template-columns: minmax(0, 1fr) 360px; }
.sx-cards > * { min-width: 0; }
.sx-cards + .sx-cards { margin-top: 16px; }

/* ---- Formulare: asezare ---- */
.sx-form label:not([class]),
.sx-form .form-label,
.os-field > label {
  display: block;
  margin-bottom: 5px;
  color: var(--os-text);
  font-size: 12.5px;
  font-weight: 550;
}
.os-field { display: flex; flex-direction: column; min-width: 0; }
.os-field--full { grid-column: 1 / -1; }
.os-field-hint { margin-top: 4px; color: var(--os-muted); font-size: 12px; line-height: 1.4; }
.os-input-strong { font-weight: 650; }

.sx-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.sx-form-grid--1 { grid-template-columns: minmax(0, 1fr); }
.sx-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sx-form-grid > .sx-span-full { grid-column: 1 / -1; }
.sx-form-grid > .sx-span-2 { grid-column: span 2; }
.sx-form-grid + .sx-form-grid,
.sx-form-grid + .sx-section-title,
.sx-form-grid + .os-form-title { margin-top: 20px; }

/* Aceleasi clase ca in modalele paginii de comanda (order_page_nou.css), acum globale */
.os-form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.os-form-col { min-width: 0; padding: 2px 22px 4px; }
.os-form-col:first-of-type { padding-left: 2px; border-right: 1px solid var(--os-divider); }
.os-form-col:last-of-type { padding-right: 2px; }
.os-form-title {
  margin-bottom: 12px;
  color: var(--os-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.os-form-title--spaced { margin-top: 24px; }
.os-form-stack { display: flex; flex-direction: column; gap: 12px; }
.os-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }

/* Titlu de sectiune (in card sau intre carduri) */
.sx-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--os-text) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.35;
}
.sx-section-title > .ti { color: var(--os-muted); font-size: 16px; }
.sx-section-title .os-count { margin-left: 2px; }
.sx-section-sub { margin: -6px 0 12px; color: var(--os-muted); font-size: 12.5px; }

/* Camp + buton alaturat (ex. CUI + "Preia de la ANAF") */
.sx-input-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sx-input-row > .form-control,
.sx-input-row > .form-select,
.sx-input-row > .sx-dd-btn { flex: 1 1 auto; width: auto; min-width: 0; }
.sx-input-row > .btn.os-btn { flex: 0 0 auto; height: 34px; }
.sx-input-row > .os-icon-btn { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--os-border); background: var(--os-card); font-size: 15px; }

/* Bara de actiuni lipita de marginea de jos (formulare lungi). Nu se pune intr-un .os-card (overflow: hidden). */
.sx-actions-bar {
  position: sticky;
  bottom: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius);
  background: var(--os-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.sx-actions-bar-info { flex: 1 1 auto; min-width: 0; margin-right: auto; color: var(--os-muted); font-size: 12.5px; }
.sx-actions-bar-info strong { color: var(--os-text); font-weight: 650; font-variant-numeric: tabular-nums; }
@media (min-width: 992px) {
  .sx-actions-bar { bottom: 16px; }
}

/* ---- Campuri Bootstrap (.form-control, .form-select, textarea, fisier, input-group) ---- */
.sx-page,
.sx-shell .modal {
  --bs-form-invalid-color: var(--os-danger);
  --bs-form-invalid-border-color: var(--os-danger);
  --bs-form-valid-color: var(--os-success);
  --bs-form-valid-border-color: var(--os-success);
}
:where(.sx-page, .sx-shell .modal) .form-label {
  margin-bottom: 5px;
  color: var(--os-text);
  font-size: 12.5px;
  font-weight: 550;
}
:where(.sx-page, .sx-shell .modal) .form-label:is(.fw-bold, .fw-bolder, .fw-semibold),
:where(.sx-page, .sx-shell .modal) label.fw-bold { font-weight: 550 !important; }
:where(.sx-page, .sx-shell .modal) .form-text { margin-top: 4px; color: var(--os-muted); font-size: 12px; }
:where(.sx-page, .sx-shell .modal) .invalid-feedback,
:where(.sx-page, .sx-shell .modal) .valid-feedback { margin-top: 4px; font-size: 12px; }

:where(.sx-page, .sx-shell .modal) .form-control,
:where(.sx-page, .sx-shell .modal) .form-select {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--os-border);
  border-radius: 8px;
  background-color: var(--os-card);
  color: var(--os-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  box-shadow: none;
}
:where(.sx-page, .sx-shell .modal) .form-select {
  padding-right: 30px;
  background-position: right 10px center;
  background-size: 12px 9px;
  cursor: pointer;
}
:where(.sx-page, .sx-shell .modal) .form-control:hover:not(:focus):not(:disabled):not(.is-invalid),
:where(.sx-page, .sx-shell .modal) .form-select:hover:not(:focus):not(:disabled):not(.is-invalid) { border-color: #cfcfcf; }
[data-bs-theme="dark"] :where(.sx-page, .sx-shell .modal) .form-control:hover:not(:focus):not(:disabled):not(.is-invalid),
[data-bs-theme="dark"] :where(.sx-page, .sx-shell .modal) .form-select:hover:not(:focus):not(:disabled):not(.is-invalid) { border-color: #3a3a42; }
:where(.sx-page, .sx-shell .modal) .form-control:focus,
:where(.sx-page, .sx-shell .modal) .form-select:focus {
  border-color: var(--os-link);
  background-color: var(--os-card);
  color: var(--os-text);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 91, 211, .12);
}
:where(.sx-page, .sx-shell .modal) .form-control::placeholder { color: var(--os-subtle); opacity: 1; }
:where(.sx-page, .sx-shell .modal) .form-control:disabled,
:where(.sx-page, .sx-shell .modal) .form-select:disabled {
  border-color: var(--os-border);
  background-color: var(--os-hover);
  color: var(--os-subtle);
  cursor: default;
}
/* Variantele Metronic "solid" (fundal gri) devin campuri normale */
:where(.sx-page, .sx-shell .modal) .form-control.form-control-solid,
:where(.sx-page, .sx-shell .modal) .form-select.form-select-solid {
  border-color: var(--os-border);
  background-color: var(--os-card);
  color: var(--os-text);
}
:where(.sx-page, .sx-shell .modal) .form-control.form-control-solid:focus,
:where(.sx-page, .sx-shell .modal) .form-select.form-select-solid:focus {
  border-color: var(--os-link) !important;
  background-color: var(--os-card);
  color: var(--os-text);
}
:where(.sx-page, .sx-shell .modal) .form-control.form-control-solid::placeholder { color: var(--os-subtle); }
/* Marimi */
:where(.sx-page, .sx-shell .modal) .form-control-sm,
:where(.sx-page, .sx-shell .modal) .form-select-sm { min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 12.5px; line-height: 20px; }
:where(.sx-page, .sx-shell .modal) .form-control-sm { padding-left: 9px; padding-right: 9px; }
:where(.sx-page, .sx-shell .modal) .form-select-sm { padding-left: 9px; padding-right: 28px; }
:where(.sx-page, .sx-shell .modal) .form-control-lg,
:where(.sx-page, .sx-shell .modal) .form-select-lg { min-height: 40px; padding-top: 8px; padding-bottom: 8px; border-radius: 10px; font-size: 15px; line-height: 22px; }
:where(.sx-page, .sx-shell .modal) .form-control-lg { padding-left: 12px; padding-right: 12px; }
:where(.sx-page, .sx-shell .modal) textarea.form-control { min-height: 64px; line-height: 1.45; resize: vertical; }
:where(.sx-page, .sx-shell .modal) .form-select[multiple],
:where(.sx-page, .sx-shell .modal) .form-select[size]:not([size="1"]) { padding-right: 10px; background-image: none; }
/* Fisier */
:where(.sx-page, .sx-shell .modal) .form-control[type="file"] { overflow: hidden; cursor: pointer; }
:where(.sx-page, .sx-shell .modal) .form-control::file-selector-button {
  margin: -6px 10px -6px -10px;
  padding: 6px 12px;
  border: 0;
  border-inline-end: 1px solid var(--os-border);
  border-radius: 0;
  background-color: var(--os-hover);
  color: var(--os-text);
  font-weight: 550;
}
:where(.sx-page, .sx-shell .modal) .form-control:hover:not(:disabled):not([readonly])::file-selector-button { background-color: var(--os-press); }
:where(.sx-page, .sx-shell .modal) .form-control-sm::file-selector-button { margin: -4px 9px -4px -9px; padding: 4px 10px; }
/* Grup (camp + text / iconita) — colturile alaturate le uneste Bootstrap */
:where(.sx-page, .sx-shell .modal) .input-group-text {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--os-border);
  border-radius: 8px;
  background-color: var(--os-hover);
  color: var(--os-muted);
  font-size: 12.5px;
  font-weight: 550;
}
:where(.sx-page, .sx-shell .modal) .input-group-text.cursor-pointer:hover { background-color: var(--os-press); color: var(--os-text); }
:where(.sx-page, .sx-shell .modal) .input-group-sm > .input-group-text { min-height: 30px; padding: 0 9px; font-size: 12px; }
:where(.sx-page, .sx-shell .modal) .input-group > .btn:not(.os-btn):not(.btn-icon):not(.btn-link) {
  min-height: 34px;
  padding: 0 12px !important;
  border: 1px solid var(--os-border) !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
  font-size: 12.5px !important;
  font-weight: 550 !important;
  box-shadow: none !important;
}
:where(.sx-page, .sx-shell .modal) .input-group > .btn:not(.os-btn):not(.btn-icon):not(.btn-link):hover { background: var(--os-hover) !important; }

/* ---- Bife, butoane radio, comutatoare ---- */
:where(.sx-page, .sx-shell .modal) .form-check { min-height: 20px; margin-bottom: 0; padding-left: 24px; }
:where(.sx-page, .sx-shell .modal) .form-check-input {
  width: 16px;
  height: 16px;
  margin-top: 0;
  border: 1px solid var(--os-subtle);
  background-color: var(--os-card);
  vertical-align: middle;
  cursor: pointer;
  box-shadow: none;
}
:where(.sx-page, .sx-shell .modal) .form-check-input[type="checkbox"] { border-radius: 4px; }
:where(.sx-page, .sx-shell .modal) .form-check-input[type="radio"] { border-radius: 50%; }
:where(.sx-page, .sx-shell .modal) .form-check .form-check-input { float: left; margin-top: 2px; margin-left: -24px; }
:where(.sx-page, .sx-shell .modal) .form-check-input:focus { border-color: var(--os-subtle); box-shadow: none; }
:where(.sx-page, .sx-shell .modal) .form-check-input:focus-visible { box-shadow: 0 0 0 3px rgba(0, 91, 211, .18); }
:where(.sx-page, .sx-shell .modal) .form-check-input:checked,
:where(.sx-page, .sx-shell .modal) .form-check-input:indeterminate { border-color: var(--os-primary); background-color: var(--os-primary); }
:where(.sx-page, .sx-shell .modal) .form-check-input:disabled { opacity: .45; }
:where(.sx-page, .sx-shell .modal) .form-check-label { color: var(--os-text); font-size: 13px; cursor: pointer; }
/* Metronic: .form-check-custom (flex) si .form-check-solid (fara bordura, fundal gri) */
:where(.sx-page, .sx-shell .modal) .form-check.form-check-custom { display: flex; align-items: center; padding-left: 0; }
:where(.sx-page, .sx-shell .modal) .form-check-custom .form-check-input { float: none; margin: 0; }
:where(.sx-page, .sx-shell .modal) .form-check-custom .form-check-label { margin-left: 8px; }
:where(.sx-page, .sx-shell .modal) .form-check.form-check-solid .form-check-input { border: 1px solid var(--os-subtle); }
:where(.sx-page, .sx-shell .modal) .form-check.form-check-solid .form-check-input:not(:checked) { background-color: var(--os-card); }
:where(.sx-page, .sx-shell .modal) .form-check.form-check-solid .form-check-input:checked { border-color: var(--os-primary); }
/* Comutator 34 x 20 */
:where(.sx-page, .sx-shell .modal) .form-switch { padding-left: 44px; }
:where(.sx-page, .sx-shell .modal) .form-switch .form-check-input,
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom .form-check-input,
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom.form-switch-sm .form-check-input,
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom.form-switch-lg .form-check-input {
  width: 34px;
  height: 20px;
  margin-left: -44px;
  border-radius: 999px;
}
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom { padding-left: 0; }
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom .form-check-input,
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom.form-switch-sm .form-check-input,
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-custom.form-switch-lg .form-check-input { margin: 0; }
:where(.sx-page, .sx-shell .modal) .form-switch.form-check-solid .form-check-input:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
  background-color: var(--os-card);
}
/* .os-switch (ca in modalele paginii de comanda): dupa regulile generale, ca sa castige */
.os-switch { display: flex; align-items: center; gap: 10px; min-height: 0; margin: 16px 0 0; padding-left: 0; }
.os-switch .form-check-input { float: none; width: 34px; height: 20px; margin: 0; cursor: pointer; }
.os-switch .form-check-input:checked { border-color: var(--os-primary); background-color: var(--os-primary); }
.os-switch .form-check-label { color: var(--os-text); font-size: 13px; cursor: pointer; }
/* Mod intunecat: butonul principal e deschis la culoare -> bifa / punctul / butonul comutatorului devin inchise */
[data-bs-theme="dark"] :where(.sx-page, .sx-shell .modal) .form-check-input:checked[type="checkbox"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11' width='13' height='11' fill='none'%3e%3cpath d='M11.0426 1.02893C11.3258 0.695792 11.8254 0.655283 12.1585 0.938451C12.4917 1.22162 12.5322 1.72124 12.249 2.05437L5.51985 9.97104C5.23224 10.3094 4.72261 10.3451 4.3907 10.05L0.828197 6.88335C0.50141 6.59288 0.471975 6.09249 0.762452 5.7657C1.05293 5.43891 1.55332 5.40948 1.88011 5.69995L4.83765 8.32889L11.0426 1.02893Z' fill='%23131316'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] :where(.sx-page, .sx-shell .modal) .form-check-input:checked[type="radio"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23131316'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] :where(.sx-page, .sx-shell .modal) .form-switch .form-check-input:checked {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23131316'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] :where(.sx-page, .sx-shell .modal) .form-switch.form-check-solid .form-check-input:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
}

/* ---- Select2 (camp inchis) in pagini noi si modale ---- */
:where(.sx-page, .sx-shell .modal) .select2-container .select2-selection {
  min-height: 34px;
  border: 1px solid var(--os-border) !important;
  border-radius: 8px !important;
  background-color: var(--os-card) !important;
  box-shadow: none !important;
  font-size: 13px;
}
:where(.sx-page, .sx-shell .modal) .select2-container .select2-selection--single { padding: 6px 30px 6px 10px; }
:where(.sx-page, .sx-shell .modal) .select2-container .select2-selection--single.form-select-sm { min-height: 30px; padding: 4px 28px 4px 9px; font-size: 12.5px; }
:where(.sx-page, .sx-shell .modal) .select2-container .select2-selection__rendered { color: var(--os-text) !important; line-height: 20px !important; }
:where(.sx-page, .sx-shell .modal) .select2-container .select2-selection__placeholder { color: var(--os-subtle) !important; }
:where(.sx-page, .sx-shell .modal) .select2-container--open .select2-selection,
:where(.sx-page, .sx-shell .modal) .select2-container--focus .select2-selection {
  border-color: var(--os-link) !important;
  box-shadow: 0 0 0 3px rgba(0, 91, 211, .12) !important;
}
:where(.sx-page, .sx-shell .modal) .select2-selection--multiple .select2-selection__choice {
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--os-neutral-bg) !important;
  color: var(--os-neutral-fg) !important;
  font-size: 12px;
}

/* Lista Select2: in modale (dropdownParent) si, pe paginile noi, cea atasata de body.
   Reguli separate: un browser fara :has() ignora doar a doua regula. */
.sx-shell .modal .select2-dropdown {
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 12px !important;
  background: var(--os-card) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16) !important;
}
.sx-shell .modal .select2-search--dropdown { padding: 8px 8px 2px !important; }
.sx-shell .modal .select2-search--dropdown .select2-search__field {
  height: 32px;
  padding: 0 10px !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 8px !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
  font-size: 13px !important;
}
.sx-shell .modal .select2-results__options { padding: 6px !important; }
.sx-shell .modal .select2-results__option {
  margin: 0 !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  color: var(--os-text) !important;
  font-size: 13px !important;
}
.sx-shell .modal .select2-results__option--highlighted { background: var(--os-hover) !important; color: var(--os-text) !important; }
.sx-shell .modal .select2-results__option--selected,
.sx-shell .modal .select2-results__option[aria-selected="true"] { background: transparent !important; font-weight: 600; }
.sx-shell .modal .select2-results__option--selected.select2-results__option--highlighted { background: var(--os-hover) !important; }

.sx-shell:has(.sx-page) > .select2-container .select2-dropdown {
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 12px !important;
  background: var(--os-card) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16) !important;
}
.sx-shell:has(.sx-page) > .select2-container .select2-search--dropdown { padding: 8px 8px 2px !important; }
.sx-shell:has(.sx-page) > .select2-container .select2-search__field {
  height: 32px;
  padding: 0 10px !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 8px !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
  font-size: 13px !important;
}
.sx-shell:has(.sx-page) > .select2-container .select2-results__options { padding: 6px !important; }
.sx-shell:has(.sx-page) > .select2-container .select2-results__option {
  margin: 0 !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  color: var(--os-text) !important;
  font-size: 13px !important;
}
.sx-shell:has(.sx-page) > .select2-container .select2-results__option--highlighted { background: var(--os-hover) !important; color: var(--os-text) !important; }
.sx-shell:has(.sx-page) > .select2-container .select2-results__option--selected,
.sx-shell:has(.sx-page) > .select2-container .select2-results__option[aria-selected="true"] { background: transparent !important; font-weight: 600; }
.sx-shell:has(.sx-page) > .select2-container .select2-results__option--selected.select2-results__option--highlighted { background: var(--os-hover) !important; }

/* ---- Modale Bootstrap: aceeasi rama pe toate paginile (ca pe pagina de comanda) ---- */
.sx-shell .modal {
  --bs-modal-color: var(--os-text);
  --bs-modal-bg: var(--os-card);
  --bs-modal-border-color: var(--os-border);
  --bs-modal-border-width: 1px;
  --bs-modal-border-radius: 14px;
  --bs-modal-inner-border-radius: 13px;
  --bs-modal-box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
  --bs-modal-padding: 18px;
  --bs-modal-header-padding-x: 18px;
  --bs-modal-header-padding-y: 14px;
  --bs-modal-header-padding: 14px 18px;
  --bs-modal-header-border-color: var(--os-divider);
  --bs-modal-header-border-width: 1px;
  --bs-modal-title-line-height: 1.35;
  --bs-modal-footer-gap: 8px;
  --bs-modal-footer-border-color: var(--os-divider);
  --bs-modal-footer-border-width: 1px;
}
.sx-shell .modal-content { font-family: var(--os-font); }
.sx-shell .modal-header { gap: 12px; }
.sx-shell .modal-title,
.sx-shell .modal-header > :is(h1, h2, h3, h4) {
  margin: 0;
  color: var(--os-text);
  font-size: 15px !important;
  font-weight: 650 !important;
  letter-spacing: -.005em;
  line-height: 1.35;
}
.sx-shell .modal-body { font-size: 13px; }
.sx-shell .modal-footer { gap: 8px; padding: 12px 18px; }
.sx-shell .modal-footer > * { margin: 0; }

/* Butonul de inchidere: .btn-close (Bootstrap) sau .btn.btn-icon (Metronic) -> buton rotund discret */
.sx-shell .modal-header .btn-close {
  box-sizing: border-box;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: -4px -6px -4px auto;
  padding: 0;
  border-radius: 50%;
  background-size: 10px auto;
  opacity: .5;
}
.sx-shell .modal-header .btn-close:hover { opacity: .85; }
.sx-shell .modal-header .btn-close:focus { box-shadow: 0 0 0 3px rgba(0, 91, 211, .18); }
.sx-shell .modal-header .btn.btn-icon[data-bs-dismiss="modal"] {
  flex: 0 0 28px;
  width: 28px !important;
  height: 28px !important;
  margin: -4px -6px -4px auto !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: var(--os-muted) !important;
}
.sx-shell .modal-header .btn.btn-icon[data-bs-dismiss="modal"]:hover { background: var(--os-hover) !important; color: var(--os-text) !important; }
.sx-shell .modal-header .btn.btn-icon[data-bs-dismiss="modal"] :is(i, .svg-icon) { color: inherit !important; font-size: 18px !important; }

/* Butoanele vechi din subsol -> butoane pastila (ca in order_page_nou.css) */
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px !important;
  border: 1px solid var(--os-border) !important;
  border-radius: 999px !important;
  background: var(--os-card) !important;
  color: var(--os-text) !important;
  font-family: var(--os-font);
  font-size: 12.5px !important;
  font-weight: 550 !important;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none !important;
}
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link) i { padding: 0; color: inherit !important; font-size: 12px; }
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link):hover { background: var(--os-hover) !important; }
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link):disabled { opacity: .55; }
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link):is(.btn-primary, .btn-success, .btn-dark, .btn-info, .btn-warning) {
  border-color: var(--os-primary) !important;
  background: var(--os-primary) !important;
  color: var(--os-primary-text) !important;
}
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link):is(.btn-primary, .btn-success, .btn-dark, .btn-info, .btn-warning):hover {
  border-color: var(--os-primary-hover) !important;
  background: var(--os-primary-hover) !important;
}
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link).btn-danger {
  border-color: var(--os-danger) !important;
  background: var(--os-danger) !important;
  color: #fff !important;
}
.sx-shell .modal-footer .btn:not(.os-btn):not(.btn-icon):not(.btn-link).btn-danger:hover { filter: brightness(.94); }

/* ---- Alerte Bootstrap -> aspect de banner (.os-banner) ---- */
:is(.sx-page, .sx-shell .modal) .alert {
  --bs-alert-padding-x: 14px;
  --bs-alert-padding-y: 12px;
  --bs-alert-border-radius: var(--os-radius);
  --bs-alert-border-color: transparent;
  --bs-alert-link-color: inherit;
  --bs-alert-bg: var(--os-neutral-bg);
  --bs-alert-color: var(--os-neutral-fg);
  border: 0;
  border-radius: var(--os-radius);
  background-color: var(--bs-alert-bg);
  color: var(--bs-alert-color);
  font-size: 13px;
  line-height: 1.45;
}
:is(.sx-page, .sx-shell .modal) :is(.alert-success, .alert-light-success) { --bs-alert-bg: var(--os-success-bg); --bs-alert-color: var(--os-success-fg); }
:is(.sx-page, .sx-shell .modal) :is(.alert-warning, .alert-light-warning) { --bs-alert-bg: var(--os-warning-bg); --bs-alert-color: var(--os-warning-fg); }
:is(.sx-page, .sx-shell .modal) :is(.alert-danger, .alert-light-danger) { --bs-alert-bg: var(--os-danger-bg); --bs-alert-color: var(--os-danger-fg); }
:is(.sx-page, .sx-shell .modal) :is(.alert-info, .alert-primary, .alert-light-info, .alert-light-primary) { --bs-alert-bg: var(--os-info-bg); --bs-alert-color: var(--os-info-fg); }
:is(.sx-page, .sx-shell .modal) .alert .alert-heading { margin-bottom: 2px; color: inherit; font-size: 13.5px; font-weight: 650; }
:is(.sx-page, .sx-shell .modal) .alert .alert-link { color: inherit; font-weight: 600; text-decoration: underline; }
:is(.sx-page, .sx-shell .modal) .text-muted { color: var(--os-muted) !important; }

/* ---- Tabele Bootstrap (.table) in pagini noi -> aspect .os-table ----
   Rezerva pentru tabelele generate din JS. Dublarea .table.table bate regulile Metronic
   (.table:not(.table-bordered) td:first-child etc.). Nu se combina .table cu .os-table. */
:is(.sx-page, .sx-modal) .table {
  --bs-table-color: var(--os-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--os-divider);
  --bs-table-accent-bg: transparent;
  --bs-table-striped-color: var(--os-text);
  --bs-table-striped-bg: var(--os-hover);
  --bs-table-active-color: var(--os-text);
  --bs-table-active-bg: var(--os-press);
  --bs-table-hover-color: var(--os-text);
  --bs-table-hover-bg: var(--os-hover);
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
  color: var(--os-text);
  font-size: 13px;
  vertical-align: middle;
}
:is(.sx-page, .sx-modal) .table.table > :is(thead, tbody, tfoot),
:is(.sx-page, .sx-modal) .table.table > :is(thead, tbody, tfoot) > tr { border: 0; }
:is(.sx-page, .sx-modal) .table.table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
  padding: 10px 16px;
  border-width: 1px 0 0;
  border-style: solid;
  border-color: var(--os-divider);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
:is(.sx-page, .sx-modal) .table.table > thead > tr > :is(th, td) {
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 0;
  background-color: var(--os-hover);
  color: var(--os-muted);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
:is(.sx-page, .sx-modal) .table.table > tbody > tr:hover > :is(th, td) { background-color: var(--os-hover); }
:is(.sx-page, .sx-modal) .table.table > tfoot > tr > :is(th, td) { font-weight: 600; }
:is(.sx-page, .sx-modal) .table.table.table-sm > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding: 6px 12px; }
:is(.sx-page, .sx-modal) .table.table.table-borderless > :is(thead, tbody, tfoot) > tr > :is(th, td) { border-top: 0; }
:is(.sx-page, .sx-modal) .table-responsive { overflow-x: auto; }

/* ---- DataTables 1.13 (bootstrap5) in pagini noi: tabelul se pune direct in .os-card ---- */
.sx-page div.dataTables_wrapper > .row { margin: 0; align-items: center; }
.sx-page div.dataTables_wrapper > .row > [class*="col-"] { padding: 0; }
.sx-page div.dataTables_wrapper > .row:has(.dataTables_length, .dataTables_filter) { border-bottom: 1px solid var(--os-divider); }
.sx-page div.dataTables_wrapper > .row:has(.dataTables_info, .dataTables_paginate) { border-top: 1px solid var(--os-divider); }
.sx-page div.dataTables_wrapper div.dataTables_length,
.sx-page div.dataTables_wrapper div.dataTables_filter { padding: 10px 12px; }
.sx-page div.dataTables_wrapper div.dataTables_length label { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--os-muted); font-size: 12.5px; font-weight: 400; }
.sx-page div.dataTables_wrapper div.dataTables_length select {
  width: auto;
  height: 30px;
  min-height: 30px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--os-border);
  border-radius: 999px;
  background-color: var(--os-card);
  background-position: right 10px center;
  background-size: 11px 8px;
  color: var(--os-text);
  font-size: 12px;
  font-weight: 550;
  line-height: 28px;
}
.sx-page div.dataTables_wrapper div.dataTables_filter label { margin: 0; font-size: 0; }
.sx-page div.dataTables_wrapper div.dataTables_filter input {
  width: 260px;
  max-width: 100%;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 10px 0 34px;
  border: 1px solid var(--os-border);
  border-radius: 8px;
  background: var(--os-card) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0'/%3e%3cpath d='M21 21l-6 -6'/%3e%3c/svg%3e") no-repeat 11px center / 15px 15px;
  color: var(--os-text);
  font-size: 13px;
}
.sx-page div.dataTables_wrapper div.dataTables_filter input:focus { border-color: var(--os-link); box-shadow: 0 0 0 3px rgba(0, 91, 211, .12); }
.sx-page div.dataTables_wrapper div.dataTables_info {
  display: block;
  padding: 12px 16px;
  color: var(--os-muted);
  font-size: 12.5px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.sx-page div.dataTables_wrapper div.dataTables_paginate { margin: 0; padding: 10px 16px; }
.sx-page div.dataTables_wrapper div.dataTables_paginate ul.pagination { margin: 0; }
.sx-page table.dataTable { margin: 0 !important; }
.sx-page table.dataTable > thead > tr > :is(th, td) {
  padding: 8px 16px;
  border-top: 0;
  border-bottom: 0;
  background-color: var(--os-hover);
  color: var(--os-muted);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.sx-page table.dataTable > thead > tr > :is(th, td):is(.sorting, .sorting_asc, .sorting_desc) { padding-right: 16px; cursor: pointer; }
.sx-page table.dataTable > thead > tr > :is(th, td):is(.sorting, .sorting_asc, .sorting_desc):hover,
.sx-page table.dataTable > thead > tr > :is(th, td):is(.sorting_asc, .sorting_desc) { color: var(--os-text); }
.sx-page table.dataTable > thead .sorting_asc::after,
.sx-page table.dataTable > thead .sorting_desc::after { width: 10px; height: 10px; margin-left: 4px; background-color: var(--os-text); vertical-align: -1px; }
.sx-page table.dataTable > tbody > tr > :is(th, td) {
  padding: 10px 16px;
  border-top: 1px solid var(--os-divider);
  border-bottom: 0;
  color: var(--os-text);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.sx-page table.dataTable > tbody > tr:hover > :is(th, td) { background-color: var(--os-hover); }
.sx-page table.dataTable td.dataTables_empty { padding: 20px 16px; color: var(--os-muted); font-size: 12.5px; text-align: center; }
/* "Se proceseaza": bara subtire de progres pe marginea de sus (ca .os-card.is-busy), datele raman estompate */
.sx-page div.dataTables_wrapper div.dataTables_processing {
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  width: auto;
  height: 2px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  transform: none;
}
.sx-page div.dataTables_wrapper div.dataTables_processing > div { display: none; }
.sx-page div.dataTables_wrapper div.dataTables_processing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 35%;
  height: 2px;
  border-radius: 2px;
  background: var(--os-link);
  animation: sx-progress 1.1s ease-in-out infinite;
}
.sx-page div.dataTables_wrapper:has(div.dataTables_processing[style*="block"]) table.dataTable > tbody { opacity: .5; transition: opacity .15s ease; }
@media (prefers-reduced-motion: reduce) {
  .sx-page div.dataTables_wrapper div.dataTables_processing::before { width: 100%; animation: none; opacity: .6; }
}

/* ---- Taburi Bootstrap (.nav-tabs / .nav-pills) -> aspect .sx-tabs ----
   .sx-tabs merge si cu pluginul Tab din Bootstrap: <button class="nav-link" data-bs-toggle="tab">, .active */
:is(.sx-page, .sx-modal) .nav-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin: 0;
  padding: 8px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--os-divider);
  list-style: none;
  scrollbar-width: none;
}
:is(.sx-page, .sx-modal) .nav-tabs::-webkit-scrollbar { display: none; }
:is(.sx-page, .sx-modal) .nav-pills { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; border: 0; list-style: none; }
.sx-tabs.nav, ul.sx-tabs { flex-wrap: nowrap; margin: 0; list-style: none; }
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) .nav-item,
.sx-tabs .nav-item { margin: 0; }
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) .nav-link,
.sx-tabs .nav-link,
.sx-tabs > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--os-muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) .nav-link:hover,
.sx-tabs .nav-link:hover,
.sx-tabs > a:hover { background: var(--os-hover); color: var(--os-text); text-decoration: none; }
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) :is(.nav-link.active, .nav-item.show .nav-link),
.sx-tabs :is(.nav-link.active, button.active),
.sx-tabs > a:is(.active, .is-active) { background: var(--os-neutral-bg); color: var(--os-text); }
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) .nav-link:is(.disabled, :disabled) { opacity: .5; pointer-events: none; }
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) .nav-link i,
.sx-tabs .nav-link i { color: inherit; font-size: 14px; }
:is(.sx-page, .sx-modal) :is(.nav-tabs, .nav-pills) .nav-link :is(.os-count, .badge),
.sx-tabs .nav-link .os-count {
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  background: transparent;
  color: var(--os-subtle);
  font-size: 11.5px;
}

/* ---- Paginare Bootstrap (.pagination, inclusiv DataTables) -> butoane rotunde ca .sx-pager ---- */
:is(.sx-page, .sx-modal) .pagination {
  --bs-pagination-padding-x: 9px;
  --bs-pagination-padding-y: 0;
  --bs-pagination-font-size: 12.5px;
  --bs-pagination-color: var(--os-text);
  --bs-pagination-bg: var(--os-card);
  --bs-pagination-border-width: 1px;
  --bs-pagination-border-color: var(--os-border);
  --bs-pagination-border-radius: 999px;
  --bs-pagination-hover-color: var(--os-text);
  --bs-pagination-hover-bg: var(--os-hover);
  --bs-pagination-hover-border-color: var(--os-border);
  --bs-pagination-focus-color: var(--os-text);
  --bs-pagination-focus-bg: var(--os-hover);
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(0, 91, 211, .18);
  --bs-pagination-active-color: var(--os-primary-text);
  --bs-pagination-active-bg: var(--os-primary);
  --bs-pagination-active-border-color: var(--os-primary);
  --bs-pagination-disabled-color: var(--os-subtle);
  --bs-pagination-disabled-bg: var(--os-card);
  --bs-pagination-disabled-border-color: var(--os-border);
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}
:is(.sx-page, .sx-modal) .pagination .page-item { margin: 0; }
:is(.sx-page, .sx-modal) .pagination .page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--bs-pagination-border-color);
  border-radius: 999px;
  background-color: var(--bs-pagination-bg);
  color: var(--bs-pagination-color);
  font-size: 12.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}
:is(.sx-page, .sx-modal) .pagination .page-item:not(.active):not(.disabled) .page-link:hover { background-color: var(--os-hover); }
:is(.sx-page, .sx-modal) .pagination .page-item .page-link:focus-visible { box-shadow: 0 0 0 3px rgba(0, 91, 211, .18); }
:is(.sx-page, .sx-modal) .pagination .page-item.active .page-link,
:is(.sx-page, .sx-modal) .pagination .page-link.active {
  border-color: var(--os-primary);
  background-color: var(--os-primary);
  color: var(--os-primary-text);
}
:is(.sx-page, .sx-modal) .pagination .page-item.disabled .page-link,
:is(.sx-page, .sx-modal) .pagination .page-link.disabled { color: var(--os-subtle); opacity: .55; pointer-events: none; }
:is(.sx-page, .sx-modal) .pagination .page-link :is(.previous, .next) { background-color: currentColor; }

/* ---- Insigne Bootstrap / Metronic (.badge) -> pastile .os-pill (rezerva pentru insignele generate din JS) ---- */
:where(.sx-page, .sx-modal) .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background-color: var(--os-neutral-bg);
  color: var(--os-neutral-fg);
  font-family: var(--os-font);
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
:where(.sx-page, .sx-modal) .badge i { color: inherit; font-size: 10px; }
:where(.sx-page, .sx-modal) .badge:is(.badge-success, .badge-light-success, .bg-success, .bg-light-success, .text-bg-success) {
  background-color: var(--os-success-bg) !important;
  color: var(--os-success-fg) !important;
}
:where(.sx-page, .sx-modal) .badge:is(.badge-warning, .badge-light-warning, .bg-warning, .bg-light-warning, .text-bg-warning) {
  background-color: var(--os-warning-bg) !important;
  color: var(--os-warning-fg) !important;
}
:where(.sx-page, .sx-modal) .badge:is(.badge-danger, .badge-light-danger, .bg-danger, .bg-light-danger, .text-bg-danger) {
  background-color: var(--os-danger-bg) !important;
  color: var(--os-danger-fg) !important;
}
:where(.sx-page, .sx-modal) .badge:is(.badge-info, .badge-light-info, .bg-info, .bg-light-info, .text-bg-info,
  .badge-primary, .badge-light-primary, .bg-primary, .bg-light-primary, .text-bg-primary) {
  background-color: var(--os-info-bg) !important;
  color: var(--os-info-fg) !important;
}
:where(.sx-page, .sx-modal) .badge:is(.badge-secondary, .badge-light-secondary, .badge-light, .badge-light-dark, .badge-dark,
  .bg-secondary, .bg-light, .bg-dark, .bg-light-dark, .text-bg-secondary, .text-bg-light, .text-bg-dark) {
  background-color: var(--os-neutral-bg) !important;
  color: var(--os-neutral-fg) !important;
}
:where(.sx-page, .sx-modal) .badge.badge-sm { min-height: 18px; padding: 0 6px; font-size: 11px; }
:where(.sx-page, .sx-modal) .badge.badge-lg { min-height: 26px; padding: 0 10px; font-size: 13px; }
:where(.sx-page, .sx-modal) .badge:is(.badge-circle, .badge-square) { justify-content: center; width: 22px; min-width: 22px; height: 22px; padding: 0; }
:where(.sx-page, .sx-modal) .badge.badge-square { border-radius: 6px; }

/* ---- Meniuri Bootstrap (.dropdown-menu) si bare de progres ---- */
:where(.sx-page, .sx-modal) .dropdown-menu {
  --bs-dropdown-bg: var(--os-card);
  --bs-dropdown-color: var(--os-text);
  --bs-dropdown-border-color: var(--os-border);
  --bs-dropdown-border-width: 1px;
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-padding-x: 6px;
  --bs-dropdown-padding-y: 6px;
  --bs-dropdown-font-size: 13px;
  --bs-dropdown-box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
  --bs-dropdown-divider-bg: var(--os-divider);
  --bs-dropdown-link-color: var(--os-text);
  --bs-dropdown-link-hover-color: var(--os-text);
  --bs-dropdown-link-hover-bg: var(--os-hover);
  --bs-dropdown-link-active-color: var(--os-text);
  --bs-dropdown-link-active-bg: var(--os-press);
  --bs-dropdown-item-padding-x: 10px;
  --bs-dropdown-item-padding-y: 6px;
  --bs-dropdown-item-border-radius: 8px;
  border: 1px solid var(--os-border);
  box-shadow: var(--bs-dropdown-box-shadow);
  font-family: var(--os-font);
}
:where(.sx-page, .sx-modal) .dropdown-item { border-radius: 8px; text-decoration: none !important; }
:where(.sx-page, .sx-modal) .progress {
  --bs-progress-height: 6px;
  --bs-progress-bg: var(--os-hover);
  --bs-progress-border-radius: 999px;
  --bs-progress-bar-bg: var(--os-text);
  box-shadow: none;
}

/* ---- Statistici mici (dale) ---- */
.sx-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sx-stat {
  display: block;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius);
  background: var(--os-card);
  color: var(--os-text);
  text-align: left;
}
.sx-stat--soft { border-color: transparent; background: var(--os-hover); }
.sx-stat-label { overflow: hidden; color: var(--os-muted); font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.sx-stat-value {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-top: 2px;
  color: var(--os-text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sx-stat-sub { margin-top: 2px; color: var(--os-subtle); font-size: 11.5px; }
.sx-stat--success .sx-stat-value { color: var(--os-success); }
.sx-stat--danger .sx-stat-value { color: var(--os-danger); }
.sx-stat--warning .sx-stat-value { color: var(--os-attention-fg); }
.sx-stat--info .sx-stat-value { color: var(--os-info-fg); }
a.sx-stat, button.sx-stat { color: var(--os-text) !important; cursor: pointer; text-decoration: none !important; transition: background .12s ease, border-color .12s ease; }
a.sx-stat:hover, button.sx-stat:hover { border-color: #cfcfcf; background: var(--os-hover); }
.sx-stat.is-active { border-color: var(--os-text); }

/* ---- Lista de randuri (ca listele din wizardul de pregatire) ---- */
.sx-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.sx-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--os-divider);
  color: var(--os-text);
}
.sx-list-item:first-child { border-top: 0; }
a.sx-list-item, .sx-list-item.is-link { color: var(--os-text) !important; text-decoration: none !important; cursor: pointer; }
a.sx-list-item:hover, .sx-list-item.is-link:hover { background: var(--os-hover); }
.sx-list-item.is-active { background: var(--os-info-bg); }
.sx-list-item.is-done { opacity: .55; }
.sx-list-media {
  display: flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--os-divider);
  border-radius: 8px;
  background: var(--os-hover);
  color: var(--os-subtle);
  font-size: 17px;
}
.sx-list-media img { width: 100%; height: 100%; object-fit: cover; }
.sx-list-body { flex: 1 1 auto; min-width: 0; }
.sx-list-title { display: block; overflow-wrap: anywhere; font-weight: 600; line-height: 1.35; }
.sx-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; color: var(--os-muted); font-size: 12px; }
.sx-list-end { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.sx-list-item > .ti-chevron-right { flex: 0 0 auto; color: var(--os-subtle); }

/* ---- Perechi eticheta / valoare ---- */
.sx-kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13px; }
.sx-kv dt { color: var(--os-muted); font-weight: 400; }
.sx-kv dd { margin: 0; color: var(--os-text); overflow-wrap: anywhere; }

/* ---- Ecrane inguste ---- */
@media (max-width: 1100px) {
  .sx-cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-cards--aside { grid-template-columns: minmax(0, 1fr); }
  .sx-form-grid--3, .sx-form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sx-cards--2, .sx-cards--3 { grid-template-columns: minmax(0, 1fr); }
  .sx-form-grid, .sx-form-grid--3, .sx-form-grid--4, .os-form-grid { grid-template-columns: minmax(0, 1fr); }
  .sx-form-grid > .sx-span-2 { grid-column: auto; }
  .os-form-cols { grid-template-columns: minmax(0, 1fr); }
  .os-form-col, .os-form-col:first-of-type, .os-form-col:last-of-type { padding: 0; border-right: 0; }
  .os-form-col + .os-form-col { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--os-divider); }
  .sx-page div.dataTables_wrapper div.dataTables_filter input { width: 100%; }
  .sx-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sx-kv dd { margin-bottom: 8px; }
}
