/* --- GENERALI --- */
body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #343a40;
}

/* --- LOGO STYLES --- */
.logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo {
    max-width: 400px; 
    width: 100%; 
    height: auto;
    display: block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.main-logo:hover {
    transform: scale(1.05);
}

/* --- DRAG & DROP STYLES --- */
.upload-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
    border-radius: 10px;
    overflow: hidden;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #fff;
    position: relative;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.upload-area.drag-over {
    border-color: #0d6efd;
    background-color: #e7f1ff;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.2);
}

.file-input-hidden {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- F24 REPORT STYLES --- */
.f24-paper {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 0;
    border: 1px solid #dce1e7;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    margin-bottom: 50px;
}

.f24-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #8898aa;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.f24-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #32325d;
    line-height: 1.4;
}

.f24-value-mono {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.section-box {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-left-width: 5px !important;
    border-radius: 6px;
    margin-bottom: 25px;
}

.section-header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Colori Background Soft */
.bg-primary-soft { background-color: #ebf0ff; color: #2c4ed6; }
.bg-success-soft { background-color: #e6fffa; color: #23a094; }
.bg-info-soft    { background-color: #e3f8ff; color: #0091ca; }
.bg-warning-soft { background-color: #fff9db; color: #f08c00; }
.bg-light        { background-color: #f8f9fa; color: #495057; }

.border-primary { border-left-color: #4c6ef5 !important; }
.border-success { border-left-color: #20c997 !important; }
.border-info    { border-left-color: #0cafda !important; }
.border-warning { border-left-color: #fcc419 !important; }
.border-secondary { border-left-color: #868e96 !important; }

.text-primary { color: #4c6ef5 !important; }
.text-success { color: #20c997 !important; }
.text-info    { color: #0cafda !important; }
.text-warning { color: #fcc419 !important; }

.table-f24 th {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #adb5bd;
    font-weight: 700;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 8px;
}

.table-f24 td {
    vertical-align: middle;
    padding: 12px 8px;
    color: #525f7f;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f3f5;
    height: 35px;
}

.row-total td {
    background-color: #fcfcfc;
    font-weight: 600;
    color: #525f7f;
    border-top: 2px solid #e9ecef;
}

.row-saldo {
    font-family: 'Consolas', monospace;
}

/* NAVIGAZIONE F24 */
.f24-navigation {
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 8px;
}

.f24-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animazione cambio pagina */
.fade-in {
    animation: fadeInPage 0.3s ease-in-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- JSON VIEWER --- */
.json-tree-container {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    max-height: 650px;
    overflow-y: auto;
}

details { margin-left: 20px; }
summary { cursor: pointer; outline: none; }
summary::before { content: '▶'; font-size: 10px; display: inline-block; margin-right: 8px; color: #858585; transition: 0.1s; }
details[open] > summary::before { transform: rotate(90deg); }

.jv-key { color: #9cdcfe; }
.jv-string { color: #ce9178; }
.jv-number { color: #b5cea8; }
.jv-boolean { color: #569cd6; }
.jv-null { color: #569cd6; font-style: italic; }
.jv-object-summary { opacity: 0.6; font-weight: normal; }

/* --- PRINT STYLES --- */
@media print {
    body { background-color: white; color: black; }
    header, .upload-card, .nav-pills, .btn, .f24-navigation, #loader, .card-header, .alert { display: none !important; }
    .f24-paper { box-shadow: none; border: none; padding: 0; margin: 0; }
    .card { border: none !important; box-shadow: none !important; }
    .section-box { break-inside: avoid; }
    .container { max-width: 100%; padding: 0; }
    /* Nascondi il logo in stampa se troppo grande */
    .main-logo { max-width: 250px; }
}