
/* BHXH Tools Pro */

.bhxh-tools{
    max-width:900px;
    margin:20px auto;
    font-family:Arial,Helvetica,sans-serif;
}

.bhxh-box{
    background:#fff;
    border:1px solid #ddd;
    border-radius:12px;
    padding:24px;
    box-shadow:0 2px 8px rgba(0,0,0,.05);
}

.bhxh-box h2{
    margin-top:0;
    color:#0d6efd;
}

.bhxh-note{
    color:#666;
    margin-bottom:20px;
}

.bhxh-field{
    margin-bottom:16px;
}

.bhxh-field label{
    display:block;
    font-weight:600;
    margin-bottom:6px;
}

.bhxh-field input,
.bhxh-field select,
.bhxh-period-row input{
    width:100%;
    padding:10px;
    border:1px solid #ccc;
    border-radius:8px;
    box-sizing:border-box;
}

.bhxh-period-row{
    display:grid;
    grid-template-columns:1fr 1fr 1fr auto;
    gap:10px;
    margin-bottom:10px;
}

.bhxh-primary,
.bhxh-secondary,
.bhxh-remove-row,
.bhxh-print{
    border:none;
    border-radius:8px;
    padding:10px 16px;
    cursor:pointer;
}

.bhxh-primary{
    background:#0d6efd;
    color:#fff;
}

.bhxh-secondary{
    background:#198754;
    color:#fff;
    margin-right:8px;
}

.bhxh-remove-row{
    background:#dc3545;
    color:#fff;
}

.bhxh-print{
    background:#6c757d;
    color:#fff;
    margin-top:15px;
}

.bhxh-result{
    margin-top:20px;
}

.bhxh-result-inner{
    border:1px solid #dbe7ff;
    background:#f8fbff;
    border-radius:10px;
    padding:20px;
}

.bhxh-result-status{
    padding:12px;
    border-radius:8px;
    margin-bottom:15px;
    font-weight:700;
}

.bhxh-result-status.is-ok{
    background:#d1e7dd;
    color:#0f5132;
}

.bhxh-result-status.is-warning{
    background:#fff3cd;
    color:#664d03;
}

.bhxh-result-table{
    width:100%;
    border-collapse:collapse;
}

.bhxh-result-table td{
    border-bottom:1px solid #eee;
    padding:10px;
}

.bhxh-total-row{
    background:#eaf4ff;
    font-size:18px;
}

.bhxh-month-list{
    margin-top:15px;
}

.bhxh-explanation{
    margin-top:15px;
    line-height:1.6;
    color:#444;
}

@media(max-width:768px){

    .bhxh-period-row{
        grid-template-columns:1fr;
    }

    .bhxh-primary,
    .bhxh-secondary{
        width:100%;
        margin-bottom:10px;
    }
}

@media print{

    .bhxh-primary,
    .bhxh-secondary,
    .bhxh-remove-row,
    .bhxh-print{
        display:none !important;
    }

    .bhxh-box{
        border:none;
        box-shadow:none;
    }
}


.bhxh-embed-section{
    margin-top:28px;
    padding-top:20px;
    border-top:1px solid #e5e7eb;
}

.bhxh-embed-section h3{
    margin-top:0;
    color:#0d6efd;
}

.bhxh-embed-code{
    width:100%;
    min-height:110px;
    padding:12px;
    border:1px solid #d7dce2;
    border-radius:8px;
    font-family:Consolas,Monaco,monospace;
    font-size:13px;
    line-height:1.5;
    resize:vertical;
    background:#fafafa;
    box-sizing:border-box;
}

.bhxh-embed-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:12px;
}

.bhxh-copy-embed,
.bhxh-preview-embed{
    display:inline-block;
    padding:10px 16px;
    border-radius:8px;
    text-decoration:none;
    cursor:pointer;
    border:none;
    font-size:14px;
}

.bhxh-copy-embed{
    background:#0d6efd;
    color:#fff;
}

.bhxh-preview-embed{
    background:#198754;
    color:#fff;
}

.bhxh-embed-note{
    color:#666;
    font-size:14px;
    margin-bottom:10px;
}

