/* MMS — tema interfeței (strat peste Bootstrap 5.3).
   Idee: consola unui depozit — cerneală bleumarin, galben „bandă de marcaj”
   folosit doar pentru ce e activ / important. */

:root,
[data-bs-theme="light"] {
  --mms-ink: #15233d;
  --mms-ink-2: #1d2f50;
  --mms-ink-line: #2a3d61;
  --mms-tape: #f5c518;
  --mms-tape-ink: #2b2200;
  --mms-canvas: #f2f4f7;
  --mms-surface: #ffffff;
  --mms-surface-2: #f7f8fa;
  --mms-line: #dde2ea;
  --mms-text: #1b2433;
  --mms-muted: #5d6b80;
  --mms-sidebar-w: 248px;
  --mms-topbar-h: 60px;

  --bs-body-font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: 0.9375rem;
  --bs-body-line-height: 1.5;
  --bs-body-color: var(--mms-text);
  --bs-body-bg: var(--mms-canvas);
  --bs-secondary-color: var(--mms-muted);
  --bs-tertiary-bg: var(--mms-surface-2);
  --bs-border-color: var(--mms-line);
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-border-radius-lg: 0.75rem;

  --bs-primary: #2047a8;
  --bs-primary-rgb: 32, 71, 168;
  --bs-primary-text-emphasis: #172f6e;
  --bs-primary-bg-subtle: #e4ebfa;
  --bs-primary-border-subtle: #b9c9ef;
  --bs-success: #188a5b;
  --bs-success-rgb: 24, 138, 91;
  --bs-success-bg-subtle: #e2f4ec;
  --bs-success-text-emphasis: #0f5c3c;
  --bs-warning: #c98a00;
  --bs-warning-rgb: 201, 138, 0;
  --bs-warning-bg-subtle: #fdf3d6;
  --bs-warning-text-emphasis: #6b4a00;
  --bs-danger: #c83e3e;
  --bs-danger-rgb: 200, 62, 62;
  --bs-danger-bg-subtle: #fbe6e6;
  --bs-danger-text-emphasis: #7d2121;
  --bs-info: #2a7fa8;
  --bs-info-rgb: 42, 127, 168;
  --bs-info-bg-subtle: #e2f1f8;
  --bs-info-text-emphasis: #17516d;
  --bs-link-color: #2047a8;
  --bs-link-color-rgb: 32, 71, 168;
  --bs-link-hover-color: #172f6e;
  --bs-focus-ring-color: rgba(245, 197, 24, 0.55);
}

[data-bs-theme="dark"] {
  --mms-ink: #0d1626;
  --mms-ink-2: #15223a;
  --mms-ink-line: #24375a;
  --mms-canvas: #0f1828;
  --mms-surface: #16223a;
  --mms-surface-2: #1b2945;
  --mms-line: #2a3b5c;
  --mms-text: #e3e8f0;
  --mms-muted: #9aa8bd;

  --bs-body-color: var(--mms-text);
  --bs-body-bg: var(--mms-canvas);
  --bs-secondary-color: var(--mms-muted);
  --bs-tertiary-bg: var(--mms-surface-2);
  --bs-border-color: var(--mms-line);
  --bs-primary: #6d93f2;
  --bs-primary-rgb: 109, 147, 242;
  --bs-primary-text-emphasis: #b3c7fa;
  --bs-primary-bg-subtle: #1c2d55;
  --bs-success-bg-subtle: #123828;
  --bs-success-text-emphasis: #8be0b9;
  --bs-warning-bg-subtle: #3a2e0c;
  --bs-warning-text-emphasis: #f3d27a;
  --bs-danger-bg-subtle: #3e1b1f;
  --bs-danger-text-emphasis: #f2a3a3;
  --bs-info-bg-subtle: #12324a;
  --bs-info-text-emphasis: #9fd3ec;
  --bs-secondary-bg-subtle: #26375a;
  --bs-secondary-text-emphasis: #c6d0df;
  --bs-secondary-border-subtle: #34496f;
  --bs-link-color: #8eacf6;
  --bs-link-color-rgb: 142, 172, 246;
  --bs-link-hover-color: #b3c7fa;
}

body {
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-stretch: 88%;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--mms-text);
}
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.375rem; }
h3, .h3 { font-size: 1.15rem; }
h4, .h4, h5, .h5 { font-size: 1rem; }

:focus-visible {
  outline: 3px solid var(--mms-tape);
  outline-offset: 2px;
}

/* ── Cadru: meniu lateral + bara de sus ─────────────────────────── */

.mms-shell { min-height: 100vh; }

.mms-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--mms-sidebar-w);
  background: var(--mms-ink);
  color: #c9d3e3;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--mms-ink-line) transparent;
}

.mms-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: var(--mms-topbar-h);
  padding: 0 1.25rem;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--mms-ink-line);
}
.mms-brand:hover { color: #fff; }
.mms-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--mms-tape);
  color: var(--mms-tape-ink);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.mms-brand-name {
  font-weight: 700;
  font-stretch: 85%;
  font-size: 1.1rem;
  line-height: 1.1;
}
.mms-brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  font-stretch: 100%;
  color: #8e9cb5;
}

.mms-nav { padding: 0.75rem 0 1.5rem; flex: 1; }
.mms-nav-group + .mms-nav-group { margin-top: 1.1rem; }
.mms-nav-heading {
  padding: 0 1.25rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7f8ea8;
}
.mms-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 1.25rem;
  color: #c9d3e3;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
}
.mms-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.75; }
.mms-nav-link:hover { color: #fff; background: var(--mms-ink-2); }
.mms-nav-link.active {
  color: #fff;
  background: var(--mms-ink-2);
  border-left-color: var(--mms-tape);
  font-weight: 600;
}
.mms-nav-link.active svg { opacity: 1; color: var(--mms-tape); }
.mms-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 5px;
  flex-shrink: 0;
}

.mms-sidebar-foot {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--mms-ink-line);
  font-size: 0.78rem;
  color: #7f8ea8;
}
.mms-sidebar-foot a { color: #9fb0cc; text-decoration: none; }
.mms-sidebar-foot a:hover { color: #fff; }

.mms-main {
  margin-left: var(--mms-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mms-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--mms-topbar-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--mms-canvas) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--mms-line);
}
.mms-topbar-title {
  font-weight: 650;
  font-stretch: 88%;
  font-size: 1.05rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mms-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.mms-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--mms-line);
  background: var(--mms-surface);
  color: var(--mms-text);
}
.mms-icon-btn:hover { background: var(--mms-surface-2); }
.mms-icon-btn svg { width: 18px; height: 18px; }

/* F-1: insigna „întârziate / expiră <24h” din bara de sus */
.mms-todo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--bs-danger-border-subtle);
  background: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.mms-todo-badge:hover { color: var(--bs-danger-text-emphasis); filter: brightness(0.97); }
