/* =====================================================
   PU-74 VIRTUAL JURNAL — Yuridik Hujjat 
   ===================================================== */

#pu74-excel-viewer {
    font-family: 'Times New Roman', 'Noto Serif', Georgia, serif !important;
}

/* ===== TOPBAR ===== */
#pu74-topbar {
    background: linear-gradient(135deg, #1a3c34, #217346) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ===== SHEET TABS ===== */
#pu74-sheet-tabs {
    background: #263238 !important;
    scrollbar-width: thin;
}

#pu74-sheet-tabs::-webkit-scrollbar {
    height: 4px;
}

#pu74-sheet-tabs::-webkit-scrollbar-thumb {
    background: #f1c40f;
    border-radius: 2px;
}

/* ===== JURNAL CONTENT ===== */
#pu74-journal-content {
    background: linear-gradient(135deg, #c9bfa3 0%, #ddd3be 50%, #c9bfa3 100%) !important;
}

/* ===== A4 SAHIFA ===== */
.pu74-paper-page {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 8px 32px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    padding: 10px;
    max-width: 1500px;
    width: 100%;
    overflow-x: auto;
    position: relative;
}

/* ===== TABLE ===== */
.pu74-journal-table {
    border-collapse: collapse;
    width: 100%;
    font-family: 'Times New Roman', serif;
    color: #1a1a2e;
    font-size: 11px;
    table-layout: auto;
}

.pu74-journal-table td {
    border: 1px solid #999;
    padding: 3px 5px;
    min-width: 18px;
    vertical-align: middle;
    line-height: 1.3;
    max-width: 350px;
    word-wrap: break-word;
}

.pu74-journal-table td:focus {
    outline: 2px solid #2980b9 !important;
    background: #fffde7 !important;
    box-shadow: 0 0 6px rgba(41, 128, 185, 0.3);
    z-index: 2;
    position: relative;
}

/* ===== BO'SH KATAK (chegarasiz) ===== */
.pu74-empty-cell {
    border-color: transparent !important;
    background: transparent !important;
}

/* ===== MATN KATAGI (forma joylari) ===== */
.pu74-text-cell {
    border-color: transparent !important;
    font-size: 12px;
    padding: 2px 4px;
    line-height: 1.5;
}

/* ===== FORMULA ===== */
.pu74-formula-cell {
    background: rgba(241, 196, 15, 0.08) !important;
    color: #1565c0 !important;
    font-weight: 600;
    cursor: default;
    position: relative;
    text-align: center;
}

.pu74-formula-cell::after {
    content: '⚡';
    position: absolute;
    top: 0;
    right: 1px;
    font-size: 7px;
    opacity: 0.35;
}

/* Qayta hisoblash animatsiyasi */
.pu74-recalc-flash {
    animation: pu74flash 0.8s ease;
}

@keyframes pu74flash {
    0% {
        background: #fff9c4 !important;
    }

    30% {
        background: #c8e6c9 !important;
    }

    100% {
        background: transparent;
    }
}

/* Cross-sheet formula */
.pu74-cross-formula {
    background: rgba(156, 39, 176, 0.06) !important;
    color: #7b1fa2 !important;
}

.pu74-cross-formula::after {
    content: '🔗';
}

/* Number cell */
.pu74-num-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Sarlavha/header cell */
.pu74-header-cell {
    font-weight: bold;
    text-align: center;
    font-size: 10px;
    color: #2c3e50;
}

/* ===== MUQOVA SAHIFA (1-bet): Forma ko'rinishi ===== */
.pu74-cover-page .pu74-journal-table {
    font-size: 13px;
}

.pu74-cover-page .pu74-journal-table td {
    border: none !important;
    padding: 3px 5px;
}

.pu74-cover-page .pu74-form-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
}

.pu74-cover-page .pu74-form-label {
    font-size: 13px;
    border-bottom: 1px solid #333 !important;
    padding-bottom: 2px;
}

/* ===== IMZO ===== */
.pu74-signature-area {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    margin-top: 25px;
    padding: 15px 0;
    border-top: 1px dashed #bbb;
    flex-wrap: wrap;
    gap: 12px;
}

.pu74-signature-box {
    text-align: center;
    flex: 1;
    min-width: 160px;
}

.pu74-signature-box label {
    display: block;
    font-size: 10px;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pu74-signature-canvas {
    width: 180px;
    height: 55px;
    border-bottom: 2px solid #333;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    background: transparent;
}

.pu74-signature-canvas.signed {
    border-bottom-color: #27ae60;
}

.pu74-sign-btn {
    margin-top: 4px;
    font-size: 9px;
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    color: #555;
}

.pu74-sign-btn:hover {
    background: #dfe6e9;
}

/* ===== TOOLBAR  ===== */
.pu74-toolbar-btn {
    border: none;
    color: white;
    padding: 7px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}

.pu74-toolbar-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* ===== SAQLANDI BADGE ===== */
.pu74-saved-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    z-index: 20000;
    animation: pu74slideUp 0.3s ease;
}

@keyframes pu74slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== PRINT ===== */
@media print {
    body * {
        visibility: hidden !important;
    }

    #pu74-excel-viewer,
    #pu74-excel-viewer * {
        visibility: visible !important;
    }

    #pu74-excel-viewer {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
    }

    #pu74-topbar,
    #pu74-sheet-tabs {
        display: none !important;
    }

    #pu74-journal-content {
        background: white !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }

    .pu74-paper-page {
        box-shadow: none !important;
        border: none !important;
        padding: 5mm !important;
        max-width: 100% !important;
    }

    .pu74-journal-table {
        font-size: 9px !important;
    }

    .pu74-journal-table td {
        color: black !important;
        padding: 2px 3px !important;
    }

    /* Data sheetlarda border */
    .pu74-journal-table td:not(.pu74-empty-cell) {
        border: 1px solid #666 !important;
    }

    .pu74-formula-cell {
        background: white !important;
        color: black !important;
    }

    .pu74-formula-cell::after,
    .pu74-cross-formula::after {
        display: none !important;
    }

    .pu74-sign-btn {
        display: none !important;
    }

    .pu74-signature-canvas {
        border-bottom: 1px solid black !important;
    }

    .pu74-saved-badge {
        display: none !important;
    }

    @page {
        size: A4 landscape;
        margin: 8mm;
    }
}