@media (min-width: 1360px) and (max-width: 1370px) {
  body {
    zoom: 0.7; /* Zoom out to 50% */
  }
}

@media (min-width: 1500px) and (max-width: 1900px) {
  body {
    zoom: 0.75; 
  }
}

@media (min-width: 1910px) and (max-width: 4500px) {
  body {
    zoom: 0.9; 
  }
}

@media only screen and (max-width: 447px) {
    .e-bg-gradient .e-signin-content {
        min-width: 100%;
        padding: 25px;
    }
    .e-form-container .e-signin-from-container {
        width: auto;
        padding: 1rem;
    }
    .wrap-blue, .wrap-green {
        width: 120px;
    }
    .login-phone-logo {
        width: 80px;
        top: 5%;
    }

    .e-otp-control {
        width: 100%;
    }

    .e-otp-container {
        justify-content: center;
    }

    #divOuter {
        width: 190px; 
        overflow: hidden;
    }
    
    #partitioned {
        padding-left: 13px;
        letter-spacing: 22px;
        background-size: 31px 2px;
        background-position-x: 30px;
        width: 220px;
        min-width: 220px;
    }

    .e-header-date-container, .e-header-user {
        display: none;
    }

    .layout-sidebar-large .sidebar-left .navigation-left {
        width: 100px;
    }
    .layout-sidebar-large .sidebar-left-secondary.open {
        left: 100px;
    }
    .main-content-wrap.sidenav-open {
        width: calc(100% - 100px);
    }
    .panel-body-view {
        padding: 10px;
    }


    
    .e-thead {
        display: none;
    }
    .e-tbody tr {
        border-bottom: 35px solid var(--bs-gray-100);
    }
    .e-tbody .e-tr td:first-child {
        padding-left:10px;
    }
    .e-tbody .e-tr td:before {
        content: attr(data-label);
        float: left;
        font-size:10px;
        text-transform: uppercase;
        font-weight: bold;
    }
    .e-tbody .e-tr td {
        display: block;
        text-align: right;
        font-size: 14px;
        padding: 0px 10px!important;
        box-shadow: 0 1px 1px rgba(0,0,0,.3);
    }

    .table-header, .table-footer {
        flex-direction: column;
    }
}
@media (min-width: 448px) and (max-width: 556px) {
    .e-form-container .e-signin-from-container {
        width: 350px;
        padding: 1rem;
    }

}
@media (min-width: 448px) and (max-width: 767px) {
    .e-bg-gradient .e-signin-content {
        min-width: 100%;
        padding: 25px;
    }
    .e-form-container .e-signin-from-container {
        padding: 1rem;
    }
    .wrap-blue, .wrap-green {
        width: 120px;
    }
    .login-phone-logo {
        width: 80px;
        top: 5%;
    }

    .e-otp-control {
        width: 100%;
    }

    .e-otp-container {
        justify-content: center;
    }

    #divOuter {
        width: 190px; 
        overflow: hidden;
    }
    #partitioned {
        padding-left: 13px;
        letter-spacing: 22px;
        background-size: 31px 2px;
        background-position-x: 30px;
        width: 220px;
        min-width: 220px;
    }

    .e-header-date-container, .e-header-user {
        display: none;
    }
    .panel-body-view {
        padding: 10px;
    }

    .e-thead {
        display: none;
    }
    .e-tbody tr {
        border-bottom: 35px solid var(--bs-gray-100);
    }
    .e-tbody .e-tr td:first-child {
        padding-left:10px;
    }
    .e-tbody .e-tr td:before {
        content: attr(data-label);
        float: left;
        font-size:10px;
        text-transform: uppercase;
        font-weight: bold;
    }
    .e-tbody .e-tr td {
        display: block;
        text-align: right;
        font-size: 14px;
        padding: 0px 10px!important;
        box-shadow: 0 1px 1px rgba(0,0,0,.3);
    }

    .table-header, .table-footer {
        flex-direction: column;
    }
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .e-otp-container {
        justify-content: center;
    }

    
}

@media (min-width: 992px) and (max-width: 1023px) {
    .e-otp-container {
        justify-content: center;
    }
}

@media (min-width: 1024px) and (max-width: 1280px) {

}

@media (min-width: 1024px) and (max-width: 1200px) {

}
@media only screen and (min-width: 1201px) and (max-width: 1366px) {

}
@media only screen and (min-width: 1367px) and (max-width: 1440px) {

}
@media only screen and (min-width: 1441px) and (max-width: 1600px) {

}
@media only screen and (min-width: 1601px) {

}