.mms-todo-badge svg { width: 16px; height: 16px; flex-shrink: 0; }
.mms-todo-short { display: none; }
/* Pe telefon insigna arată doar cifrele (textul întreg rămâne pentru cititoarele de ecran și în title) */
@media (max-width: 575.98px) {
  .mms-todo-badge { padding: 0 0.6rem; flex-shrink: 0; }
  .mms-todo-short { display: inline; white-space: nowrap; }
  .mms-todo-full {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
}

.mms-workspace-form { display: flex; align-items: center; min-width: 0; }
.mms-workspace-select {
  min-width: 170px;
  max-width: 240px;
  background-color: var(--mms-surface);
  text-overflow: ellipsis;
}

.mms-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.6rem 0.2rem 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--mms-line);
  background: var(--mms-surface);
  color: var(--mms-text);
  font-size: 0.875rem;
}
.mms-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mms-ink);
  color: var(--mms-tape);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.mms-content {
  flex: 1;
  width: 100%;
}
.mms-content > .container {
  max-width: 1320px;
}

.mms-footer {
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--mms-muted);
  border-top: 1px solid var(--mms-line);
}
.mms-footer a { color: var(--mms-muted); }

.mms-backdrop { display: none; }

@media (max-width: 991.98px) {
  .mms-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .mms-shell.nav-open .mms-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.35); }
  .mms-shell.nav-open .mms-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(13, 22, 38, 0.45);
    z-index: 1035;
  }
  .mms-main { margin-left: 0; }
  .mms-topbar { padding: 0 1rem; }
  .mms-workspace-form { flex: 1 1 auto; }
  .mms-workspace-select { min-width: 0; width: 100%; max-width: 240px; }
}
@media (max-width: 575.98px) {
  .mms-topbar { gap: 0.5rem; }
  .mms-topbar-actions { gap: 0.4rem; }
}
@media (min-width: 992px) {
  .mms-nav-toggle { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .mms-sidebar { transition: none; }
}

/* ── Titlul paginii: banda galbenă dedesubt ─────────────────────── */

.mms-content h1:first-child,
.mms-page-title {
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 1.25rem;
}
.mms-content h1:first-child::after,
.mms-page-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--mms-tape);
}

/* ── Componente Bootstrap reglate ───────────────────────────────── */

.card {
  --bs-card-bg: var(--mms-surface);
  --bs-card-border-color: var(--mms-line);
  --bs-card-cap-bg: var(--mms-surface-2);
  --bs-card-border-radius: 0.75rem;
  --bs-card-inner-border-radius: calc(0.75rem - 1px);
  box-shadow: 0 1px 2px rgba(21, 35, 61, 0.04);
}
.card-header { font-weight: 600; }

.list-group {
  --bs-list-group-bg: var(--mms-surface);
  --bs-list-group-border-color: var(--mms-line);
}

.table {
  --bs-table-bg: var(--mms-surface);
  --bs-table-border-color: var(--mms-line);
  --bs-table-striped-bg: var(--mms-surface-2);
  --bs-table-hover-bg: color-mix(in srgb, var(--bs-primary) 6%, var(--mms-surface));
  font-size: 0.875rem;
}
.table > :not(caption) > * > * { padding: 0.6rem 0.75rem; }
.table-sm > :not(caption) > * > * { padding: 0.4rem 0.55rem; }
.table > thead th,
.table > thead td {
  background: var(--mms-surface-2);
  color: var(--mms-muted);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  border-bottom-width: 1px;
}
.table-dark,
.table > thead.table-dark th,
.table > thead.table-light th {
  --bs-table-bg: var(--mms-surface-2);
  --bs-table-color: var(--mms-muted);
  background: var(--mms-surface-2);
  color: var(--mms-muted);
}
.table-responsive {
  border: 1px solid var(--mms-line);
  border-radius: 0.75rem;
  background: var(--mms-surface);
}
.table-responsive > .table { margin-bottom: 0; }
/* Tabel (sau listă goală) direct în panou: colțurile urmează panoul, chiar cu .rounded-0 */
.mms-panel > .table-responsive:first-child {
  border-top-left-radius: calc(0.75rem - 1px) !important;
  border-top-right-radius: calc(0.75rem - 1px) !important;
}
.mms-panel > .table-responsive:last-child,
.mms-panel > .mms-empty:last-child {
  border-bottom-left-radius: calc(0.75rem - 1px) !important;
  border-bottom-right-radius: calc(0.75rem - 1px) !important;
}

.btn {
  --bs-btn-font-weight: 550;
  --bs-btn-border-radius: 0.5rem;
  --bs-btn-padding-x: 0.9rem;
}
.btn-sm { --bs-btn-padding-x: 0.6rem; --bs-btn-border-radius: 0.4rem; }
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: #193b8e;
  --bs-btn-hover-border-color: #193b8e;
  --bs-btn-active-bg: #153277;
  --bs-btn-active-border-color: #153277;
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}
[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: #0d1626;
  --bs-btn-hover-color: #0d1626;
  --bs-btn-active-color: #0d1626;
  --bs-btn-hover-bg: #8eacf6;
  --bs-btn-hover-border-color: #8eacf6;
  --bs-btn-active-bg: #a5bdf8;
  --bs-btn-active-border-color: #a5bdf8;
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary-border-subtle);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
}
.btn-secondary {
  --bs-btn-color: var(--mms-text);
  --bs-btn-bg: var(--mms-surface-2);
  --bs-btn-border-color: var(--mms-line);
  --bs-btn-hover-color: var(--mms-text);
  --bs-btn-hover-bg: var(--mms-line);
  --bs-btn-hover-border-color: var(--mms-line);
  --bs-btn-active-color: var(--mms-text);
  --bs-btn-active-bg: var(--mms-line);
}
.btn-outline-secondary {
  --bs-btn-color: var(--mms-text);
  --bs-btn-border-color: var(--mms-line);
  --bs-btn-bg: var(--mms-surface);
  --bs-btn-hover-color: var(--mms-text);
  --bs-btn-hover-bg: var(--mms-surface-2);
  --bs-btn-hover-border-color: #c6cedb;
  --bs-btn-active-color: var(--mms-text);
  --bs-btn-active-bg: var(--mms-line);
}
.btn-tape {
  --bs-btn-color: var(--mms-tape-ink);
  --bs-btn-bg: var(--mms-tape);
  --bs-btn-border-color: var(--mms-tape);
  --bs-btn-hover-color: var(--mms-tape-ink);
  --bs-btn-hover-bg: #e6b70c;
  --bs-btn-hover-border-color: #e6b70c;
  --bs-btn-active-color: var(--mms-tape-ink);
  --bs-btn-active-bg: #d9ab00;
  --bs-btn-font-weight: 650;
}

.form-control,
.form-select {
  border-color: var(--mms-line);
  background-color: var(--mms-surface);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #c9a30f;
  box-shadow: 0 0 0 0.2rem rgba(245, 197, 24, 0.35);
}
.form-label { font-weight: 550; font-size: 0.875rem; }
.form-text { color: var(--mms-muted); }

