/* =====================================================================
   কর অঞ্চল-৩, চট্টগ্রাম — মোবাইলে টেবিল (পাবলিক সাইট ও অ্যাডমিন প্যানেল)
   js/responsive-tables.js টেবিলে rt-stack / rt-scroll class যোগ করে।
   ===================================================================== */

:root {
    --rt-primary: #176b62;
    --rt-primary-dark: #10524b;
    --rt-soft: #eaf5f2;
    --rt-border: #dce8e4;
    --rt-muted: #62736f;
    --rt-radius: 10px;
}

/* বড় টেবিলের জন্য স্বয়ংক্রিয় স্ক্রল-আবরণ (site-polish.js যোগ করে) */
.rt-scroll {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}
.rt-scroll > table { margin-bottom: 0; }
.rt-scroll.rt-has-more {
    background:
        linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left center / 24px 100% no-repeat local,
        linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right center / 24px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent) left center / 10px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) right center / 10px 100% no-repeat scroll;
}


@media (max-width: 767px) {
    /* ---------- সাধারণ ডেটা টেবিল: কার্ড লেআউট (site-polish.js দিয়ে চিহ্নিত) ---------- */
    table.rt-stack,
    table.rt-stack > tbody,
    table.rt-stack > tbody > tr,
    table.rt-stack > tbody > tr > td,
    table.rt-stack > tfoot,
    table.rt-stack > tfoot > tr,
    table.rt-stack > tfoot > tr > td,
    table.rt-stack > tfoot > tr > th,
    table.rt-stack > tbody > tr > th {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    table.rt-stack { min-width: 0 !important; border: 0 !important; background: transparent; }
    table.rt-stack > thead, table.rt-stack tr.rt-head-row { display: none !important; }
    table.rt-stack > tbody > tr,
    table.rt-stack > tfoot > tr {
        margin: 0 0 12px;
        border: 1px solid var(--rt-border);
        border-radius: var(--rt-radius);
        background: #fff;
        box-shadow: 0 2px 8px rgba(20, 62, 54, .06);
        overflow: hidden;
    }
    table.rt-stack > tbody > tr > td,
    table.rt-stack > tbody > tr > th,
    table.rt-stack > tfoot > tr > td,
    table.rt-stack > tfoot > tr > th {
        padding: 9px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #edf3f1 !important;
        text-align: left !important;
        word-break: break-word;
        background: transparent !important;
    }
    table.rt-stack > tbody > tr > td:last-child,
    table.rt-stack > tfoot > tr > td:last-child,
    table.rt-stack > tfoot > tr > th:last-child { border-bottom: 0 !important; }
    table.rt-stack td[data-label]::before,
    table.rt-stack th[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--rt-muted);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.5;
        letter-spacing: .1px;
    }
    table.rt-stack td > *:first-child, table.rt-stack th > *:first-child { margin-top: 0; }
    table.rt-stack td p { margin: 0 0 4px; }
    table.rt-stack td img { max-width: 110px; border-radius: 8px; }

    table.rt-stack td.rt-full::before { display: none; }

    /* ক্রমিক নং কার্ডের মাথায় ছোট লেবেল হিসেবে */
    table.rt-stack td.rt-serial {
        background: var(--rt-soft) !important;
        color: var(--rt-primary-dark);
        font-weight: 600;
        padding: 6px 12px !important;
        font-size: 13px;
    }
    table.rt-stack td.rt-serial::before { display: inline; margin: 0 8px 0 0; }
    table.rt-stack td.rt-empty { display: none !important; }
    table.rt-stack td.rt-serial p, table.rt-stack td.rt-serial span { display: inline; margin: 0; }
    table.rt-stack td.rt-inline::before {
        display: inline-block;
        width: 36%;
        margin: 0 8px 0 0;
        vertical-align: top;
    }

    /* কার্ড লেআউটে আর স্ক্রল-নির্দেশনার দরকার নেই */
    .rt-hint-hidden { display: none !important; }

    /* স্ক্রল-আবরণের ভেতরের কার্ড টেবিলের পুরোনো min-width বাতিল */
    .rt-scroll > table.rt-stack,
    .table-scroll-wrapper > table.rt-stack,
    .mobile-table-scroll-area > table.rt-stack,
    .jurisdiction-table-wrapper > table.rt-stack,
    .commissioner-table-wrap > table.rt-stack { min-width: 0 !important; width: 100% !important; }
    .table-scroll-wrapper, .mobile-table-scroll-area,
    .jurisdiction-table-wrapper, .commissioner-table-wrap { overflow-x: visible; }

    /* এডিটরে তৈরি টেবিলের স্থির উচ্চতা/প্রস্থ বাতিল — লেখা কেটে যাবে না */
    table[style*="height"], table[height] { height: auto !important; }
    table[style*="width"] td, table[style*="width"] th { width: auto; }

}
