.fullgrid{ margin-bottom: 0px;}
/* z-index 900 (antes 1000): sigue por encima del cuerpo del grid y de sus propios menús de columnas,
   pero DEBAJO del dropdown del autocompletar (950) cuando un buscador queda sobre el grid, para que los
   resultados no queden tapados por la cabecera de la tabla. */
.fullgrid-dt-toolbar{display:block;position:relative;padding:6px 7px 1px;width:100%;float:left;border-right: 1px solid #ccc;border-left:1px solid #ccc;border-top:1px solid #ccc;background:#fafafa;overflow:visible;z-index:900;}
.fullgrid ul.ColVis_collection {width: 160px; padding: 8px; margin: 0; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,.4); background-color: rgba(255,255,255,.98); overflow-y: auto; max-height: 400px; z-index: 9999; border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.3); list-style: none; top: 0; left: 0;}

/* Dropdown menus en fullgrid/cards */
.fullgrid .fg-dropdown-group {position: relative; display: inline-block; margin: 0 5px;}
.fullgrid .fg-dropdown-menu {display: none; position: absolute; z-index: 1050; top: 100%; right: 0; left: auto; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; background-color: #fff; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 6px 12px rgba(0,0,0,.175);}
.fullgrid .fg-dropdown-menu.show {display: block;}
.fullgrid .fg-dropdown-menu li {padding: 0; margin: 0; list-style: none;}
.fullgrid .fg-dropdown-menu li a {display: block; padding: 8px 15px; color: #333; text-decoration: none; cursor: pointer; white-space: nowrap;}
.fullgrid .fg-dropdown-menu li a:hover {background-color: #f5f5f5; color: #000;}
.fullgrid .fg-card-actions {position: relative; z-index: 20; display: flex; gap: 5px; flex-wrap: wrap;}
.fullgrid ul.ColVis_collection li {position: relative; height: auto; padding: 6px 4px; display: block; float: none; margin-bottom: 3px; box-shadow: none; text-align: left; background: #fff; border: 1px solid #e5e5e5; border-radius: 3px; cursor: pointer; transition: all 0.15s ease;}
.fullgrid ul.ColVis_collection li:hover {background: #f5f5f5; border-color: #999; box-shadow: inset 0 0 3px rgba(0,0,0,.1);}
.fullgrid ul.ColVis_collection li label {margin-bottom: 0 !important; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;}
.fullgrid ul.ColVis_collection li label input[type="checkbox"] {margin: 0; cursor: pointer;}
.fullgrid ul.ColVis_collection li label span {margin: 0; vertical-align: middle; font-size: 12px; color: #333; word-break: break-word;}
table.fullgrid thead .sorting,table.fullgrid thead .sorting_asc,table.fullgrid thead .sorting_asc_disabled,table.fullgrid thead .sorting_desc,table.fullgrid thead .sorting_desc_disabled{cursor:pointer}
table.fullgrid thead>tr>th{padding-right:18px}
table.fullgrid th:active{outline:0}
.fullgrid .table.table-bordered thead td,table.table-bordered thead th{border-left-width:0;border-top-width:0}
.fullgrid table.table-bordered tbody td,table.table-bordered tbody th{border-left-width:0;border-bottom-width:0}
.fullgrid table.table-bordered td:last-child,table.table-bordered th:last-child{border-right-width:0}
table.fullgrid thead .sorting{background:#FAFAFA  url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATAgMAAAAPPt5fAAAACVBMVEUAAADIyMjl5eVIBBP/AAAAAXRSTlMAQObYZgAAAClJREFUCNdjwAYEwGQKiGDsBJFsTA5AUoJhAqZaiDhEDVg9RC/MHEwAANsMA91AQfd/AAAAAElFTkSuQmCC) no-repeat center right}
table.fullgrid thead .sorting_asc{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATAQMAAABInqSPAAAABlBMVEUAAABVVVUT3Vn+AAAAAXRSTlMAQObYZgAAAB1JREFUCNdjwAkcgPgBAwPjBwYG5h8MDOx/GAgBAKRJBBCQbHkwAAAAAElFTkSuQmCC) no-repeat center right}
table.fullgrid thead .sorting_desc{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATAQMAAABInqSPAAAABlBMVEUAAABVVVUT3Vn+AAAAAXRSTlMAQObYZgAAABxJREFUCNdjIATY/zAwMP9gYGD8AOQ8AGIHnEoBkNkEEEbbutQAAAAASUVORK5CYII=) no-repeat center right}
table.fullgrid thead .sorting_asc_disabled{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATAQMAAABInqSPAAAABlBMVEUAAABUVFR8AzIeAAAAAnRSTlMAf7YpoZUAAAAdSURBVAjXY8AJHID4AQMD4wcGBuYfDAzsfxgIAQCkSQQQkGx5MAAAAABJRU5ErkJggg==) no-repeat center right}
table.fullgrid thead .sorting_desc_disabled{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATAQMAAABInqSPAAAABlBMVEUAAABUVFR8AzIeAAAAAnRSTlMAf7YpoZUAAAAcSURBVAjXYyAE2P8wMDD/YGBg/ADkPABiB5xKAZDZBBBG27rUAAAAAElFTkSuQmCC) no-repeat center right}
table.fullgrid thead .sorting_asc,table.fullgrid thead .sorting_desc{background-color:#eee}
table.fullgrid tfoot>tr>th,table.fullgrid thead>tr>th{padding-left:9px!important}
table.fullgrid tfoot>tr>th input,table.fullgrid thead>tr>th input{width:100%!important;font-weight:400}
table.fullgrid thead>tr>th.hasinput{padding:6px!important}
div.fullgrids_info{padding-top:9px;font-size:13px;font-weight:700;font-style:italic;color:#969696}
.fullgrid thead>tr>th{border-left:none!important}
.fullgrid input[type=checkbox].checkbox,.fullgrid input[type=radio].radiobox{position:relative!important}
table.fullgrid thead>tr>th.sorting_disabled{padding-right:9px!important}
.fullgrid-dt-toolbar-footer{background:#fafafa;font-size:11px;overflow:hidden;padding:5px 10px;border-right: 1px solid #ccc;border-left:1px solid #ccc;border-bottom:1px solid #ccc;-webkit-box-shadow:inset 0 1px #fff;-moz-box-shadow:inset 0 1px #fff;-ms-box-shadow:inset 0 1px #fff;box-shadow:inset 0 1px #fff}
.fullgrid-dt-toolbar-footer>:first-child,.dt-toolbar>:first-child{padding-left:0!important}
.fullgrid-dt-toolbar-footer>:last-child,.dt-toolbar>:last-child{padding-right:0!important}
.fullgrid_info{padding-top:9px;font-size:13px;font-weight:700;font-style:italic;color:#969696}
.fullgrid_paginate{float:right;margin:0}
.fullgrid_paginate ul.pagination{margin:2px 0;white-space:nowrap}
.fullgrid .pagination{margin:2px 0;white-space:nowrap}
.fullgrid .pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}
.fullgrid .pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:2px;border-top-left-radius:2px}
.fullgrid .pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:2px;border-top-right-radius:2px}
.fullgrid thead th{background: #FAFAFA;}
table.fullgrid tr td.sorting_1 { background-color: #F2F2F2; }
table.fullgrid tr td.sorting_2 {background-color: #E6E6E6;}
.fullgrid .icon-addon{position:relative;color:#555;display:block}
.fullgrid .icon-addon:after,.icon-addon:before{display:table;content:" "}
.fullgrid .icon-addon:after{clear:both}
.fullgrid .icon-addon .glyphicon,.icon-addon.addon-md .glyphicon{position:absolute;z-index:2;left:10px;width:20px;margin-left:-2.5px;text-align:center;padding:10px 0;top:1px}
.fullgrid .icon-addon.addon-lg .form-control{line-height:1.33;height:46px;font-size:18px;padding:10px 16px 10px 40px}
.fullgrid .input-group-lg .icon-addon.addon-lg+.input-group-btn>.btn{height:46px}
.fullgrid .icon-addon.addon-sm .form-control{height:30px;padding:5px 10px 5px 28px;font-size:12px;line-height:1.5}
.fullgrid .icon-addon.addon-lg .fa,.icon-addon.addon-lg .glyphicon{font-size:18px;margin-left:0;left:11px;top:4px}
.fullgrid .icon-addon .form-control,.icon-addon.addon-md .form-control{padding-left:30px;float:left;font-weight:400}
.fullgrid .icon-addon.addon-sm .fa,.icon-addon.addon-sm .glyphicon{margin-left:0;font-size:12px;left:5px;top:-1px}
.fullgrid .icon-addon .form-control:focus+.glyphicon,.icon-addon:hover .glyphicon{color:#2580db}

/* ============================================================
   FULLGRID — MOBILE CARD VIEW (solo en dispositivos móviles)
   ============================================================ */
@media (max-width: 767px) {

    /* Contenedor principal de las cards */
    .fg-cards-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 8px 4px;
    }

    /* Card individual */
    .fg-card {
        background: #fff;
        border: 1px solid #dde3ec;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
        position: relative;
        transition: box-shadow .2s;
    }
    .fg-card:active {
        box-shadow: 0 4px 12px rgba(0,0,0,.14);
    }

    /* Cabecera de la card: número + botones de acción */
    .fg-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #f4f6fb;
        border-bottom: 1px solid #dde3ec;
        padding: 7px 10px;
        gap: 8px;
    }

    /* Badge con el número de registro */
    .fg-card-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 26px;
        height: 26px;
        padding: 0 6px;
        background: #5e72e4;
        color: #fff;
        border-radius: 13px;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        flex-shrink: 0;
    }

    /* Zona de botones de acción (se mueven desde el <td> de la tabla) */
    .fg-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: center;
    }
    .fg-card-actions .btn {
        padding: 4px 9px;
        font-size: 12px;
        line-height: 1.4;
        border-radius: 4px;
    }

    /* Cuerpo de la card: pares label / valor */
    .fg-card-body {
        padding: 8px 10px;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Fila de campo */
    .fg-card-field {
        display: flex;
        align-items: baseline;
        padding: 5px 0;
        border-bottom: 1px solid #f0f2f7;
    }
    .fg-card-field:last-child {
        border-bottom: none;
    }

    /* Etiqueta del campo */
    .fg-card-label {
        flex: 0 0 42%;
        max-width: 42%;
        font-size: 11px;
        font-weight: 600;
        color: #8898aa;
        text-transform: uppercase;
        letter-spacing: .3px;
        padding-right: 6px;
        word-break: break-word;
    }

    /* Valor del campo */
    .fg-card-value {
        flex: 1 1 58%;
        font-size: 13px;
        color: #32325d;
        word-break: break-word;
    }

    /* Mensaje cuando no hay datos */
    .fg-card-empty {
        text-align: center;
        color: #adb5bd;
        font-style: italic;
        padding: 20px 0;
        font-size: 13px;
    }
}

/* ============================================================
   DARK MODE — MOBILE CARD VIEW
   ============================================================ */
@media (max-width: 767px) {

    body.theme-dark .fg-card {
        background: #2a2d3e;
        border-color: #3a3f55;
        box-shadow: 0 2px 6px rgba(0,0,0,.35);
    }

    body.theme-dark .fg-card-header {
        background: #1e2130;
        border-bottom-color: #3a3f55;
    }

    body.theme-dark .fg-card-num {
        background: #7986e7;
    }

    body.theme-dark .fg-card-field {
        border-bottom-color: #353850;
    }

    body.theme-dark .fg-card-label {
        color: #8892b0;
    }

    body.theme-dark .fg-card-value {
        color: #cdd5f0;
    }

    body.theme-dark .fg-card-empty {
        color: #5a6070;
    }
}