.dong-ho tr td {
    margin: 0;
    border: none !important
}

.list-gia-pha {
    background: #FFFAC1 !important
}

.list-gia-pha tr th {
    background: #FFFAC1 !important;
    border: 0 solid #D72D08 !important;
    font-size: 16px;
    color: rgb(177, 38, 6)
}

.tab-giapha {
    background: rgb(177, 38, 6);
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
}

.tab-giapha .title-gia-pha {
    color: #fff66e;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 15px;
}

.tab-giapha .title-gia-pha a {
    color: #fff66e;
    font-size: 18px;
    font-weight: bold;
    padding: 10px
}

.tab-giapha .title-gia-pha a span {
    font-family: Arial
}

.a-giapha {
    color: rgb(177, 38, 6);
    font-weight: 600;
    border: 1px solid rgb(177, 38, 6);
    padding: 10px;
    margin-bottom: 10px
}

.a-giapha a {
    color: rgb(177, 38, 6)
}

.location {
    background: #FFF8A9;
    margin: 0;
    padding: 10px;
    width: 100%;
    border: 1px solid rgb(177, 38, 6);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    -moz-border-radius-bottomleft: 5px;
    -moz-border-radius-bottomright: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -webkit-border-bottom-right-radius: 5px
}

.location tr {
    border-collapse: separate
}

.location tr td {
    border: 1px solid #D12607 !important
}

table {
    border-collapse: separate
}

table.tabnkv {
    border: 1px solid rgb(177, 38, 6);
    border-collapse: separate;
    border-spacing: 1px;
    caption-side: top;
    empty-cells: show;
    width: 100%;
    table-layout: auto;
    max-width: 100%;
}

table.tabnkvv {
    width: 66.66666667%
}