/* Chat panel responsive layout. Added 1 Aug 2026; phone full-screen 24 Aug 2026.
   ---------------------------------------------------------------------------------------
   On a phone the panel takes the whole screen: a 50%-wide slide-over on a 390px display is
   a 195px column, which is not a chat window. On anything wider the desktop slide-over is
   left exactly as it was.

   The panel is position:fixed with top and bottom pinned, so full width is all that is
   needed for full screen - but left is pinned too rather than relying on width alone, and
   the shadow and rounding are dropped because there is nothing beside it to cast onto.

   One column at a time at this width: the contact list, or the conversation. The class the
   panel's own JS toggles decides which, and the back arrow that only appears here is the
   way back to the list. */
@media only screen and (max-width: 767px) {
    .chat-panel {
        width: 100%;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* The backdrop has nothing left to reveal once the panel is full-bleed, and on a phone it
       only ever caught taps meant for the panel itself. */
    .chat-panel-backdrop {
        display: none !important;
    }

    .chat-panel-header {
        padding: 12px 15px;
    }

    .chatpage-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
    }

    .chatpage-main {
        display: none;
    }

    .chatpage-wrap.chatpage-mobile-thread-open .chatpage-sidebar {
        display: none;
    }

    .chatpage-wrap.chatpage-mobile-thread-open .chatpage-main {
        display: flex;
    }

    .chatpage-mobile-back-btn {
        display: inline-flex;
    }

    .chat-attachment-image img,
    .chat-attachment-video video,
    .chat-attachment-doc {
        max-width: 100%;
    }

    /* Thumb-sized targets. The filter chips and the media tabs are the two rows a phone user
       actually taps, and 6px of padding is not a tap target. */
    .chatpage-filter {
        padding: 0 12px 12px 12px;
    }

    .chatpage-filter-btn,
    .chatpage-media-tab {
        padding: 9px 16px;
        font-size: 0.82rem;
    }

    .chatpage-search,
    .chatpage-media-search {
        padding: 12px;
    }

    .chatpage-thread,
    .chatpage-media-body {
        padding: 14px 12px;
    }

    .chatpage-input-bar {
        padding: 10px 12px;
    }

    /* On a phone the media browser is the whole screen, so its Back arrow is the only way out -
       the thread underneath is hidden at this width. */
    .chatpage-media-header {
        padding: 12px 15px;
    }

    .chatpage-media-item {
        padding: 12px 4px;
    }

    .chatpage-media-tabs {
        padding: 0 12px 12px 12px;
    }

    /* The bar wraps onto two rows rather than squeezing the message into a column of two
       words; the button stays full width so it is still a target. */
    .notify-optin-bar {
        flex-wrap: wrap;
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .notify-optin-text {
        flex: 1 1 100%;
        order: 3;
    }

    .notify-optin-btn {
        flex: 1 1 auto;
        order: 4;
        margin-top: 8px;
    }
}

/* A phone held sideways is still a phone: 812x375 never matches a max-width of 767, so without
   this a landscape handset would get the desktop slide-over in a 375px-tall window. */
@media only screen and (max-width: 991px) and (max-height: 500px) and (orientation: landscape) {
    .chat-panel {
        width: 100%;
        left: 0;
        right: 0;
        box-shadow: none;
    }

    .chat-panel-backdrop {
        display: none !important;
    }

    .chat-panel-header {
        padding: 8px 15px;
    }
}
/* =========================================================================================
   Mobile and tablet layout. Added 01/10/2026 after a scan of all 125 sidebar pages at 360px,
   768px and 1024px (the audit is written up in CLAUDE.md, "Phones and tablets").
   -----------------------------------------------------------------------------------------
   Everything here is shared layout: the header, the sidebar, the stat cards, the filter
   grid, DataTables and modals. Nothing above 992px is touched, so the desktop stays as it
   was. Rules are grouped by what they fix, widest breakpoint first.
   ========================================================================================= */

:root {
    --erp-header-h: 60px;
}

/* ---- Header: the page title stays, the user's name and the clock go, nothing wraps ------
   .e-header is fixed at a set height with flex-wrap:wrap, so whatever does not fit drops
   to a second row that is clipped out of sight. Below 992px the title is allowed to shrink
   (ellipsis) and the account block is not, so the row fits down to 576px. ------------- */
@media (max-width: 991.98px) {
    .e-header {
        padding: 0 12px;
    }

    .e-header-logo-container {
        flex: 1 1 auto;
        min-width: 0;
    }

    .e-header-title {
        display: block;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1rem;
    }

    .e-header-account {
        flex: 0 0 auto;
    }

    .e-header-user,
    .e-header-date-container {
        display: none;
    }
}

/* ---- Phones: a two-row header -----------------------------------------------------------
   Logo, menu, title and search on the first row; the account icons on their own row under
   it. 44px for the second row keeps every icon a full tap target. The height is a variable
   because the content offset and the three sidebar panels all have to follow it. ------ */
@media (max-width: 575.98px) {
    :root {
        --erp-header-h: 104px;
    }

    /* The two rows (logo/title, then the account icons) give the header its natural height;
       the JS in master.blade.php measures it and writes --erp-header-h, which the content
       and sidebars follow. The :root default above is the fallback if that script does not
       run. Not a fixed height, so this never clips a row or fights the measured value. */
    .e-header {
        padding: 0 8px;
        align-content: flex-start;
    }

    .e-header-logo-container {
        height: 60px;
    }

    .layout-sidebar-large .menu-toggle {
        width: 40px;
        margin-right: 4px;
    }

    .e-header-account {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        height: 44px;
        justify-content: flex-end;
        padding-right: 4px;
    }

    .e-header-account .e-icon {
        width: 34px;
        height: 34px;
    }

    .main-content-wrap {
        margin-top: var(--erp-header-h);
        min-height: calc(100vh - var(--erp-header-h));
    }

    .layout-sidebar-large .sidebar-left,
    .layout-sidebar-large .sidebar-left-secondary,
    .layout-sidebar-large .sidebar-left-third {
        top: var(--erp-header-h);
        height: calc(100vh - var(--erp-header-h));
    }
}

/* ---- Sidebar under 768px: it overlays the page instead of squeezing it ------------------
   Opening the rail used to take 100-120px off the content (a 240px column on a 360px
   phone); the content now keeps its full width and a dimmed overlay closes the menu on
   tap (sidebar.js). The secondary panel is lifted back above the overlay: style.css puts
   it at z-index 1000 on mobile, under the overlay's 1007. ---------------------------- */
@media (max-width: 767.98px) {
    .main-content-wrap.sidenav-open {
        width: 100%;
    }

    .layout-sidebar-large .sidebar-left-secondary {
        z-index: 1008;
    }

    .layout-sidebar-large .sidebar-overlay.open {
        display: block;
        position: fixed;
        top: var(--erp-header-h);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--erp-header-h));
        background: rgba(0, 0, 0, 0.35);
        cursor: pointer;
    }

    /* A 100px rail leaves a 260px second panel on a 360px phone; the rail only ever shows
       an icon and two short words, so 90px is enough. */
    .layout-sidebar-large .sidebar-left .navigation-left {
        width: 90px;
    }

    .layout-sidebar-large .sidebar-left .navigation-left .nav-item .nav-item-hold .nav-text {
        font-size: 12px;
        overflow-wrap: anywhere;   /* "Store/Inventory" breaks at the slash instead of spilling */
        padding: 0 2px;
    }

    .layout-sidebar-large .sidebar-left-secondary.open,
    .layout-sidebar-large .sidebar-left-third.open {
        left: 90px;
    }

    .layout-sidebar-large .sidebar-left-secondary,
    .layout-sidebar-large .sidebar-left-third {
        width: calc(100% - 90px);
    }
}

