body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.topbar {
    min-height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    background: white;
    border-bottom: 1px solid #d9dee5;
}

.brand {
    color: #1546a0;
    font-weight: 800;
}

.topbar nav {
    flex: 1;
}

.topbar a {
    color: #1546a0;
    text-decoration: none;
}

.link-button {
    border: 0;
    background: none;
    color: #1546a0;
    cursor: pointer;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px;
}

.rentri-page-title {
    margin-bottom: 20px;
}

.rentri-console,
.rentri-toolbar,
.rentri-grid-panel,
.rentri-role-card,
.rentri-bottom-actions {
    background: white;
    border: 1px solid #e1e6ed;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(31, 41, 55, .05);
}

.rentri-toolbar {
    display: grid;
    grid-template-columns: minmax(300px, 2fr) 170px 170px;
    gap: 14px;
    align-items: end;
    padding: 20px;
}

.rentri-credentials-wide {
    grid-column: 1 / -1;
}

.rentri-credentials-wide label {
    display: block;
    margin-bottom: 7px;
    color: #5b2dab;
    font-weight: 900;
    font-size: 18px;
}

.rentri-credentials-wide select,
.rentri-toolbar input,
.rentri-role-card input,
.rentri-role-card textarea,
.rentri-bottom-actions textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #d6dce5;
    border-radius: 8px;
    background: white;
}

.rentri-date-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.rentri-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.rentri-check input {
    width: auto;
}

.rentri-update-button {
    margin: 0;
}

.rentri-state-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0;
    padding: 13px 16px;
    background: #f8fafc;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
}

.rentri-state-filters label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
}

.rentri-two-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.rentri-grid-panel {
    min-width: 0;
    overflow: hidden;
}

.rentri-grid-heading {
    display: flex;
    justify-content: space-between;
    padding: 13px 15px;
    font-weight: 800;
    color: #273244;
    background: #f4f6f9;
    border-bottom: 1px solid #e1e6ed;
}

.rentri-grid-scroll {
    overflow: auto;
    min-height: 390px;
    max-height: 520px;
}

.rentri-grid {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 13px;
}

.rentri-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px;
    text-align: left;
    white-space: nowrap;
    background: #edf1f6;
    border-bottom: 1px solid #d8dee7;
}

.rentri-grid td {
    padding: 8px 9px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: top;
}

.rentri-grid tbody tr:nth-child(even) {
    background: #fafbfc;
}

.rentri-grid tbody tr:hover {
    background: #f2effa;
}

