.company-title {
    font-size: 1.25rem;
    color: #1F2937;
}

/* --- Page Header --- */
.page-title {
    color: #374151;
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 24px;
}

/* --- Main Card Container --- */
.sp-main-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    padding: 24px;
}

/* --- Section Title --- */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

    .section-title i {
        color: #059669;
        font-size: 1.2rem;
    }

.sp-section-icon {
    width: 24px;
    height: 24px;
}

/* --- Custom Tabs --- */
.sp-custom-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

    .sp-custom-tabs .tab-btn {
        cursor: pointer;
        white-space: nowrap;
    }

/* --- Table Scroll Container --- */
.sp-table-wrapper {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
    margin-bottom: 24px;
}

.table-scroll-fixed {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #C7D4E5 #F3F6F9;
}

    .table-scroll-fixed::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    .table-scroll-fixed::-webkit-scrollbar-track {
        background: #F3F6F9;
        border-radius: 20px;
    }

    .table-scroll-fixed::-webkit-scrollbar-thumb {
        background: #C7D4E5;
        border-radius: 20px;
        border: 2px solid #F3F6F9;
    }

        .table-scroll-fixed::-webkit-scrollbar-thumb:hover {
            background: #AFC0D4;
        }

.sp-spic-table {
    min-width: 1800px;
    border-collapse: separate;
    border-spacing: 0;
}

    .sp-spic-table thead th {
        position: sticky;
        top: 0;
        background: #F4F7F9;
        z-index: 5;
        color: #334155;
        font-size: 0.85rem;
        font-weight: 700;
        padding: 14px 8px;
        border-bottom: 1px solid #E5E7EB;
    }

    .sp-spic-table thead tr:nth-child(2) th {
        top: 42px;
        z-index: 6;
    }

    .sp-spic-table .sub-th {
        font-size: 0.72rem;
        color: #64748B;
        font-weight: 600;
        padding: 8px;
        background: #F4F7F9;
    }

    .sp-spic-table tbody td {
        vertical-align: middle;
        padding: 10px 8px;
        border-bottom: 1px solid #F1F5F9;
    }

/* Sticky first column */
.sticky-first-col {
    position: sticky;
    left: 0;
    min-width: 180px;
    background: #fff;
    z-index: 3;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.05);
}

.sp-spic-table thead .sticky-first-col {
    background: #F4F7F9 !important;
}

.sticky-head-first {
    z-index: 8 !important;
}

/* Input boxes inside table */
.sp-table-input {
    background-color: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
    font-size: 0.8rem;
    color: #374151;
    font-weight: 600;
    width: 100%;
    min-width: 90px;
    max-width: 110px;
    margin: 0 auto;
    display: block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: 0.2s;
}

    .sp-table-input:focus {
        border-color: #059669;
        outline: none;
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    }

/* --- Per-Category Summary Cards --- */
.sp-summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    height: 100%;
}

.sp-summary-header {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sp-summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
    flex-shrink: 0;
}

    .sp-summary-dot.sp-dot-active {
        background: #2563eb;
    }

.sp-summary-name {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.sp-summary-unit-pill {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
}

.sp-summary-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.sp-summary-block {
    min-width: 0;
}

.sp-summary-block-right {
    text-align: right;
}

.sp-summary-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.sp-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    word-break: break-word;
}

.sp-summary-value-blue {
    color: #2563eb;
}

.sp-summary-suffix {
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748b;
}