/* BHXH một lần theo mức lương */
.bhxh-onetime-periods{display:flex;flex-direction:column;gap:12px;margin:12px 0;}
.bhxh-onetime-row{display:grid;grid-template-columns:1fr 1fr 1.5fr auto;align-items:end;gap:10px;padding:14px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;}
.bhxh-onetime-row label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:#374151;}
.bhxh-onetime-row input{width:100%;min-width:0;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:7px;font:inherit;}
.bhxh-add-onetime-period{margin-bottom:10px;}
@media(max-width:640px){.bhxh-onetime-row{grid-template-columns:1fr 1fr;}.bhxh-onetime-row label:nth-child(3){grid-column:1/-1;}.bhxh-onetime-row .bhxh-remove-row{grid-column:1/-1;width:100%;}}

/* v0.1.6: import contribution history and allowance fields */
.bhxh-import-panel{margin:16px 0;padding:16px;border:1px dashed #b7c4d8;border-radius:10px;background:#f8fafc}
.bhxh-import-panel input[type=file]{display:block;max-width:100%;margin:8px 0 12px}
.bhxh-onetime-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:10px;align-items:end;margin:12px 0;padding:12px;border:1px solid #e0e6ef;border-radius:10px}
.bhxh-onetime-row label{display:flex;flex-direction:column;gap:5px;font-size:13px}
.bhxh-onetime-row input{max-width:100%;min-width:0;box-sizing:border-box}
@media(max-width:600px){.bhxh-onetime-row{grid-template-columns:1fr 1fr}.bhxh-import-panel{padding:12px}}

/* v0.2.8 - import panel and salary mode selector */
.bhxh-import-panel{margin:16px 0;padding:18px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc}
.bhxh-import-heading h3{margin:0 0 5px}.bhxh-import-heading p{margin:0 0 14px;color:#64748b}
.bhxh-template-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 16px}
.bhxh-template-link{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid #bfdbfe;border-radius:10px;background:#fff;color:#1e40af;text-decoration:none}
.bhxh-template-link:hover{border-color:#2563eb;background:#eff6ff}.bhxh-template-link strong,.bhxh-template-link small{display:block}.bhxh-template-link small{margin-top:3px;color:#64748b;font-size:12px}
.bhxh-template-icon{display:grid;place-items:center;width:34px;height:34px;flex:none;border-radius:8px;background:#dbeafe;font-size:22px;font-weight:bold}
.bhxh-file-label{display:block;margin:8px 0 12px;font-weight:600}.bhxh-file-label input{display:block;margin-top:7px;max-width:100%;font-weight:400}
.bhxh-import-status{margin-top:8px;font-size:13px;color:#166534}
.bhxh-salary-mode-wrap{margin:18px 0;padding:16px;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff}
.bhxh-salary-mode-wrap h3{margin:0 0 12px;color:#1e3a8a}.bhxh-salary-mode-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.bhxh-mode-card{display:flex;align-items:center;gap:10px;padding:15px;border:2px solid #cbd5e1;border-radius:10px;background:#fff;cursor:pointer;transition:.15s}
.bhxh-mode-card input{position:absolute;opacity:0;width:1px;height:1px}.bhxh-mode-card.is-active{border-color:#2563eb;background:#dbeafe;box-shadow:0 0 0 2px #bfdbfe}
.bhxh-mode-radio{width:18px;height:18px;flex:none;border:2px solid #94a3b8;border-radius:50%;position:relative}.bhxh-mode-card.is-active .bhxh-mode-radio{border-color:#1d4ed8}.bhxh-mode-card.is-active .bhxh-mode-radio:after{content:"";position:absolute;inset:3px;border-radius:50%;background:#1d4ed8}
.bhxh-mode-card strong,.bhxh-mode-card small{display:block}.bhxh-mode-card small{margin-top:3px;color:#475569;font-size:12px}
@media(max-width:600px){.bhxh-template-links,.bhxh-salary-mode-cards{grid-template-columns:1fr}}

/* v0.2.9: force the two salary-mode choices to remain readable under theme CSS */
.bhxh-tools .bhxh-salary-mode-wrap{display:block!important;clear:both!important;width:100%!important;box-sizing:border-box!important;margin:20px 0!important;padding:18px!important;border:1px solid #bfdbfe!important;border-radius:14px!important;background:#f0f6ff!important}
.bhxh-tools .bhxh-salary-mode-wrap h3{display:block!important;margin:0 0 14px!important;font-size:18px!important;line-height:1.35!important;color:#173b72!important}
.bhxh-tools .bhxh-salary-mode-cards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;width:100%!important}
.bhxh-tools .bhxh-mode-card{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;position:relative!important;box-sizing:border-box!important;width:100%!important;min-width:0!important;min-height:82px!important;margin:0!important;padding:16px!important;white-space:normal!important;text-align:left!important;border:2px solid #cbd5e1!important;border-radius:12px!important;background:#fff!important;cursor:pointer!important}
.bhxh-tools .bhxh-mode-card.is-active{border-color:#1769d2!important;background:#eaf3ff!important;box-shadow:0 0 0 2px rgba(23,105,210,.12)!important}
.bhxh-tools .bhxh-mode-card input[type=radio]{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;margin:0!important;pointer-events:none!important}
.bhxh-tools .bhxh-mode-radio{display:inline-block!important;position:relative!important;flex:0 0 20px!important;width:20px!important;height:20px!important;box-sizing:border-box!important;border:2px solid #8795a8!important;border-radius:50%!important}
.bhxh-tools .bhxh-mode-card.is-active .bhxh-mode-radio{border-color:#1769d2!important}
.bhxh-tools .bhxh-mode-card.is-active .bhxh-mode-radio:after{content:""!important;position:absolute!important;inset:4px!important;border-radius:50%!important;background:#1769d2!important}
.bhxh-tools .bhxh-mode-card>span:last-child{display:block!important;flex:1 1 auto!important;min-width:0!important;line-height:1.4!important}
.bhxh-tools .bhxh-mode-card strong{display:block!important;margin:0!important;font-size:16px!important;font-weight:700!important;color:#172b4d!important;line-height:1.35!important}
.bhxh-tools .bhxh-mode-card small{display:block!important;margin-top:5px!important;font-size:13px!important;color:#52647a!important;line-height:1.4!important;white-space:normal!important}
.bhxh-tools .bhxh-template-links{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
.bhxh-tools .bhxh-template-link{display:flex!important;align-items:center!important;gap:10px!important;box-sizing:border-box!important;min-width:0!important;white-space:normal!important;line-height:1.35!important;padding:12px!important;border-radius:10px!important}
.bhxh-tools .bhxh-template-link strong,.bhxh-tools .bhxh-template-link small{display:block!important;white-space:normal!important}
.bhxh-tools .bhxh-import-panel .bhxh-file-label{display:block!important;line-height:1.5!important;margin:12px 0!important}
.bhxh-tools .bhxh-import-panel .bhxh-file-label input[type=file]{display:block!important;width:100%!important;max-width:100%!important;margin-top:7px!important}
@media(max-width:650px){.bhxh-tools .bhxh-salary-mode-cards,.bhxh-tools .bhxh-template-links{grid-template-columns:1fr!important}.bhxh-tools .bhxh-mode-card{min-height:72px!important}}

/* v0.2.10: compact spreadsheet-like BHXH contribution periods */
.bhxh-onetime-periods{display:flex;flex-direction:column;gap:8px}
.bhxh-onetime-row{
 display:grid!important;
 grid-template-columns:1.05fr 1.05fr .9fr .95fr .95fr .95fr auto;
 gap:8px!important;
 align-items:end;
 padding:10px!important;
 margin:0!important;
 border:1px solid #d8e1ef!important;
 border-radius:9px!important;
 background:#fff!important;
}
.bhxh-onetime-row label{display:flex;flex-direction:column;gap:5px;min-width:0;margin:0!important;font-size:12px;font-weight:600}
.bhxh-onetime-row input{width:100%!important;min-width:0;box-sizing:border-box;padding:9px 8px!important;font-size:13px!important}
.bhxh-onetime-row .bhxh-remove-row{min-width:54px;padding:9px 10px!important;margin:0!important}
.bhxh-import-status{margin-top:10px;font-size:13px}
.bhxh-import-status.is-success{color:#137547}
.bhxh-import-status.is-error{color:#b42332}
@media(max-width:900px){.bhxh-onetime-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:560px){.bhxh-onetime-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:8px!important}}

/* v0.3.0 - per-period automatic salary type detection */
.bhxh-auto-detect-note{display:flex;flex-direction:column;gap:5px;padding:13px 15px;margin:14px 0;border:1px solid #93c5fd;border-radius:10px;background:#eff6ff;color:#1e3a8a}
.bhxh-auto-detect-note span{font-size:13px;color:#334155}
.bhxh-onetime-row{grid-template-columns:120px 120px minmax(0,1fr) minmax(0,1fr) auto!important;align-items:start!important}
.bhxh-input-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:9px;border-radius:8px;border:1px solid #dbe3ee;background:#f8fafc;min-width:0}
.bhxh-input-group>strong{grid-column:1/-1;font-size:12px;color:#334155}
.bhxh-input-group label{font-size:11px!important}
.bhxh-input-group input{font-size:12px!important;padding:7px!important}
.bhxh-remove-row{align-self:end}
@media(max-width:900px){.bhxh-onetime-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}.bhxh-input-group{grid-column:1/-1}}
@media(max-width:560px){.bhxh-onetime-row{grid-template-columns:1fr 1fr!important}.bhxh-input-group{grid-template-columns:1fr 1fr}}


/* v0.3.1 - detailed lump-sum result report */
.bhxh-tools .bhxh-import-heading h3{font-size:18px;color:#173b72}
.bhxh-tools .bhxh-template-links{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.bhxh-tools .bhxh-template-link{min-height:72px;box-shadow:0 2px 8px rgba(31,65,114,.05);transition:.18s ease}
.bhxh-tools .bhxh-template-link:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(31,65,114,.1)}
.bhxh-onetime-report{background:#fff!important;border:1px solid #dce6f3!important;border-radius:16px!important;padding:clamp(14px,3vw,24px)!important;box-shadow:0 8px 28px rgba(30,64,110,.07)}
.bhxh-report-header{display:flex;justify-content:space-between;align-items:center;gap:18px;padding-bottom:18px;border-bottom:1px solid #e7edf5}
.bhxh-report-kicker{font-size:11px;letter-spacing:1.2px;font-weight:800;color:#2563a6}
.bhxh-report-header h3{margin:5px 0;font-size:23px;color:#17365f}
.bhxh-report-header p{margin:0;color:#64748b;font-size:13px}
.bhxh-report-total{min-width:220px;padding:16px 18px;border-radius:13px;background:linear-gradient(135deg,#123e70,#1769aa);color:#fff;text-align:right}
.bhxh-report-total small{display:block;font-size:12px;opacity:.88}
.bhxh-report-total strong{display:block;margin-top:5px;font-size:24px;line-height:1.3}
.bhxh-report-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0 22px}
.bhxh-report-stats>div{padding:12px;border:1px solid #e4ebf4;border-radius:10px;background:#f8fafd;min-width:0}
.bhxh-report-stats small{display:block;color:#64748b;font-size:11px}
.bhxh-report-stats strong{display:block;margin-top:5px;color:#17365f;font-size:15px;overflow-wrap:anywhere}
.bhxh-report-section-title{margin:22px 0 10px!important;padding-left:10px;border-left:4px solid #2878bd;color:#173b68;font-size:16px}
.bhxh-detail-table-wrap{width:100%;overflow-x:auto;border:1px solid #e3eaf3;border-radius:10px}
.bhxh-detail-table{width:100%;min-width:760px;border-collapse:collapse;font-size:12px}
.bhxh-detail-table th{padding:11px 9px;background:#edf4fb;color:#244568;text-align:left;white-space:nowrap}
.bhxh-detail-table td{padding:10px 9px;border-top:1px solid #e9eef5;color:#334155;vertical-align:middle}
.bhxh-detail-table tbody tr:nth-child(even){background:#fafcff}
.bhxh-type-pill{display:inline-block;padding:4px 8px;border-radius:20px;font-size:11px;font-weight:700;white-space:nowrap}
.bhxh-type-pill.state{background:#e8f3ff;color:#155a9b}.bhxh-type-pill.employer{background:#eaf8f0;color:#187344}
.bhxh-report-hint{padding:11px 13px;border-radius:9px;background:#fff8e7;color:#805b13;font-size:12px;line-height:1.6}
.bhxh-formula-card{padding:15px;border:1px solid #d9e6f5;border-radius:11px;background:#f6faff;line-height:1.65;color:#334155}
.bhxh-formula-card>strong{display:block;margin:8px 0;color:#173b68}
.bhxh-formula-total{margin-top:10px;padding-top:10px;border-top:1px dashed #c5d5e8;font-size:18px;font-weight:800;color:#145c39}
.bhxh-report-disclaimer{font-size:12px;color:#8a5b16;line-height:1.6}
.bhxh-report-actions{display:flex;justify-content:flex-end;margin-top:14px}
@media(max-width:720px){.bhxh-tools .bhxh-template-links{grid-template-columns:1fr!important}.bhxh-report-header{align-items:stretch;flex-direction:column}.bhxh-report-total{min-width:0;text-align:left}.bhxh-report-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.bhxh-report-total strong{font-size:21px}}
@media print{.bhxh-report-actions,.bhxh-import-panel,.bhxh-auto-detect-note,.bhxh-add-onetime-period,.bhxh-calculate-onetime,.bhxh-embed-section{display:none!important}.bhxh-onetime-report{box-shadow:none!important;border:0!important}.bhxh-detail-table-wrap{overflow:visible}.bhxh-detail-table{min-width:0;font-size:9px}.bhxh-detail-table th,.bhxh-detail-table td{padding:5px 4px}}

/* Maternity-only mixed salary period editor; isolated from BHXH one-time module */
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:end;padding:14px;margin:0 0 12px;border:1px solid #d7e2ef;border-radius:10px;background:#fff}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period label{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:13px;font-weight:600;color:#24364b}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period input,.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period select{width:100%;min-width:0;box-sizing:border-box;padding:9px 10px;border:1px solid #cbd5e1;border-radius:7px;background:#fff}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-employer-fields,.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-state-fields{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:10px;border-radius:8px;background:#f4f8fc}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-employer-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period .bhxh-remove-row{grid-column:1/-1;max-width:140px}
@media(max-width:700px){.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period{grid-template-columns:repeat(2,minmax(0,1fr))}.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-state-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:440px){.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period{grid-template-columns:1fr}.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-state-fields,.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-employer-fields{grid-template-columns:1fr}}


/* v0.3.5 - Thai san form visual refresh (scoped; does not affect BHXH one-time tool) */
.bhxh-tools[data-tool="thaisan"] .bhxh-box{
    background:linear-gradient(180deg,#f7fbff 0%,#ffffff 220px);
    border:1px solid #d9e7f7;
    box-shadow:0 8px 28px rgba(27,75,125,.08);
}
.bhxh-tools[data-tool="thaisan"] .bhxh-box>h2{
    margin:-24px -24px 18px;
    padding:20px 24px;
    color:#fff;
    font-size:22px;
    line-height:1.35;
    background:linear-gradient(110deg,#145da0,#287fc1);
    border-radius:12px 12px 0 0;
    letter-spacing:.1px;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-note{
    padding:12px 14px;
    color:#36536f;
    background:#edf6ff;
    border:1px solid #d6eaff;
    border-left:4px solid #3987c9;
    border-radius:9px;
    line-height:1.55;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-field{
    padding:13px 14px;
    margin:0 0 12px;
    background:#f4f8fd;
    border:1px solid #e1ebf6;
    border-radius:10px;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-field label,
.bhxh-tools[data-tool="thaisan"] .bhxh-period-row label{
    color:#244765;
    font-size:13px;
    font-weight:700;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-field input,
.bhxh-tools[data-tool="thaisan"] .bhxh-field select,
.bhxh-tools[data-tool="thaisan"] .bhxh-period-row input,
.bhxh-tools[data-tool="thaisan"] .bhxh-period-row select{
    min-height:42px;
    color:#20364b;
    background:#fff;
    border:1px solid #cbd9e8;
    border-radius:8px;
    box-shadow:inset 0 1px 2px rgba(20,50,80,.03);
    transition:border-color .15s ease,box-shadow .15s ease;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-field input:focus,
.bhxh-tools[data-tool="thaisan"] .bhxh-field select:focus,
.bhxh-tools[data-tool="thaisan"] .bhxh-period-row input:focus,
.bhxh-tools[data-tool="thaisan"] .bhxh-period-row select:focus{
    outline:0;
    border-color:#3987c9;
    box-shadow:0 0 0 3px rgba(57,135,201,.14);
}
.bhxh-tools[data-tool="thaisan"] .bhxh-box>h3{
    margin:22px 0 12px;
    padding:11px 14px;
    color:#174d7c;
    font-size:16px;
    background:#eaf4ff;
    border:1px solid #d5e8fb;
    border-radius:9px;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    align-items:start;
    margin:0 0 14px;
    padding:16px;
    background:#f7faff;
    border:1px solid #d9e7f5;
    border-radius:12px;
    box-shadow:0 3px 12px rgba(31,76,119,.05);
}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period>label{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-employer-fields,
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-state-fields{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    padding:13px;
    background:#fff;
    border:1px solid #e0eaf4;
    border-radius:9px;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-employer-fields label,
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-state-fields label{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-maternity-type{
    font-weight:700;
    background:#f0f7ff!important;
}
.bhxh-tools[data-tool="thaisan"] .bhxh-remove-row{
    justify-self:start;
    min-height:38px;
    padding:8px 14px;
    font-weight:700;
}
.bhxh-tools[data-tool="thaisan"] #bhxh_add_period{
    margin:0 8px 12px 0;
    font-weight:700;
}
.bhxh-tools[data-tool="thaisan"] #bhxh_calculate_maternity{
    min-height:46px;
    padding:12px 24px;
    font-size:16px;
    font-weight:700;
    background:linear-gradient(110deg,#1769aa,#2585c6);
    box-shadow:0 4px 12px rgba(23,105,170,.2);
}
.bhxh-tools[data-tool="thaisan"] .bhxh-result-inner{
    border-color:#cfe2f5;
    background:linear-gradient(180deg,#f2f8ff,#fff 180px);
    box-shadow:0 5px 18px rgba(30,80,130,.07);
}
@media(max-width:700px){
    .bhxh-tools[data-tool="thaisan"] .bhxh-box{padding:15px}
    .bhxh-tools[data-tool="thaisan"] .bhxh-box>h2{
        margin:-15px -15px 15px;
        padding:17px 15px;
        font-size:19px;
    }
    .bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period{
        grid-template-columns:repeat(2,minmax(0,1fr));
        padding:12px;
    }
    .bhxh-tools[data-tool="thaisan"] .bhxh-maternity-period>label:nth-child(3){
        grid-column:1/-1;
    }
    .bhxh-tools[data-tool="thaisan"] .bhxh-maternity-employer-fields,
    .bhxh-tools[data-tool="thaisan"] .bhxh-maternity-state-fields{
        grid-template-columns:1fr;
    }
}

/* Module BHYT hộ gia đình */
.bhxh-tools[data-tool="bhyt-household"] .bhxh-box{padding:22px;background:#fff;border:1px solid #e1e8f0;border-radius:16px;box-shadow:0 8px 28px rgba(20,55,90,.07)}
.bhxh-tools[data-tool="bhyt-household"] .bhxh-box>h2{margin:-22px -22px 18px;padding:20px 22px;color:#fff;background:linear-gradient(110deg,#145b9c,#2488c7);border-radius:15px 15px 0 0;font-size:22px}
.bhyt-household-inputs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:18px 0}
.bhyt-household-inputs label{display:flex;flex-direction:column;gap:7px;font-weight:700;color:#26384d}
.bhyt-household-inputs input,.bhyt-household-inputs select{width:100%;min-height:44px;padding:9px 11px;border:1px solid #cbd7e4;border-radius:9px;background:#fbfdff;box-sizing:border-box;font-size:16px}
.bhyt-household-inputs input:focus,.bhyt-household-inputs select:focus{outline:2px solid #9bc9ee;border-color:#287fbd}
#bhyt_household_calculate{min-height:46px;padding:11px 24px;font-weight:700;background:linear-gradient(110deg,#1769aa,#2585c6)}
.bhyt-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}
.bhyt-summary>div{padding:15px;border:1px solid #d8e6f3;border-radius:11px;background:#f2f8ff}
.bhyt-summary span{display:block;color:#526579;font-size:13px}
.bhyt-summary strong{display:block;margin-top:7px;color:#145b9c;font-size:19px}
.bhyt-table-wrap{overflow-x:auto}
.bhyt-household-table{width:100%;border-collapse:collapse;margin:12px 0;font-size:14px}
.bhyt-household-table th,.bhyt-household-table td{padding:10px 12px;border:1px solid #dce4ed;text-align:right;white-space:nowrap}
.bhyt-household-table th:first-child,.bhyt-household-table td:first-child{text-align:left}
.bhyt-household-table thead th,.bhyt-household-table tfoot th{background:#eaf3fb;color:#1e4264}
.bhyt-household-table tbody tr:nth-child(even){background:#f8fbfe}
.bhyt-method{padding:11px 13px;border-left:4px solid #5a9acb;background:#f3f8fc;color:#53677b;font-size:13px}
.bhyt-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.bhyt-actions button{padding:10px 16px;border:0;border-radius:8px;background:#1769aa;color:#fff;font-weight:700;cursor:pointer}
.bhyt-actions button:hover{background:#105487}
.bhyt-error{padding:12px;background:#fff1f0;color:#a32920;border-radius:8px}
@media(max-width:700px){.bhyt-household-inputs,.bhyt-summary{grid-template-columns:1fr}.bhxh-tools[data-tool="bhyt-household"] .bhxh-box{padding:15px}.bhxh-tools[data-tool="bhyt-household"] .bhxh-box>h2{margin:-15px -15px 15px;padding:17px 15px;font-size:19px}.bhyt-summary strong{font-size:18px}}


/* v0.3.9 – BHYT hộ gia đình: tiêu đề rõ ràng, in/lưu PDF không cần popup. */
.bhxh-tools[data-tool="bhyt-household"] .bhxh-box > h2,
.bhxh-tools[data-tool="bhyt-household"] .bhyt-household-print > h3{
    font-weight:800 !important;
}
.bhxh-tools[data-tool="bhyt-household"] .bhyt-household-inputs label{
    font-weight:800;
}
.bhxh-tools[data-tool="bhyt-household"] .bhyt-household-print > h3{
    color:#153f69;
    font-size:20px;
    text-align:center;
    margin:0 0 16px;
}
.bhxh-tools[data-tool="bhyt-household"] .bhyt-summary span{
    font-weight:700;
    color:#304a64;
}
.bhxh-tools[data-tool="bhyt-household"] .bhyt-household-table thead th,
.bhxh-tools[data-tool="bhyt-household"] .bhyt-household-table tfoot th{
    font-weight:800 !important;
    color:#153f69;
}
@media print{
    body.bhyt-print-mode *{
        visibility:hidden !important;
    }
    body.bhyt-print-mode .bhyt-household-print,
    body.bhyt-print-mode .bhyt-household-print *{
        visibility:visible !important;
    }
    body.bhyt-print-mode .bhyt-household-print{
        position:absolute !important;
        top:0 !important;
        left:0 !important;
        width:100% !important;
        max-width:none !important;
        margin:0 !important;
        padding:0 !important;
        border:0 !important;
        border-radius:0 !important;
        box-shadow:none !important;
        background:#fff !important;
        color:#172033 !important;
        box-sizing:border-box !important;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-actions{
        display:none !important;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-table-wrap{
        overflow:visible !important;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-household-table{
        width:100% !important;
        font-size:12px !important;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-household-table th,
    body.bhyt-print-mode .bhyt-household-print .bhyt-household-table td{
        white-space:normal !important;
        padding:7px 8px !important;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-household-table thead{
        display:table-header-group;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-household-table tr{
        break-inside:avoid;
        page-break-inside:avoid;
    }
    body.bhyt-print-mode .bhyt-household-print .bhyt-summary{
        grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    }
}