.badge { font-weight: 600; letter-spacing: 0.01em; border-radius: 0.4rem; }

.alert { border-width: 0 0 0 4px; border-radius: 0.5rem; }

.nav-tabs {
  --bs-nav-tabs-border-color: var(--mms-line);
  --bs-nav-tabs-link-active-bg: var(--mms-surface);
  --bs-nav-tabs-link-active-border-color: var(--mms-line) var(--mms-line) var(--mms-surface);
}
.nav-tabs .nav-link { color: var(--mms-muted); font-weight: 550; }
.nav-tabs .nav-link.active { color: var(--mms-text); box-shadow: inset 0 3px 0 var(--mms-tape); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--mms-ink); }
.nav-pills .nav-link.active { color: #fff; }

.pagination {
  --bs-pagination-bg: var(--mms-surface);
  --bs-pagination-border-color: var(--mms-line);
  --bs-pagination-active-bg: var(--mms-ink);
  --bs-pagination-active-border-color: var(--mms-ink);
  --bs-pagination-color: var(--mms-text);
}

.dropdown-menu {
  --bs-dropdown-bg: var(--mms-surface);
  --bs-dropdown-border-color: var(--mms-line);
  box-shadow: 0 10px 30px rgba(21, 35, 61, 0.12);
}
.modal { --bs-modal-bg: var(--mms-surface); --bs-modal-border-radius: 0.875rem; }
.bg-light { background-color: var(--mms-surface-2) !important; }
.bg-white { background-color: var(--mms-surface) !important; }
.text-muted { color: var(--mms-muted) !important; }
.display-6 { font-weight: 650; font-stretch: 85%; }
code { color: var(--bs-primary-text-emphasis); font-size: 0.85em; }

/* ── Marketplace: punct de culoare ──────────────────────────────── */

.mp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mms-muted); }
.mp-emag { background: #0a64d6; }
.mp-temu { background: #fb7701; }
.mp-trendyol { background: #f27a1a; }
.mp-infinity { background: #7a3fd1; }
.mp-okazii { background: #00a3a3; }
.mp-skroutz { background: #f68b24; }

/* ── Filtre avansate pliabile ───────────────────────────────────── */

.mms-advanced { border-top: 1px solid var(--mms-line); padding-top: 0.75rem; }
.mms-advanced > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--bs-primary);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.mms-advanced > summary::-webkit-details-marker { display: none; }
.mms-advanced > summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.mms-advanced[open] > summary::before { transform: rotate(45deg); }
.mms-advanced-count { font-weight: 500; color: var(--mms-muted); }
/* Card de filtre cu „Filtre avansate” (Produse, Listări Temu): aceeași densitate ca .mms-filterbar */
.mms-filtercard > .card-body { padding: 0.75rem 1rem; }
.mms-filtercard > .card-footer { padding: 0.5rem 1rem; }
.mms-filtercard .mms-toolbar-label { display: block; }
.mms-filtercard .mms-advanced { margin-top: 0.75rem !important; }
/* Detalii pliabile în text (ex. conturile din „Timp de procesare”): săgeată în locul triunghiului browserului */
.mms-disclosure > summary { cursor: pointer; list-style: none; }
.mms-disclosure > summary::-webkit-details-marker { display: none; }
.mms-disclosure > summary::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin: 0 0.55rem 0.1rem 0.1rem;
  border-right: 2px solid var(--bs-primary);
  border-bottom: 2px solid var(--bs-primary);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.mms-disclosure[open] > summary::before { transform: rotate(45deg); }
.mms-disclosure > summary:hover { color: var(--bs-primary); }

/* Hartă Leaflet (Harta clienților): fundal, butoane +/−, etichete și ferestre pe variabilele temei */
.mms-map,
.mms-map.leaflet-container { height: 70vh; min-height: 420px; background: var(--mms-surface-2); overflow: hidden; font-family: inherit; }
.mms-map path:focus { outline: none; }
.mms-map.leaflet-container .leaflet-bar { border: 1px solid var(--mms-line); box-shadow: none; }
.mms-map .leaflet-bar a,
.mms-map .leaflet-bar a:hover { background: var(--mms-surface); color: var(--mms-text); border-bottom-color: var(--mms-line); }
.mms-map .leaflet-bar a:hover { background: var(--mms-surface-2); }
.mms-map .leaflet-tooltip,
.mms-map .leaflet-popup-content-wrapper,
.mms-map .leaflet-popup-tip { background: var(--mms-surface); color: var(--mms-text); border-color: var(--mms-line); font-family: inherit; }
.mms-map .leaflet-tooltip::before { display: none; }
.mms-map .leaflet-popup-close-button { color: var(--mms-muted); }
@media (max-width: 575.98px) { .mms-map, .mms-map.leaflet-container { height: 60vh; min-height: 320px; } }

/* ── Dashboard ──────────────────────────────────────────────────── */

.mms-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--mms-line);
  border: 1px solid var(--mms-line);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
@media (min-width: 1200px) {
  .mms-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mms-kpi {
  background: var(--mms-surface);
  padding: 1rem 1.25rem;
  color: inherit;
  text-decoration: none;
  display: block;
}
a.mms-kpi:hover { background: var(--mms-surface-2); color: inherit; }
.mms-kpi-label { font-size: 0.8125rem; color: var(--mms-muted); font-weight: 550; }
.mms-kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  font-stretch: 80%;
  line-height: 1.15;
  margin-top: 0.15rem;
}
.mms-kpi-note { font-size: 0.78rem; color: var(--mms-muted); margin-top: 0.15rem; }
.mms-kpi.is-alert .mms-kpi-value { color: var(--bs-danger); }
.mms-kpi.is-attention { box-shadow: inset 4px 0 0 var(--mms-tape); }

.mms-panel {
  background: var(--mms-surface);
  border: 1px solid var(--mms-line);
  border-radius: 0.75rem;
}
.mms-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--mms-line);
}
.mms-panel-head h2 { font-size: 1rem; margin: 0; }
.mms-panel-body { padding: 1rem 1.25rem; }

/* Panou pliabil (explicații lungi): <details class="mms-panel mms-fold"> + <summary class="mms-panel-head"> */
.mms-fold > summary { cursor: pointer; list-style: none; border-radius: 0.75rem 0.75rem 0 0; }
.mms-fold > summary::-webkit-details-marker { display: none; }
.mms-fold > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.2rem;
  border-right: 2px solid var(--mms-muted);
  border-bottom: 2px solid var(--mms-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.mms-fold[open] > summary::after { transform: rotate(-135deg); }
.mms-fold:not([open]) > summary { border-bottom: 0; border-radius: 0.75rem; }
.mms-fold > summary:hover h2 { color: var(--bs-primary); }
.mms-fold-note { font-size: 0.8125rem; font-weight: 500; color: var(--mms-muted); margin-left: auto; }
@media (max-width: 575.98px) { .mms-fold-note { display: none; } }

/* Tabel lung într-un panou: derulare în interior (și pe telefon), cu .mms-sticky-head */
.mms-scroll-box { max-height: 26rem; overflow: auto; }
.mms-scroll-box.is-short { max-height: 20rem; }
.mms-scroll-box.is-tall { max-height: 32rem; }

.mms-bars { display: flex; flex-direction: column; gap: 0.7rem; }
.mms-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 56px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}
.mms-bar-track { height: 10px; border-radius: 5px; background: var(--mms-surface-2); overflow: hidden; }
.mms-bar-fill { height: 100%; border-radius: 5px; background: var(--mms-ink); }
[data-bs-theme="dark"] .mms-bar-fill { background: #6d93f2; }
.mms-bar-val { text-align: right; font-weight: 600; }

.mms-spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding-top: 0.5rem;
}
.mms-spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; height: 100%; justify-content: flex-end; }
.mms-spark-bar {
  width: 100%;
  max-width: 38px;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: var(--mms-ink);
}
[data-bs-theme="dark"] .mms-spark-bar { background: #6d93f2; }
.mms-spark-col.is-today .mms-spark-bar { background: var(--mms-tape); }
.mms-spark-day { font-size: 0.72rem; color: var(--mms-muted); }
.mms-spark-num { font-size: 0.75rem; font-weight: 600; }

/* ── Autentificare ──────────────────────────────────────────────── */

.mms-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  background: var(--mms-canvas);
}
.mms-auth-side {
  position: relative;
  background: var(--mms-ink);
  color: #c9d3e3;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.mms-auth-side::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background: repeating-linear-gradient(
    -45deg,
    var(--mms-tape) 0 22px,
    var(--mms-ink) 22px 44px
  );
}
.mms-auth-headline {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  font-weight: 700;
  font-stretch: 78%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 14ch;
  margin: 0 0 1rem;
}
.mms-auth-lede { max-width: 38ch; color: #9fb0cc; margin: 0; }
.mms-auth-channels { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 2rem; font-size: 0.875rem; }
.mms-auth-channels span { display: inline-flex; align-items: center; gap: 0.45rem; }
.mms-auth-form-wrap { display: grid; place-items: center; padding: 2rem 1.5rem; }
.mms-auth-form { width: 100%; max-width: 360px; }
.mms-auth-form h1 { font-size: 1.6rem; }
.mms-auth-form .form-control { padding: 0.65rem 0.85rem; }

@media (max-width: 767.98px) {
  .mms-auth { grid-template-columns: 1fr; }
  .mms-auth-side { padding: 2rem 1.5rem 3rem; }
  .mms-auth-headline { font-size: 2rem; }
  .mms-auth-channels { margin-top: 1.25rem; }
}

/* ── Etichete deschise (bg-light text-dark) lizibile și pe tema întunecată ── */

[data-bs-theme="dark"] .text-dark { color: var(--mms-text) !important; }
.badge.bg-light,
.mms-chip {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid var(--mms-line);
  background: var(--mms-surface-2) !important;
  color: var(--mms-text) !important;
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.3;
}
/* Etichetă-link (ex. „SPV (ZIP)” lângă nr. actului): același chip, text de link */
a.mms-chip-link { color: var(--bs-link-color) !important; text-decoration: none; }
a.mms-chip-link:hover { border-color: var(--bs-link-color); text-decoration: underline; }
.min-w-0 { min-width: 0; }

/* ── Card comandă ───────────────────────────────────────────────── */

.mms-order-card { color: var(--mms-text); transition: border-color 0.15s ease; }
.mms-order-card:hover { border-color: color-mix(in srgb, var(--bs-primary) 45%, var(--mms-line)); color: var(--mms-text); }
.mms-order-card.is-late { border-color: var(--bs-danger); box-shadow: inset 4px 0 0 var(--bs-danger); }
.mms-order-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-stretch: 85%;
  font-size: 1rem;
  color: var(--bs-primary-text-emphasis);
}
.mms-order-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.mms-order-items li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem;
  border: 1px solid var(--mms-line);
  border-radius: 0.6rem;
  background: var(--mms-surface-2);
}
.mms-order-thumb {
  width: 96px;
  height: 96px;
  border-radius: 0.45rem;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--mms-line);
}
.mms-order-thumb.is-empty {
  display: block;
  background:
    linear-gradient(135deg, transparent 46%, var(--mms-line) 46% 54%, transparent 54%),
    var(--mms-surface);
}
.mms-order-item-text { display: flex; flex-direction: column; min-width: 0; font-size: 0.8125rem; line-height: 1.3; }
.mms-order-item-name {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mms-order-qty { font-weight: 700; font-size: 0.875rem; padding-right: 0.35rem; }
.mms-order-thumb-lg { width: 128px; height: 128px; }

/* Antetul comenzii (fișă + Procesare rapidă): nr. + insigne stânga, total + stări dreapta */
.mms-order-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.mms-order-head-main { flex: 1 1 16rem; min-width: 0; }
.mms-order-head-main h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; }
.mms-order-head-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; text-align: right; }
.mms-order-total { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* Butoane „contur închis” (ex. Print listă): vizibile în ambele teme */
.btn-outline-dark {
  --bs-btn-color: var(--mms-text);
  --bs-btn-border-color: var(--mms-text);
  --bs-btn-hover-color: var(--mms-surface);
  --bs-btn-hover-bg: var(--mms-text);
  --bs-btn-hover-border-color: var(--mms-text);
  --bs-btn-active-color: var(--mms-surface);
  --bs-btn-active-bg: var(--mms-text);
  --bs-btn-active-border-color: var(--mms-text);
}

/* ── Fișa produsului ────────────────────────────────────────────── */

.mms-product-head { margin-bottom: 0.75rem; }
.mms-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  font-size: 0.875rem;
  margin-bottom: 0.6rem;
}
.mms-fact { display: inline-flex; align-items: center; gap: 0.35rem; }
.mms-fact-label { color: var(--mms-muted); font-size: 0.8125rem; }
.mms-mp-states { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mms-mp-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.25rem 0.2rem 0.55rem;
  border: 1px solid var(--mms-line);
  border-radius: 0.5rem;
  background: var(--mms-surface);
  font-size: 0.8125rem;
  font-weight: 550;
}
.mms-mp-state .badge { font-size: 0.72rem; }