table.tabnkv caption {
    font: bold 13px/27px tahoma, verdana, sans-serif;
    margin-top: 8px;
    text-align: center;
    text-indent: 0;
    color: #fff66e;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Location grid */
.location-grid-wrapper {
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.location-grid-title {
    color: #fff66e;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 15px;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.location-grid__item {
    background: #FFF8A9;
    border: 1px solid #D12607;
    border-radius: 5px;
    padding: 10px 8px;
    text-align: center;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.location-grid__item a {
    color: #b12606;
    font-weight: bold;
    display: block;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.location-grid__count {
    margin-top: 4px;
    font-size: 12px;
    color: #d72d08;
    line-height: 1.2;
}

.location-grid__count span {
    font-weight: bold;
}

@media (max-width: 1199.98px) {
    .location-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .location-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .location-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    .location-grid__item {
        min-height: auto;
    }
}

/* Location detail grid */
.location-detail-grid-wrapper {
    padding: 20px 15px;
}

.location-detail-grid-title {
    color: #fff66e;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 18px;
    line-height: 1.4;
}

.location-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.location-detail-card {
    background: #FFF8A9;
    border: 1px solid #D12607;
    border-radius: 6px;
    padding: 14px 12px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.location-detail-card__stt {
    font-weight: bold;
    color: #d72d08;
    font-size: 13px;
}

.location-detail-card__title {
    font-size: 16px;
    margin: 0;
    line-height: 1.4;
}

.location-detail-card__title a {
    color: #b12606;
    text-decoration: none;
}

.location-detail-card__title a:hover {
    text-decoration: underline;
}

.location-detail-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #333;
}

.meta-label {
    color: #b12606;
    font-weight: 600;
    margin-right: 10px;
}

.meta-value {
    font-weight: 600;
    color: #1f1f1f;
}

@media (max-width: 1199.98px) {
    .location-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .location-detail-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    .location-detail-card {
        min-height: auto;
    }
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

table.tabnkv tbody {
    background: #f7f7f7
}

table.tabnkv tbody.second {
    background: #eee
}

table.tabnkv td a, table.tabnkv th a {
    color: #333;
    text-decoration: inherit;
    text-align: center;
    display: inline-block;
    width: 100%;
}

table.tabnkv td, table.tabnkv th {
    padding: 7px 5px 7px 5px;
    background-color: #FFF8A9;
    text-align: center;
}

table.tabnkv tfoot {
    background: #ccc;
    font: bold 11px tahoma, verdana, sans-serif
}

table.tabnkv th {
    background: #ccc;
    font-weight: normal;
    text-align: left
}

table.tabnkv thead, table.tabnkv .thead_box {
    background: #FFF66E;
    font: bold 11px/18px tahoma, verdana, sans-serif;
    white-space: nowrap
}

table.tabnkv th.head1 {
    width: 35px;
    text-align: center;
    white-space: nowrap
}

table.tabnkv td.col1 {
    text-align: center;
    width: 35px;
    font-size: 8px;
    vertical-align: bottom
}

table.tabnkv td.col2 {
    font-size: 8px;
    width: 300px
}

table.tabnkv tr.row1 {
    width: 35px;
    text-align: center
}

table.tabnkv td.align_r {
    text-align: right
}

table.tabnkv>tbody>tr:nth-child(odd)>td, table.tabnkv>tbody>tr:nth-child(odd)>th {
    background: #FFF8A9
}

ul.list-genealogy {
    list-style-type: none;
    text-align: center;
}

ul.list-genealogy.clearfix {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 0;
    gap: 8px;
}

ul.list-genealogy li {
    display: inline-block;
    padding: 0;
    float: none;
}

ul.list-genealogy li a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #a63700;
    font-size: 14px;
    text-transform: uppercase;
    background: rgb(217, 48, 8);
    color: #FAFAFA;
    font-weight: 700;
    white-space: nowrap;
}

ul.list-genealogy li.ui-genealogys-selected a {
    border: 1px solid #a63700;
    background: #982100;
    color: #fff;
}

.filetree span.male, .filetree span.female, span.default {
    padding: 1px 0 1px 16px
}

.filetree span.male {
    background: url(../images/gia-pha/male.png) 0 0 no-repeat
}

.filetree span.female {
    background: url(../images/gia-pha/female.png) 0 0 no-repeat
}

.filetree span.default {
    background: url(../images/gia-pha/default.png) 0 0 no-repeat
}

#biagiapha {
    background: url(../images/gia-pha/bg-giapha.jpg) center center no-repeat;
    background-size: cover;
    width: 100%;
    max-width: 100%;
    text-align: center;
    border: 3px solid #6F3700;
    min-height: 877px;
    margin: 0 auto;
    color: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (max-width: 767.98px) {
    #biagiapha {
        min-height: 0;
        padding: 20px 10px;
    }

    #tengiapha {
        font-size: 32px;
        padding: 20px 20px 15px;
    }
}

#tengiapha {
    color: #FBFE00;
    font-size: 60px;
    font-weight: bold;
    padding: 50px 70px 30px;
    text-shadow: 2px 2px 3px #666666, -1px -1px 3px, 1px 1px #666666, -1px -1px #FFF;
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 0 auto;
}

#biagiapha .header {
    font-size: 14px;
    padding-top: 30px;
    text-transform: uppercase;
    color: #ff0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 2;
    text-align: center;
}

.ui-dialog {
    z-index: 99999 !important
}

.biagiapha {
    position: relative;
    width: 100%;
    padding: 80px 0 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
}

#banners {
    top: 0;
    left: 0;
    overflow: hidden
}

#banners img {
    width: 100%;
    min-height: 100%
}

