/* Nexus CRM — stili minimi sopra MudBlazor. I colori seguono il tema (variabili Mud). */

body { font-family: Calibri, "Segoe UI", "Helvetica Neue", Arial, sans-serif; }

.nx-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.nx-brand img { height: 28px; width: auto; }
.nx-brand em { font-style: normal; color: var(--mud-palette-primary); }
.nx-brand-lg { font-size: 1.6rem; }
.nx-brand-lg img { height: 40px; }

.nx-appbar { border-bottom: 1px solid var(--mud-palette-lines-default); }
.nx-drawer { border-right: 1px solid var(--mud-palette-lines-default); }
.nx-card { border: 1px solid var(--mud-palette-lines-default); border-radius: 12px; }

.nx-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--mud-palette-background); }
.nx-login-card { width: 100%; max-width: 380px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default);
  border-radius: 16px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.nx-login-sub { color: var(--mud-palette-text-secondary); margin: 6px 0 20px; }
.nx-login label { display: block; font-size: .8rem; color: var(--mud-palette-text-secondary); margin: 12px 0 4px; }
.nx-login input[type=text], .nx-login input[type=password] { width: 100%; padding: 10px 12px; border-radius: 8px; font: inherit;
  border: 1px solid var(--mud-palette-lines-inputs); background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); }
.nx-login input:focus { outline: 2px solid var(--mud-palette-primary); outline-offset: 0; }
.nx-login .nx-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .9rem; }
.nx-btn { margin-top: 20px; width: 100%; padding: 11px; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.nx-btn:hover { filter: brightness(.95); }
.nx-alert { background: rgba(229,72,77,.12); color: var(--mud-palette-error); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; }
.nx-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; width: 100%; text-align: left; }

.nx-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 48px 16px; color: var(--mud-palette-text-secondary); }

#blazor-error-ui { background: #FFF3CD; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem;
  position: fixed; width: 100%; z-index: 1000; color: #3B2E22; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Elenco etichetta/valore delle schede */
.nx-dl { display: grid; grid-template-columns: 9rem 1fr; gap: 6px 12px; margin: 0; }
.nx-dl dt { color: var(--mud-palette-text-secondary); font-size: .85rem; }
.nx-dl dd { margin: 0; }

/* Board dei task */
.nx-board { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.nx-column { min-width: 270px; width: 270px; flex: 0 0 270px; border: 1px solid var(--mud-palette-lines-default); border-radius: 12px; background: var(--mud-palette-background-gray); }
.nx-column-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.nx-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nx-column-body { min-height: 80px; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.nx-can-drop { outline: 2px dashed var(--mud-palette-primary); outline-offset: -4px; }
.nx-task { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-left: 4px solid var(--mud-palette-primary);
  border-radius: 10px; padding: 10px 12px; cursor: grab; }
.nx-task:hover { box-shadow: 0 2px 10px rgba(0,0,0,.10); }
.nx-task-closed { opacity: .72; }
.nx-task-title { font-weight: 600; margin-bottom: 6px; }
.nx-task-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8rem; color: var(--mud-palette-text-secondary); }
.nx-task-foot { justify-content: space-between; margin-top: 8px; }
.nx-overdue { color: var(--mud-palette-error); font-weight: 600; }
.nx-done { color: var(--mud-palette-success); }

/* Calendario degli incontri */
.nx-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--mud-palette-lines-default); border-radius: 12px; overflow: hidden; background: var(--mud-palette-surface); }
.nx-cal-dow { padding: 8px; text-align: center; font-size: .8rem; color: var(--mud-palette-text-secondary); background: var(--mud-palette-background-gray); }
.nx-cal-day { min-height: 104px; padding: 4px 6px; border-top: 1px solid var(--mud-palette-lines-default); border-left: 1px solid var(--mud-palette-lines-default); cursor: pointer; }
.nx-cal-day:nth-child(7n+8) { border-left: 0; }
.nx-cal-out { opacity: .5; }
.nx-cal-today .nx-cal-num { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; }
.nx-cal-num { font-size: .85rem; margin-bottom: 2px; }
.nx-cal-ev { font-size: .75rem; padding: 2px 6px; border-radius: 6px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  background: color-mix(in srgb, var(--mud-palette-info) 18%, transparent); color: var(--mud-palette-text-primary); }
.nx-cal-svolto { background: color-mix(in srgb, var(--mud-palette-success) 20%, transparent); }
.nx-cal-annullato { background: var(--mud-palette-background-gray); text-decoration: line-through; opacity: .7; }
@media (max-width: 700px) { .nx-cal-day { min-height: 70px; } .nx-cal-ev { font-size: .65rem; } }