.mms-actionbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  border-top: 1px solid var(--mms-line);
  border-bottom: 1px solid var(--mms-line);
}

@media (min-width: 992px) {
  .mms-sticky {
    position: sticky;
    top: calc(var(--mms-topbar-h) + 0.5rem);
    z-index: 1020;
  }
}
.mms-toolbar-label { font-size: 0.75rem; color: var(--mms-muted); font-weight: 550; margin-bottom: 0.25rem; }

.mms-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.6rem;
}
.mms-gallery figure { margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.mms-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--mms-line);
  border-radius: 0.5rem;
}
.mms-gallery figure.is-main img { border: 2px solid var(--mms-tape); }
.mms-gallery figcaption { display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.72rem; color: var(--mms-muted); }
.mms-gallery .badge { font-size: 0.68rem; }

.mms-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; }
.mms-check li { display: flex; align-items: center; gap: 0.5rem; }
.mms-check-mark {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.mms-check li.is-ok .mms-check-mark { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.mms-check li.is-missing .mms-check-mark { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.mms-check li.is-missing { color: var(--mms-text); }
.mms-check-note { color: var(--mms-muted); font-size: 0.8rem; }

.mms-dl { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.35rem 0.75rem; margin: 0; font-size: 0.875rem; }
.mms-dl dt { color: var(--mms-muted); font-weight: 550; }
.mms-dl dd { margin: 0; }

.mms-preview-desc {
  border: 1px solid var(--mms-line);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--mms-surface-2);
  font-size: 0.875rem;
}
.mms-preview-img { max-height: 320px; object-fit: contain; background: #fff; }

/* Butoane contur colorate: text cu contrast suficient în ambele teme */
.btn-outline-warning,
.btn-outline-info,
.btn-outline-success {
  --bs-btn-bg: var(--mms-surface);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: transparent;
}
.btn-outline-warning {
  --bs-btn-color: var(--bs-warning-text-emphasis);
  --bs-btn-border-color: var(--bs-warning);
  --bs-btn-hover-color: var(--mms-tape-ink);
  --bs-btn-active-color: var(--mms-tape-ink);
  --bs-btn-hover-bg: var(--bs-warning);
  --bs-btn-hover-border-color: var(--bs-warning);
  --bs-btn-active-bg: var(--bs-warning);
  --bs-btn-disabled-color: var(--bs-warning-text-emphasis);
  --bs-btn-disabled-border-color: var(--bs-warning);
}
.btn-outline-info {
  --bs-btn-color: var(--bs-info-text-emphasis);
  --bs-btn-border-color: var(--bs-info);
  --bs-btn-hover-bg: var(--bs-info);
  --bs-btn-hover-border-color: var(--bs-info);
  --bs-btn-active-bg: var(--bs-info);
  --bs-btn-disabled-color: var(--bs-info-text-emphasis);
  --bs-btn-disabled-border-color: var(--bs-info);
}
.btn-outline-success {
  --bs-btn-color: var(--bs-success-text-emphasis);
  --bs-btn-border-color: var(--bs-success);
  --bs-btn-hover-bg: var(--bs-success);
  --bs-btn-hover-border-color: var(--bs-success);
  --bs-btn-active-bg: var(--bs-success);
  --bs-btn-disabled-color: var(--bs-success-text-emphasis);
  --bs-btn-disabled-border-color: var(--bs-success);
}

/* ── Formulare de setări ────────────────────────────────────────── */

.mms-form-card { gap: 0; }
.mms-form-title { font-size: 1rem; margin: 0 0 1rem; }
.mms-section-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mms-muted);
}
.mms-section-label::after { content: ""; flex: 1; height: 1px; background: var(--mms-line); }
.mms-help {
  font-size: 0.8125rem;
  color: var(--mms-muted);
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--mms-surface-2);
  border: 1px solid var(--mms-line);
}
/* Țintă de ancoră (#...) — nu intră sub bara de sus fixă */
.mms-anchor { scroll-margin-top: calc(var(--mms-topbar-h) + 1rem); }
.mms-anchor:target { box-shadow: 0 0 0 2px var(--mms-tape); }
td .mp-dot + .mp-dot { margin-left: 2px; }