.rentri-transfer-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.transfer-button {
    min-height: 48px;
    margin: 0;
    border: 1px solid #d3d9e2;
    border-radius: 9px;
    background: white;
    color: #5b2dab;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}

.transfer-button:hover {
    background: #f4f0fb;
}

.rentri-role-sections {
    display: grid;
    grid-template-columns: 1fr 1.45fr 1fr;
    gap: 15px;
    margin-top: 18px;
}

.rentri-role-card {
    padding: 18px;
}

.rentri-role-card h2 {
    margin: 0 0 15px;
}

.rentri-role-card label {
    display: block;
    margin: 9px 0 5px;
    font-weight: 700;
}

.rentri-role-card label input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

.rentri-role-card.producer {
    border-top: 5px solid #7868d8;
}

.rentri-role-card.transporter {
    border-top: 5px solid #4abf72;
}

.rentri-role-card.recipient {
    border-top: 5px solid #dfbf45;
}

.rentri-inline-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.module-button {
    width: 100%;
    min-height: 44px;
    margin-top: 13px;
    border: 1px solid #c8cdd5;
    border-radius: 8px;
    font-weight: 800;
}

.module-button.important {
    background: #effff1;
    border-color: #93d59e;
}

.rentri-bottom-actions {
    margin-top: 18px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto auto auto auto minmax(260px, 1fr) auto auto;
    gap: 14px;
    align-items: center;
}

.rentri-download-options {
    display: grid;
    gap: 5px;
}

.rentri-action-group {
    display: grid;
    gap: 6px;
    padding: 12px;
    background: #fff9d8;
    border-radius: 9px;
}

.module-development-note {
    margin-top: 15px;
    padding: 12px 15px;
    border: 1px dashed #b9a9db;
    border-radius: 9px;
    color: #5d4d78;
    background: #faf8ff;
}

.formulari-module-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

@media (max-width: 1100px) {
    .rentri-two-grid-layout {
        grid-template-columns: 1fr;
    }

    .rentri-transfer-buttons {
        flex-direction: row;
    }

    .rentri-role-sections {
        grid-template-columns: 1fr;
    }

    .rentri-bottom-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .rentri-toolbar {
        grid-template-columns: 1fr;
    }

    .rentri-credentials-wide {
        grid-column: auto;
    }

    .rentri-bottom-actions {
        grid-template-columns: 1fr;
    }

    .rentri-inline-two {
        grid-template-columns: 1fr;
    }
}


.login-card {
    width: min(430px, calc(100% - 40px));
    margin: 80px auto;
    padding: 28px;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
}

.login-card label,
.login-card input {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.login-card label {
    margin-top: 14px;
    margin-bottom: 5px;
    font-weight: 700;
}

.login-card input {
    padding: 10px;
}

button {
    padding: 10px 18px;
    margin-top: 16px;
}

.error,
.error-box {
    color: #9b1c1c;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise {
    display: flex;
    gap: 8px;
    align-items: end;
}

.exercise button {
    margin: 0;
}

.cards {
    margin-top: 25px;
}

.card {
    padding: 24px;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
}

.muted {
    color: #6b7280;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.pianeta-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.login-card {
    width: min(430px, calc(100% - 40px));
    margin: 40px auto;
    padding: 28px;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
}


.connector-ok {
    margin-top: 15px;
    padding: 12px;
    background: #eef9ee;
    border: 1px solid #85b985;
    border-radius: 6px;
}

.connector-error {
    margin-top: 15px;
    padding: 12px;
    background: #fff0f0;
    border: 1px solid #cc8d8d;
    border-radius: 6px;
}

.formulari-header {
    margin-bottom: 18px;
}

.formulari-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
    padding: 16px;
}

.filter-field label,
.filter-field input {
    display: block;
}

.filter-field label {
    font-weight: 700;
    margin-bottom: 5px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.formulari-filters button {
    margin: 0;
}

.result-summary {
    margin: 16px 0 10px;
}

.formulari-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #dce3ea;
}

.formulari-table th {
    background: #eef2f7;
    text-align: left;
    padding: 11px;
    border-bottom: 1px solid #dce3ea;
}

.formulari-table td {
    padding: 11px;
    border-bottom: 1px solid #e7ebef;
}

.table-actions {
    text-align: right;
}

.btn-secondary,
.btn-mobile-open {
    display: inline-block;
    padding: 9px 14px;
    background: #1546a0;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

.mobile-cards {
    display: none;
}

.formulario-mobile-card {
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}

.mobile-fir {
    font-size: 18px;
    font-weight: 800;
    color: #1546a0;
    margin-bottom: 12px;
}

.mobile-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid #eef1f4;
}

.mobile-row span {
    color: #6b7280;
}

.btn-mobile-open {
    display: block;
    text-align: center;
    margin-top: 14px;
}

@media (max-width: 760px) {
    .container {
        padding: 14px;
    }

    .page-header {
        display: block;
    }

    .formulari-filters {
        display: block;
    }

    .filter-field,
    .checkbox-field {
        margin-bottom: 12px;
    }

    .filter-field input {
        width: 100%;
        box-sizing: border-box;
    }

    .formulari-filters button {
        width: 100%;
    }

    .desktop-table {
        display: none;
    }

    .mobile-cards {
        display: block;
        margin-top: 15px;
    }
}

.form-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.form-detail-header h1 {
    margin: 4px 0 8px;
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #64748b;
}

.form-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-pill {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef2f7;
    border: 1px solid #d6dde6;
    font-size: 13px;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-card {
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
    padding: 18px;
}

.detail-card h2 {
    margin-top: 0;
    color: #1546a0;
}

.subject-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #edf0f3;
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list dt {
    color: #64748b;
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
}

.detail-list.compact > div {
    grid-template-columns: 100px 1fr;
}

.detail-notes {
    margin-top: 16px;
}

.rentri-actions {
    margin-top: 18px;
    background: white;
    border: 1px solid #dce3ea;
    border-radius: 10px;
    padding: 18px;
}

.rentri-actions h2 {
    margin-top: 0;
    color: #1546a0;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.action-grid button {
    margin: 0;
    min-height: 44px;
}

.action-note {
    margin-top: 12px;
}

.back-row {
    margin-top: 18px;
}

@media (max-width: 800px) {
    .form-detail-header {
        display: block;
    }

    .form-statuses {
        margin-top: 12px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .detail-list > div,
    .detail-list.compact > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 28px;
}

.home-header h1 {
    margin: 4px 0 6px;
}

.home-kicker {
    color: #5c2db5;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.exercise-modern {
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(31, 41, 55, .06);
}

.exercise-modern label {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.exercise-modern input {
    width: 92px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
}

.btn-soft {
    border: 1px solid #d8dee8;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    font-weight: 700;
    transition: .18s ease;
}

.btn-soft:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

.dashboard-stack {
    display: grid;
    gap: 24px;
}

.dashboard-card {
    position: relative;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 26px;
    align-items: start;
    padding: 34px 38px;
    background: #ffffff;
    border: 1px solid #e6e9ef;
    border-radius: 16px;
    box-shadow:
        0 10px 28px rgba(30, 41, 59, .07),
        0 2px 6px rgba(30, 41, 59, .03);
    overflow: hidden;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #6d35c5 0%, #4f2aa5 100%);
}

.dashboard-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f2eefb 0%, #eee8fa 100%);
}

.dashboard-icon svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: #5b2dab;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-content h2 {
    margin: 3px 0 12px;
    font-size: 30px;
    line-height: 1.15;
    color: #1f2937;
}

.dashboard-content h2.accent-title {
    color: #5b2dab;
}

.dashboard-content p {
    margin: 0 0 24px;
    color: #475569;
    font-size: 17px;
    line-height: 1.55;
}

.dashboard-action-form {
    margin: 0;
}

.btn-primary-modern,
.btn-outline-modern {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 24px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.btn-primary-modern {
    border: 1px solid #5c2db5;
    color: white;
    background: linear-gradient(180deg, #6d35c5 0%, #5627aa 100%);
    box-shadow: 0 8px 18px rgba(92, 45, 181, .20);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(92, 45, 181, .26);
}

.btn-outline-modern {
    border: 1.5px solid #6b37c2;
    color: #5b2dab;
    background: #ffffff;
}

.btn-outline-modern:hover {
    background: #f8f5fd;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(92, 45, 181, .12);
}

.btn-icon {
    width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
}

.btn-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.arrow-icon {
    font-size: 27px;
    font-weight: 400;
    line-height: 1;
}

.modern-alert {
    margin: 0 0 18px;
    border-radius: 9px;
}

@media (max-width: 780px) {
    .home-header {
        display: block;
    }

    .exercise-modern {
        margin-top: 16px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .dashboard-card {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 26px 22px;
    }

    .dashboard-icon {
        width: 64px;
        height: 64px;
    }

    .dashboard-icon svg {
        width: 35px;
        height: 35px;
    }

    .dashboard-content h2 {
        font-size: 25px;
    }

    .dashboard-content p {
        font-size: 16px;
    }

    .btn-primary-modern,
    .btn-outline-modern {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .dashboard-card {
        border-radius: 13px;
        padding: 22px 18px;
    }

    .dashboard-content h2 {
        font-size: 22px;
    }

    .exercise-modern input {
        width: 85px;
    }
}

/* =========================================================
   COLORAZIONE FORMULARI DIGITALI RENTRI
   ========================================================= */

.fir-annullato > td {
    background-color: #f8d7da !important;
}

.fir-quantita > td {
    background-color: #fff3cd !important;
}

.fir-iniziale > td {
    background-color: #e2e3e5 !important;
}

.fir-produttore > td {
    background-color: #d1ecf1 !important;
}

.fir-trasportatore > td {
    background-color: #d4edda !important;
}

.fir-accettato > td {
    background-color: #cce5ff !important;
}

.fir-annotazione > td {
    background-color: #e8daef !important;
}

.fir-trasbordo > td {
    background-color: #fdebd0 !important;
}

.fir-sosta > td {
    background-color: #d6eaf8 !important;
}

/* ============================================================
   PULSANTI FORMULARI HOME
   ============================================================ */

.formulari-buttons {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 18px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.formulari-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 370px;
    min-height: 76px;

    box-sizing: border-box;

    padding: 16px 24px;

    border: 2px solid #6d35d4;
    border-radius: 12px;

    background: #ffffff;
    color: #5d2dbb;

    text-decoration: none;

    font-size: 18px;
    font-weight: 800;

    text-align: center;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.formulari-action-button .button-arrow {
    font-size: 30px;
    line-height: 1;
    font-weight: 400;
}

/* Passaggio mouse */

.formulari-action-button:hover {
    background: #6d35d4;
    color: #ffffff;

    text-decoration: none;

    transform: translateY(-2px);

    box-shadow:
        0 10px 22px rgba(70, 35, 140, 0.20);
}

/* Pressione */

.formulari-action-button:active {
    transform: translateY(0);
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1000px) {

    .formulari-action-button {
        width: calc(50% - 9px);
        min-width: 280px;
    }
}


/* ============================================================
   TELEFONO
   ============================================================ */

@media (max-width: 700px) {

    .formulari-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .formulari-action-button {
        width: 100%;
        min-width: 0;
    }
}
/* =========================================================
   PULSANTI FORMULARI HOME
   Stesso stile del pulsante TEST CONNESSIONE CLIENTE
   ========================================================= */

.formulari-buttons {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
    margin-top: 28px;
    width: 100%;
}

.formulari-purple-button,
.formulari-purple-button:link,
.formulari-purple-button:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 390px;
    min-height: 72px;
    box-sizing: border-box;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient( 135deg, #7138d2 0%, #5725ae 100% );
    color: #ffffff !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(91, 43, 178, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}


/* FRECCIA */

.formulari-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #ffffff;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
}


/* PASSAGGIO MOUSE */

.formulari-purple-button:hover {
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(91, 43, 178, 0.30);
    filter: brightness(1.06);
}


/* CLICK */

.formulari-purple-button:active {
    transform: translateY(0);
    box-shadow: 0 5px 12px rgba(91, 43, 178, 0.22);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .formulari-buttons {
        gap: 14px;
    }

    .formulari-purple-button {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        font-size: 15px;
    }
}


/* =========================================================
   SMARTPHONE
   ========================================================= */

@media (max-width: 700px) {

    .formulari-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .formulari-purple-button {
        width: 100%;
        min-height: 64px;
    }
}

/* =========================================================
   TRASPORTATORE - PRIMA FIRMA GI APPOSTA
   ========================================================= */

.gia-firmato-box {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin-top: 12px !important;
    padding: 7px 10px;
    background: #c9ffd0;
    border: 1px solid #8bd497;
    border-radius: 6px;
    color: #e33a22;
    font-size: 16px;
    font-weight: 800;
}

    .gia-firmato-box input[type="checkbox"] {
        width: 19px !important;
        height: 19px;
        margin: 0 !important;
        flex: 0 0 auto;
        cursor: pointer;
    }



/* =========================================================
   HOME - VERSIONE PROFESSIONALE
   ========================================================= */
.dashboard-professional {
    gap: 20px;
}

.dashboard-professional .dashboard-card {
    border-radius: 18px;
    border-color: #e4e8ef;
    box-shadow: 0 12px 34px rgba(30, 41, 59, .07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-professional .dashboard-card:hover {
    transform: translateY(-1px);
    border-color: #ddd5ec;
    box-shadow: 0 16px 38px rgba(30, 41, 59, .09);
}

.dashboard-card-main::before {
    width: 6px;
}

.dashboard-card-rentri::before {
    width: 6px;
    background: linear-gradient(180deg, #5b2dab 0%, #45228d 100%);
}

.dashboard-card-compact {
    grid-template-columns: 72px 1fr;
    gap: 22px;
    padding-top: 26px;
    padding-bottom: 26px;
}

.dashboard-icon-small {
    width: 58px;
    height: 58px;
}

.dashboard-icon-small svg {
    width: 30px;
    height: 30px;
}

.dashboard-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 6px;
}

.dashboard-section-label {
    margin-bottom: 6px;
    color: #7b6f91;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .11em;
}

.dashboard-chip,
.connection-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid #e2d8f4;
    background: #f8f5fd;
    color: #5b2dab;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-chip-rentri {
    background: #f2edfb;
}

.connection-pill {
    border-color: #dce3ea;
    background: #f8fafc;
    color: #526174;
}

.professional-actions {
    gap: 14px;
    margin-top: 22px;
}

.professional-actions .formulari-purple-button {
    position: relative;
    width: 360px;
    min-height: 64px;
    justify-content: flex-start;
    padding: 14px 18px;
    border-radius: 11px;
    font-size: 15px;
    text-align: left;
}

.professional-actions .action-primary {
    background: linear-gradient(135deg, #6d35c5 0%, #5426a6 100%);
}

.professional-actions .action-secondary {
    border: 1.5px solid #d8c9ef;
    background: #ffffff;
    color: #5b2dab !important;
    box-shadow: 0 6px 16px rgba(91, 43, 178, .08);
}

.professional-actions .action-secondary .action-svg {
    border-color: #e6ddf4;
    background: #f7f3fc;
}

.professional-actions .action-secondary:hover {
    background: #f8f5fd;
    color: #4f249d !important;
}

.professional-actions .action-rentri {
    width: 430px;
    background: linear-gradient(135deg, #6330bb 0%, #4c218f 100%);
}

.action-svg {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 9px;
    background: rgba(255,255,255,.10);
}

.action-svg svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-status {
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.professional-actions .formulari-purple-button:disabled {
    opacity: .88;
    cursor: default;
    filter: saturate(.82);
}

.professional-actions .formulari-purple-button:disabled:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(91, 43, 178, .22);
}

.compact-heading {
    align-items: center;
}

.compact-action-form {
    display: flex;
    justify-content: flex-end;
}

.compact-test-button {
    min-height: 46px;
    padding: 0 18px;
    font-size: 13px;
}

@media (max-width: 900px) {
    .dashboard-heading-row {
        flex-direction: column;
    }

    .professional-actions .formulari-purple-button,
    .professional-actions .action-rentri {
        width: 100%;
    }

    .compact-action-form {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .dashboard-card-compact {
        grid-template-columns: 1fr;
    }

    .connection-pill,
    .dashboard-chip {
        align-self: flex-start;
    }

    .compact-test-button {
        width: 100%;
    }
}

/* ================================================================
   MENU PRINCIPALE PER RUOLI
   ================================================================ */
.main-menu-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 0 40px;
}

.main-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 34px;
}

.main-menu-header h1 {
    margin: 5px 0 4px;
}

.main-menu-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.main-menu-role,
.main-menu-exercise {
    padding: 7px 12px;
    border: 1px solid #dce3ea;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.main-menu-title {
    text-align: center;
    margin-bottom: 24px;
}

.main-menu-title h2 {
    margin-bottom: 6px;
}

.main-menu-title p {
    margin: 0;
    color: #6b7280;
}

.main-module-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 780px;
    margin: 0 auto;
}

.main-module-button {
    min-height: 118px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 22px 26px;
    border: 1px solid #d9e0e8;
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    color: #202733;
    box-shadow: 0 8px 24px rgba(27, 39, 51, .08);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.main-module-button.enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 13px 30px rgba(27, 39, 51, .13);
}

.main-module-button.productions.enabled { border-left: 7px solid #4d8f68; }
.main-module-button.formulari.enabled { border-left: 7px solid #7868d8; }
.main-module-button.registro.enabled { border-left: 7px solid #3e7ea8; }

.main-module-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f2f4f7;
    font-size: 31px;
    font-weight: 800;
}

.main-module-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.main-module-text strong {
    font-size: 20px;
    letter-spacing: .02em;
}

.main-module-text small {
    color: #697386;
    font-size: 13px;
}

.main-module-status {
    padding: 7px 10px;
    border-radius: 999px;
    background: #edf7ef;
    color: #28713f;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.main-module-button.disabled {
    opacity: .48;
    box-shadow: none;
    cursor: not-allowed;
    filter: grayscale(.35);
}

.main-module-button.disabled .main-module-status {
    background: #eceff3;
    color: #687180;
}

.module-placeholder-page {
    max-width: 760px;
    margin: 45px auto;
    padding: 32px;
    border: 1px solid #dce3ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(27, 39, 51, .08);
}

.module-placeholder-note {
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    background: #f6f8fa;
    color: #596273;
}

@media (max-width: 700px) {
    .main-menu-header {
        flex-direction: column;
    }

    .main-menu-user-info {
        align-items: flex-start;
    }

    .main-module-button {
        grid-template-columns: 52px minmax(0, 1fr);
        padding: 18px;
    }

    .main-module-icon {
        width: 48px;
        height: 48px;
        font-size: 25px;
    }

    .main-module-status {
        grid-column: 2;
        justify-self: start;
    }
}


/* ================================================================
   PDF REGISTRO - CARTELLA CLIENTE
   ================================================================ */
.registro-pdf-panel {
    margin-top: -2px;
    padding: 20px 22px;
    border: 1px solid #dce3ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(27, 39, 51, .06);
}

.registro-pdf-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.registro-pdf-heading h3 {
    margin: 3px 0 0;
    font-size: 18px;
}

.registro-pdf-count {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f8;
    color: #506170;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.registro-pdf-list {
    display: grid;
    gap: 9px;
}

.registro-pdf-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 11px 12px;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    background: #fafbfc;
}

.registro-pdf-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #edf2f6;
    color: #3e5366;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .05em;
}

.registro-pdf-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.registro-pdf-info strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.registro-pdf-info small {
    color: #6c7784;
    font-size: 11px;
}

.registro-pdf-open {
    min-width: 70px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #3e7ea8;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
}

.registro-pdf-open:hover {
    background: #326b91;
    color: #fff;
}

.registro-pdf-empty {
    padding: 13px 14px;
    border-radius: 9px;
    background: #f6f8fa;
    color: #637080;
    font-size: 12px;
}

@media (max-width: 700px) {
    .registro-pdf-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .registro-pdf-open {
        grid-column: 2;
        justify-self: start;
    }

    .registro-pdf-heading {
        align-items: flex-start;
    }
}

/* REGISTRO: documenti PDF integrati nel riquadro principale */
.registro-module-group {
    overflow: hidden;
    border: 1px solid #d9e0e8;
    border-left: 7px solid #3e7ea8;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(27, 39, 51, .08);
}

.registro-module-group .registro-main-link {
    border: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
}

.registro-module-group .registro-main-link.enabled:hover {
    transform: none;
    box-shadow: none;
    background: #fbfcfd;
}

.registro-module-group .registro-pdf-panel {
    margin: 0 22px 22px;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid #e2e7ec;
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 700px) {
    .registro-module-group .registro-pdf-panel {
        margin: 0 18px 18px;
    }
}


/* PAGINA REGISTRO: i documenti vengono caricati solo entrando nel modulo */
.registro-page {
    width: 100%;
    max-width: 1180px;
    margin: 28px auto;
}

.registro-main-static {
    cursor: default;
}

.registro-main-static:hover {
    transform: none !important;
    box-shadow: none !important;
    background: #fff !important;
}

.registro-page-actions {
    margin-top: 18px;
}

/* ============================================================
   MOVIMENTI OPERATORE - EDITOR / AZIONI
   ============================================================ */
.btn-danger-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid #d7a3a3;
    border-radius: 10px;
    background: #fff4f4;
    color: #a51f1f;
    font-weight: 700;
    cursor: pointer;
}
.btn-danger-soft:hover { background: #ffe7e7; }

.operator-editor-card {
    background: #fff;
    border: 1px solid #dbe3ea;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.operator-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px 26px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #dbe3ea;
}
.operator-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 26px;
}
.field-block { min-width: 0; }
.field-block > label:not(.check-line) {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}
.full-width { grid-column: 1 / -1; }
.form-control {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #b9c5d1;
    border-radius: 8px;
    background: #fff;
    color: #152238;
}
.check-line {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    cursor: pointer;
}
.check-line input { width: 20px; height: 20px; }
.vehicle2-row {
    display: flex;
    align-items: end;
    gap: 16px;
}
.vehicle2-main { flex: 1; min-width: 0; }
.rimorchio-check { padding-bottom: 10px; white-space: nowrap; }
.auth-row { display: flex; align-items: end; padding-bottom: 10px; }
.editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #dbe3ea;
}
.connector-success {
    margin: 14px 0;
    padding: 12px 16px;
    border-radius: 10px;
    background: #edf8ef;
    border: 1px solid #b8dfbf;
    color: #176b2c;
    font-weight: 600;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 800px) {
    .operator-type-grid,
    .operator-form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: auto; }
    .vehicle2-row { flex-direction: column; align-items: stretch; }
    .rimorchio-check { padding-bottom: 0; }
}

/* ============================================================
   FORMULARI - PULSANTE NUOVO FORMULARIO
   La view usa class="btn-primary".
   ============================================================ */
.btn-primary,
.btn-primary:link,
.btn-primary:visited {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 22px;
    border: 1px solid #3e7ea8;
    border-radius: 10px;
    background: #4388b3;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(62, 126, 168, .16);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn-primary:hover {
    background: #36779f;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(62, 126, 168, .22);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(62, 126, 168, .16);
}

.btn-primary:focus-visible {
    outline: 3px solid rgba(62, 126, 168, .28);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .formulari-header .btn-primary {
        width: 100%;
        margin-top: 12px;
    }
}

/* ================================================================
   CREA FORMULARIO DA MODELLO
   ================================================================ */
.model-generator-card {
    max-width: 980px;
    margin: 24px auto 0;
}

.model-generator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-generator-grid .field-wide {
    grid-column: 1 / -1;
}

.model-generator-grid label:not(.form-check) {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
}

.model-generator-grid select,
.model-generator-grid input[type="date"],
.model-generator-grid input[type="number"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    font: inherit;
}

.model-generator-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 30px;
    margin-top: 4px;
}

.model-generator-checks .form-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}

.model-generator-checks input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

@media (max-width: 760px) {
    .model-generator-grid {
        grid-template-columns: 1fr;
    }
}


/* PRODUZIONI MULTIPLE */
.productions-multiple-page{display:grid;gap:24px}.production-entry-card,.production-preview-card{background:#fff;border:1px solid #dce4ec;border-radius:22px;padding:28px}.production-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 22px}.field-span-2{grid-column:1/-1}.field-group{display:flex;flex-direction:column;gap:7px;min-width:0}.field-group label{font-weight:750;color:#17243a}.field-group input,.field-group select{min-height:46px;border:1px solid #c9d4df;border-radius:10px;padding:9px 12px;font:inherit;background:#fff}.production-entry-actions{display:flex;justify-content:flex-end;margin-top:22px}.production-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}.production-preview-heading h2{margin:3px 0 0}.production-table-wrap{overflow-x:auto}.production-table{width:100%;border-collapse:collapse}.production-table th,.production-table td{padding:13px 12px;border-bottom:1px solid #e5eaf0;text-align:left;white-space:nowrap}.production-table th{font-size:.82rem;text-transform:uppercase;letter-spacing:.04em;color:#5a687b}.btn-delete-row{border:1px solid #d8a6a6;background:#fff;color:#9d2929;border-radius:9px;padding:8px 12px;font-weight:800;cursor:pointer}.production-confirm-form{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin-top:24px}.production-empty{padding:22px 0}.production-confirm-form button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:760px){.production-grid{grid-template-columns:1fr}.field-span-2{grid-column:auto}.production-entry-card,.production-preview-card{padding:20px}.production-preview-heading{align-items:flex-start;flex-direction:column}.production-entry-actions,.production-confirm-form{justify-content:stretch}.production-entry-actions button,.production-confirm-form button,.production-confirm-form a{width:100%;text-align:center}}

.production-quantity-warning {
    margin-bottom: 18px;
    font-size: 1.05rem;
}
.production-quantity-warning strong {
    font-weight: 800;
}

/* RICHIEDI RITIRO */
.field-group textarea{border:1px solid #c9d4df;border-radius:10px;padding:10px 12px;font:inherit;background:#fff;resize:vertical;min-height:88px}.production-note-cell{white-space:normal!important;min-width:220px;max-width:380px}

.production-mail-destinations {
    margin: 0 0 18px 0;
    line-height: 1.55;
}

.production-mail-destinations span {
    overflow-wrap: anywhere;
}


/* REPORT GIACENZA */
.productions-multiple-page .production-entry-card form {
    width: 100%;
}

.productions-multiple-page .production-entry-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

@media (max-width: 760px) {
    .productions-multiple-page .production-grid {
        grid-template-columns: 1fr;
    }

    .productions-multiple-page .production-entry-actions {
        justify-content: stretch;
    }

    .productions-multiple-page .production-entry-actions .formulari-purple-button {
        width: 100%;
    }
}
