/* Trang Thư Viện Dầm Sàn */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #F4F6F9;
}

.main-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0.4rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

.filter-section {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.filter-item label {
    white-space: nowrap;
    color: #334155;
    font-weight: 500;
}

.filter-item select, .filter-item input {
    padding: 0.15rem 0.35rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #FFFFFF;
    outline: none;
}

.range-box {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.range-box input {
    width: 50px;
    text-align: center;
    padding: 2px 4px;
}

.fb-main-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    flex: 0 0 auto;
    height: 220px;
    min-height: 170px;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 0.5rem;
    overscroll-behavior: contain;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.fb-main-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.fb-main-table-wrap th {
    background: #F8FAFC;
    padding: 3px 6px;
    border-bottom: 1px solid #CBD5E1;
    border-right: 1px solid #E2E8F0;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
}

.fb-main-table-wrap td {
    padding: 3px 6px;
    border-bottom: 1px solid #F1F5F9;
    border-right: 1px solid #F8FAFC;
    white-space: nowrap;
}

.fb-main-table-wrap tr:hover {
    background: #F1F5F9;
    cursor: pointer;
}

.fb-main-table-wrap tr.active {
    background: #0D2B4E !important;
    color: #FFFFFF !important;
}

.fb-main-table-wrap tr.active td {
    color: #FFFFFF !important;
}

/* 2-Column Split: Left Segment Breakdown (500px) + Right Expanded SVG Elevation */
.fb-workspace-grid {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-height: 260px;
    margin-bottom: 0.4rem;
}

@media (max-width: 1200px) {
    .fb-workspace-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.fb-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.45rem 0.65rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.fb-card-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 0.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Right SVG Box (Expanded Wide Elevation Canvas) */
.fb-svg-box {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: #FFFFFF;
    border: 1px solid #F1F5F9;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-svg-box svg {
    width: 100%;
    height: 100%;
    display: block;
}

.action-bar-flex {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Print only header */
.print-only-header {
    display: none;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overscroll-behavior: contain;
}

.modal-box {
    background: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}
