
:root {
    --bg: #f3f7fb;
    --card: #ffffff;
    --line: #2563eb;
    --invert: #334155;
    --loss: #dc2626;
    --zero: #111827;
    --grid: #dbe4ef;
    --text: #0f172a;
    --muted: #64748b;
    --basin: #eaf3ff;
    --basin-stroke: #94a3b8;
    --ok: #059669;
}

.card-clean {
    border: 0;
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.hydraulic-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .3px;
    margin-bottom: 6px;
}

.hydraulic-sub {
    color: var(--muted);
    font-size: 14px;
}

.h_chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: #eef6ff;
    color: #1d4ed8;
    margin: 4px 8px 0 0;
}

.h_chip.dark {
    background: #eef2f7;
    color: #334155;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.line-sample {
    width: 34px;
    height: 0;
    border-top: 3px solid var(--line);
}

.line-sample.gray {
    border-color: var(--invert);
}

.line-sample.red {
    border-color: var(--loss);
}

.line-sample.black {
    border-color: var(--zero);
    border-top-style: dashed;
    border-top-width: 2px;
}

.basin-sample {
    width: 22px;
    height: 12px;
    border-radius: 4px;
    background: var(--basin);
    border: 1px solid var(--basin-stroke);
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 14px;
}

.control-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}
.btn-soft {
    background: #eef6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-soft:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.profile-box {
    overflow: auto;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #e5edf7;
}

#profileSvg {
    width: 100%;
    height: 620px;
    display: block;
}

.table-hydraulic thead th {
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    vertical-align: middle;
}

.table-hydraulic tbody td {
    font-size: 13px;
    vertical-align: middle;
}

.table-input {
    min-width: 110px;
    border-radius: 10px;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    font-size: 13px;
}

.table-input.name {
    min-width: 180px;
}

.pill-loss {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fdba74;
}

.pill-zero {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #111827;
    background: #f3f4f6;
    border: 1px dashed #9ca3af;
}

.note-box {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
}

.sticky-tools {
    position: sticky;
    top: 12px;
    z-index: 4;
}

.summary-head {
    font-size: 13px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.summary-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

.small-help {
    font-size: 12px;
    color: #64748b;
}

.danger-soft {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.print-sheet-host {
    display: none;
}
@media print{
    html, body{
        margin:0 !important;
        padding:0 !important;
        background:#fff !important;
        width:100% !important;
        height:100% !important;
    }

    /* Ẩn toàn bộ mọi thứ trên trang */
    body.print-mode *{
        visibility:hidden !important;
    }

    /* Chỉ hiện sheet in */
    body.print-mode #printSheetHost,
    body.print-mode #printSheetHost *{
        visibility:visible !important;
    }

    body.print-mode #printSheetHost{
        display:block !important;
        position:fixed !important;
        inset:0 !important;
        width:100vw !important;
        height:100vh !important;
        background:#fff !important;
        z-index:2147483647 !important;
        overflow:hidden !important;
    }

    body.print-mode .print-sheet{
        width:100% !important;
        height:100% !important;
        box-sizing:border-box !important;
        background:#fff !important;
        overflow:hidden !important;
    }

    body.print-mode .print-sheet svg{
        width:100% !important;
        height:100% !important;
        display:block !important;
    }
}

/* ===== Bảng tổng hợp cao trình ===== */
.summary-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    /* overflow: hidden; */
    background: #fff;
}

#summaryTable {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

#summaryTable thead th {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

#summaryTable thead th:last-child {
    border-right: 0;
}

#summaryTable tbody td {
    padding: 11px 10px;
    vertical-align: middle;
    border-top: 1px solid #eef2f7;
    color: #1e293b;
    background: #fff;
}

#summaryTable tbody tr:nth-child(even) td {
    background: #f8fbff;
}

#summaryTable tbody tr:hover td {
    background: #eef6ff;
    transition: background .2s ease;
}

#summaryTable tbody td:nth-child(1) {
    width: 60px;
    text-align: center;
    font-weight: 700;
    color: #475569;
}

#summaryTable tbody td:nth-child(2) {
    font-weight: 700;
    min-width: 180px;
    color: #0f172a;
}

#summaryTable tbody td:nth-child(n+3) {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

#summaryTable .pill-loss {
    display: inline-block;
    min-width: 72px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #b45309;
    background: #fff7ed;
    border: 1px solid #fdba74;
}

#summaryTable .elev-plus {
    color: #0f766e;
    font-weight: 700;
}

#summaryTable .elev-minus {
    color: #b91c1c;
    font-weight: 700;
}

#summaryTable .elev-zero {
    color: #1d4ed8;
    font-weight: 800;
}

#summaryTable .depth-cell {
    font-weight: 700;
    color: #047857;
}

@media (max-width: 992px) {
    #summaryTable {
        font-size: 12px;
    }

    #summaryTable thead th,
    #summaryTable tbody td {
        padding: 10px 8px;
    }
}
