/* ════════════════════════════════════════════════════════════════════════
   Documenti ricevuti · Notifiche · Revisiona
   Piccolo sistema visivo condiviso (prefisso vx-). Colore di marca #0092A7.
   ════════════════════════════════════════════════════════════════════════ */
:root {
    --vx-brand: #0092A7;
    --vx-brand-strong: #007f90;
    --vx-brand-deep: #006777;
    --vx-brand-soft: #e6f5f7;
    --vx-ink: #12354a;
    --vx-ink-2: #3b5868;
    --vx-muted: #5b7482;
    --vx-line: #dbe5ea;
    --vx-line-soft: #eef2f4;
    --vx-bg: #f5f8fa;
    --vx-card: #fff;
    --vx-ok: #1e7a3c;      --vx-ok-bg: #e3f6ea;
    --vx-warn: #8a5a00;    --vx-warn-bg: #fff4d6;
    --vx-err: #b42318;     --vx-err-bg: #fde8e8;
    --vx-info: #1f6fb2;    --vx-info-bg: #e6f4ff;
    --vx-radius: 12px;
    --vx-shadow: 0 1px 2px rgba(16, 52, 66, .06), 0 8px 24px -16px rgba(16, 52, 66, .25);
}

.vx-page { max-width: 1480px; margin: 8px auto 40px; color: var(--vx-ink); font-size: 14px; }
.vx-page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.vx-page__title { font-size: 28px; font-weight: 700; color: var(--vx-brand); margin: 0 0 4px; letter-spacing: -.01em; }
.vx-page__lead { margin: 0; color: var(--vx-ink-2); font-size: 14px; max-width: 70ch; }
.vx-page__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vx-page__actions form { margin: 0; }

