/* =========================================================================
   TIER6-FIX mobile_fixes.css applied 2026-05-12
   ----------------------------------------------------------------------
   All mobile-only overrides for Bootstrap 3.3.6 admin shell.
   Loaded AFTER css/responsive.css so it wins on equal specificity.
   Desktop (>=768px) is untouched — every rule lives inside a
   max-width: 767px media query.
   ========================================================================= */


/* =========================================================================
   TIER6-FIX-MOB-01 — Dynamic mobile accordion menu
   ========================================================================= */
@media (max-width: 767px) {

    .mobile-accordion {
        margin: 0;
        border-radius: 0;
        background: #2c3e50;
    }

    .mobile-accordion .panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
        background: transparent;
    }

    .mobile-accordion .panel-heading {
        padding: 0;
        background: #2c3e50;
        border: none;
        border-bottom: 1px solid #1c2833;
    }

    .mobile-accordion .panel-title a {
        display: block;
        padding: 14px 16px;
        color: #ecf0f1;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        line-height: 1.3;
    }

    .mobile-accordion .panel-title a:focus,
    .mobile-accordion .panel-title a:hover {
        color: #fff;
        background: #34495e;
    }

    .mobile-accordion .panel-title a:after {
        content: '\25BC';                /* down triangle when open */
        float: right;
        font-size: 10px;
        margin-top: 3px;
        transition: transform 0.15s ease;
    }

    .mobile-accordion .panel-title a.collapsed:after {
        content: '\25B6';                /* right triangle when closed */
    }

    .mobile-accordion .panel-collapse .panel-body {
        padding: 0;
        background: #34495e;
    }

    .mobile-accordion .mobile-quicklink .panel-heading {
        background: #1abc9c;
        border-bottom: 1px solid #16a085;
    }
    .mobile-accordion .mobile-quicklink .panel-title a {
        color: #fff;
        font-weight: 600;
    }
    .mobile-accordion .mobile-quicklink .panel-title a:after {
        content: '';                     /* no caret on quick link */
    }
    .mobile-accordion .mobile-quicklink .panel-title a:hover {
        background: #16a085;
    }

    .mobile-menu-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-menu-list li a {
        display: block;
        padding: 10px 20px;
        color: #bdc3c7;
        font-size: 13px;
        border-bottom: 1px solid #2c3e50;
        text-decoration: none;
        line-height: 1.3;
    }

    .mobile-menu-list li a:hover,
    .mobile-menu-list li a:focus,
    .mobile-menu-list li a.active {
        background: #1abc9c;
        color: #ffffff;
    }

    .mobile-accordion .badge {
        background: #1abc9c;
        color: #fff;
        font-size: 10px;
    }
}


/* =========================================================================
   TIER6-FIX-MOB-02 — table-responsive helpers on mobile
   ========================================================================= */
@media (max-width: 767px) {

    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        border: 0;            /* override BS3 default for cleaner look */
    }

    /* Keep table cells from wrapping to multiple lines on small screens. */
    .table-responsive > table th,
    .table-responsive > table td {
        white-space: nowrap;
    }

    /* Action button groups inside cells — stack vertically. */
    .table-responsive .btn-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* Make inline form inputs inside tables fluid up to their cell. */
    .table-responsive input[type="text"],
    .table-responsive input[type="number"],
    .table-responsive select {
        width: 100%;
        min-width: 80px;
    }
}


/* =========================================================================
   TIER6-FIX-MOB-06 — Container width override (responsive.css forces 300px
   on phones; we widen to full viewport so 360px Android phones don't show
   60px of empty side margin).
   ========================================================================= */
@media (max-width: 767px) {

    .container {
        width: 100% !important;       /* override responsive.css:324 */
        padding-left: 10px;
        padding-right: 10px;
    }

    .all-content-wrapper {
        padding-left: 5px;
        padding-right: 5px;
    }
}


/* =========================================================================
   TIER6-FIX-MOB-08 — Override inline fixed widths from
   chip_scrap_release.php / box_return.php / wip_*.php so wide content
   shrinks on phones. Original desktop CSS still applies via specificity at
   >=768px since these rules live inside the mobile media query.
   ========================================================================= */
@media (max-width: 767px) {

    /* Container / card / filter wrappers from chip_scrap_release.php */
    .csr-table,
    .csr-card,
    .csr-filters,
    .br-table,
    .br-form-card,
    .br-filters,
    .wc-table,
    .wc-card,
    .wc-filters,
    .wd-table,
    .wd-filters {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* form-inline elements should stack on phones */
    .form-inline .form-group {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }

    .form-inline .form-control {
        width: 100%;
    }

    .form-inline label {
        display: block;
        margin-bottom: 4px;
    }

    /* Generic filter button row — make full-width on phone */
    .csr-filters .btn,
    .br-filters .btn,
    .wc-filters .btn,
    .wd-filters .btn {
        width: 100%;
        margin-bottom: 4px;
    }

    /* Bootstrap grid stack helpers for filter rows */
    .filter-row .col-md-2,
    .filter-row .col-md-3,
    .filter-row .col-md-4,
    .filter-row .col-sm-2,
    .filter-row .col-sm-3 {
        width: 100%;
        margin-bottom: 8px;
    }
}


/* =========================================================================
   TIER6-FIX (general polish) — tap targets, font-size, modal, cards,
   breadcrumb. Items below are mobile-only.
   ========================================================================= */
@media (max-width: 767px) {

    /* Tap targets ≥ 44px (Apple HIG) / 48px (Google MD) */
    .btn {
        min-height: 44px;
        padding: 10px 15px;
    }

    /* Tab-bar small buttons override — narrower padding */
    .btn-xs {
        min-height: 32px;
        padding: 5px 10px;
    }

    /* iOS zooms inputs whose font-size < 16px on focus. Force 16px. */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Page titles on mobile */
    h1, h2, h3 {
        line-height: 1.25;
    }
    h2.page-title,
    h3.page-title,
    .content-title h2,
    .content-title h3 {
        font-size: 18px;
    }

    /* Status badges readable on phone */
    .label,
    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Floating print button helper class (opt-in via .print-only-page) */
    .print-only-page .btn-print {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 999;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        padding: 0;
        font-size: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    /* Summary card rows — stack on phone */
    .wd-cards,
    .summary-cards-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .wd-cards .wd-card,
    .summary-cards-row .summary-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
    }

    /* Breadcrumb compact on mobile */
    .breadcrumb {
        font-size: 11px;
        padding: 6px 10px;
    }
    .breadcrumb > li + li:before {
        padding: 0 3px;
    }

    /* Modal dialogs full-screen on phone */
    .modal-dialog {
        margin: 0;
        width: 100%;
        height: 100%;
    }
    .modal-content {
        border-radius: 0;
        min-height: 100%;
    }

    /* Logo bar — shrink on phone */
    .logo-pro .main-logo {
        max-width: 70%;
        height: auto !important;
    }
}
