.au-page {
    max-width: 1200px;
}

.au-intro {
    color: #475569;
    font-size: 14px;
    margin: 0 0 16px;
}

.au-list-header {
    margin-bottom: 16px;
}

.au-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 1024px) {
    .au-cols { grid-template-columns: 1fr; }
}

.au-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

.au-box h3 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.au-box label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

.au-box input,
.au-box select,
.au-box textarea {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.au-inline2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.au-readonly {
    padding: 8px 10px;
    background: #e2e8f0;
    border-radius: 6px;
    font-weight: 700;
    color: #0f172a;
}

.au-radio-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 4px;
    font-size: 13px;
    color: #334155;
}

.au-radio-group label {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-weight: 500;
}

.au-allegati-box {
    margin-bottom: 0;
}

[data-au-allegati-list] {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

[data-au-allegati-list]::-webkit-scrollbar {
    width: 10px;
}

[data-au-allegati-list]::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.au-hint {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 10px;
}

.au-allegato-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 13px;
}

/* Form: area scrollabile + pulsanti sempre visibili (solo quando il form è aperto) */
body.au-form-active .content-body:has([data-ddm-acquisto-usato-host].au-form-mode) {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    min-height: 0;
}

[data-ddm-acquisto-usato-host].au-form-mode {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.au-page.au-view-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.au-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.au-form-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding-right: 6px;
    padding-bottom: 8px;
    scrollbar-width: auto;
    scrollbar-color: #64748b #e2e8f0;
}

.au-form-scroll::-webkit-scrollbar {
    width: 12px;
}

.au-form-scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 8px;
}

.au-form-scroll::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.au-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 0;
    padding: 14px 0 4px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 2;
}

.au-page .btn-primary {
    background: #3d9c35;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
}

.au-page .btn-primary:hover { background: #358c2e; }
.au-page .btn-primary:disabled { opacity: 0.7; cursor: wait; }

.au-page .btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.au-tabella .btn-link {
    background: none;
    border: none;
    color: #3d9c35;
    cursor: pointer;
    font-size: 13px;
}

.au-tabella .btn-link.danger { color: #b91c1c; }