.buttom-giapha {
    width: 100%;
    margin: 0 auto 30px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.buttom-giapha ul.list-genealogy {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 0;
}

.gia-pha-vietnam {
    text-align: center;
    font-size: 30px;
    font-weight: bold;
    color: #fff66e;
    margin: 0 auto 20px;
    position: relative;
    z-index: 2;
    line-height: 1.2;
}

.gia-pha-vn {
    font-size: 12px;
    font-weight: 700;
    color: #fff66e;
    text-align: center;
    position: relative;
    z-index: 2;
    margin: 0 auto;
    line-height: 1.5;
}

.xuatdpf {
    text-align: center;
    width: 100%;
    max-width: 100%;
    *width: 620px;
    margin: 10px auto;
    background: rgb(255, 248, 169)
}

.xuatfile>tbody>tr:nth-child(2n+1)>td, .xuatfile>tbody>tr:nth-child(2n+1)>th {
    background: #FFF583;
    border: 1px solid #B42606
}

.xuatfile>thead>tr>th, .xuatfile>tbody>tr>th, .xuatfile>tfoot>tr>th, .xuatfile>thead>tr>td, .xuatfile>tbody>tr>td, .xuatfile>tfoot>tr>td {
    border: 1px solid #B42606
}

.pha-ky {
    padding: 10px;
    border: 1px solid #B42606;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px
}

.pha-ky-one {
    border-bottom: solid 1px #B42606;
}
.pha-ky-one ul{
    padding-left: 0px
}
.pha-ky-tow {
    padding-top: 10px
}

.text-center {
    text-align: center
}

.locations {
    background: none repeat scroll 0% 0% #FFF66E;
    margin: 0;
    padding: 10px;
    width: 100%;
    border: 1px solid #B12606;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px
}

.locations ul li {
    background-color: #fff66e
}

#loadbar input {
    background-color: rgb(217, 48, 8);
    color: #FAFAFA;
    padding: 5px 10px;
    border: 1px solid rgb(225, 45, 0);
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-bottom: 1px solid #0D5E94;
    zoom: 1;
    background-color: #d93008;
    background-image: -webkit-linear-gradient(bottom, #d93008 15%, #b92a09 100%);
    background-image: linear-gradient(to top, #b92a09 15%, #d93008 100%);
    -webkit-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2);
    -moz-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2);
    -khtml-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2)
}

.sunghiep-congduc a span {
    font-family: arial
}

.sunghiep-congduc-a {
    background: #FFF8A9
}

.padding-topbottom {
    margin: 10px 0;
    padding: 0;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    -moz-border-radius-bottomleft: 5px;
    -moz-border-radius-bottomright: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -webkit-border-bottom-right-radius: 5px
}

#visualization {
    background-color: #FFF8A9;
    border: 1px solid rgb(177, 38, 6);
    padding: 10px
}


#imghome {
    padding-top: 3em
}

.tabnkvs #imghome {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.tabnkvs {
    background: #FFF8A9;
    border: 1px solid rgb(177, 38, 6);
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

.tabnkvs .tabnkvv {
    background: #FFF8A9;
}

.tabnkvs .title-gia-pha {
    background: rgb(177, 38, 6);
    padding: 10px;
    border-radius: 5px 5px 0 0;
    -moz-border-radius: 5px 5px 0 0;
    -webkit-border-radius: 5px 5px 0 0;
    margin: -10px -10px 10px -10px;
    display: block;
}

.tabnkvs .title-gia-pha a {
    color: #fff66e;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    display: block;
    text-decoration: none;
}

.tabnkvs .title-gia-pha a .fa {
    margin-right: 5px;
}

.tabnkvs table.tabnkv {
    background: #FFF8A9;
    border: 1px solid rgb(177, 38, 6);
    width: 100%;
    margin-top: 10px;
}

.tabnkvs table.tabnkv tbody {
    background: #FFF8A9;
}

.tabnkvs table.tabnkv td {
    background: #FFF8A9;
    border: 1px solid #D12607;
    padding: 8px;
}

.tabnkvs table.tabnkv tr {
    border-bottom: 1px solid #D12607;
}

.tabnkvs table.tabnkv tr:last-child {
    border-bottom: none;
}

