/* Dual-render mobile cards for DataTables */
.mobile-only { display: none; }

@media (max-width: 767.98px) {
    .desktop-only { display: none !important; }
    .mobile-only {
        display: table-cell !important;
        width: 100%;
        padding: 4px !important;
        border: 0 !important;
        background: transparent;
    }
    .mobile-only .panel {
        margin-bottom: 8px;
        border: 1px solid #ddebe4;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 8px 20px rgba(32, 83, 62, 0.06);
    }
    .mobile-only .panel-heading {
        font-weight: bold;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        padding: 6px 10px;
        font-size: 12.5px;
        background: #eefaf3;
        color: #173f33;
        border-color: #ddebe4;
    }
    .mobile-only .panel-heading .fa-user { color: #0f6a51; }
    .mobile-only .panel-footer {
        background: #f9fcfa;
        border-color: #e8f1ec;
    }
    .mobile-only .panel-heading br { display: none; }
    .mobile-only .panel-body { padding: 6px 10px; }
    .mobile-only .panel-footer { padding: 5px 10px; }
    .mobile-only .mobile-field {
        margin-bottom: 6px;
        font-size: 12px;
        line-height: 1.35;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: flex;
        align-items: flex-start;
        gap: 6px;
    }
    .mobile-only .mobile-field small {
        color: #999;
        display: inline-block;
        flex: 0 0 auto;
        font-size: 10.5px;
        margin-top: 1px;
    }
    .mobile-only .mobile-field br { display: none; }
    /* buttons follow the authentication page palette:
       primary action solid green, additional buttons outlined */
    .mobile-only .panel-footer .btn {
        background: linear-gradient(135deg, #0f6a51 0%, #16946e 100%);
        border: 0;
        color: #fff;
        border-radius: 14px;
        padding: 5px 14px;
        font-size: 12px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        white-space: nowrap;
    }
    .mobile-only .panel-footer .btn:hover,
    .mobile-only .panel-footer .btn:focus {
        background: linear-gradient(135deg, #0c5d47 0%, #13855f 100%);
        color: #fff;
    }
    .mobile-only .panel-footer .mobile-footer-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    .mobile-only .panel-footer .mobile-footer-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-only .panel-footer .mobile-footer-action .btn-group-mobile {
        display: inline-flex;
        align-items: stretch;
    }
    .mobile-only .panel-footer .mobile-footer-action .btn-group-mobile > .btn {
        float: none;
        border-radius: 0;
        margin-left: 0 !important;
    }
    .mobile-only .panel-footer .mobile-footer-action .btn-group-mobile > .btn:first-child {
        border-top-left-radius: 14px;
        border-bottom-left-radius: 14px;
    }
    .mobile-only .panel-footer .mobile-footer-action .btn-group-mobile > .btn:last-child {
        border-top-right-radius: 14px;
        border-bottom-right-radius: 14px;
    }
    .mobile-only .panel-footer .mobile-footer-action .btn-group-mobile.btn-group-single > .btn {
        border-radius: 14px;
    }
    .mobile-only .panel-footer .mobile-footer-action .btn-group-mobile > .btn.display-hide {
        display: none !important;
    }
    .mobile-only .panel-footer .btn ~ .btn {
        background: #fff;
        border: 1px solid #0f6a51;
        color: #0f6a51;
    }
    .mobile-only .panel-footer .btn ~ .btn:hover,
    .mobile-only .panel-footer .btn ~ .btn:focus {
        background: #e8f4ee;
        color: #0c5d47;
    }
    .mobile-only .panel-footer .mobile-secondary-action .btn {
        background: #fff;
        border: 1px solid #0f6a51;
        color: #0f6a51;
    }
    .mobile-only .panel-footer .mobile-secondary-action .btn:hover,
    .mobile-only .panel-footer .mobile-secondary-action .btn:focus {
        background: #e8f4ee;
        color: #0c5d47;
    }
    .mobile-only .panel-footer .mobile-action-label {
        display: inline-block;
        line-height: 1;
    }
    /* compact one-line fields: inline label, server <br>s collapsed */
    .mobile-only .mobile-field-line {
        margin-bottom: 2px;
        font-size: 12px;
        line-height: 1.4;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .mobile-only .mobile-field-line br { display: none; }
    .mobile-only .mobile-field-line small {
        color: #999;
        display: inline;
        margin-right: 4px;
    }
}