/* Bifă pe același rând cu câmpurile: cutie cât un câmp, aliniată jos */
.mms-check-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: calc(1.5em + 0.75rem + 2px);
  margin: 0;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--mms-line);
  border-radius: var(--bs-border-radius);
  background: var(--mms-surface-2);
  cursor: pointer;
}
.mms-check-field .form-check-input { margin: 0; flex: none; border-color: var(--mms-muted); }
.mms-check-field:has(.form-check-input:checked) { border-color: var(--bs-primary); }
/* Bifă cu text lung (confirmări): textul pe mai multe rânduri, bifa sus */
.mms-check-field.is-multiline { align-items: flex-start; }
.mms-check-field.is-multiline .form-check-input { margin-top: 0.2em; }
.mms-check-field-sm { min-height: calc(1.5em + 0.5rem + 2px); padding: 0.25rem 0.5rem; font-size: 0.875rem; border-radius: var(--bs-border-radius-sm); }
/* Listă lungă de valori (enum) pe 2 coloane; pe telefon una */
.mms-value-cols { columns: 2; column-gap: 1.5rem; margin: 0; padding-left: 1.1rem; }
@media (max-width: 575.98px) { .mms-value-cols { columns: 1; } }
.mms-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--mms-line);
}

/* Taburi care încap pe telefon (derulare orizontală în interiorul lor) */
.mms-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.mms-tabs .nav-link { white-space: nowrap; }
.mms-tab-count {
  margin-left: 0.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--mms-surface-2);
  border: 1px solid var(--mms-line);
  font-size: 0.72rem;
  color: var(--mms-muted);
}

/* Acordeon de conturi (marketplace-uri) */
.mms-accordion {
  --bs-accordion-bg: var(--mms-surface);
  --bs-accordion-border-color: var(--mms-line);
  --bs-accordion-active-bg: var(--mms-surface);
  --bs-accordion-active-color: var(--mms-text);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(245, 197, 24, 0.35);
}
.mms-accordion .accordion-item { border: 1px solid var(--mms-line); border-radius: 0.75rem; overflow: hidden; }
.mms-accordion .accordion-item.is-active { border-left: 4px solid var(--bs-success); }
.mms-accordion .accordion-item.is-error { border-left: 4px solid var(--bs-warning); }
.mms-accordion .accordion-button:not(.collapsed) { box-shadow: inset 0 -1px 0 var(--mms-line); }
.mms-accordion .accordion-body { background: var(--mms-surface-2); }

.mms-account { border: 1px solid var(--mms-line); box-shadow: none; }
.mms-account.is-current { border-color: var(--mms-tape); box-shadow: inset 4px 0 0 var(--mms-tape); }
.mms-account.is-empty { border-style: dashed; background: transparent; }

/* ── Bară de filtre + bare de pondere în tabele (Statistici) ─────── */

