/* concert-d-0-9-cleanup.css · Sessione D.0.9 · 28-apr-2026
 * Append-only · piccoli aggiustamenti UI per i 7 fix critici post-audit.
 */

/* ─── FIX 2 · Tab Comunicazioni cliente sempre visibile ──────────────
   Card-oggetto Cliente ora ha 9 tab (5 originali + 4 D-beta-1) ·
   overflow-x:auto può nascondere Comunicazioni in viewport stretti.
   flex-wrap permette ai tab di andare a capo · sempre visibili. */
.nx-co-tabs {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0;
}
.nx-co-tabs > .nx-tab {
  flex-shrink: 0;
}

/* ─── FIX 4 · Avatar admin in Canvas mode ─────────────────────────────
   In Canvas la mode-bar (.nx-shell-modes) si estende fino al bordo destro
   (x=1155 → 1416 su 1440 viewport · 261px), coprendo .nx-shell-profile
   col suo avatar AS che normalmente vive top-right.
   Fix · z-index 250 sull'avatar globale + restringimento padding-right
   della mode-bar Canvas. */
.nx-shell-profile,
.nx-shell-profile__avatar {
  position: relative;
  z-index: 250 !important;
}

/* Mode-bar globale: lascia margine destro per l'avatar (~84px) */
.nx-shell-modes {
  margin-right: 84px;
}

/* ─── FIX 5 · Badge counter Action mode ───────────────────────────────
   Pallino visivo sul tab Action quando ci sono nuove azioni in coda
   non lette. */
.nx-shell-mode-btn[data-mode-id="action"][data-d09-pending-count] {
  position: relative;
}
.nx-shell-mode-btn[data-mode-id="action"][data-d09-pending-count]::after {
  content: attr(data-d09-pending-count);
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--nx-d-fattura, #d08a72);
  color: #1a0a05;
  border-radius: 8px;
  font-family: var(--nx-font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(208, 138, 114, 0.5);
}

/* ─── FIX 6 · CRUD modal styling ──────────────────────────────────────
   Modale per create/edit/delete entità · stile coerente col resto della
   shell · scuro, bordi netti, tipografia DM Sans. */
.nx-crud-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  animation: nx-crud-fade 0.18s ease;
}
@keyframes nx-crud-fade { from { opacity: 0 } to { opacity: 1 } }

.nx-crud-modal {
  width: 540px;
  max-width: 92vw;
  max-height: 85vh;
  background: var(--nx-surface, #15171c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nx-crud-modal__head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.nx-crud-modal__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--nx-text, #e8e8e8);
}

.nx-crud-modal__close {
  background: transparent;
  border: none;
  color: var(--nx-text-muted, #888);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
}
.nx-crud-modal__close:hover {
  color: var(--nx-text, #e8e8e8);
  background: rgba(255, 255, 255, 0.06);
}

.nx-crud-modal__body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nx-crud-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nx-crud-field__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--nx-text-muted, #888);
  font-weight: 600;
}
.nx-crud-field__label--required::after {
  content: " *";
  color: var(--nx-d-fattura, #d08a72);
}

.nx-crud-field__input,
.nx-crud-field__select,
.nx-crud-field__textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--nx-text, #e8e8e8);
  font-size: 13px;
  font-family: var(--nx-font-body, "DM Sans", system-ui, sans-serif);
}
.nx-crud-field__input:focus,
.nx-crud-field__select:focus,
.nx-crud-field__textarea:focus {
  outline: none;
  border-color: var(--nx-d-cliente, #5e8dff);
  box-shadow: 0 0 0 2px rgba(94, 141, 255, 0.15);
}
.nx-crud-field__textarea {
  resize: vertical;
  min-height: 70px;
  max-height: 200px;
}
.nx-crud-field__input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.nx-crud-field__error {
  font-size: 11px;
  color: var(--nx-d-fattura, #d08a72);
  margin-top: 2px;
  display: none;
}
.nx-crud-field--error .nx-crud-field__error {
  display: block;
}
.nx-crud-field--error .nx-crud-field__input,
.nx-crud-field--error .nx-crud-field__select {
  border-color: var(--nx-d-fattura, #d08a72);
}

.nx-crud-modal__foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.nx-crud-btn {
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease;
}
.nx-crud-btn--primary {
  background: var(--nx-d-cliente, #5e8dff);
  color: #0a1230;
}
.nx-crud-btn--primary:hover { filter: brightness(1.1); }
.nx-crud-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }

.nx-crud-btn--ghost {
  background: transparent;
  color: var(--nx-text, #e8e8e8);
  border-color: rgba(255, 255, 255, 0.12);
}
.nx-crud-btn--ghost:hover { background: rgba(255, 255, 255, 0.04); }

.nx-crud-btn--danger {
  background: var(--nx-d-fattura, #d08a72);
  color: #2a0e08;
}
.nx-crud-btn--danger:hover { filter: brightness(1.1); }

/* CRUD action buttons inline su card-oggetto */
.nx-crud-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.nx-crud-actions .nx-btn-ghost {
  font-size: 11px;
  padding: 4px 10px;
}