/* Calore (heatmap e offerte) */
.nx-heat { display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--heat, transparent);
  border: 1px solid rgba(0,0,0,.22); box-shadow: 0 0 0 3px color-mix(in srgb, var(--heat, transparent) 25%, transparent); vertical-align: -3px; }
.nx-heat-none { background: transparent; border-style: dashed; box-shadow: none; }
.nx-heat-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.nx-heat-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--mud-palette-lines-default); border-radius: 12px;
  background: var(--mud-palette-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.nx-heat-chip span:not(.nx-heat) { flex: 1; line-height: 1.2; }
.nx-heat-chip small { display: block; color: var(--mud-palette-text-secondary); font-size: .75rem; }
.nx-heat-chip b { font-size: 1.25rem; }
.nx-heat-chip:hover { border-color: var(--mud-palette-primary); }
.nx-heat-chip.on { border-color: var(--mud-palette-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-primary) 22%, transparent); }
.nx-heat-chip.dim { opacity: .5; }
.nx-accepted { color: var(--mud-palette-success); font-weight: 600; }
.nx-potential { color: var(--mud-palette-info); font-weight: 600; }
.nx-rejected { color: var(--mud-palette-error); }

/* Home e previsionale */
.nx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.nx-kpi { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.nx-link { cursor: pointer; }
.nx-link:hover { border-color: var(--mud-palette-primary); }
.nx-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--mud-palette-lines-default); cursor: pointer; }
.nx-row:last-child { border-bottom: 0; }
.nx-row:hover { background: var(--mud-palette-background-gray); }
.nx-fbar { position: relative; height: 14px; background: var(--mud-palette-background-gray); border-radius: 7px; display: flex; overflow: visible; }
.nx-fbar-signed { background: var(--mud-palette-success); border-radius: 7px 0 0 7px; }
.nx-fbar-pot { background: var(--mud-palette-info); opacity: .65; }
.nx-fbar-budget { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--mud-palette-text-primary); }
.nx-current-row { background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent); }
.nx-custom input { font-weight: 700; color: var(--mud-palette-primary); }

/* Anteprima allegati */
.nx-preview-frame { width: 100%; height: 72vh; border: 0; background: #fff; }
.nx-preview-text { max-height: 70vh; overflow: auto; white-space: pre-wrap; font: .85rem/1.4 Consolas, monospace; margin: 0; }
.nx-word { max-height: 70vh; overflow: auto; background: #fff; color: #222; padding: 24px 32px; border-radius: 8px; }
.nx-word .w-li { margin: 2px 0; } .nx-word .w-marker { display: inline-block; min-width: 1.4em; margin-left: -1.4em; }
.nx-word .w-table { border-collapse: collapse; margin: 8px 0; } .nx-word .w-table td { border: 1px solid #ccc; padding: 4px 8px; vertical-align: top; }
.nx-word .w-cont { border-top: 0 !important; } .nx-word img { max-width: 100%; height: auto; }
.nx-sheet { max-height: 62vh; overflow: auto; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; }
.nx-sheet table { border-collapse: collapse; font-size: .85rem; } .nx-sheet td { border: 1px solid var(--mud-palette-lines-default); padding: 3px 8px; white-space: nowrap; }