/* Flex (nu grilă): câmpurile ~240px, butoanele cât textul lor, pe același rând cât încap */
.mms-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  padding: 0.75rem 1rem;
}
.mms-filterbar > * { flex: 0 1 220px; min-width: 170px; }
.mms-filterbar > .mms-filterbar-actions { flex: 0 0 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mms-filterbar > .mms-filterbar-wide { flex-basis: 360px; }
.mms-filterbar > .mms-filterbar-narrow { flex-basis: 120px; min-width: 110px; }
.mms-filterbar-note { flex: 1 1 100% !important; margin: 0; font-size: 0.78rem; color: var(--mms-muted); }

.mms-kpi.is-good .mms-kpi-value { color: var(--bs-success-text-emphasis); }

.mms-col-bar { min-width: 200px; }
.mms-input-order-nr { max-width: 12rem; }
.mms-col-progress { min-width: 180px; }
.mms-col-note { min-width: 260px; }
.mms-share { display: grid; grid-template-columns: minmax(60px, 1fr) 7.5rem; align-items: center; gap: 0.6rem; }
.mms-panel .table td.text-end, .mms-panel .table th.text-end { white-space: nowrap; }
.mms-share-track { height: 8px; border-radius: 4px; background: var(--mms-surface-2); border: 1px solid var(--mms-line); overflow: hidden; }
.mms-share-fill { display: block; height: 100%; max-width: 100%; background: var(--mms-ink); border-radius: 4px; }
[data-bs-theme="dark"] .mms-share-fill { background: #6d93f2; }
.mms-share.is-loss .mms-share-fill { background: var(--bs-danger); }
.mms-share-val { text-align: right; white-space: nowrap; font-weight: 550; grid-column: 2; }
/* Telefon: bara de pondere scurtă, cifra rămâne vizibilă fără derulare laterală */
@media (max-width: 575.98px) {
  .mms-col-bar { min-width: 0; }
  .mms-share { grid-template-columns: 2.5rem auto; gap: 0.4rem; }
  /* Tabele cu 3+ cifre pe rând: pe telefon doar cifra, fără bară */
  .mms-share.is-xs-val { grid-template-columns: auto; }
  .mms-share.is-xs-val .mms-share-track { display: none; }
  .mms-share.is-xs-val .mms-share-val { grid-column: auto; }
}
.table tr.is-current > * { background: color-mix(in srgb, var(--mms-tape) 14%, var(--mms-surface)); box-shadow: none; }
.table tr.is-current > td:first-child { box-shadow: inset 4px 0 0 var(--mms-tape); font-weight: 650; }
@media (max-width: 575.98px) {
  .mms-kpi { padding: 0.75rem 0.9rem; }
  .mms-kpi-value { font-size: 1.35rem; }
  .mms-filterbar > * { flex: 1 1 140px; min-width: 140px; }
  .mms-filterbar > :has(> .mms-check-field) { flex-basis: 100%; }
}

/* ── Liste dense: titlu pe 2 rânduri + eroarea sub titlu ─────────── */

.mms-cell-title { min-width: 200px; max-width: 320px; }
/* Pe telefon, când coloanele secundare sunt ascunse, titlul ia doar locul rămas */
@media (max-width: 575.98px) { .mms-cell-title.is-fluid-xs { min-width: 0; } }
/* Listă de sarcini cu formular pe rând (ex. Fișiere de descărcat): pe telefon celulele unui rând stau una sub alta */
@media (max-width: 575.98px) {
  .mms-stack-xs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mms-stack-xs, .mms-stack-xs tbody { display: block; }
  .mms-stack-xs tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--bs-border-color); }
  .mms-stack-xs tbody tr:last-child { border-bottom: 0; }
  .mms-stack-xs tbody td { display: block; padding: 0; border: 0; box-shadow: none; }
  .mms-stack-xs .mms-cell-title { flex: 1 1 100%; min-width: 0; max-width: none; }
  .mms-stack-xs .mms-stack-grow { flex: 1 1 100%; min-width: 0; }
}
.mms-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.mms-row-error {
  display: block;
  margin-top: 0.3rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  font-size: 0.75rem;
  line-height: 1.3;
}
.table tr.has-error > td:first-child { box-shadow: inset 3px 0 0 var(--bs-warning); }
.table .mms-chip, .table .badge { white-space: nowrap; }
.mms-row-error {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mms-row-link { color: var(--mms-text); text-decoration: none; font-weight: 550; }
.mms-row-link:hover { color: var(--bs-link-color); text-decoration: underline; }
.mms-row-error { padding: 0 0.45rem; border-block: 0.2rem solid var(--bs-warning-bg-subtle); }

/* ── Acțiuni în masă, comenzi CLI, 3 cifre-cheie ─────────────────── */

.mms-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--mms-line);
  border-radius: 0.75rem;
  background: var(--mms-surface-2);
}
.mms-cli { grid-template-columns: 9.5rem minmax(0, 1fr); }
.mms-cli code { word-break: break-all; }
@media (min-width: 768px) {
  .mms-kpis.mms-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.mms-card-accent { border-left: 4px solid var(--mms-tape); }

/* ── Text lung din Markdown (Întrebări frecvente, Confidențialitate) ── */

.mms-prose-wrap { max-width: 920px; }
/* Pagini scurte de setări: titlul, butoanele și cardul pe aceeași lățime */
.mms-page-narrow { max-width: 920px; }
.mms-prose { line-height: 1.7; }
.mms-prose h1, .mms-prose h2, .mms-prose h3, .mms-prose h4 { margin: 1.4em 0 0.6em; color: var(--mms-text); }
.mms-prose > :first-child { margin-top: 0; }
.mms-prose h1 { font-size: 1.4rem; padding-bottom: 0; }
.mms-prose h1::after { display: none; }
.mms-prose h2 { font-size: 1.15rem; padding-bottom: 0.35em; border-bottom: 1px solid var(--mms-line); }
.mms-prose h3 { font-size: 1rem; }
.mms-prose p, .mms-prose ul, .mms-prose ol { margin-bottom: 1em; }
.mms-prose ul, .mms-prose ol { padding-left: 1.4em; }
.mms-prose li { margin-bottom: 0.3em; }
.mms-prose strong { color: var(--mms-text); font-weight: 650; }
.mms-prose code {
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: var(--mms-surface-2);
  border: 1px solid var(--mms-line);
  color: var(--bs-primary-text-emphasis);
}
.mms-prose pre {
  padding: 0.9em 1.1em;
  border-radius: 0.6rem;
  background: var(--mms-surface-2);
  border: 1px solid var(--mms-line);
  overflow-x: auto;
  font-size: 0.85em;
}
.mms-prose pre code { padding: 0; border: 0; background: none; }
.mms-prose table { width: 100%; margin: 1em 0; border-collapse: collapse; font-size: 0.9rem; }
.mms-prose th, .mms-prose td { padding: 0.5em 0.75em; border: 1px solid var(--mms-line); text-align: left; vertical-align: top; }
.mms-prose th { background: var(--mms-surface-2); font-weight: 600; }
.mms-prose blockquote {
  margin: 1em 0;
  padding: 0.6em 1em;
  border-left: 4px solid var(--mms-tape);
  border-radius: 0.4rem;
  background: var(--mms-surface-2);
}
.mms-prose hr { margin: 2em 0; border-color: var(--mms-line); opacity: 1; }

/* Telefon: etichetele din titlurile de acordeon trec pe rândul următor */
@media (max-width: 575.98px) {
  .accordion-button { flex-wrap: wrap; row-gap: 0.35rem; }
}
/* Ecrane tactile: butoanele mici rămân ușor de apăsat cu degetul */
@media (pointer: coarse) {
  .btn-sm { min-height: 36px; }
  .pagination-sm .page-link { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Stare goală: ce s-a întâmplat + ce faci mai departe ───────────── */

.mms-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  border: 1px dashed var(--mms-line);
  border-radius: 0.75rem;
  background: var(--mms-surface);
  color: var(--mms-muted);
}
.mms-empty-title { font-weight: 650; font-stretch: 90%; font-size: 1.05rem; color: var(--mms-text); margin-bottom: 0.35rem; }
.mms-empty p { max-width: 52ch; margin: 0 auto 0.85rem; font-size: 0.875rem; }
.mms-empty p:last-child { margin-bottom: 0; }
/* Variantă mică, în panourile de pe Acasă */
.mms-empty.is-compact { padding: 1.25rem 1.25rem 1.4rem; }
.mms-empty.is-compact .mms-empty-title { font-size: 0.95rem; }

.mms-kpis.mms-kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mms-cell-name { max-width: 12.5rem; }

/* ── Pagini de eroare (404 / 403 / 500) ──────────────────────────── */

.mms-error { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--mms-canvas); }
.mms-error-box { max-width: 460px; text-align: center; }
.mms-error-box .mms-brand-mark { margin: 0 auto 1.25rem; width: 44px; height: 44px; font-size: 1.4rem; }
.mms-error-code { margin: 0 0 0.25rem; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mms-muted); }
.mms-error .mms-page-title::after { left: 50%; transform: translateX(-50%); }

