﻿
.ap-page {
    padding: 20px;
    background: #f5f7fb;
    min-height: 100vh;
}

.ap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

    .ap-header h3 {
        margin: 5px 0;
        font-size: 24px;
        font-weight: 700;
        color: #183153;
    }

.ap-breadcrumb, .ap-subtitle, .ap-label {
    color: #8491a5;
    font-size: 12px;
}

.ap-header-actions, .ap-status {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ap-document-card,
.ap-section,
.ap-summary-card,
.ap-total-card {
    border-radius: 12px;
    border: 1px solid #e8edf4;
    margin-bottom: 16px;
    background: white;
    box-shadow: 0 2px 8px rgba(20, 40, 70, .035);
}

.ap-document-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

    .ap-document-top h2 {
        font-size: 25px;
        color: #1765ae;
        margin: 5px 0 0;
        font-weight: 700;
    }

.ap-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 16px;
}

.ap-summary-card {
    position: relative;
    min-height: 115px;
    padding: 18px;
    overflow: hidden;
}

    .ap-summary-card h3 {
        font-size: 21px;
        font-weight: 700;
        margin: 12px 0;
        color: #183153;
    }

.summary-icon {
    position: absolute;
    right: 17px;
    top: 35px;
    font-size: 26px;
    opacity: .7;
}

.blue {
    color: #2878ce;
}

.green {
    color: #16a36a;
}

.orange {
    color: #e49b32;
}

.text-green {
    color: #16a36a !important;
}

.text-red {
    color: #dc4c4c !important;
}

.ap-section {
    padding: 20px;
}

.ap-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: #1765ae;
}

    .ap-section-title h4 {
        font-size: 16px;
        font-weight: 700;
        color: #243b59;
        margin: 0;
    }

.ap-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px 20px;
}

    .ap-info-grid > div {
        display: flex;
        flex-direction: column;
        gap: 7px;
        min-width: 0;
    }

    .ap-info-grid strong {
        font-size: 14px;
        color: #27374c;
        overflow-wrap: anywhere;
    }

.ap-grid {
    border: 1px solid #e7ebf1;
    border-radius: 8px;
}

.ap-total-card {
    padding: 20px;
    margin-left: auto;
    max-width: 430px;
}

.ap-total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: #58677a;
}

    .ap-total-row strong {
        color: #253b57;
    }

.ap-balance-row {
    border-top: 1px solid #e6eaf0;
    margin-top: 8px;
    padding-top: 17px;
    font-size: 16px;
    font-weight: 700;
}

@media(max-width: 900px) {
    .ap-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ap-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 550px) {
    .ap-page {
        padding: 10px;
    }

    .ap-header, .ap-document-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .ap-summary-grid {
        grid-template-columns: 1fr;
    }

    .ap-info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px 10px;
    }

    .ap-total-card {
        max-width: 100%;
    }
}

@media print {
    .ap-header-actions {
        display: none !important;
    }

    .ap-page {
        background: white;
        padding: 0;
    }

    .ap-section, .ap-summary-card, .ap-total-card,
    .ap-document-card {
        break-inside: avoid;
        box-shadow: none;
    }
}
