/*
 * LA RIPARERIA — area.css
 * Copyright (c) 2026 Noccioli Carlo — Noccioli Tecnologie Srl.
 * Tutti i diritti riservati.
 * File CSS documentato e indentato; selettori e dichiarazioni invariati.
 */
[hidden] {
    display: none!important;
}
.private-header {
    background: #fff;
    border-bottom: 1px solid #e2e5df;
}
.private-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 104px;
    gap: 20px;
}
.private-nav img {
    width: 240px;
    max-width: 52vw;
    display: block;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 13px;
}
.nav-actions a {
    text-decoration: none;
}
.nav-actions form {
    margin: 0;
}
.logout {
    border: 1px solid #d3d8d1;
    border-radius: 5px;
    padding: 10px 15px;
    background: #fff;
    cursor: pointer;
    font: inherit;
}
.area-main {
    min-height: 70vh;
    padding-top: 70px;
    padding-bottom: 90px;
}
.area-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px;
}
.area-intro h1,.login-card h1 {
    font: 800 clamp(36px,5vw,65px)/1.15 Manrope,sans-serif;
    letter-spacing: -.055em;
    margin: 15px 0;
}
.area-intro p,.login-card p {
    color: #687169;
    margin: 0;
}
.accent {
    color: var(--accent);
}
.stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
    margin-bottom: 55px;
}
.stats>div {
    background: white;
    border: 1px solid #e2e4df;
    padding: 24px 27px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.stats small {
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: #7c857e;
}
.stats strong {
    font: 800 27px Manrope,sans-serif;
}
.stats .active-dot {
    font-size: 17px;
    color: var(--accent);
}
.panel {
    background: #fff;
    border: 1px solid #d7ddd5;
    padding: 32px;
    margin-bottom: 50px;
    box-shadow: 0 14px 45px #1a2b2110;
}
.panel-heading,.archive-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}
.panel h2,.archive-heading h2 {
    font: 800 26px Manrope,sans-serif;
    letter-spacing: -1px;
    margin: 5px 0;
}
.close {
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 23px;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.stack label {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.stack input,.stack select,.stack textarea,.filters input,.filters select {
    width: 100%;
    border: 1px solid #d3d8d1;
    background: #fff;
    border-radius: 5px;
    padding: 13px 14px;
    font: inherit;
    color: #242824;
}
.stack input:focus,.stack textarea:focus,.stack select:focus,.filters input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.stack .btn {
    align-self: flex-start;
}
.stack small {
    color: #69766e;
}
.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.filters {
    display: flex;
    gap: 10px;
    min-width: min(520px,100%);
}
.filters input {
    min-width: 0;
}
.filters select {
    max-width: 210px;
}
.count {
    font: 700 13px DM Sans,sans-serif;
    background: #e4e9e3;
    padding: 5px 10px;
    border-radius: 50px;
    vertical-align: middle;
    letter-spacing: 0;
}
.document-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.document {
    display: grid;
    grid-template-columns: 62px minmax(0,1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 23px;
    background: #fff;
    border: 1px solid #e0e4dc;
}
.file-symbol {
    height: 58px;
    width: 58px;
    background: #e8efea;
    color: #426c5a;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
}
.document-info {
    min-width: 0;
}
.category {
    font-size: 10px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: #426c5a;
    font-weight: 800;
}
.document h3 {
    font: 800 17px Manrope,sans-serif;
    letter-spacing: -.4px;
    margin: 4px 0;
}
.document p {
    font-size: 13px;
    color: #5e6b62;
    margin: 5px 0;
    overflow-wrap: anywhere;
}
.document small {
    font-size: 11px;
    color: #8a928b;
    overflow-wrap: anywhere;
}
.document-actions {
    display: flex;
    gap: 13px;
    align-items: center;
    flex-wrap: wrap;
}
.document-actions button,.document-actions a {
    font: 700 12px DM Sans,sans-serif;
    text-decoration: none;
    border: 0;
    background: none;
    cursor: pointer;
    padding: 8px 3px;
}
.document-actions .download {
    background: #171a19;
    color: white;
    border-radius: 4px;
    padding: 10px 14px;
}
.document-actions .delete {
    color: #a34a43;
}
.edit-panel {
    grid-column: 1/-1;
    border-top: 1px solid #e2e4df;
    padding-top: 20px;
}
.empty {
    padding: 80px 20px;
    text-align: center;
    border: 1px dashed #cbd2c9;
    background: #fff;
}
.empty h3 {
    font: 800 23px Manrope,sans-serif;
    margin: 8px 0;
}
.empty p {
    color: #6e786f;
}
.empty .btn {
    margin-top: 18px;
}
.empty-icon {
    font-size: 48px;
    color: #426c5a;
}
.no-results {
    padding: 30px;
    text-align: center;
    color: #687169;
}
.login-card {
    background: white;
    border: 1px solid #e0e4dc;
    max-width: 530px;
    margin: 30px auto;
    padding: 45px;
}
.login-card p {
    margin-bottom: 30px;
}
.secure-caption {
    font-size: 11px;
    color: #89928a;
    margin-top: 30px;
    border-top: 1px solid #e7eae4;
    padding-top: 20px;
}
.alert {
    padding: 13px 17px;
    margin: 20px 0;
    border-radius: 5px;
    font-size: 13px;
}
.alert.error {
    background: #fbe9e7;
    color: #8c332e;
}
.alert.success {
    background: #e6f1e9;
    color: #2e6541;
}
.private-footer {
    border-top: 1px solid #dfe2dc;
    padding: 28px 0;
    color: #7a847b;
    font-size: 12px;
}
.private-footer .wrap {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
@media(max-width:850px) {
    .area-intro {
        align-items: flex-start;
        flex-direction: column;
    }
    .archive-heading {
        align-items: stretch;
        flex-direction: column;
    }
    .document {
        grid-template-columns: 50px minmax(0,1fr);
    }
    .file-symbol {
        width: 48px;
        height: 48px;
    }
    .document-actions {
        grid-column: 2;
    }
    .stats>div {
        padding: 18px;
    }
}
@media(max-width:560px) {
    .private-nav {
        min-height: 80px;
    }
    .nav-actions {
        gap: 10px;
        font-size: 11px;
    }
    .area-main {
        padding-top: 35px;
    }
    .stats {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 35px;
    }
    .stats>div {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .stats strong {
        font-size: 19px;
    }
    .panel {
        padding: 20px;
    }
    .two-cols {
        grid-template-columns: 1fr;
    }
    .filters {
        flex-direction: column;
    }
    .filters select {
        max-width: none;
    }
    .document {
        padding: 15px;
        gap: 12px;
    }
    .document-actions {
        gap: 8px;
    }
    .login-card {
        padding: 25px;
        margin: 10px auto;
    }
    .private-footer .wrap {
        flex-direction: column;
    }
}
/* Anteprima documentale */
.document-actions .preview-btn {
    background: #e4eee7;
    color: #315e47;
    border: 1px solid #b8d1c0;
    border-radius: 4px;
    padding: 10px 14px;
}
.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(12,22,17,.75);
    padding: clamp(10px,3vw,30px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-dialog {
    background: #fff;
    width: min(1100px,100%);
    height: min(92dvh,900px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px #0005;
    border-radius: 9px;
    overflow: hidden;
}
.preview-top {
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e0e5df;
}
.preview-top h2 {
    font-size: 17px;
    margin: 5px 0 0;
    overflow-wrap: anywhere;
}
.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.preview-toolbar button,.preview-download {
    font: 700 12px inherit;
    padding: 10px 12px;
    border-radius: 5px;
    border: 1px solid #cdd9cf;
    background: #edf4ee;
    color: #284b36;
    text-decoration: none;
    cursor: pointer;
}
#closePreview {
    background: #f5f5f5;
    color: #333;
}
.preview-content {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef0ed;
    overflow: auto;
}
.preview-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: white;
}
.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.preview-content pre {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 24px;
    background: #fff;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 13px/1.65 ui-monospace,monospace;
}
.preview-message {
    margin: 0;
    padding: 10px 20px;
    font-size: 12px;
    color: #526459;
    border-top: 1px solid #e1e6e1;
}
body.preview-open {
    overflow: hidden;
}
@media(max-width:650px) {
    .preview-top {
        align-items: flex-start;
        flex-direction: column;
    }
    .preview-dialog {
        height: 95dvh;
    }
    .preview-toolbar {
        width: 100%;
    }
    .preview-content pre {
        padding: 12px;
    }
}
.preview-unavailable {
    padding: 30px;
    text-align: center;
}
/* Modal sempre in overlay, mai nel flusso della pagina */
#previewModal:not([hidden]) {
    position: fixed!important;
    inset: 0!important;
    display: flex!important;
    z-index: 2147483000!important;
    align-items: center!important;
    justify-content: center!important;
}
#previewModal[hidden] {
    display: none!important;
}
#previewModal .preview-dialog {
    position: relative!important;
    max-width: 100%!important;
    max-height: 90dvh!important;
}
/* Condivisione WhatsApp: stile autonomo e responsive */
.document-actions .whatsapp-btn {
    background: #e6f5eb;
    color: #176b39;
    border: 1px solid #a9d8b8;
    border-radius: 5px;
    padding: 10px 13px;
    white-space: nowrap;
}
.document-actions .whatsapp-btn:hover {
    background: #d3ebdb;
}
.document-actions .whatsapp-btn:disabled {
    opacity: .55;
    cursor: wait;
}