.detail-hn ul.list-genealogy, .pha-ky-one ul.list-genealogy {
    margin: 0 auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.detail-hn ul.list-genealogy li a, .pha-ky-one ul.list-genealogy li a {
    font-size: 0.9em
}

.detail-hn {
    padding: 10px;
    border: 1px solid rgb(177, 38, 6);
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px
}

a.morelink {
    text-decoration: none;
    outline: none
}

.morecontent span {
    display: none
}

.comment {
    margin: 0;
    padding: 10px
}

.readmore-js-toggle {
    padding: 10px;
    font-weight: bold;
    width: 100%;
    background: #FFF8A9
}

.readmore-js-toggle a {
    float: right;
    margin-top: -10px
}

.tabnkvsbc {
    background: #B12606;
    border-top: 1px solid rgb(177, 38, 6);
    border-left: 1px solid rgb(177, 38, 6);
    border-right: 1px solid rgb(177, 38, 6);
    padding: 10px;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px
}

.title-tab {
    color: #FFF583;
    font-weight: bold;
    font-size: 14px;
    padding: 10px
}

.main-title {
    color: #d72d08;
    background: #FFF8A9
}

.table-bordered {
    border: 1px solid #d72d08
}

.table-bordereds>thead>tr>th, .table-bordereds>thead>tr>td {
    border: 1px solid #D72D08
}

.wrappers {
    text-align: center;
}

.wrappers ul {
    display: inline-block;
    margin: 0;
    padding: 0;
    /* For IE, the outcast */
    zoom: 1;
    *display: inline;
}

@media only screen and (max-width: 600px){
    .wrappers{
        overflow-x: scroll;
        white-space: nowrap;
    }
    ul.list-genealogy li{
        float: none;
        margin-left: -4px;
    }
    .pha-ky-one {
        white-space: nowrap;
        overflow-x: scroll;
    }
}

/* Responsive cho bảng location (main-location.tpl) */
@media (max-width: 767.98px) {
    /* Bảng location - chuyển thành grid trên mobile, không scroll ngang */
    /* Override Bootstrap table-responsive */
    div.tab-giapha.table-responsive,
    .tab-giapha.table-responsive,
    div.table-responsive.tab-giapha {
        overflow-x: visible !important;
        overflow-y: visible !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        -webkit-overflow-scrolling: auto !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    .tab-giapha.table-responsive *,
    div.tab-giapha.table-responsive * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tab-giapha table.tabnkv {
        width: 100% !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        display: block !important;
        table-layout: fixed !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .tab-giapha table.tabnkv caption {
        font-size: 15px !important;
        padding: 8px 10px !important;
        margin: 0 0 10px 0 !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        line-height: 1.4 !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        overflow: visible !important;
        hyphens: auto !important;
    }
    
    .tab-giapha table.tabnkv tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .tab-giapha table.tabnkv tr {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px !important;
        border: 1px solid #D12607 !important;
        border-radius: 5px !important;
        background: #FFF8A9 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        float: none !important;
    }
    
    .tab-giapha table.tabnkv td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
        text-align: center !important;
        border: none !important;
        border-bottom: 1px solid #D12607 !important;
        background-color: #FFF8A9 !important;
        box-sizing: border-box !important;
        float: none !important;
        position: relative !important;
    }
    
    .tab-giapha table.tabnkv td:last-child {
        border-bottom: none !important;
    }
    
    .tab-giapha table.tabnkv td a {
        display: block !important;
        padding: 5px 0 !important;
        font-size: 14px !important;
        word-wrap: break-word !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tab-giapha table.tabnkv td a b {
        font-size: 15px !important;
        font-weight: bold !important;
        text-align: center !important;
        display: inline-block !important;
    }
    
    /* Đảm bảo text không bị tràn */
    .tab-giapha table.tabnkv td,
    .tab-giapha table.tabnkv td a,
    .tab-giapha table.tabnkv td a b {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        white-space: normal !important;
    }
    
    /* Loại bỏ tất cả các thuộc tính table */
    .tab-giapha table.tabnkv,
    .tab-giapha table.tabnkv * {
        border-collapse: collapse !important;
        border-spacing: 0 !important;
    }
    
    /* Bảng location detail (location.tpl) */
    .tab-giapha.padding-topbottom table.tabnkv {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv thead {
        display: none;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv tbody {
        display: block;
        width: 100%;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv tr {
        display: block;
        width: 100%;
        margin-bottom: 15px;
        border: 1px solid #D12607;
        border-radius: 5px;
        background: #FFF8A9;
        padding: 10px;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv td {
        display: block;
        width: 100% !important;
        padding: 8px 10px !important;
        text-align: left !important;
        border: none !important;
        border-bottom: 1px solid rgba(209, 38, 7, 0.3) !important;
        background-color: #FFF8A9 !important;
        position: relative;
        padding-left: 40% !important;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv td:last-child {
        border-bottom: none !important;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv td:before {
        content: attr(data-label) ":";
        position: absolute;
        left: 10px;
        width: 35%;
        font-weight: bold;
        color: #d72d08;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv td.text-center {
        text-align: left !important;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv td.text-right {
        text-align: left !important;
    }
    
    .tab-giapha.padding-topbottom table.tabnkv caption {
        font-size: 16px;
        padding: 10px 5px;
        margin-bottom: 10px;
    }
}

/* Tablet responsive */
@media (min-width: 768px) and (max-width: 991.98px) {
    .tab-giapha table.tabnkv {
        font-size: 14px;
    }
    
    .tab-giapha table.tabnkv td {
        padding: 8px 6px !important;
    }
    
    .tab-giapha table.tabnkv td a {
        font-size: 13px;
    }
}

.magrin-bt{
    margin-bottom: 7px
}

@media (min-width: 800px) and (max-width:899px){
    .magin-tp-button{
        margin-top: 1.4em
    }
}

/* Desktop form optimization for gia-pha */
@media (min-width: 768px) {
    /* Form table optimization */
    .table-responsive {
        width: 100%;
        overflow: visible;
    }

    .table-responsive table {
        width: 100%;
        table-layout: auto;
    }

    /* Optimize table cells */
    .table-responsive table td {
        padding: 8px 12px;
        vertical-align: middle;
    }

    .table-responsive table td[align="right"] {
        width: 20%;
        min-width: 120px;
        white-space: nowrap;
        padding-right: 15px;
    }

    .table-responsive table td[align="right"] + td {
        width: 30%;
        padding-right: 20px;
    }

    /* Form controls optimization */
    .table-responsive .form-control {
        display: inline-block;
        vertical-align: middle;
    }

    /* Code input - compact */
    .table-responsive input[name="code"] {
        width: 120px !important;
        min-width: 120px;
    }

    /* Full name - wider */
    .table-responsive input[name="full_name"] {
        width: 250px !important;
        min-width: 250px;
    }

    /* Name fields - standard width */
    .table-responsive input[name="name1"],
    .table-responsive input[name="name2"],
    .table-responsive input[name="name3"],
    .table-responsive input[name="name4"],
    .table-responsive input[name="regency"] {
        width: 220px !important;
        min-width: 220px;
    }

    /* Burial address - full width */
    .table-responsive input[name="burial"] {
        width: 100% !important;
        max-width: 600px;
    }

    /* Select dropdowns */
    .table-responsive select.form-control {
        min-width: 150px;
        max-width: 300px;
    }

    .table-responsive select[name="weight"],
    .table-responsive select[name="life"] {
        width: 120px !important;
        min-width: 120px;
    }

    .table-responsive select[name="parentid2"] {
        width: 250px !important;
        min-width: 250px;
    }

    /* Date inputs */
    .table-responsive input[name="birthday_date"],
    .table-responsive input[name="dieday_date"],
    .table-responsive input#birthday_date,
    .table-responsive input#dieday_date {
        width: 100px !important;
        min-width: 100px;
        margin-right: 5px;
    }

    /* Time selects - compact */
    .table-responsive select[name="birthday_hour"],
    .table-responsive select[name="birthday_min"],
    .table-responsive select[name="dieday_hour"],
    .table-responsive select[name="dieday_min"] {
        width: 65px !important;
        min-width: 65px;
        margin: 0 2px;
    }

    /* Radio buttons spacing */
    .table-responsive input[type="radio"] {
        margin-right: 8px;
        margin-left: 0;
    }

    .table-responsive input[type="radio"] + label,
    .table-responsive input[type="radio"] + span {
        margin-right: 15px;
    }

    /* Content editor */
    .table-responsive td[colspan="4"] {
        padding: 15px;
    }

    /* Button styling */
    form center .btn {
        min-width: 120px;
        padding: 10px 20px;
        font-size: 14px;
    }

    /* Table row spacing */
    .table-responsive table tr {
        height: auto;
    }

    /* Improve form readability */
    .table-responsive table td[align="right"] {
        font-weight: 500;
        color: #333;
    }

    .table-responsive table td[align="right"] b {
        font-weight: 700;
        color: #000;
    }
}

/* Mobile responsive for gia-pha forms */
@media (max-width: 767.98px) {
    /* Form responsive */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .table-responsive table {
        width: 100% !important;
        min-width: 600px !important;
    }

    /* Form controls responsive */
    .table-responsive .form-control,
    .table-responsive input.form-control,
    .table-responsive select.form-control,
    .table-responsive textarea.form-control {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    /* Remove inline width styles on mobile */
    .table-responsive input[style*="width"],
    .table-responsive select[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Table cells responsive */
    .table-responsive table td {
        display: block !important;
        width: 100% !important;
        padding: 8px !important;
        text-align: left !important;
        border: none !important;
        border-bottom: 1px solid #ddd !important;
    }

    .table-responsive table td:before {
        content: attr(data-label) !important;
        font-weight: bold !important;
        display: inline-block !important;
        width: 40% !important;
        margin-right: 10px !important;
    }

    .table-responsive table td[align="right"] {
        text-align: left !important;
    }

    .table-responsive table td[align="right"]:before {
        content: "" !important;
    }

    /* Table rows responsive */
    .table-responsive table tr {
        display: block !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        border: 1px solid #ddd !important;
        border-radius: 5px !important;
        padding: 10px !important;
    }

    /* Radio buttons and checkboxes */
    .table-responsive input[type="radio"],
    .table-responsive input[type="checkbox"] {
        margin-right: 5px !important;
        margin-left: 0 !important;
    }

    /* Select dropdowns inline */
    .table-responsive select.form-control {
        display: inline-block !important;
        width: auto !important;
        min-width: 80px !important;
        margin: 0 5px !important;
    }

    /* Date inputs */
    .table-responsive input[name="birthday_date"],
    .table-responsive input[name="dieday_date"],
    .table-responsive input#birthday_date,
    .table-responsive input#dieday_date {
        width: 100px !important;
        min-width: 100px !important;
        display: inline-block !important;
    }

    /* Time selects inline */
    .table-responsive select[name="birthday_hour"],
    .table-responsive select[name="birthday_min"],
    .table-responsive select[name="dieday_hour"],
    .table-responsive select[name="dieday_min"] {
        width: 60px !important;
        min-width: 60px !important;
        display: inline-block !important;
    }

    /* Buttons responsive */
    .table-responsive + center .btn,
    form center .btn {
        width: 100% !important;
        padding: 12px !important;
        font-size: 16px !important;
        margin-top: 10px !important;
    }

    /* Export PDF form responsive */
    .export-pdf-form {
        margin-top: 20px !important;
        padding: 10px !important;
    }

    .export-pdf-form h4 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .export-pdf-form .export-checkboxes {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .export-pdf-form .export-checkboxes label {
        display: flex !important;
        align-items: center !important;
        padding: 8px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 3px !important;
    }

    .export-pdf-form .export-checkboxes input[type="checkbox"] {
        margin-right: 10px !important;
    }

    .export-pdf-form button {
        width: 100% !important;
        padding: 12px !important;
        font-size: 16px !important;
        margin-top: 15px !important;
    }
}

/* Form xuất PDF */
.export-pdf-form {
    margin-top: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.export-pdf-form h4 {
    color: #fff66e;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 18px;
}

.export-pdf-form #export {
    display: inline-block;
}

.export-pdf-form .export-checkboxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.export-pdf-form #export label {
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 5px;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.export-pdf-form #export label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.export-pdf-form #export input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.export-pdf-form #loadbar {
    min-height: 20px;
    color: #fff66e;
    margin-bottom: 10px;
    font-weight: bold;
}

.export-pdf-form button[name="exportpdf"] {
    background-color: rgb(217, 48, 8) !important;
    border-color: rgb(217, 48, 8) !important;
    color: #fff !important;
    padding: 8px 20px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.export-pdf-form button[name="exportpdf"]:hover {
    background-color: rgb(182, 38, 6) !important;
    border-color: rgb(182, 38, 6) !important;
}

.export-pdf-form button[name="exportpdf"] .fa {
    margin-right: 5px;
}