/* ── Bottoni ─────────────────────────────────────────────────────────── */
.vx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 36px; padding: 7px 14px; border-radius: 8px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.vx-btn:focus-visible { outline: 3px solid rgba(0, 146, 167, .35); outline-offset: 2px; }
.vx-btn--primary { background: var(--vx-brand-strong); color: #fff; }
.vx-btn--primary:hover { background: var(--vx-brand-deep); color: #fff; }
.vx-btn--secondary { background: #fff; color: var(--vx-brand-strong); border-color: #b9dbe1; }
.vx-btn--secondary:hover { background: var(--vx-brand-soft); color: var(--vx-brand-deep); border-color: #8ccbd4; }
.vx-btn--ghost { background: transparent; color: var(--vx-ink-2); border-color: var(--vx-line); }
.vx-btn--ghost:hover { background: #fff; color: var(--vx-ink); border-color: #c5d3da; }
.vx-btn--link { background: none; border: 0; color: var(--vx-brand-strong); padding-inline: 4px; }
.vx-btn--link:hover { color: var(--vx-brand-deep); text-decoration: underline; }
.vx-btn--danger { background: #fff; color: var(--vx-err); border-color: #f3c3c0; }
.vx-btn--danger:hover { background: var(--vx-err-bg); color: #8f1c13; }
.vx-btn--success { background: #1f8a46; color: #fff; }
.vx-btn--success:hover { background: #18723a; color: #fff; }
.vx-btn--lg { min-height: 42px; padding: 9px 18px; font-size: 15px; }
.vx-btn:disabled, .vx-btn.is-disabled { opacity: .5; pointer-events: none; }
.vx-icon-btn { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--vx-muted); }
.vx-icon-btn:hover { background: #fff; border-color: var(--vx-line); color: var(--vx-brand-strong); }

/* ── Tab segmentati ──────────────────────────────────────────────────── */
.vx-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #eaf1f4; border-radius: 10px; }
.vx-segmented__item {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 7px; border: 0; background: transparent;
    font-size: 13px; font-weight: 600; color: var(--vx-ink-2); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.vx-segmented__item:hover { color: var(--vx-ink); background: rgba(255,255,255,.6); }
.vx-segmented__item.is-active { background: #fff; color: var(--vx-brand-deep); box-shadow: 0 1px 2px rgba(16,52,66,.12); }
.vx-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #d7e6eb; color: var(--vx-ink-2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vx-segmented__item.is-active .vx-count { background: var(--vx-brand-soft); color: var(--vx-brand-deep); }
.vx-count--alert { background: var(--vx-err-bg) !important; color: var(--vx-err) !important; }
.vx-count--warn { background: var(--vx-warn-bg) !important; color: var(--vx-warn) !important; }

/* ── Barra filtri ────────────────────────────────────────────────────── */
.vx-toolbar { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: var(--vx-card); border: 1px solid var(--vx-line); border-radius: var(--vx-radius); box-shadow: var(--vx-shadow); margin-bottom: 16px; }
.vx-toolbar__fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.vx-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 150px; }
.vx-field--grow { flex: 1 1 260px; }
.vx-field__label { font-size: 12px; font-weight: 600; color: var(--vx-muted); }
.vx-field .form-control, .vx-field .form-select { min-height: 34px; border-color: #cfdbe1; border-radius: 8px; font-size: 14px; }
.vx-search { position: relative; display: block; }
.vx-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--vx-muted); font-size: 13px; pointer-events: none; }
.vx-search .form-control { padding-left: 32px; }

/* ── Stato vuoto ─────────────────────────────────────────────────────── */
.vx-empty { text-align: center; padding: 56px 20px; background: var(--vx-card); border: 1px dashed #cfdde3; border-radius: var(--vx-radius); color: var(--vx-ink-2); }
.vx-empty__icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--vx-brand-soft); color: var(--vx-brand); font-size: 22px; }
.vx-empty h2 { font-size: 17px; font-weight: 700; color: var(--vx-ink); margin: 0 0 6px; }
.vx-empty p { margin: 0 auto 14px; max-width: 52ch; color: var(--vx-muted); }

/* ── Elenco notifiche (pagina) ───────────────────────────────────────── */
.vx-feed { display: flex; flex-direction: column; gap: 18px; }
.vx-feed__day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--vx-muted); margin: 0 0 8px 4px; }
.vx-feed__day::first-letter { text-transform: uppercase; }
.vx-feed__list { list-style: none; margin: 0; padding: 0; background: var(--vx-card); border: 1px solid var(--vx-line); border-radius: var(--vx-radius); box-shadow: var(--vx-shadow); overflow: hidden; }
.vx-notif { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--vx-line-soft); transition: background-color .12s ease; }
.vx-notif:last-child { border-bottom: 0; }
.vx-notif:hover { background: #f7fbfc; }
.vx-notif.is-unread { background: #f2fafb; }
.vx-notif.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--vx-brand); }
.vx-notif__body { flex: 1; min-width: 0; }
.vx-notif__title { font-size: 14px; font-weight: 600; color: var(--vx-ink); text-decoration: none; overflow-wrap: anywhere; }
.vx-notif.is-unread .vx-notif__title { font-weight: 700; }
.vx-notif__title:hover { color: var(--vx-brand-deep); }
.vx-notif__msg { margin: 2px 0 0; font-size: 13px; color: var(--vx-muted); }
.vx-notif__actions { display: flex; align-items: center; gap: 4px; }
.vx-notif__actions form { margin: 0; }
.vx-notif__go { color: #a9bcc6; padding: 0 4px; }

/* ── Paginazione ─────────────────────────────────────────────────────── */
.vx-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.vx-pager__info { margin-right: auto; color: var(--vx-muted); font-size: 13px; }

/* ── Pillole di stato e tag tipo documento ───────────────────────────── */
.vx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.vx-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.vx-pill--review { background: var(--vx-warn-bg); color: var(--vx-warn); }
.vx-pill--processing { background: var(--vx-info-bg); color: var(--vx-info); }
.vx-pill--processing::before { animation: vx-pulse 1.4s ease-in-out infinite; }
.vx-pill--error { background: var(--vx-err-bg); color: var(--vx-err); }
.vx-pill--approved { background: var(--vx-ok-bg); color: var(--vx-ok); }
.vx-pill--rejected { background: #eef1f3; color: #4c6371; }
@keyframes vx-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.vx-doctag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.vx-doctag--ddt { background: var(--vx-info-bg); color: var(--vx-info); }
.vx-doctag--ordine { background: #fff3e0; color: #a35800; }
.vx-doctag--fattura { background: #f1eafe; color: #6b3fb5; }
.vx-doctag--altro { background: #eef1f3; color: #4c6371; }

/* ── Tabella documenti ricevuti ──────────────────────────────────────── */
.vx-table-card { background: var(--vx-card); border: 1px solid var(--vx-line); border-radius: var(--vx-radius); box-shadow: var(--vx-shadow); overflow: hidden; }
.vx-table-card .dataTables_wrapper { padding: 0; }
.vx-table { width: 100% !important; margin: 0 !important; border-collapse: separate !important; border-spacing: 0; }
.vx-table thead th { background: #f7fafb; color: var(--vx-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px !important; border-bottom: 1px solid var(--vx-line) !important; border-top: 0 !important; white-space: nowrap; }
.vx-table tbody td { padding: 12px 14px !important; border-bottom: 1px solid var(--vx-line-soft) !important; border-top: 0 !important; vertical-align: middle; font-size: 14px; color: var(--vx-ink); background: #fff; }
.vx-table tbody tr { cursor: pointer; transition: background-color .12s ease; }
.vx-table tbody tr:hover td { background: #f5fafb; }
.vx-table tbody tr:last-child td { border-bottom: 0 !important; }
.vx-table .dataTables_empty { cursor: default; }
.vx-doc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vx-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.vx-doc__main { min-width: 0; }
.vx-doc__supplier { font-weight: 600; color: var(--vx-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.vx-doc__sub { font-size: 12px; color: var(--vx-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.vx-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx-cell-muted { color: var(--vx-muted); font-size: 13px; }
.vx-note { display: block; max-width: 300px; font-size: 12px; color: var(--vx-muted); white-space: normal; margin-top: 4px; }
.vx-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.vx-table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--vx-line); background: #fbfcfd; font-size: 13px; color: var(--vx-muted); }
.vx-table-foot .dataTables_info { padding: 0 !important; }
.vx-table-foot .pagination { margin: 0; }
.vx-table-foot .page-link { border-radius: 6px !important; margin: 0 2px; border-color: var(--vx-line); color: var(--vx-ink-2); }
.vx-table-foot .page-item.active .page-link { background: var(--vx-brand-strong); border-color: var(--vx-brand-strong); color: #fff; }
.vx-table-card div.dataTables_processing { top: 60px !important; background: rgba(255,255,255,.92); border: 1px solid var(--vx-line); border-radius: 10px; box-shadow: var(--vx-shadow); color: var(--vx-ink-2); }
.vx-table-card div.dataTables_processing > div:last-child { display: none; }

/* ── Riquadro guida (come si lavora) ─────────────────────────────────── */
.vx-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.vx-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--vx-card); border: 1px solid var(--vx-line); border-radius: var(--vx-radius); }
.vx-step__n { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--vx-brand-soft); color: var(--vx-brand-deep); font-weight: 700; font-size: 13px; }
.vx-step strong { display: block; font-size: 13px; color: var(--vx-ink); }
.vx-step span { font-size: 12px; color: var(--vx-muted); }

@media (max-width: 900px) {
    .vx-steps { grid-template-columns: 1fr; }
    .vx-page__title { font-size: 24px; }
    .vx-doc__supplier, .vx-doc__sub { max-width: 200px; }
}
@media (max-width: 575.98px) {
    .vx-page__head { align-items: stretch; }
    .vx-page__actions, .vx-page__actions .vx-btn { width: 100%; }
    .vx-field { min-width: 0; flex: 1 1 140px; }
    .vx-notif__go { display: none; }
}
@media (prefers-reduced-motion: reduce) { .vx-pill--processing::before { animation: none; } }

/* ── Modale di caricamento ───────────────────────────────────────────── */
.vx-modal { border: 0; border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(16,52,66,.4); }
.vx-modal .modal-header { border-bottom: 1px solid var(--vx-line-soft); padding: 16px 20px; }
.vx-modal .modal-title { font-weight: 700; color: var(--vx-ink); }
.vx-modal .modal-body { padding: 18px 20px; }
.vx-modal .modal-footer { border-top: 1px solid var(--vx-line-soft); padding: 12px 20px; gap: 8px; }
.vx-modal__lead { color: var(--vx-ink-2); font-size: 14px; margin-bottom: 14px; }
.vx-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed #b9d4dc; border-radius: 12px; background: #f8fcfd; text-align: center; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; width: 100%; }
.vx-drop:hover, .vx-drop.is-over { border-color: var(--vx-brand); background: var(--vx-brand-soft); }
.vx-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.vx-drop:focus-within { outline: 3px solid rgba(0,146,167,.35); outline-offset: 2px; }
.vx-drop__icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--vx-brand); font-size: 20px; box-shadow: var(--vx-shadow); }
.vx-drop__title { font-weight: 700; color: var(--vx-ink); }
.vx-drop__hint { font-size: 12px; color: var(--vx-muted); max-width: 46ch; }
.vx-drop__files { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.vx-drop__files span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--vx-line); font-size: 12px; color: var(--vx-ink-2); }
.vx-upload-results { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.vx-upload-results:empty { display: none; }
.vx-upload-line { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: #f7fafb; border: 1px solid var(--vx-line-soft); font-size: 13px; }
.vx-upload-line i { color: var(--vx-ok); }
.vx-upload-line.is-error i { color: var(--vx-err); }
.vx-upload-line span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vx-upload-line a { font-weight: 600; color: var(--vx-brand-strong); white-space: nowrap; }

/* select2 dentro la barra filtri: stessa altezza e bordo dei campi accanto */
.vx-field .select2-container .select2-selection--single { min-height: 34px; height: 34px; border-color: #cfdbe1; border-radius: 8px; display: flex; align-items: center; }
.vx-field .select2-container--bootstrap-5 .select2-selection { font-size: 14px; }
