/* Next Be CRM — modulo Plus (Cruscotto, Clienti). Namespace "nbp-". */
.nbp, .nbp * { box-sizing: border-box; }
.nbp {
  --ink: #0f172a; --body: #1e293b; --muted: #64748b; --faint: #94a3b8;
  --line: #e2e8f0; --line2: #eef1f6; --surface: #fff; --subtle: #f8fafc; --hover: #f1f5f9;
  --accent: #059669; --accent-ink: #047857; --accent-tint: #ecfdf5;
  --warn: #b45309; --warn-tint: #fffbeb; --bad: #dc2626; --bad-tint: #fef2f2;
  --chart-surface: #fcfcfb;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--body); font-size: 14px; -webkit-font-smoothing: antialiased;
}
.nbp-page { max-width: 1280px; margin: 0 auto; padding: 4px 0 40px; display: flex; flex-direction: column; gap: 18px; }
.nbp h1 { font-size: 24px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -.01em; }
.nbp h2 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; display: flex; align-items: center; gap: 8px; }
.nbp h3 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 6px; }
.nbp p { margin: 0; }
.nbp-muted { color: var(--muted); }
.nbp-small { font-size: 12px; }
.nbp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nbp-head p { margin-top: 4px; font-size: 13px; }
.nbp-head-actions { display: flex; align-items: center; gap: 12px; }
.nbp-loading, .nbp-empty { color: var(--faint); text-align: center; padding: 28px 8px; font-size: 13px; list-style: none; }
.nbp-err { color: var(--bad); padding: 16px; }

