/* Runitro Desk — professional business tools mobile surface
   Applied only when layouts.app marks the current route as rd-pro-mobile. */

.rd-pro-mobile {
    --rdm-surface: #ffffff;
    --rdm-soft: #f7f9fc;
    --rdm-soft-strong: #eef3f8;
    --rdm-text: #102033;
    --rdm-muted: #69788d;
    --rdm-line: #e2e8f0;
    --rdm-primary: #0f766e;
    --rdm-primary-soft: #eaf8f5;
    --rdm-danger: #c83f54;
    --rdm-warning: #a96207;
    --rdm-shadow: 0 12px 32px rgba(15, 23, 42, .075);
}

@media (max-width: 991.98px) {
    .rd-pro-mobile .rd-page {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .rd-pro-mobile .rd-page > .container,
    .rd-pro-mobile .rd-page > .container-fluid,
    .rd-pro-mobile .rd-page .ledger-wrap {
        width: 100%;
        max-width: none !important;
        margin-inline: 0 !important;
        padding: 0 !important;
    }

    .rd-pro-mobile .rdm-page-head,
    .rd-pro-mobile .rd-page > .container > .d-flex:first-child,
    .rd-pro-mobile .rd-page > .container-fluid > .d-flex:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center !important;
        gap: 12px !important;
        margin: 0 0 12px !important;
        padding: 15px;
        border: 1px solid var(--rdm-line);
        border-radius: 20px;
        background: linear-gradient(145deg, #fff, #f8fbfd);
        box-shadow: var(--rdm-shadow);
    }

    .rd-pro-mobile .rdm-page-title {
        margin: 0 !important;
        color: var(--rdm-text);
        font-size: 20px !important;
        font-weight: 950 !important;
        line-height: 1.55;
        letter-spacing: -.35px;
    }

    .rd-pro-mobile .rdm-page-head .text-secondary,
    .rd-pro-mobile .rdm-page-head .text-muted {
        margin-top: 4px;
        font-size: 10px !important;
        line-height: 1.85;
    }

    .rd-pro-mobile .rdm-page-head > a.btn,
    .rd-pro-mobile .rdm-page-head > button.btn,
    .rd-pro-mobile .rdm-page-head > .btn {
        min-width: 48px;
        margin: 0 !important;
    }

    .rd-pro-mobile .card,
    .rd-pro-mobile .rd-card,
    .rd-pro-mobile .panel,
    .rd-pro-mobile .pay-box,
    .rd-pro-mobile .soft-hint,
    .rd-pro-mobile .date-box,
    .rd-pro-mobile .list-group {
        border-color: var(--rdm-line) !important;
        border-radius: 20px !important;
        background-color: var(--rdm-surface) !important;
        box-shadow: var(--rdm-shadow) !important;
    }

    .rd-pro-mobile .card,
    .rd-pro-mobile .rd-card,
    .rd-pro-mobile .panel {
        overflow: hidden;
    }

    .rd-pro-mobile .card-body,
    .rd-pro-mobile .rd-card,
    .rd-pro-mobile .panel > .p-3,
    .rd-pro-mobile .panel > .p-4 {
        padding: 15px !important;
    }

    .rd-pro-mobile .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }

    .rd-pro-mobile .form-label {
        margin-bottom: 6px;
        color: #445269;
        font-size: 10px;
        font-weight: 900;
    }

    .rd-pro-mobile .form-control,
    .rd-pro-mobile .form-select,
    .rd-pro-mobile input.form-control,
    .rd-pro-mobile select.form-control,
    .rd-pro-mobile textarea.form-control {
        min-height: 48px;
        border: 1px solid #d7dfe9;
        border-radius: 14px !important;
        background-color: #fbfcfe;
        color: var(--rdm-text);
        font-size: 12px;
        box-shadow: none;
    }

    .rd-pro-mobile textarea.form-control {
        min-height: 104px;
        line-height: 1.9;
    }

    .rd-pro-mobile .form-control:focus,
    .rd-pro-mobile .form-select:focus {
        border-color: #79bfb6;
        background: #fff;
        box-shadow: 0 0 0 4px rgba(15, 118, 110, .09);
    }

    .rd-pro-mobile input[type="file"].form-control {
        min-height: 52px;
        padding-top: 11px;
    }

    .rd-pro-mobile .btn {
        min-height: 44px;
        border-radius: 14px !important;
        padding: 9px 13px;
        font-size: 11px;
        font-weight: 900;
        line-height: 1.45;
    }

    .rd-pro-mobile .btn-sm {
        min-height: 38px;
        padding: 7px 11px;
        font-size: 10px;
    }

    .rd-pro-mobile .btn-group {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .rd-pro-mobile .btn-group > .btn {
        width: 100%;
        border-radius: 13px !important;
    }

    .rd-pro-mobile .alert,
    .rd-pro-mobile .note,
    .rd-pro-mobile .pay-help,
    .rd-pro-mobile .draft-help {
        border-radius: 16px !important;
        font-size: 10px !important;
        line-height: 1.9;
    }

    .rd-pro-mobile .table-responsive {
        overflow: visible !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .rd-pro-mobile table.rdm-card-table,
    .rd-pro-mobile table.rdm-card-table tbody {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .rd-pro-mobile table.rdm-card-table thead {
        display: none !important;
    }

    .rd-pro-mobile table.rdm-card-table tbody {
        display: grid !important;
        gap: 10px;
    }

    .rd-pro-mobile table.rdm-card-table tbody tr {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 12px 14px !important;
        border: 1px solid var(--rdm-line) !important;
        border-radius: 18px !important;
        background: #fff !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .055) !important;
        transform: none !important;
    }

    .rd-pro-mobile table.rdm-card-table tbody td {
        display: grid !important;
        grid-template-columns: minmax(86px, .72fr) minmax(0, 1.28fr);
        align-items: center;
        gap: 10px;
        width: 100% !important;
        min-height: 34px;
        padding: 7px 0 !important;
        border: 0 !important;
        border-bottom: 1px dashed #edf1f5 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: var(--rdm-text);
        text-align: right !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .rd-pro-mobile table.rdm-card-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .rd-pro-mobile table.rdm-card-table tbody td::before {
        content: attr(data-rdm-label);
        color: var(--rdm-muted);
        font-size: 9px;
        font-weight: 900;
        line-height: 1.6;
    }

    .rd-pro-mobile table.rdm-card-table tbody td.rdm-empty-cell {
        display: block !important;
        padding: 22px 6px !important;
        text-align: center !important;
        color: var(--rdm-muted);
    }

    .rd-pro-mobile table.rdm-card-table tbody td.rdm-empty-cell::before {
        display: none;
    }

    .rd-pro-mobile table.rdm-card-table tbody td .d-flex,
    .rd-pro-mobile table.rdm-card-table tbody td.text-end {
        justify-content: flex-start !important;
        text-align: right !important;
    }

    .rd-pro-mobile table.rdm-card-table tbody td form,
    .rd-pro-mobile table.rdm-card-table tbody td .btn {
        max-width: 100%;
    }

    .rd-pro-mobile table.rdm-card-table tbody td:last-child:has(.btn),
    .rd-pro-mobile table.rdm-card-table tbody td:last-child:has(form) {
        display: flex !important;
        flex-wrap: wrap;
        gap: 7px;
        padding-top: 10px !important;
    }

    .rd-pro-mobile .pagination {
        justify-content: center;
        gap: 4px;
        flex-wrap: wrap;
    }

    .rd-pro-mobile .page-link {
        min-width: 38px;
        min-height: 38px;
        display: grid;
        place-items: center;
        border-radius: 11px !important;
        font-size: 10px;
    }

    .rd-pro-mobile .list-group {
        display: grid;
        gap: 9px;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .rd-pro-mobile .list-group-item {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 11px;
        padding: 14px !important;
        border: 1px solid var(--rdm-line) !important;
        border-radius: 18px !important;
        background: #fff;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    }

    .rd-pro-mobile .list-group-item .small.text-muted {
        display: grid;
        gap: 4px;
        margin-top: 6px;
        line-height: 1.8;
    }

    .rd-pro-mobile .list-group-item > .d-flex:last-child {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px !important;
        margin-top: 0 !important;
    }

    .rd-pro-mobile .list-group-item > .d-flex:last-child .btn,
    .rd-pro-mobile .list-group-item > .d-flex:last-child form,
    .rd-pro-mobile .list-group-item > .d-flex:last-child form .btn {
        width: 100%;
    }

    .rd-pro-mobile .date-row {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }

    .rd-pro-mobile .date-box {
        padding: 12px !important;
    }

    .rd-pro-mobile .jalali-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .rd-pro-mobile .jalali-fields .field-label {
        font-size: 9px !important;
    }

    .rd-pro-mobile .radio-button-group {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px !important;
    }

    .rd-pro-mobile .radio-button-group label {
        min-height: 44px;
        margin: 0 !important;
        justify-content: center;
        padding: 8px !important;
        border-radius: 13px !important;
        font-size: 10px;
        text-align: center;
    }

    .rd-pro-mobile #product-table tbody tr,
    .rd-pro-mobile #service-table tbody tr {
        padding: 13px !important;
        border: 1px solid var(--rdm-line) !important;
        border-radius: 18px !important;
        background: #fff !important;
    }

    .rd-pro-mobile #product-table .form-control,
    .rd-pro-mobile #product-table .form-select,
    .rd-pro-mobile #service-table .form-control,
    .rd-pro-mobile #service-table .form-select {
        width: 100% !important;
    }

    .rd-pro-mobile #add-product,
    .rd-pro-mobile #add-service {
        width: 100%;
        min-height: 48px;
        color: var(--rdm-primary);
        border: 1px dashed #8ecdc4;
        background: var(--rdm-primary-soft);
    }

    .rd-pro-mobile #total-invoice {
        font-size: 22px;
        font-weight: 950;
    }

    .rd-pro-mobile .stat {
        min-height: 112px;
        border-radius: 17px !important;
        padding: 13px !important;
    }

    .rd-pro-mobile .stat .v {
        font-size: 18px !important;
        overflow-wrap: anywhere;
    }

    .rd-pro-mobile .head {
        padding: 15px !important;
        border-radius: 0 !important;
    }

    .rd-pro-mobile .head .t {
        font-size: 19px !important;
    }

    .rd-pro-mobile .head .chip {
        max-width: 100%;
        white-space: normal;
    }

    .rd-pro-mobile .display-6 {
        font-size: 30px !important;
    }

    .rd-pro-mobile .d-flex.gap-2.mt-2,
    .rd-pro-mobile .col-12.d-flex.gap-2,
    .rd-pro-mobile .col-12.d-flex.flex-wrap.gap-2 {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .rd-pro-mobile .d-flex.gap-2.mt-2 > *,
    .rd-pro-mobile .col-12.d-flex.gap-2 > *,
    .rd-pro-mobile .col-12.d-flex.flex-wrap.gap-2 > * {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .rd-pro-mobile .rdm-page-head,
    .rd-pro-mobile .rd-page > .container > .d-flex:first-child,
    .rd-pro-mobile .rd-page > .container-fluid > .d-flex:first-child {
        grid-template-columns: minmax(0, 1fr);
    }

    .rd-pro-mobile .rdm-page-head > .btn,
    .rd-pro-mobile .rd-page > .container > .d-flex:first-child > .btn,
    .rd-pro-mobile .rd-page > .container-fluid > .d-flex:first-child > .btn {
        width: 100%;
    }

    .rd-pro-mobile table.rdm-card-table tbody td {
        grid-template-columns: minmax(76px, .65fr) minmax(0, 1.35fr);
        gap: 8px;
    }

    .rd-pro-mobile .radio-button-group {
        grid-template-columns: minmax(0, 1fr);
    }

    .rd-pro-mobile .list-group-item > .d-flex:last-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