/* Rânduri de acoperire (bară + text) și liste de bifat */
.mms-cov-row { display: grid; grid-template-columns: 6.5rem minmax(80px, 1fr) minmax(0, auto); align-items: center; gap: 0.75rem; }
@media (max-width: 767.98px) { .mms-cov-row { grid-template-columns: 5.5rem 1fr; } .mms-cov-row > :last-child { grid-column: 1 / -1; } }
.mms-pick-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; font-size: 0.875rem; }
.mms-pick-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--mms-line); }
.mms-pick-list li:last-child { border-bottom: 0; }

/* ── Antete de tabel sortabile + antet fix la derulare ───────────── */

.mms-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.mms-sort:hover { color: var(--bs-link-color); }
.mms-sort.is-active { color: var(--mms-text); }
.mms-sort-mark { margin-left: 0.2rem; font-size: 0.7em; color: var(--bs-link-color); }
.mms-sticky-head thead th { position: sticky; top: 0; z-index: 2; background: var(--mms-surface-2); box-shadow: inset 0 -1px 0 var(--mms-line); }
.table tr.is-live > td:first-child { box-shadow: inset 4px 0 0 var(--bs-success); }
.table tr.is-soon > td:first-child { box-shadow: inset 4px 0 0 var(--mms-tape); }
.mms-sub { display: block; font-size: 0.75rem; color: var(--mms-muted); line-height: 1.3; }

/* Editare pe rând (câmp mic + buton lipit) */
.mms-inline-edit { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.mms-inline-edit .input-group { width: auto; flex-wrap: nowrap; }
.mms-inline-edit .form-control { width: 5.5rem; }
/* Varianta pe toată lățimea (panou îngust, telefon): câmpurile împart spațiul, nu ies din chenar */
.mms-inline-edit.is-fluid { flex-direction: column; align-items: stretch; gap: 0.25rem; }
.mms-inline-edit.is-fluid .input-group { width: 100%; max-width: 26rem; }
.mms-inline-edit.is-fluid .form-control { width: 1%; flex: 1 1 0; min-width: 0; }
/* Tabel lung cu antetul mereu vizibil: derulare în interior (doar ecran mare) */
@media (min-width: 992px) { .mms-scroll-y { max-height: 72vh; overflow: auto; } }
/* Textele .visually-hidden din tabele (position:absolute) nu mai ies din chenarul derulabil pe telefon */
.table-responsive { position: relative; }

/* Bară de acțiuni lipită jos, în coloana de conținut (nu sub meniul lateral) */
.mms-stickybar {
  position: sticky;
  bottom: 0;
  z-index: 1020;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mms-line);
  border-radius: 0.75rem 0.75rem 0 0;
  background: var(--mms-surface);
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
}
.mms-kbd-hint { font-size: 0.75rem; color: var(--mms-muted); }
.mms-kbd-hint kbd { padding: 0.05rem 0.35rem; font-size: 0.7rem; background: var(--mms-surface-2); color: var(--mms-text); border: 1px solid var(--mms-line); }
/* Telefon: linia de produs din comandă — poză mică, prețul și butonul pe rândul de jos */
@media (max-width: 575.98px) {
  .mms-order-thumb-lg { width: 72px; height: 72px; }
  .mms-order-line-side { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; text-align: left !important; }
  .mms-order-line-side > * { margin-top: 0 !important; }
  .mms-order-head-side { margin-left: 0; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; text-align: left; }
  .mms-stickybar { padding: 0.5rem 0.75rem; }
}
/* Coloană cu câmp de cantitate pe rând (ex. Inventar): mai îngustă pe telefon, ca tabelul să încapă în 375px */
.mms-col-count { width: 9rem; }
@media (max-width: 575.98px) {
  .mms-col-count { width: 5.5rem; }
  .mms-col-count .form-control { padding-left: 0.4rem; padding-right: 0.4rem; }
}

/* Editor listare Temu: câmpuri cu URL-uri, tabel de variante */
.mms-code-input { font-size: 0.78rem; line-height: 1.5; }
.mms-sku-table .sku-qty { width: 5.5rem; }
.mms-sku-table .sku-price { width: 7rem; }
.mms-sku-table .sku-weight { width: 5.5rem; }
/* Câmp numeric scurt într-un formular (nu `style="width"` inline); pe telefon ia coloana */
.mms-num-input { width: 8rem; }
@media (max-width: 575.98px) { .mms-num-input { width: 100%; } }
.mms-dims { display: flex; gap: 0.25rem; }
.mms-dims .form-control { width: 4.25rem; }