.sp-summary-divider {
    width: 1px;
    height: 36px;
    background: #e2e8f0;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════ */

/* --- Tablet (≤ 991px) --- */
@media (max-width: 991.98px) {
    .company-title {
        font-size: 1.1rem;
    }

    .sp-main-card {
        padding: 18px;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 18px;
    }

    .sp-spic-table {
        min-width: 1500px;
    }

    .sp-summary-card {
        padding: 14px 16px;
    }

    .sp-summary-value {
        font-size: 1.1rem;
    }

    .table-scroll-fixed {
        max-height: 380px;
    }
}

/* --- Small Tablet / Large Phone (≤ 767px) --- */
@media (max-width: 767.98px) {
    .company-title {
        font-size: 1rem;
    }

    .sp-main-card {
        padding: 14px;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .sp-section-icon {
        width: 20px;
        height: 20px;
    }

    /* Tabs scroll horizontally instead of wrapping */
    .sp-custom-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

        .sp-custom-tabs::-webkit-scrollbar {
            height: 4px;
        }

        .sp-custom-tabs::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }

        .sp-custom-tabs .tab-btn {
            flex-shrink: 0;
            font-size: 0.78rem;
            padding: 7px 12px;
        }

    .sp-spic-table {
        min-width: 1300px;
    }

        .sp-spic-table thead th {
            padding: 10px 6px;
            font-size: 0.78rem;
        }

        .sp-spic-table tbody td {
            padding: 8px 6px;
        }

    .sticky-first-col {
        min-width: 150px;
    }

    .sp-table-input {
        min-width: 80px;
        max-width: 100px;
        padding: 7px 8px;
        font-size: 0.75rem;
    }

    .table-scroll-fixed {
        max-height: 360px;
    }

    .sp-summary-body {
        gap: 8px;
    }

    .sp-summary-value {
        font-size: 1rem;
    }
}

/* --- Mobile (≤ 575px) --- */
@media (max-width: 575.98px) {
    .company-title {
        font-size: 0.95rem;
    }

    .sp-main-card {
        padding: 12px;
        border-radius: 10px;
    }

    .section-title {
        font-size: 0.88rem;
        margin-bottom: 14px;
    }

    .sp-custom-tabs .tab-btn {
        font-size: 0.72rem;
        padding: 6px 10px;
    }

    .sp-spic-table {
        min-width: 1100px;
    }

        .sp-spic-table thead th {
            padding: 8px 4px;
            font-size: 0.72rem;
        }

        .sp-spic-table .sub-th {
            font-size: 0.65rem;
            padding: 6px 4px;
        }

        .sp-spic-table tbody td {
            padding: 6px 4px;
        }

        .sp-spic-table thead tr:nth-child(2) th {
            top: 36px;
        }

    .sticky-first-col {
        min-width: 130px;
        font-size: 0.75rem;
    }

    .sp-table-input {
        min-width: 70px;
        max-width: 90px;
        padding: 6px 6px;
        font-size: 0.72rem;
    }

    .table-scroll-fixed {
        max-height: 340px;
    }

    /* Summary card — stack value blocks if needed */
    .sp-summary-card {
        padding: 12px 14px;
    }

    .sp-summary-header {
        font-size: 0.78rem;
        margin-bottom: 10px;
    }

    .sp-summary-name {
        font-size: 0.78rem;
    }

    .sp-summary-value {
        font-size: 0.95rem;
    }

    .sp-summary-suffix {
        font-size: 0.62rem;
    }

    .sp-summary-label {
        font-size: 0.6rem;
    }

    .sp-summary-divider {
        height: 28px;
    }
}

/* --- Extra Small Phone (≤ 380px) --- */
@media (max-width: 380px) {
    .sp-main-card {
        padding: 10px;
    }

    .section-title {
        font-size: 0.82rem;
        gap: 6px;
    }

    .sp-section-icon {
        width: 18px;
        height: 18px;
    }

    .sp-custom-tabs .tab-btn {
        font-size: 0.68rem;
        padding: 5px 8px;
    }

    .sp-spic-table {
        min-width: 1000px;
    }

    .sticky-first-col {
        min-width: 115px;
        font-size: 0.7rem;
    }

    .sp-table-input {
        min-width: 60px;
        max-width: 80px;
        font-size: 0.68rem;
        padding: 5px 4px;
    }

    .sp-summary-body {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .sp-summary-block-right {
        text-align: left;
    }

    .sp-summary-divider {
        width: 100%;
        height: 1px;
    }
}
