:root {
    --acsi-navy: #1a3a6c;
    --acsi-navy-deep: #12294d;
    --acsi-blue: #2456a3;
    --acsi-green: #008c45;
    --acsi-red: #cd212a;
    --surface: #f3f6fb;
    --card: #ffffff;
    --text: #1b2430;
    --muted: #5b6777;
    --border: #d7e0ec;
    --ok: #1f7a4d;
    --err: #b42318;
    --shadow: 0 18px 40px rgba(18, 41, 77, 0.12);
    --home-bg: #0b0b0d;
    --home-accent: #d20a11;
    --page-gradient: linear-gradient(165deg, var(--home-bg) 0%, #1a0a0c 38%, #6e0810 72%, var(--home-accent) 100%);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page-gradient);
    background-attachment: fixed;
    min-height: 100vh;
}

.page {
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.brand-bar img {
    width: min(220px, 55vw);
    height: auto;
    display: block;
}

.brand-side {
    text-align: right;
    color: var(--acsi-navy);
}

.brand-side strong {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-side span {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
}

.card {
    background: var(--card);
    border: 1px solid rgba(26, 58, 108, 0.08);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-head {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%),
        linear-gradient(120deg, var(--acsi-navy-deep), var(--acsi-navy) 55%, var(--acsi-blue));
    color: #fff;
    padding: 1.4rem 1.5rem 1.2rem;
    position: relative;
}

.card-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--acsi-green) 0 33%, #fff 33% 66%, var(--acsi-red) 66% 100%);
}

.card-head h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.card-head p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.98rem;
    max-width: 40rem;
}

.card-body {
    padding: 1.5rem;
}

.alert {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
    font-size: 0.95rem;
}

.alert-ok {
    background: #e8f7ee;
    color: var(--ok);
    border: 1px solid #b9e4c8;
}

.alert-err {
    background: #fef3f2;
    color: var(--err);
    border: 1px solid #f3c4c0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--acsi-navy);
}

.field label .req {
    color: var(--acsi-red);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field select,
.motori-select {
    width: 100%;
    border: 1px solid var(--border);
    background: #fbfdff;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    font: inherit;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field select,
.motori-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 2.5rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--acsi-navy) 50%),
        linear-gradient(135deg, var(--acsi-navy) 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px),
        100% 0;
    background-size: 6px 6px, 6px 6px, 2.6rem 100%;
    background-repeat: no-repeat;
}

.field input:focus,
.field select:focus,
.motori-select:focus {
    outline: none;
    border-color: #7ea0d8;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(36, 86, 163, 0.12);
}

.field .hint {
    font-size: 0.8rem;
    color: var(--muted);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    width: 100%;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--acsi-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle.is-on {
    background: #e8f0ff;
}

.upload-box {
    border: 2px dashed #b7c7de;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff, #f2f6fc);
    padding: 1.2rem;
    display: grid;
    gap: 0.85rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-box.is-dragover {
    border-color: var(--acsi-blue);
    background: #eaf2ff;
}

.upload-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.upload-copy strong {
    display: block;
    color: var(--acsi-navy);
    margin-bottom: 0.2rem;
}

.upload-copy span {
    color: var(--muted);
    font-size: 0.88rem;
}

.upload-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--acsi-navy), var(--acsi-blue));
    color: #fff;
    box-shadow: 0 10px 22px rgba(26, 58, 108, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--acsi-navy-deep), var(--acsi-navy));
}

.btn-secondary {
    background: #fff;
    color: var(--acsi-navy);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f4f8ff;
}

#tessera_input,
#pdf_tessera_input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.preview {
    display: none;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border);
}

.preview.is-visible {
    display: flex;
}

.preview img {
    width: 88px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #eef3f9;
}

.preview-meta {
    min-width: 0;
}

.preview-meta strong,
.preview-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-meta strong {
    color: var(--acsi-navy);
    font-size: 0.92rem;
}

.preview-meta span {
    color: var(--muted);
    font-size: 0.82rem;
}

.preview-pdf-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(135deg, #9b2c2c, #c53030);
    flex-shrink: 0;
}

.tessera-acsi-form {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.tessera-acsi-form .section-title {
    margin: 0 0 1rem;
}

.scheda-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.tessera-pdf-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    min-height: 3rem;
}