/* Stări pe marketplace într-o celulă (lista Produse): etichete mici, aceeași ordine pe fiecare rând */
.mms-mp-tags { display: grid; grid-template-columns: repeat(5, auto); gap: 0.25rem; justify-content: start; }
.mms-mp-tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  border: 1px solid transparent;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}
.mms-mp-tag.is-active { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.mms-mp-tag.is-rejected { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.mms-mp-tag.is-pending { background: transparent; color: var(--mms-muted); border-color: var(--mms-line); border-style: dashed; }
.mms-mp-legend { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; margin-bottom: 0.4rem; }
@media (max-width: 767.98px) {
  .mms-mp-tags { grid-template-columns: repeat(3, auto); }
  /* Pe telefon stările stau sub titlul produsului, pe un rând dacă încap */
  .mms-mp-sub { margin-top: 0.3rem; }
  .mms-mp-sub .mms-mp-tags { display: flex; flex-wrap: wrap; }
}

/* Text legal cu propriul titlu h1 (dublează titlul paginii) */
.mms-prose-notitle > h1:first-child { display: none; }
.mms-prose-notitle > h1:first-child + * { margin-top: 0; }
/* Markdown scris cu rânduri rupte la ~80 de caractere (nl2br): textul curge pe toată lățimea */
.mms-prose-reflow p > br, .mms-prose-reflow li > br { display: none; }

/* Asistentul din colțul paginii (Ajutor) */
.mms-assist { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1045; }
.mms-assist-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1rem 0 0.85rem;
  border: 1px solid var(--mms-ink-line);
  border-radius: 999px;
  background: var(--mms-ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(13, 22, 38, 0.22);
}
.mms-assist-fab svg { width: 18px; height: 18px; color: var(--mms-tape); }
.mms-assist-fab:hover { background: var(--mms-ink-2); }
.mms-assist-fab:focus-visible { outline: 3px solid var(--bs-focus-ring-color); outline-offset: 2px; }
.mms-assist.is-open .mms-assist-fab { display: none; }
.mms-assist-panel {
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 6rem));
  border: 1px solid var(--mms-line);
  border-radius: 12px;
  background: var(--mms-surface);
  box-shadow: 0 12px 32px rgba(13, 22, 38, 0.18);
  overflow: hidden;
}
.mms-assist-panel[hidden] { display: none; }
.mms-assist-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.85rem 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid var(--mms-line);
  border-top: 3px solid var(--mms-tape);
}
.mms-assist-head > div { flex: 1; min-width: 0; }
.mms-assist-title { margin: 0; font-size: 1rem; font-weight: 700; }
.mms-assist-sub { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--mms-muted); }
.mms-assist-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; background: var(--mms-surface-2); }
.mms-assist-msg { max-width: 88%; padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.9rem; }
.mms-assist-msg p { margin: 0; white-space: pre-line; }
.mms-assist-msg.is-bot { align-self: flex-start; background: var(--mms-surface); border: 1px solid var(--mms-line); }
.mms-assist-msg.is-user { align-self: flex-end; background: var(--bs-primary); color: #fff; }
.mms-assist-msg.is-wait p { color: var(--mms-muted); font-style: italic; }
.mms-assist-chips, .mms-assist-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.mms-assist-chip {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--mms-line);
  border-radius: 999px;
  background: var(--mms-surface-2);
  color: var(--mms-text);
  font-size: 0.8rem;
  text-align: left;
}
.mms-assist-chip:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.mms-assist-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.25rem 0.7rem;
  border-radius: 8px;
  background: var(--bs-primary-bg-subtle);
  border: 1px solid var(--bs-primary-border-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.mms-assist-link:hover { border-color: var(--bs-primary); color: var(--bs-primary-text-emphasis); }
.mms-assist-note { display: block; margin-top: 0.4rem; color: var(--mms-muted); font-size: 0.72rem; }
.mms-assist-form { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--mms-line); }
.mms-assist-form textarea { resize: none; min-height: 40px; }
.mms-assist-form .btn { min-height: 40px; }
/* Loc pentru butonul Ajutor: spațiu la capătul paginii și în dreapta barei lipite jos */
body:has(.mms-assist) .mms-content::after { content: ""; display: block; height: 3.5rem; }
body:has(.mms-assist) .mms-stickybar { padding-right: 8.5rem; }
@media (max-width: 575.98px) {
  .mms-assist { right: 0.75rem; bottom: 0.75rem; }
  .mms-assist-panel { height: calc(100vh - 5rem); }
  /* Pe telefon doar iconița (numele rămâne pentru cititoarele de ecran) */
  .mms-assist-fab { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .mms-assist-fab svg { width: 22px; height: 22px; }
  .mms-assist-fab span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  body:has(.mms-assist) .mms-stickybar { padding-right: 4.25rem; }
}
@media print { .mms-assist { display: none; } }

/* Trecere lină între pagini (Chrome/Edge): meniul lateral rămâne pe loc, conținutul se schimbă fără „clipire” albă */
@view-transition { navigation: auto; }
.mms-sidebar { view-transition-name: mms-sidebar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ── Luni pe rând (ex. Luna pentru contabil): o căsuță pe lună, culoarea doar pe notă ── */
.mms-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr));
  gap: 0.4rem;
}
.mms-month {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--mms-line);
  border-radius: 0.5rem;
  background: var(--mms-surface);
  color: var(--mms-text);
  text-decoration: none;
  line-height: 1.25;
}
.mms-month:hover { background: var(--mms-surface-2); color: var(--mms-text); }
.mms-month-name { font-weight: 600; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.mms-month-note { font-size: 0.75rem; color: var(--mms-muted); }
.mms-month.is-missing .mms-month-note { color: var(--bs-danger-text-emphasis); font-weight: 600; }
.mms-month.is-ok .mms-month-note { color: var(--bs-success-text-emphasis); }
.mms-month.is-open { border-style: dashed; }
.mms-month.is-current {
  border-color: var(--bs-primary);
  box-shadow: inset 0 -3px 0 var(--mms-tape);
  background: color-mix(in srgb, var(--bs-primary) 8%, var(--mms-surface));
}
@media (max-width: 575.98px) {
  .mms-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Listă de lipsuri cu acțiune pe rând (text stânga, câmp + buton lipite dreapta) ── */
.mms-gaps { list-style: none; margin: 0; padding: 0; }
.mms-gap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--mms-line);
  box-shadow: inset 3px 0 0 var(--bs-warning);
}
.mms-gap:first-child { border-top: 0; }
.mms-gap-title { font-weight: 600; }
.mms-gap-detail { font-size: 0.875rem; overflow-wrap: anywhere; }
.mms-gap-where { font-size: 0.8125rem; color: var(--mms-muted); }
.mms-gap.is-dismissed { box-shadow: none; color: var(--mms-muted); }
.mms-gap.is-dismissed .mms-gap-title s { text-decoration-color: var(--mms-muted); }
.mms-gap .mms-inline-edit .form-control { width: 12rem; }
@media (max-width: 767.98px) {
  .mms-gap { grid-template-columns: minmax(0, 1fr); padding: 0.7rem 1rem; }
  .mms-gap .mms-inline-edit .input-group { width: 100%; }
  .mms-gap .mms-inline-edit .form-control { width: 1%; flex: 1 1 0; min-width: 0; }
}

/* Tabel grupat (ex. Statistici marketplace pe luni): eticheta grupului doar pe primul rând, linie mai groasă între grupuri */
.table tbody tr.mms-group-start > * { border-top: 2px solid color-mix(in srgb, var(--mms-muted) 45%, var(--mms-line)); }
.table tbody tr.mms-group-start:first-child > * { border-top: 0; }
.mms-group-label { font-weight: 650; }