.nbp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04); min-width: 0; }
.nbp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.nbp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.nbp-btn { border: 1px solid var(--line); background: var(--surface); color: #334155; border-radius: 10px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.nbp-btn:hover { background: var(--subtle); border-color: #cbd5e1; }
.nbp-btn:disabled { opacity: .6; cursor: default; }
.nbp-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.nbp-btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.nbp-btn-danger { color: var(--bad); }
.nbp-btn-danger:hover { background: var(--bad-tint); border-color: #fecaca; }
.nbp-link { background: none; border: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.nbp-link:hover { text-decoration: underline; }
.nbp a { color: var(--accent-ink); }
.nbp :focus-visible { outline: 2px solid #6ee7b7; outline-offset: 2px; }
.nbp-pill { background: var(--hover); color: #475569; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; }
.nbp-tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: var(--hover); color: #475569; white-space: nowrap; }
.nbp-tag-ok { background: var(--accent-tint); color: var(--accent-ink); }
.nbp-tag-warn { background: var(--warn-tint); color: var(--warn); }

/* Avvisi */
.nbp-alerts { display: flex; flex-direction: column; gap: 8px; }
.nbp-alert { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-tint); border: 1px solid #fde68a; color: #78350f; border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.45; }

/* KPI */
.nbp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.nbp-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.nbp-kpi[role="button"] { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.nbp-kpi[role="button"]:hover { border-color: #cbd5e1; box-shadow: 0 4px 12px -6px rgba(15,23,42,.15); }
.nbp-kpi-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.nbp-kpi-value { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.nbp-kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.nbp-kpi-warn { border-left: 4px solid #f59e0b; }
.nbp-up { color: var(--accent-ink); font-weight: 700; }
.nbp-down { color: var(--bad); font-weight: 700; }

/* Grafico */
.nbp-seg { display: inline-flex; background: var(--hover); border-radius: 10px; padding: 3px; }
.nbp-seg button { border: none; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.nbp-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.1); }
.nbp-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 12.5px; color: #334155; margin-bottom: 8px; }
.nbp-legend i, .nbp-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.nbp-chart-wrap { position: relative; background: var(--chart-surface); border-radius: 10px; }
.nbp-chart { width: 100%; height: auto; display: block; }
.nbp-grid { stroke: #eef0f3; stroke-width: 1; }
.nbp-baseline { stroke: #cbd5e1; stroke-width: 1; }
.nbp-axis { fill: #64748b; font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.nbp-hit { fill: transparent; cursor: pointer; }
.nbp-hit.on { fill: rgba(15,23,42,.04); }
.nbp-tip { position: absolute; top: 6px; transform: translateX(-50%); background: #0f172a; color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.6; pointer-events: none; white-space: nowrap; box-shadow: 0 10px 24px -8px rgba(15,23,42,.4); z-index: 2; }
.nbp-tip .nbp-muted { color: #cbd5e1; }
.nbp-table-toggle { margin-top: 10px; font-size: 12.5px; }
.nbp-table-toggle summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.nbp-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.nbp-table th, .nbp-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.nbp-table th:first-child, .nbp-table td:first-child { text-align: left; }
.nbp-table th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Liste */
.nbp-list { list-style: none; margin: 0; padding: 0; }
.nbp-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line2); }
.nbp-list li:last-child { border-bottom: none; }
.nbp-list li > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nbp-list li b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.nbp-list li .nbp-muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.nbp-right { display: flex; align-items: center; gap: 10px; flex: none; font-size: 12.5px; }
.nbp-amt { min-width: 84px; text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.nbp-more { display: inline-block; margin-top: 10px; font-size: 13px; }
.nbp-status { font-size: 14px; margin-bottom: 4px; }
.nbp-right select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font: inherit; font-size: 12.5px; background: var(--surface); }

/* Barre clienti principali (una sola serie, un solo colore) */
.nbp-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nbp-bars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.nbp-bars li:hover { background: var(--subtle); }
.nbp-bar-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbp-bar-track { height: 12px; }
.nbp-bar { display: block; height: 12px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.nbp-bar-val { font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }

/* Sistema */
.nbp-sys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; font-size: 13px; }
.nbp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.nbp-dot-ok { background: #16a34a; }
.nbp-dot-bad { background: var(--bad); }

/* ── Clienti ── */
.nbp-split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.nbp-side { padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 10px; }
.nbp-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13.5px; outline: none; background: var(--surface); }
.nbp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.nbp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nbp-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.nbp-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.nbp-clist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 120px; }
.nbp-crow { padding: 9px 10px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.nbp-crow:hover { background: var(--subtle); }
.nbp-crow.on { background: var(--accent-tint); }
.nbp-crow-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nbp-crow-main b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbp-crow-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.nbp-miss { color: var(--warn); font-weight: 600; white-space: nowrap; }
.nbp-ok { color: var(--accent-ink); font-weight: 600; white-space: nowrap; }

.nbp-detail { padding: 20px 22px; min-height: 400px; }
.nbp-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.nbp-detail-head h2 { font-size: 20px; flex: 1; min-width: 0; }
.nbp-detail-actions { display: flex; gap: 8px; }
.nbp-back { display: none; }
.nbp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.nbp-stat { background: var(--subtle); border-radius: 12px; padding: 12px 14px; }
.nbp-stat-val { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.nbp-detail .nbp-alert { margin-bottom: 16px; }

.nbp-fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.nbp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; font-weight: 600; color: #475569; grid-column: span 1; }
.nbp-field.nbp-wide { grid-column: span 2; }
.nbp-field input, .nbp-field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13.5px; font-weight: 400; color: var(--ink); outline: none; background: var(--surface); resize: vertical; }
.nbp-field input:focus, .nbp-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.nbp-field input.nbp-bad { border-color: #f59e0b; }
.nbp-ferr { font-style: normal; font-weight: 500; color: var(--warn); min-height: 0; font-size: 11.5px; }
.nbp-ferr:empty { display: none; }
.nbp-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

.nbp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 24px 0 8px; overflow-x: auto; }
.nbp-tabs button { border: none; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.nbp-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* Finestra "Unisci" */
.nbp-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.nbp-modal-box { background: #fff; border-radius: 16px; padding: 22px; width: min(480px, 100%); box-shadow: 0 24px 48px -12px rgba(15,23,42,.35); display: flex; flex-direction: column; gap: 12px; }
.nbp-modal-box h3 { font-size: 16px; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; }

.nbp-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 11px; font: 500 13px ui-sans-serif, system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; max-width: calc(100vw - 32px); }
.nbp-toast-show { opacity: 1; transform: translate(-50%, 0); }
.nbp-toast-err { background: #b91c1c; }

@media (max-width: 1100px) {
  .nbp-kpis { grid-template-columns: repeat(2, 1fr); }
  .nbp-grid2 { grid-template-columns: 1fr; }
  .nbp-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nbp-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nbp-split { grid-template-columns: 1fr; }
  .nbp-side { position: static; max-height: none; }
  .nbp-clist { max-height: 60vh; }
  .nbp-clients.nbp-show-detail .nbp-side { display: none; }
  .nbp-clients:not(.nbp-show-detail) .nbp-detail { display: none; }
  .nbp-back { display: inline-block; }
  .nbp-sys { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nbp-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .nbp-kpi { padding: 12px; }
  .nbp-kpi-value { font-size: 24px; }
  .nbp-fgrid { grid-template-columns: 1fr; }
  .nbp-field.nbp-wide { grid-column: span 1; }
  .nbp-detail { padding: 14px; }
  .nbp-list li { flex-direction: column; align-items: flex-start; }
  .nbp-right { width: 100%; justify-content: space-between; }
  .nbp-amt { min-width: 0; }
  .nbp h1 { font-size: 20px; }
}
@media (max-width: 820px) {
  .nbp-detail-head h2 { order: 3; flex-basis: 100%; }
  .nbp-detail-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .nbp-chart-wrap { overflow-x: auto; }
  .nbp-chart { min-width: 600px; }
}

/* ═════════════ v2 ═════════════ */
.nbp-tag-bad { background: var(--bad-tint); color: var(--bad); }
.nbp-danger { color: var(--bad) !important; }
.nbp-btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 8px; text-decoration: none; }
.nbp-click { cursor: pointer; }
.nbp-click:hover { background: var(--subtle); }
.nbp-quote { display: block; font-size: 12.5px; color: #475569; background: var(--subtle); border-left: 3px solid var(--line); padding: 4px 8px; margin-top: 4px; white-space: pre-wrap; border-radius: 0 6px 6px 0; }
.nbp-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.nbp-row > .nbp-field { flex: 1 1 120px; }
.nbp-grow { flex: 3 1 220px !important; }
.nbp-check { flex-direction: row !important; align-items: center; gap: 7px !important; font-weight: 500 !important; flex: 0 0 auto !important; padding-bottom: 8px; }
.nbp-check input { width: auto !important; }
.nbp-field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13.5px; background: #fff; }
.nbp-modal-box .nbp-field { margin-bottom: 10px; }
.nbp-modal-wide { width: min(640px, 100%) !important; }
.nbp-modal-box { max-height: calc(100vh - 32px); overflow-y: auto; }

/* Schede di gruppo sopra le pagine (Agenda, Fatture, Clienti, AI) */
.nb-tabs-host:empty { display: none; }
.nbp-pagetabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 16px; width: fit-content; max-width: 100%; overflow-x: auto; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.nbp-pagetabs a { text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: 9px; white-space: nowrap; }
.nbp-pagetabs a:hover { background: var(--hover); color: var(--ink); }
.nbp-pagetabs a.on { background: var(--accent-tint); color: var(--accent-ink); }

/* Barra in basso a sinistra: cerca + timer */
.nbp-dock { position: fixed; left: 16px; bottom: 16px; z-index: 56; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.nbp-dock > * { pointer-events: auto; }
.nbp-dock-search { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: #334155; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 18px -8px rgba(15,23,42,.3); }
.nbp-dock-search:hover { border-color: #cbd5e1; }
.nbp kbd { font: 600 10.5px ui-monospace, monospace; background: var(--hover); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--muted); }
.nbp-dock-timer { display: flex; align-items: center; gap: 8px; background: #0f172a; color: #fff; border-radius: 999px; padding: 6px 6px 6px 12px; font-size: 13px; box-shadow: 0 8px 22px -8px rgba(15,23,42,.5); max-width: min(420px, calc(100vw - 160px)); }
.nbp-dock-timer[hidden] { display: none; }
.nbp-dock-timer a { color: #fff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nbp-dock-timer b { font-variant-numeric: tabular-nums; }
.nbp-dock-timer button { border: 0; background: #dc2626; color: #fff; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-size: 11px; flex: none; }
.nbp-rec { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: nbp-blink 1.4s infinite; flex: none; }
@keyframes nbp-blink { 50% { opacity: .3; } }

/* Cerca ovunque */
.nbp-palette { align-items: flex-start; padding-top: 12vh; }
.nbp-pal-box { background: #fff; border-radius: 16px; width: min(640px, 100%); box-shadow: 0 30px 60px -15px rgba(15,23,42,.45); overflow: hidden; }
.nbp-pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.nbp-pal-in input { flex: 1; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--ink); }
.nbp-pal-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.nbp-pal-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.nbp-pal-list li.on { background: var(--accent-tint); }
.nbp-pal-ic { width: 24px; text-align: center; flex: none; }
.nbp-pal-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nbp-pal-t b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbp-pal-t small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbp-pal-timer { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.nbp-pal-empty { color: var(--faint); justify-content: center; cursor: default !important; }
.nbp-pal-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--line2); font-size: 11.5px; color: var(--muted); }

/* Scheda lavorazione: bozze */
.nbp-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; color: #334155; margin-bottom: 12px; transition: background .12s, border-color .12s; }
.nbp-drop:hover, .nbp-drop.on { background: var(--accent-tint); border-color: var(--accent); }
.nbp-proofs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.nbp-proof { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.nbp-proof-thumb { width: 96px; height: 96px; flex: none; border-radius: 8px; overflow: hidden; background: var(--hover); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); text-decoration: none; }
.nbp-proof-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nbp-proof-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

/* Strisce sopra le pagine native */
.nb-strip-host:empty { display: none; }
.nbp-strip { margin-bottom: 14px; }
.nbp-strip-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.nbp-strip-search { position: relative; flex: 1 1 320px; display: flex; align-items: center; gap: 8px; }
.nbp-strip-search input { flex: 1; border: 0; outline: none; font: inherit; font-size: 13.5px; padding: 4px 0; min-width: 0; }
.nbp-sugg { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; list-style: none; margin: 0; padding: 6px; box-shadow: 0 14px 32px -12px rgba(15,23,42,.3); z-index: 30; }
.nbp-sugg a { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.nbp-sugg a:hover { background: var(--accent-tint); }
.nbp-sugg small { color: var(--muted); }
.nbp-strip-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nbp-chip2 { font-size: 12px; font-weight: 600; text-decoration: none; background: var(--warn-tint); color: var(--warn); border-radius: 999px; padding: 3px 10px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.nbp-chip2.warn { background: var(--bad-tint); color: var(--bad); }
.nbp-qbox { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.nbp-qbox summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.nbp-qbox .nbp-list { margin-top: 8px; }
.nbp-qbox .nbp-right { flex-wrap: wrap; justify-content: flex-end; }

/* Impianti: planner a quattordicine */
.nbp-imp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; }
.nbp-imp-bar select, .nbp-imp-bar input[type=search] { border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 13px; background: #fff; }
.nbp-imp-bar input[type=search] { flex: 1 1 180px; }
.nbp-imp-bar .nbp-legend { margin: 0 0 0 auto; }
.lg-ok { background: #2a78d6 !important; } .lg-opt { background: repeating-linear-gradient(45deg, #f59e0b 0 4px, #fde68a 4px 8px) !important; } .lg-sel { background: #a7f3d0 !important; outline: 2px solid #059669; }
.nbp-grid-wrap { padding: 0; overflow: auto; max-height: calc(100vh - 230px); }
.nbp-plan { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.nbp-plan th, .nbp-plan td { border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); }
.nbp-plan thead th { position: sticky; top: 0; background: #fff; z-index: 2; font-weight: 700; color: var(--muted); text-align: center; padding: 6px 4px; min-width: 76px; }
.nbp-plan thead th.cur { background: var(--accent-tint); color: var(--accent-ink); }
.nbp-plan thead th .nbp-link { color: inherit; font-weight: 700; line-height: 1.25; }
.nbp-plan thead th small { font-weight: 500; }
.nbp-sticky { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 6px 10px; min-width: 210px; max-width: 260px; }
thead .nbp-sticky { z-index: 3; }
.nbp-plan tbody th { font-weight: 500; }
.nbp-plan tbody th .nbp-link { color: var(--ink); text-align: left; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.nbp-plan tbody th small { color: var(--muted); display: block; font-size: 11px; }
.nbp-plan tr.off th { opacity: .5; }
.nbp-plan td { height: 40px; padding: 2px; text-align: center; }
.nbp-plan td.free { cursor: pointer; }
.nbp-plan td.free:hover { background: var(--accent-tint); }
.nbp-plan td.dis { cursor: not-allowed; background: repeating-linear-gradient(45deg, #fff 0 6px, #f1f5f9 6px 12px); }
.nbp-plan td.sel { background: #a7f3d0; box-shadow: inset 0 0 0 2px #059669; }
.nbp-plan td.bk { cursor: pointer; padding: 3px; }
.nbp-plan td.bk span { display: block; height: 100%; border-radius: 6px; color: #fff; font-weight: 600; font-size: 11px; line-height: 1.2; padding: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nbp-plan td.ok span { background: #2a78d6; }
.nbp-plan td.opt span { background: repeating-linear-gradient(45deg, #f59e0b 0 6px, #f8b84a 6px 12px); color: #451a03; }
.nbp-plan tfoot td, .nbp-plan tfoot th { position: sticky; bottom: 0; background: var(--subtle); font-weight: 700; color: #334155; height: 30px; }
.nbp-selbar { position: sticky; bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; background: #0f172a; color: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 14px 30px -10px rgba(15,23,42,.5); width: fit-content; margin: 0 auto; z-index: 5; }
.nbp-print h4 { margin: 14px 0 4px; font-size: 14px; }

@media (max-width: 640px) {
  .nbp-dock { left: 10px; bottom: 10px; }
  .nbp-dock-search span, .nbp-dock-search kbd { display: none; }
  .nbp-pal-foot { display: none; }
  .nbp-palette { padding-top: 8px; }
  .nbp-proof { flex-direction: column; }
  .nbp-proof-thumb { width: 100%; height: 160px; }
  .nbp-imp-bar .nbp-legend { margin: 0; }
  .nbp-sticky { min-width: 140px; max-width: 160px; }
}
@media print { .nbp-dock, #nb-fab { display: none !important; } }
.nbp-seg-full { display: flex; margin-bottom: 12px; } .nbp-seg-full button { flex: 1; }
.nbp-plan tbody th { overflow: hidden; }
.nbp-plan tbody th .nbp-link { max-width: 100%; }
@media (max-width: 640px) { .nbp-sticky { min-width: 130px; max-width: 130px; } .nbp-plan tbody th small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* ═════════════ v3: Oggi ═════════════ */
.nbp-oggi { gap: 16px; }
.nbp-o-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.nbp-o-head h1 { font-size: 30px; letter-spacing: -0.02em; }
.nbp-o-date { color: var(--muted); font-size: 13.5px; margin-bottom: 2px !important; text-transform: capitalize; }
.nbp-o-sum { font-size: 15px; color: #334155; margin-top: -4px !important; }
.nbp-o-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.nbp-o-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.nbp-o-side { display: flex; flex-direction: column; gap: 16px; }
.nbp-o-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.nbp-o-card .nbp-card-head { margin-bottom: 8px; }
.nbp-o-group { display: flex; align-items: center; gap: 8px; font-size: 12.5px !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--muted) !important; margin: 14px 0 4px !important; font-weight: 700 !important; }
.nbp-o-group:first-child { margin-top: 2px !important; }
.nbp-o-group span { font-weight: 600; color: var(--faint); }
.nbp-o-group.late { color: var(--bad) !important; }
.nbp-o-group.today { color: var(--accent-ink) !important; }
.nbp-o-tasks { list-style: none; margin: 0; padding: 0; }
.nbp-o-tasks li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line2); transition: opacity .25s; }
.nbp-o-tasks li:last-child { border-bottom: 0; }
.nbp-o-tasks li.done { opacity: .35; }
.nbp-o-tasks li.done .nbp-o-check { background: var(--accent); border-color: var(--accent); }
.nbp-o-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; flex: none; cursor: pointer; padding: 0; }
.nbp-o-check:hover { border-color: var(--accent); background: var(--accent-tint); }
.nbp-o-ttl { flex: 1; min-width: 0; text-decoration: none; display: flex; flex-direction: column; }
.nbp-o-ttl b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbp-o-ttl small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbp-o-due { font-size: 12px; color: var(--bad); font-weight: 600; white-space: nowrap; }
.nbp-o-agenda, .nbp-o-rem, .nbp-o-flag, .nbp-o-team { list-style: none; margin: 0; padding: 0; }
.nbp-o-agenda li, .nbp-o-rem li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 13.5px; }
.nbp-o-agenda li:last-child, .nbp-o-rem li:last-child { border-bottom: 0; }
.nbp-o-agenda li span:last-child { display: flex; flex-direction: column; min-width: 0; }
.nbp-o-agenda small { color: var(--muted); font-size: 12px; }
.nbp-o-agenda li.tom { opacity: .7; }
.nbp-o-time { font-weight: 700; color: var(--accent-ink); min-width: 64px; font-variant-numeric: tabular-nums; font-size: 13px; }
.nbp-o-rem li.past .nbp-o-time { color: var(--bad); }
.nbp-o-rem a, .nbp-o-flag a { color: var(--body); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nbp-o-rem a:hover, .nbp-o-flag a:hover { color: var(--accent-ink); }
.nbp-o-flag li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); font-size: 13.5px; }
.nbp-o-flag li:last-child { border-bottom: 0; }
.nbp-o-flag small { color: var(--faint); white-space: nowrap; }
.nbp-empty-sm { padding: 14px 6px !important; }
.nbp-o-week { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.nbp-o-week > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.nbp-o-week .bar { width: 100%; max-width: 40px; height: 70px; background: var(--hover); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.nbp-o-week .bar i { display: block; width: 100%; background: #2a78d6; border-radius: 4px 4px 0 0; min-height: 0; }
.nbp-o-week b { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 12px; }
.nbp-o-week small { color: var(--muted); text-transform: capitalize; }
.nbp-o-week .cur small { color: var(--accent-ink); font-weight: 700; }
.nbp-o-team { margin-top: 12px; border-top: 1px solid var(--line2); padding-top: 8px; }
.nbp-o-team li { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.nbp-o-foot { text-align: center; }
.nbp-o-foot a { color: var(--muted); }

/* ═════════════ v3: Scadenze ═════════════ */
.nbp-kpis-3 { grid-template-columns: repeat(3, 1fr); }
.nbp-ren-group.bad { border-left: 4px solid var(--bad); }
.nbp-ren-group.warn { border-left: 4px solid #f59e0b; }
.nbp-ren-group.off { opacity: .7; }
.nbp-ren-group .nbp-right { flex-wrap: wrap; justify-content: flex-end; }
.nbp-sugg-box { background: #fffdf6; border-color: #f5e3b3; }

/* ═════════════ v3: installa app ═════════════ */
.nbp-install { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: 0 18px 40px -12px rgba(15,23,42,.35); max-width: 460px; margin: 0 auto; }
.nbp-install img { width: 40px; height: 40px; border-radius: 10px; }
.nbp-install div { flex: 1; display: flex; flex-direction: column; font-size: 13.5px; min-width: 0; }
.nbp-install small { color: var(--muted); font-size: 12px; }
.nbp-icon-x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 6px; }
.nbp-steps { padding-left: 20px; line-height: 1.7; font-size: 14px; }

@media (max-width: 1100px) { .nbp-o-grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .nbp-o-grid, .nbp-o-grid3 { grid-template-columns: 1fr; } .nbp-o-head h1 { font-size: 24px; } }
@media (max-width: 560px) { .nbp-kpis-3 { grid-template-columns: 1fr 1fr 1fr; } .nbp-o-head .nbp-head-actions .nbp-btn:first-child { display: none; } }
/* barra Cerca/timer: in basso a destra, accanto al pulsante delle note */
.nbp-dock { left: auto !important; right: 88px; bottom: 22px; flex-direction: row-reverse; }
@media (max-width: 640px) { .nbp-dock { right: 78px; bottom: 16px; } }

/* ══════════════ v6 — Dashboard "La mia giornata" (.nbd) ══════════════ */
.nbd { gap: 20px; }
.nbd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.nbd-date { color: var(--muted); font-size: 13px; text-transform: capitalize; margin-bottom: 2px !important; letter-spacing: .01em; }
.nbd-head h1 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; }
.nbd-kpis { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.nbd-kpi { display: flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 13px 5px 11px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s; }
.nbd-kpi b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.nbd-kpi:hover { border-color: #cbd5e1; background: var(--subtle); }
.nbd-kpi.bad { border-color: #fecaca; background: var(--bad-tint); color: #b91c1c; }
.nbd-kpi.bad b { color: var(--bad); }
.nbd-kpi.warn { border-color: #fde68a; background: var(--warn-tint); color: var(--warn); }
.nbd-kpi.warn b { color: var(--warn); }
.nbd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nbd-actions kbd { font: inherit; font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }

.nbd-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.nbd-col-l, .nbd-col-r { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.nbd-card { padding: 18px 18px 14px; }
.nbd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; min-height: 30px; }
.nbd-card-head h2 { font-size: 15.5px; }
.nbd-head-r { display: flex; align-items: center; gap: 8px; }
.nbd-scope { display: inline-flex; background: var(--hover); border-radius: 9px; padding: 3px; }
.nbd-scope button { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 11px; border-radius: 7px; cursor: pointer; }
.nbd-scope button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.nbd-who { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12.5px; background: var(--surface); max-width: 180px; }

/* creazione rapida */
.nbd-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; background: var(--subtle); transition: border-color .12s, box-shadow .12s, background .12s; }
.nbd-quick:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-tint); }
.nbd-quick-plus { color: var(--accent); font-weight: 700; font-size: 18px; line-height: 1; }
.nbd-quick input[data-q="title"] { flex: 1 1 220px; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; padding: 7px 2px; outline: none; color: var(--ink); box-shadow: none !important; }
.nbd-quick-opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nbd-quick select, .nbd-quick input[type="date"] { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12.5px; color: #334155; max-width: 160px; }
.nbd-quick-more { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 5px 6px; border-radius: 7px; }
.nbd-quick-more:hover { color: var(--accent-ink); background: var(--accent-tint); }
.nbp-btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }

/* tab elenco */
.nbd-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 4px; overflow-x: auto; scrollbar-width: none; }
.nbd-tabs button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 10px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.nbd-tabs button small { font-size: 11px; color: var(--faint); font-weight: 700; margin-left: 2px; }
.nbd-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.nbd-tabs button:hover { color: var(--ink); }

.nbd-group h3 { display: flex; align-items: center; gap: 7px; font-size: 12px !important; letter-spacing: .02em !important; margin: 14px 0 2px !important; color: var(--muted) !important; }
.nbd-group h3 span { color: var(--faint); font-weight: 600; }
.nbd-group.late h3 { color: var(--bad) !important; }
.nbd-group.today h3 { color: var(--accent-ink) !important; }
.nbd-tasks, .nbd-agenda, .nbd-rems, .nbd-list, .nbd-plan-list, .nbd-team-h { list-style: none; margin: 0; padding: 0; }
.nbd-task { display: flex; align-items: center; gap: 10px; padding: 2px 0; border-bottom: 1px solid var(--line2); transition: opacity .25s; }
.nbd-task:last-child { border-bottom: 0; }
.nbd-task.done { opacity: .3; }
.nbd-check { width: 19px; height: 19px; border-radius: 50%; border: 1.8px solid #cbd5e1; background: var(--surface); flex: none; cursor: pointer; padding: 0; position: relative; transition: border-color .12s, background .12s; }
.nbd-check:hover { border-color: var(--accent); background: var(--accent-tint); }
.nbd-check:hover::after, .nbd-task.done .nbd-check::after { content: ''; position: absolute; left: 5.5px; top: 2.5px; width: 4px; height: 8px; border: solid var(--accent); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.nbd-task.done .nbd-check { background: var(--accent); border-color: var(--accent); }
.nbd-task.done .nbd-check::after { border-color: #fff; }
.nbd-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: transparent; font: inherit; text-align: left; padding: 8px 6px; margin: 0 -6px; border-radius: 8px; cursor: pointer; }
.nbd-task-main:hover { background: var(--subtle); }
.nbd-task-t { color: var(--ink); font-weight: 550; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbd-task-m { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.nbd-proj { display: inline-flex; align-items: center; gap: 5px; }
.nbd-proj i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.nbd-sep { color: #cbd5e1; }
.nbd-task-r { display: flex; align-items: center; gap: 6px; flex: none; }
.nbd-prio { font-size: 11px; font-weight: 700; color: #b91c1c; background: var(--bad-tint); border-radius: 6px; padding: 1px 7px; }
.nbd-due { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nbd-due.late { color: var(--bad); }
.nbd-av { width: 24px; height: 24px; border-radius: 50%; background: #e8edf3; color: #475569; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nbd-more { display: block; width: 100%; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); padding: 10px 0 2px; cursor: pointer; text-align: left; text-decoration: none; }
.nbd-more:hover { text-decoration: underline; }
.nbd-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 26px 10px 18px; color: var(--muted); font-size: 13px; }
.nbd-empty b { color: var(--ink); font-size: 14px; }
.nbd-empty-sm { padding: 14px 6px 8px; font-size: 12.5px; }
.nbd-note { margin-top: 8px !important; }

/* calendario */
.nbd-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.nbd-week button { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 6px 0 5px; font: inherit; cursor: pointer; color: var(--muted); }
.nbd-week button small { font-size: 10.5px; text-transform: capitalize; font-weight: 600; }
.nbd-week button b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.nbd-week button:hover { background: var(--subtle); }
.nbd-week button.today small { color: var(--accent-ink); }
.nbd-week button.on { background: var(--ink); border-color: var(--ink); color: #cbd5e1; }
.nbd-week button.on b, .nbd-week button.on small { color: #fff; }
.nbd-dots { display: flex; gap: 3px; height: 5px; }
.nbd-dots i { width: 5px; height: 5px; border-radius: 50%; }
.nbd-dots i.ev { background: #2563eb; }
.nbd-dots i.tk { background: #f59e0b; }
.nbd-week button.on .nbd-dots i.ev { background: #93c5fd; }
.nbd-cal-foot { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line2); }
.nbd-day-title { font-weight: 700; color: var(--ink); text-transform: capitalize; font-size: 13.5px; }
.nbd-add-link { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.nbd-add-link:hover { text-decoration: underline; }
.nbd-agenda li { display: flex; align-items: stretch; gap: 10px; padding: 6px 0; font-size: 13px; }
.nbd-time { width: 44px; flex: none; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); font-size: 12.5px; display: flex; flex-direction: column; line-height: 1.25; padding-top: 1px; }
.nbd-time small { color: var(--faint); font-weight: 500; font-size: 11.5px; }
.nbd-ag-bar { width: 3px; border-radius: 3px; background: #2563eb; flex: none; }
.nbd-agenda li.rem .nbd-ag-bar { background: #f59e0b; }
.nbd-ag-t { flex: 1; min-width: 0; color: var(--body); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.nbd-ag-t small { color: var(--muted); font-size: 12px; }
.nbd-lock { font-size: 11px; opacity: .55; }
.nbd-agenda-tasks { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; border: 1px dashed #fcd34d; background: var(--warn-tint); color: var(--warn); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
.nbd-agenda-tasks i { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }

/* promemoria */
.nbd-remq { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); margin-bottom: 4px; }
.nbd-remq:focus-within { border-color: #f59e0b; background: var(--surface); box-shadow: 0 0 0 3px rgba(245,158,11,.14); }
.nbd-remq input[data-r="text"] { border: 0; background: transparent; font: inherit; font-size: 13.5px; padding: 4px 4px; outline: none; box-shadow: none !important; }
.nbd-remq-row { display: flex; gap: 6px; }
.nbd-remq-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 12.5px; background: var(--surface); }
.nbd-rems li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 13px; transition: opacity .25s; }
.nbd-rems li:last-child { border-bottom: 0; }
.nbd-rems li.done { opacity: .3; }
.nbd-group.late .nbd-rems .nbd-time { color: var(--bad); }
.nbd-rem-t { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--body); }
.nbd-rem-t em { font-style: normal; color: var(--faint); }
.nbd-rem-a { display: flex; gap: 2px; opacity: .55; transition: opacity .12s; }
.nbd-rems li:hover .nbd-rem-a, .nbd-rem-a:focus-within { opacity: 1; }
.nbd-rem-a button, .nbd-icon { border: 0; background: transparent; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.nbd-rem-a button:hover, .nbd-icon:hover { background: var(--hover); color: var(--ink); }
.nbd-menu { position: absolute; z-index: 9999; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.14); padding: 4px; width: 150px; display: flex; flex-direction: column; }
.nbd-menu button { border: 0; background: transparent; text-align: left; font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: #1e293b; }
.nbd-menu button:hover { background: #f1f5f9; }

/* piano AI */
.nbd-spark { color: #7c3aed; font-size: 14px; }
.nbd-plan-sum { font-size: 13.5px; color: #334155; margin: -4px 0 10px !important; }
.nbd-plan-list li { display: flex; gap: 10px; padding: 7px 0 7px 10px; border-left: 2px solid #e2e8f0; margin-left: 2px; }
.nbd-plan-list li.pr-critica { border-left-color: var(--bad); }
.nbd-plan-list li.pr-alta { border-left-color: #f59e0b; }
.nbd-plan-list .nbd-time { width: 84px; font-size: 12px; color: var(--muted); }
.nbd-plan-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.nbd-plan-t b { color: var(--ink); font-weight: 600; }
.nbd-plan-t small { color: var(--muted); font-size: 12px; }
.nbd-team-notes { margin-top: 10px; padding: 10px 12px; background: #f3f8f6; border: 1px solid #dcebe4; border-radius: 10px; }
.nbd-team-notes h3 { margin: 0 0 6px !important; color: var(--accent-ink) !important; }
.nbd-team-notes ul { margin: 0; padding-left: 16px; font-size: 13px; color: #334155; }
.nbd-team-notes li { margin: 3px 0; }

/* righe secondarie */
.nbd-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.nbd-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.nbd-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.nbd-list li:last-child { border-bottom: 0; }
.nbd-list li > a { flex: 1; min-width: 0; text-decoration: none; display: flex; flex-direction: column; }
.nbd-list li > a b { color: var(--ink); font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbd-list li > a small, .nbd-list li > small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbd-list li > a:hover b { color: var(--accent-ink); }
.nbd-flag li > a b { font-weight: 500; }
.nbd-hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.nbd-hours > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nbd-hours .bar { width: 100%; max-width: 38px; height: 64px; background: var(--hover); border-radius: 7px; display: flex; align-items: flex-end; overflow: hidden; }
.nbd-hours .bar i { display: block; width: 100%; background: #94a3b8; border-radius: 7px 7px 0 0; }
.nbd-hours .cur .bar i { background: var(--accent); }
.nbd-hours b { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.nbd-hours small { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.nbd-hours .cur small { color: var(--accent-ink); font-weight: 700; }
.nbd-team-h { margin-top: 12px; border-top: 1px solid var(--line2); padding-top: 8px; }
.nbd-team-h li { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.nbd-running { margin-top: 10px !important; }
.nbd-foot { text-align: center; }
.nbd-foot a { color: inherit; }

@media (max-width: 1180px) { .nbd-main { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1023px) {
  .nbd-main { grid-template-columns: minmax(0, 1fr); }
  .nbd-col-r { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .nbd-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .nbd-head h1 { font-size: 23px; }
  .nbd-actions { width: 100%; }
  .nbd-actions .nbp-btn { flex: 1; }
  .nbd-actions [data-a="palette"] { display: none; }
  .nbd-col-r, .nbd-grid3, .nbd-grid2 { grid-template-columns: minmax(0, 1fr); display: grid; }
  .nbd-quick-opts { width: 100%; }
  .nbd-quick-opts select { flex: 1; max-width: none; }
  .nbd-card { padding: 14px 14px 10px; }
  .nbd-rem-a { opacity: 1; }
}

/* ══════════════ v6 — Impostazioni pianificatore (.nbps) ══════════════ */
.nbps { max-width: 1100px; padding-bottom: 90px; }
.nbps-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.nbps-head p { margin-top: 4px !important; font-size: 13.5px; }
.nbps-master { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 16px 7px 8px; cursor: pointer; font-size: 14px; }
.nbps-master.on { border-color: #b7dccd; background: var(--accent-tint); }
.nbps-master b { color: var(--ink); }
.nbps-master input, .nbps-sw input { position: absolute; opacity: 0; pointer-events: none; }
.nbps-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #cbd5e1; flex: none; transition: background .15s; }
.nbps-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
input:checked + .nbps-track { background: var(--accent); }
input:checked + .nbps-track::after { transform: translateX(16px); }
input:focus-visible + .nbps-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.nbps-status { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.nbps-status b { color: var(--ink); }
.nbps-status .bad, .nbps .bad { color: var(--bad); }
.nbps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; transition: opacity .2s; }
.nbps-grid.off { opacity: .55; }
.nbps-card { display: flex; flex-direction: column; gap: 12px; }
.nbps-card h2 { font-size: 15px; }
.nbps-wide { grid-column: 1 / -1; }
.nbps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nbps .nbp-field input, .nbps .nbp-field select, .nbps textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink); }
.nbps textarea { resize: vertical; line-height: 1.45; }
.nbps-inline { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between; gap: 10px; text-align: left !important; }
.nbps-inline select { width: auto !important; }
.nbps-checks { display: flex; flex-direction: column; gap: 2px; }
.nbps-check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
.nbps-check:hover { background: var(--subtle); }
.nbps-check input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.nbps-check span, .nbps-sw-l { display: flex; flex-direction: column; font-size: 13.5px; }
.nbps-check b, .nbps-sw-l b { color: var(--ink); font-weight: 600; }
.nbps-check small, .nbps-sw-l small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.nbps-sw { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.nbps-sw .nbps-track { margin-top: 1px; }
.nbps-sw-sm .nbps-track { margin-top: 2px; }
.nbps-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nbps-examples button { border: 1px dashed #cbd5e1; background: var(--surface); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; color: #475569; cursor: pointer; text-align: left; }
.nbps-examples button:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-tint); }
.nbps-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nbps-people li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line2); }
.nbps-people li:first-child { border-top: 0; }
.nbps-people li.off .nbps-person { opacity: .5; }
.nbps-person { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nbps-person b { color: var(--ink); font-size: 14px; }
.nbps-person small { color: var(--muted); font-size: 12px; }
.nbps-person textarea { margin-top: 4px; font-size: 13px !important; }
.nbps-results { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.nbps-results h3 { margin: 0 0 8px !important; }
.nbps-results ul { list-style: none; margin: 0 0 8px; padding: 0; }
.nbps-results li { display: flex; gap: 12px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.nbps-results li span { color: var(--muted); text-align: right; }
.nbps-results li.ok b::before { content: '✓ '; color: var(--accent); }
.nbps-results li.bad span { color: var(--bad); }
.nbps-results li.skip { opacity: .65; }
.nbps-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 18px; background: #18202e; color: #c9d0dc; border-radius: 14px; padding: 9px 10px 9px 18px; box-shadow: 0 12px 32px rgba(15,23,42,.28); font-size: 13px; max-width: calc(100vw - 32px); flex-wrap: wrap; }
@media (min-width: 1024px) { .nbps-bar { left: calc(50% + 128px); } }
.nbps-bar > div { display: flex; gap: 6px; flex-wrap: wrap; }
.nbps-bar .nbp-btn:not(.nbp-btn-primary) { background: transparent; color: #e2e8f0; border-color: #3a4558; }
.nbps-bar .nbp-btn:not(.nbp-btn-primary):hover { background: #222b3b; }
.nbps-bar.dirty > span { color: #fcd34d; font-weight: 600; }
.nbps-bar .nbp-btn:disabled { opacity: .45; }
.nbps code { font-size: 12px; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 1023px) { .nbps-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .nbps-row { grid-template-columns: 1fr; } .nbps-bar { bottom: 8px; padding: 8px; } .nbps-bar > span { display: none; } }

/* v7 — box bilanciati */
.nbd-main { align-items: stretch; }
.nbd-col-l > .nbd-card, .nbd-col-r > .nbd-card { flex: 0 0 auto; }
.nbd-col-l > .nbd-tasks-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.nbd-col-r > .nbd-card:last-child { flex: 1 1 auto; }
.nbd-scroll { flex: 1 1 auto; min-height: 120px; max-height: 640px; overflow-y: auto; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; }
.nbd-rem .nbd-group:last-child { margin-bottom: 0; }
.nbd-rem { display: flex; flex-direction: column; }
.nbd-grid3, .nbd-grid2 { align-items: stretch; }
.nbd-grid3 > .nbd-card, .nbd-grid2 > .nbd-card { display: flex; flex-direction: column; min-height: 230px; }
.nbd-grid3 > .nbd-card > .nbd-more, .nbd-grid2 > .nbd-card > .nbd-more { margin-top: auto; padding-top: 12px; }
.nbd-grid3 .nbd-empty, .nbd-grid2 .nbd-empty { flex: 1; justify-content: center; }
.nbd-quick select[data-q="section"] { max-width: 150px; }
@media (max-width: 1023px) { .nbd-scroll { max-height: none; overflow: visible; margin-right: 0; padding-right: 0; } .nbd-grid3 > .nbd-card, .nbd-grid2 > .nbd-card { min-height: 0; } }