.btn-pdf-tessera {
    appearance: none;
    border: 1px solid #f0c2c2;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #9b2c2c;
    background: linear-gradient(180deg, #fff7f7, #ffecec);
    box-shadow: 0 6px 14px rgba(155, 44, 44, 0.12);
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-pdf-tessera:hover {
    background: linear-gradient(180deg, #ffecec, #ffdede);
    box-shadow: 0 8px 18px rgba(155, 44, 44, 0.18);
}

.btn-pdf-tessera:active {
    transform: translateY(1px);
}

.actions {
    margin-top: 1.35rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.actions-filter {
    justify-content: space-between;
    align-items: center;
}

.actions-export,
.actions-filter-main {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-export-excel {
    background: linear-gradient(135deg, #1f7a4d, #2f9e66);
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 122, 77, 0.2);
}

.btn-export-excel:hover {
    background: linear-gradient(135deg, #17653f, #1f7a4d);
}

.btn-export-pdf {
    background: linear-gradient(135deg, #9b2c2c, #c53030);
    color: #fff;
    box-shadow: 0 10px 22px rgba(155, 44, 44, 0.2);
}

.btn-export-pdf:hover {
    background: linear-gradient(135deg, #822727, #9b2c2c);
}

.footer-note {
    margin-top: 1rem;
    text-align: center;
    color: rgba(243, 245, 248, 0.82);
    font-size: 0.85rem;
}

.page-narrow {
    width: min(560px, calc(100% - 2rem));
}

.page-wide {
    width: min(1280px, calc(100% - 1.5rem));
}

body.page-index {
    color: #f3f5f8;
}

body.page-index .site-logo {
    padding-top: 1.5rem;
    padding-bottom: 0.25rem;
}

body.page-index .site-logo img {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

body.page-index .home-cta-hint {
    color: rgba(243, 245, 248, 0.78);
}

.page-home {
    width: min(920px, calc(100% - 2rem));
    display: flex;
    justify-content: center;
}

.page-wide > .card + .card,
.page-wide > .card + .filter-card,
.page-wide > .filter-card + .card {
    margin-top: 1rem;
}

.filter-card {
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    appearance: none;
    border: 0;
    background: linear-gradient(120deg, var(--acsi-navy-deep), var(--acsi-navy) 55%, var(--acsi-blue));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.35rem;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.accordion-trigger:hover,
.accordion-trigger.is-open {
    background: linear-gradient(120deg, #0f2344, var(--acsi-navy-deep) 55%, var(--acsi-navy));
}

.accordion-caret {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid currentColor;
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.accordion-trigger.is-open .accordion-caret {
    transform: rotate(180deg);
}

.accordion-panel {
    border-top: 5px solid transparent;
    border-image: linear-gradient(90deg, var(--acsi-green) 0 33%, #fff 33% 66%, var(--acsi-red) 66% 100%) 1;
}

.filter-form .hint {
    color: rgba(243, 245, 248, 0.85);
}

.filter-card .card-body {
    background: rgba(255, 255, 255, 0.97);
}

.filter-card .filter-form .hint {
    color: var(--muted);
}

.home-hero {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0 2.5rem;
    gap: 1rem;
}

.home-cta {
    position: relative;
    display: block;
    width: min(100%, 680px);
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(26, 58, 108, 0.12);
    background: #fff;
    box-shadow: 0 18px 40px rgba(18, 41, 77, 0.12);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.home-cta:hover,
.home-cta:focus-visible {
    transform: translateY(-6px) scale(1.015);
    border-color: rgba(36, 86, 163, 0.45);
    box-shadow:
        0 0 0 4px rgba(36, 86, 163, 0.14),
        0 28px 50px rgba(18, 41, 77, 0.2);
    outline: none;
}

.home-cta-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(70vh, 640px);
    object-fit: contain;
    background:
        radial-gradient(circle at top, rgba(36, 86, 163, 0.08), transparent 55%),
        #0b1220;
    transition: filter 0.22s ease, transform 0.22s ease;
}

video.home-cta-image {
    pointer-events: none;
    object-fit: cover;
    aspect-ratio: 834 / 1112;
}

.home-cta:hover .home-cta-image,
.home-cta:focus-visible .home-cta-image {
    filter: brightness(1.04) saturate(1.05);
    transform: scale(1.02);
}

.home-cta-label {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--acsi-navy), var(--acsi-blue));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(26, 58, 108, 0.25);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.home-cta:hover .home-cta-label,
.home-cta:focus-visible .home-cta-label {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.home-cta-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

.topnav {
    background: linear-gradient(120deg, var(--acsi-navy-deep), var(--acsi-navy) 60%, var(--acsi-blue));
    color: #fff;
    box-shadow: 0 8px 24px rgba(18, 41, 77, 0.18);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    overflow: visible;
}

.topnav-inner {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    min-height: 58px;
    max-height: none;
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
}

.topnav-brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
}

.topnav-brand:hover {
    background: rgba(255, 255, 255, 0.12);
}

.site-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 1rem 0.35rem;
}

.site-logo a {
    display: inline-block;
    line-height: 0;
}

.site-logo img {
    width: min(280px, 70vw);
    height: auto;
    max-height: 110px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.topnav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: auto;
    overflow: visible;
}

.topnav-label {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.topnav-menu-heading {
    display: block;
    padding: 0.45rem 0.85rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7c93;
}

.topnav-link,
.topnav-dropbtn {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
}

.topnav-link:hover,
.topnav-dropbtn:hover,
.topnav-link.is-active,
.topnav-dropbtn.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.topnav-dropdown-menu a.is-active-item {
    background: #eef3fb;
}

.topnav-dropdown {
    position: relative;
}

.topnav-dropbtn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.topnav-dropbtn .caret {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
}

.topnav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 240px;
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(26, 58, 108, 0.1);
    padding: 0.4rem;
    z-index: 60;
}

.topnav-dropdown-menu a,
.topnav-dropdown-menu .topnav-drop-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    color: var(--acsi-navy);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.topnav-dropdown-menu a:hover {
    background: #eef3fb;
}

.topnav-user-dropdown {
    margin-left: 0;
    flex: 0 0 auto;
}

.topnav-menu > .topnav-dropdown:last-child .topnav-dropdown-menu {
    left: auto;
    right: 0;
}

.topnav-user {
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.65rem 0.3rem 0.3rem;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.15;
}

.topnav-user:hover,
.topnav-user[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.16);
}

.topnav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #d7e5ff);
    color: var(--acsi-navy);
    font-size: 0.95rem;
    font-weight: 800;
    flex: 0 0 36px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.topnav-user-text {
    text-align: left;
    min-width: 0;
}

.topnav-user-text small {
    display: block;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}

.topnav-user-menu {
    right: 0;
    left: auto;
    min-width: 220px;
}

.topnav-dropdown-menu a.is-danger {
    color: var(--err);
}

.topnav-dropdown-menu a.is-danger:hover {
    background: #fef3f2;
}

.split-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.4rem;
    align-items: start;
}

.split-main,
.split-side {
    min-width: 0;
}

.section-title {
    margin: 0 0 1rem;
    color: var(--acsi-navy);
    font-size: 1.15rem;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-title-row .section-title {
    margin: 0;
}

.subcard {
    margin-top: 1.4rem;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
}

.result-card .result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.result-card .result-head .section-title {
    margin: 0;
}

.status-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 0 0 1.2rem;
}

.status-progress .step {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
}

.status-progress .step-dot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 auto 0.4rem;
    background: #c5d0e0;
}

.status-progress .step.is-done,
.status-progress .step.is-current {
    color: var(--acsi-navy);
    border-color: #b7c7de;
    background: #eef3fb;
}

.status-progress .step.is-done .step-dot,
.status-progress .step.is-current .step-dot {
    background: var(--acsi-blue);
}

.status-progress .step.is-current {
    box-shadow: 0 0 0 3px rgba(36, 86, 163, 0.12);
    font-weight: 700;
}

.status-progress .step.is-current .step-dot {
    background: #1f7a4d;
}

.status-progress .step-label {
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 720px) {
    .status-progress {
        grid-template-columns: 1fr;
    }
}

.data-table tr.is-selected td {
    background: #eef3fb;
}

@media (max-width: 960px) {
    .split-layout {
        grid-template-columns: 1fr;
    }
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.65rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--acsi-navy);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:hover {
    background: #f7faff;
}

.col-actions {
    width: 1%;
    text-align: center !important;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--acsi-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    background: #eef3fb;
}

.icon-btn.icon-delete {
    color: var(--err);
}

.icon-btn.icon-delete:hover {
    background: #fef3f2;
    border-color: #f3c4c0;
}

.btn-danger {
    background: linear-gradient(135deg, #9f1d1d, #b42318);
    color: #fff;
    box-shadow: 0 10px 22px rgba(180, 35, 24, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #861818, #9f1d1d);
}

.btn-success {
    background: linear-gradient(135deg, #17663f, #1f7a4d);
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 122, 77, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #145536, #17663f);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-aperta,
.badge-in_attesa {
    background: #e8f0ff;
    color: #1a3a6c;
}

.badge-in_lavorazione {
    background: #fff4e5;
    color: #9a5b00;
}

.badge-evasa {
    background: #e8f7ee;
    color: #1f7a4d;
}

.row-evasa td:not(.col-actions) {
    opacity: 0.78;
}

.icon-btn.icon-edit {
    color: #2456a3;
}

.icon-btn.icon-edit:hover {
    background: #e8f0ff;
    border-color: #b7c7de;
}

.icon-btn.icon-evade {
    color: #1f7a4d;
}

.motori-swal-field {
    text-align: left;
    margin-top: 0.35rem;
}

.motori-swal-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--acsi-navy);
    margin-bottom: 0.4rem;
}

.motori-swal-hint {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.motori-swal-select.motori-select,
select.motori-swal-select {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border: 1px solid var(--border) !important;
    background-color: #fbfdff !important;
    border-radius: 12px !important;
    padding: 0.85rem 2.5rem 0.85rem 0.95rem !important;
    font-family: "Source Sans 3", "Segoe UI", sans-serif !important;
    font-size: 0.98rem !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 48px;
}

.motori-swal-select.motori-select:focus,
select.motori-swal-select:focus {
    border-color: #7ea0d8 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(36, 86, 163, 0.12) !important;
}

.swal2-popup.motori-swal-popup {
    border-radius: 18px !important;
    font-family: "Source Sans 3", "Segoe UI", sans-serif !important;
}

.swal2-popup.motori-swal-popup .swal2-title {
    color: var(--acsi-navy) !important;
    font-weight: 700 !important;
}

.swal2-popup.motori-swal-popup .swal2-html-container {
    color: var(--text) !important;
}

.icon-btn.icon-evade:hover {
    background: #e8f7ee;
    border-color: #b9e4c8;
}

.icon-btn.icon-evade.is-done {
    cursor: default;
    color: #fff !important;
    background: #1f7a4d !important;
    border-color: #1f7a4d !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(31, 122, 77, 0.28);
}

.is-hidden {
    display: none !important;
}

.scheda-form .field input[readonly] {
    background: #f4f7fc;
    color: var(--text);
    cursor: default;
}

.tessera-viewer {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    min-height: 140px;
}

.tessera-viewer img,
.tessera-thumb {
    width: min(100%, 320px);
    height: auto;
    max-height: 220px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tessera-thumb:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(18, 41, 77, 0.14);
}

.swal-tessera-image {
    max-width: min(86vw, 820px) !important;
    max-height: min(70vh, 720px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px;
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 1.2rem, 920px);
        padding-top: 1rem;
    }

    .page-narrow,
    .page-wide {
        width: min(100% - 1.2rem, 1280px);
    }

    .brand-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-side {
        text-align: left;
    }

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

    .card-body {
        padding: 1.1rem;
    }

    .actions {
        justify-content: stretch;
    }

    .actions .btn {
        width: 100%;
    }

    .actions-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-export,
    .actions-filter-main {
        width: 100%;
    }

    .actions-export .btn,
    .actions-filter-main .btn {
        flex: 1 1 auto;
    }

    .topnav-inner {
        flex-wrap: wrap;
    }

    .topnav-menu {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
        order: 3;
        margin-left: 0;
    }

    .topnav-user-dropdown {
        margin-left: auto;
    }
}