/* ---- Filter grid on tablets --------------------------------------------------------------
   Nearly every list page lays its filters out as col-sm-2 (six to a row). At 768px that is
   a 108px select, which truncates "In-Service (Active + On-Rent)" to "In-Se". Three to a row
   between 576 and 991px, and the col-sm-3 fields two to a row below 768px. Bootstrap 5
   sizes columns with width, not flex-basis, so that is what is overridden. ------------ */
@media (min-width: 576px) and (max-width: 991.98px) {
    .panel-body-view .col-sm-2,
    .panel-body-view .col-md-2 {
        flex: 0 0 auto;
        width: 33.3333%;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .panel-body-view .col-sm-3 {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* ---- Tables under 992px -------------------------------------------------------------------
   The lists put table-responsive on the <table> itself, which does nothing: a table box
   cannot scroll. The 104 lists that pass responsive:true to DataTables collapse columns
   and are fine; the rest (support tickets, active sessions, the vehicle task report...)
   ran 500px past the right edge with no way to reach it. The DataTables wrapper now
   scrolls sideways for tables that are NOT collapsing (Responsive stamps dtr-inline /
   dtr-column on the ones it manages), and a plain table that is not a DataTable scrolls
   itself. Collapsing tables are left alone on purpose: the voucher list keeps its header
   sticky against the page, and an overflow container would become its scroll context. */
@media (max-width: 991.98px) {
    .dataTables_wrapper:not(:has(table.dtr-inline, table.dtr-column)) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.table-responsive:not(.dataTable) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .e-card,
    .panel-body-view {
        min-width: 0;
    }

    .select2-container {
        max-width: 100%;
    }
}

/* ---- Phones: stat cards, DataTables controls, modals, pagination -------------------- */
@media (max-width: 575.98px) {
    /* The card's text block carries mr-5 (3rem) to keep the icon away from the figure; on a
       card 320px wide that pushed the icon out of the card. */
    .card-content.mr-5 {
        margin-right: 1rem !important;
    }

    .card-content {
        min-width: 0;
    }

    .card-icon {
        flex-shrink: 0;
    }

    .card-count {
        word-break: break-word;
    }

    /* Stat cards, second pass (29/10/2026). A phone scan of every sidebar page found
       the figure squeezed to ~75px on most list pages and to 3px on Gas Purity, whose
       cards are col-3 (four to a row, 85px each). Each card also stacked mr-3 (16px)
       on the column gutter, 15px padding and a decorative icon - the same fa-industry
       on every card - beside the number. Under 576px: never more than two cards to a
       row, no margin on top of the gutter, a tighter pad, no icon, and the figure
       sized to the screen. Only columns narrower than half are widened, and only
       when they hold an .e-card, so full-width form cards are not touched. */
    .row > :is(.col-1, .col-2, .col-3, .col-4, .col-5):has(> .e-card) {
        flex: 0 0 auto;
        width: 50%;
    }

    .e-card.mr-3 {
        margin-right: 0 !important;
    }

    .panel-body-view-15:has(.card-count) {
        padding: 10px 12px;
    }

    .card-content.mr-5 {
        margin-right: 0 !important;
    }

    .card-content + .card-icon {
        display: none;
    }

    .card-count {
        font-size: clamp(1.05rem, 5vw, 1.5rem);
        font-variant-numeric: tabular-nums;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    /* "Show [100] entries" and the search box each take a row; the search box fills it. */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: left;
        width: 100%;
        margin-bottom: 6px;
    }

    .dataTables_wrapper .dataTables_filter label {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;
    }

    .dataTables_wrapper .dataTables_paginate {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        margin: 0;
        padding: 0.45em 0.8em;
    }

    /* Popups: edge to edge with a small gutter, and the body scrolls rather than the page
       growing taller than the screen with the Save button out of reach. */
    .modal-dialog {
        margin: 0.5rem auto;
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        max-height: calc(100vh - 9rem);
        overflow-y: auto;
    }

    .panel-body-view {
        padding: 12px;
    }

    .main-content-wrap {
        padding-bottom: 72px;   /* room under the last row for the floating + button */
    }
}

/* ---- Touch targets ------------------------------------------------------------------------
   On a touch screen a 28px button is a miss. Only full-size buttons are raised; the small
   icon buttons in table rows keep their size so the rows do not grow. ----------------- */
@media (hover: none) and (pointer: coarse) {
    .btn:not(.btn-sm):not(.paginate_button) {
        min-height: 40px;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-height: 36px;
        min-width: 36px;
    }

    .e-form-input,
    .e-input-container select {
        min-height: 2.5rem;
    }
}

/* ---- Operations dashboard / home page on phones (29/10/2026) -----------------------------
   Reported from an iPhone: the CBG Gas Sale cards were 130px wide, so "₹ 5,04,061.18" broke
   into "₹" over the figure and "399.21 SCM" into two lines. Three nested gutters (the section,
   <main>'s px-4 and the white card's p-6) took ~75px of a 390px screen before any tile. Under
   576px the gutters are cut, the tiles tighten, and big figures scale with the screen and
   break only when nothing else fits. Scoped to .opsdash (opsdash/_panel) so no other
   Tailwind page moves; two classes deep so it beats Tailwind's CDN sheet, injected later.
   The !important is not optional: bootstrap.min.css also defines .p-4, .px-4 and .gap-4,
   as 1.5rem !important, so on this page those win over Tailwind's 1rem and over any plain
   rule - that is where most of the lost width went. */
@media (max-width: 575.98px) {
    section.opsdash {
        padding-left: 6px;
        padding-right: 6px;
    }

    .opsdash > header .mx-auto,
    .opsdash > main {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .opsdash > main {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .opsdash > header h1 {
        font-size: 1.25rem;
    }

    .opsdash .p-6 {
        padding: 14px 12px;
    }

    .opsdash .p-4 {
        padding: 10px 8px !important;
    }

    .opsdash .gap-8,
    .opsdash .gap-6 {
        gap: 14px;
    }

    .opsdash .gap-4 {
        gap: 10px !important;
    }

    .opsdash .mb-8 {
        margin-bottom: 16px;
    }

    .opsdash .text-3xl {
        font-size: clamp(1.25rem, 6.5vw, 1.875rem);
        line-height: 1.2;
    }

    .opsdash .text-2xl {
        font-size: clamp(1.05rem, 5.2vw, 1.5rem);
        line-height: 1.25;
    }

    .opsdash .font-bold {
        overflow-wrap: anywhere;
        font-variant-numeric: tabular-nums;
    }

    /* The period pills and buttons above the cards were 24px tall: too small to hit. */
    .opsdash .cbg-period-btn,
    .opsdash #cbg_sale_copy,
    .opsdash #cbg_sale_whatsapp,
    .opsdash #cbg_sale_report_link {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }

    .opsdash .chart-container {
        height: 220px;
    }
}
