.bas-wrap {
    max-width: 1180px;
    margin: 30px auto;
    font-family: Arial, sans-serif;
    color: #172033;
}

.bas-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 12px 35px rgba(17, 24, 39, 0.10);
    border: 1px solid rgba(17, 24, 39, 0.08);
    margin-bottom: 22px;
}

.bas-hero {
    background: linear-gradient(135deg, #0f4c81, #1d8fbd);
    color: #ffffff;
}

.bas-hero h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 30px;
}

.bas-hero p {
    margin: 0;
    opacity: 0.95;
}

.bas-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 22px;
    align-items: stretch;
}

.bas-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.bas-field {
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 48px;
}

.bas-field-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 165px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    background: #eef6fb;
    color: #18324a;
    font-weight: 800;
    font-size: 13px;
    line-height: 1.25;
    border: 1px solid #d9e9f4;
}

.bas-form input,
.bas-form select {
    width: 100%;
    height: 46px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #d7dce5;
    border-radius: 12px;
    font-size: 15px;
    background: #f8fafc;
    box-sizing: border-box;
}

.bas-form select {
    cursor: pointer;
}

.bas-form input:focus,
.bas-form select:focus {
    outline: none;
    border-color: #0f7db8;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 125, 184, 0.12);
}

.bas-btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    background: #edf2f7;
    color: #172033;
    transition: 0.2s ease;
}

.bas-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

.bas-primary {
    background: #0f7db8;
    color: #ffffff;
}

.bas-form .bas-primary {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 48px;
    font-size: 15px;
}

.bas-summary-card h3,
.bas-chart-card h3,
.bas-table-card h3 {
    margin-top: 0;
}

.bas-summary {
    display: grid;
    gap: 14px;
}

.bas-summary div {
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bas-summary span {
    color: #64748b;
    font-size: 14px;
}

.bas-summary strong {
    font-size: 18px;
}

.bas-chart-card canvas {
    cursor: default;
}

.bas-chart-card canvas.bas-chart-pointer {
    cursor: pointer;
}

.bas-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bas-table-actions div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bas-table-scroll {
    overflow-x: auto;
}

.bas-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.bas-table th,
.bas-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    font-size: 14px;
}

.bas-table th:nth-child(1),
.bas-table td:nth-child(1),
.bas-table th:nth-child(2),
.bas-table td:nth-child(2) {
    text-align: left;
}

.bas-table th {
    background: #f1f5f9;
    font-weight: 800;
    color: #334155;
}

.bas-table tbody tr:hover {
    background: #f8fafc;
}

.bas-empty {
    text-align: center !important;
    padding: 25px !important;
    color: #64748b;
}

@media (max-width: 1050px) {
    .bas-grid,
    .bas-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bas-field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bas-field-label {
        width: 100%;
        min-height: 40px;
        box-sizing: border-box;
    }

    .bas-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .bas-card {
        padding: 18px;
    }
}


/* v1.3.1 visibility and large number field fixes */
.bas-form-card { overflow: visible; }
.bas-field {
    grid-template-columns: 190px minmax(260px, 1fr);
}
.bas-field-label {
    width: 190px;
    box-sizing: border-box;
}
.bas-form input,
.bas-form select {
    min-width: 260px;
}
#basLoanAmount {
    min-width: 330px;
    width: 100%;
    font-size: 16px;
    letter-spacing: 0.2px;
}
.bas-table {
    min-width: 820px;
}
@media (max-width: 1050px) {
    .bas-field {
        grid-template-columns: 190px minmax(260px, 1fr);
    }
}
@media (max-width: 640px) {
    .bas-field {
        grid-template-columns: 1fr;
    }
    .bas-field-label,
    .bas-form input,
    .bas-form select,
    #basLoanAmount {
        width: 100%;
        min-width: 0;
    }
}


/* v1.3.2 layout collision fixes */
.bas-grid {
    grid-template-columns: 1fr;
}

.bas-form-card {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.bas-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
    width: 100%;
}

.bas-field {
    grid-template-columns: minmax(150px, 42%) minmax(0, 58%);
    gap: 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.bas-field-label {
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: normal;
}

.bas-form input,
.bas-form select,
#basLoanAmount {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    font-size: 15px;
}

#basLoanAmount {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.bas-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .bas-form,
    .bas-summary {
        grid-template-columns: 1fr;
    }
    .bas-field {
        grid-template-columns: minmax(150px, 42%) minmax(0, 58%);
    }
}

@media (max-width: 520px) {
    .bas-field {
        grid-template-columns: 1fr;
    }
    .bas-field-label,
    .bas-form input,
    .bas-form select,
    #basLoanAmount {
        width: 100% !important;
    }
}
