:root {
    --primary-red: #e51e25;
    --dark-red: #b9151b;
    --deep-navy: #1f2a44;
    --soft-gray: #f4f6f8;
    --white: #ffffff;
    --text-dark: #222222;
    --gold: #f4b000;
    --success: #198754;
    --border: #dde2ea;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: var(--soft-gray);
    color: var(--text-dark);
    max-width: 100%;
    overflow-x: hidden;
}

a {
    color: inherit;
}

.top-banner {
    min-height: 105px;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--white);
    display: grid;
    grid-template-columns: minmax(0, 370px) minmax(0, 1fr) minmax(0, 340px);
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    max-width: 100vw;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-box img {
    width: 145px;
    max-height: 78px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: 5px;
}

.brand-text {
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: .25px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.page-title {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
    min-width: 0;
    overflow-wrap: anywhere;
}

.user-status-box {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.45;
    min-width: 0;
    overflow-wrap: anywhere;
}

.user-status-box strong {
    color: #fff7c7;
}

.mobile-menu-toggle {
    display: none;
}

.layout {
    display: flex;
    min-height: calc(100vh - 90px);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.sidebar {
    width: 280px;
    background: var(--deep-navy);
    color: var(--white);
    padding: 14px 10px;
    flex-shrink: 0;
}

.lang-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    padding: 0 6px;
}

.lang-switch button {
    flex: 1;
    border: 0;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.lang-switch .active {
    background: var(--gold);
    color: #222;
}

.menu-group {
    margin-bottom: 6px;
}

.menu-main {
    width: 100%;
    background: transparent;
    color: var(--white);
    border: 0;
    padding: 13px 12px;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}

.menu-main:hover,
.menu-main.active {
    background: var(--primary-red);
}

.submenu {
    display: none;
    padding-left: 14px;
    margin: 4px 0 8px;
}

.submenu a {
    display: block;
    color: #dce3f2;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.submenu a:hover {
    background: rgba(255, 255, 255, .10);
    color: var(--white);
}

.submenu a.active {
    background: rgba(229, 30, 37, .42);
    color: var(--white);
    font-weight: 800;
}

.content {
    flex: 1;
    padding: 22px;
    min-width: 0;
    max-width: 100%;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
    margin-bottom: 18px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.card h2,
.card h3 {
    margin-top: 0;
    color: var(--deep-navy);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.kpi-card {
    background: #fff;
    border-left: 6px solid var(--primary-red);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .07);
}

.kpi-title {
    font-size: 13px;
    color: #666;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 8px;
    color: var(--deep-navy);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.form-control label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-control input,
.form-control select,
.form-control textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.date-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.date-input-wrap .date-display-control {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.date-picker-trigger {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #eef1f5;
    color: var(--deep-navy);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.date-picker-trigger:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.date-native-control {
    position: absolute !important;
    right: 0;
    bottom: 0;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-secondary {
    background: var(--deep-navy);
    color: var(--white);
}

.btn-danger {
    background: #c92a2a;
    color: var(--white);
}

.btn-danger:hover {
    background: #a61e1e;
}

.delete-record-form {
    display: inline;
    margin: 0;
}

/* Keep every data table within the visible page width without horizontal scrolling. */
.content,
.job-create-wrap,
.job-list-wrap,
.rate-card-wrap,
.update-status-wrap,
.invoice-list-wrap,
.invoice-view-wrap,
.outstanding-wrap,
.doc-wrap,
.job-doc-wrap,
.invoice-doc-wrap,
.doc-upload-wrap,
.dashboard-wrap,
.billing-wrap,
.cost-wrap,
.report-wrap,
.customer-wrap,
.user-wrap,
.setting-wrap,
.page-wrap {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden !important;
}

.card,
.card-box,
.filter-card,
.table-card,
.report-card {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.table-scroll,
.table-wrap {
    box-sizing: border-box;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    padding-bottom: 0;
}

.table-scroll > table,
.table-wrap > table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    font-family: "TH Sarabun New", Sarabun, Tahoma, sans-serif;
}

.table-scroll > table th,
.table-scroll > table td,
.table-wrap > table th,
.table-wrap > table td {
    padding: 7px 8px;
    font-family: "TH Sarabun New", Sarabun, Tahoma, sans-serif;
    font-size: 16px !important;
    line-height: 1.35;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
}

.table-scroll input,
.table-scroll select,
.table-scroll textarea,
.table-wrap input,
.table-wrap select,
.table-wrap textarea {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 6px;
    font-family: "TH Sarabun New", Sarabun, Tahoma, sans-serif;
    font-size: 16px;
}

.table-scroll .btn,
.table-wrap .btn {
    max-width: 100%;
    padding: 6px 7px;
    font-family: "TH Sarabun New", Sarabun, Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.25;
    white-space: normal;
}

@media (max-width: 980px) {
    .table-scroll,
    .table-wrap {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .table-scroll > table th,
    .table-scroll > table td,
    .table-wrap > table th,
    .table-wrap > table td {
        padding: 6px 5px;
        font-size: 16px !important;
    }
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

th,
td {
    border: 1px solid var(--border);
    padding: 10px;
    font-size: 14px;
    text-align: left;
}

th {
    background: var(--deep-navy);
    color: var(--white);
}

.footer {
    font-size: 11px;
    color: #777;
    text-align: center;
    padding: 12px;
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa, #dde2ea);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 12px 35px rgba(31, 42, 68, .18);
    text-align: center;
}

.login-card img {
    width: 210px;
    max-width: 100%;
    margin-bottom: 16px;
}

.login-card h1 {
    margin: 0 0 18px;
    color: var(--deep-navy);
}

.login-card .form-control {
    text-align: left;
    margin-bottom: 14px;
}

.login-links {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
}

.login-links a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 700;
}

.alert {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    text-align: left;
}

.alert-danger {
    background: #ffe8e8;
    color: #9b1111;
}

.alert-success {
    background: #e8fff0;
    color: #0f7035;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-weight: 700;
}

.alert-error {
    background: #ffe5e8;
    color: #9b111e;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-weight: 700;
}

@media (max-width: 980px) {
    .top-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .brand-box {
        justify-content: center;
    }

    .page-title {
        font-size: 24px;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .dashboard-grid,
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}
/* =====================================================
   FINAL LAYOUT FIX
   แก้เมนูซ้ายเลื่อนตาม / เนื้อหาไปอยู่ใต้เมนู
   ใช้ได้ทั้งหน้า index ที่มี .layout และหน้า /pages/... ที่ไม่มี .layout
   ===================================================== */

@media (min-width: 981px) {

    /* แบนเนอร์บนค้างอยู่ด้านบน */
    .top-banner {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    /* ================================
       กรณีหน้าเดิม เช่น index.php
       โครงสร้าง: .layout > .sidebar + .content
       ================================ */

    .layout {
        display: flex;
        align-items: flex-start;
        min-height: calc(100vh - 105px);
    }

    .layout > .sidebar {
        position: sticky;
        top: 105px;
        width: 280px;
        min-width: 280px;
        flex: 0 0 280px;
        height: calc(100vh - 105px);
        max-height: calc(100vh - 105px);
        overflow-y: auto;
        overflow-x: hidden;
        align-self: flex-start;
    }

    .layout > .content {
        flex: 1;
        min-width: 0;
        width: calc(100% - 280px);
        max-width: calc(100% - 280px);
        overflow-x: auto;
    }

    /* ================================
       กรณีหน้าใหม่ใน /pages/...
       โครงสร้าง: header + sidebar + content/wrap
       ================================ */

    body > .sidebar {
        position: fixed;
        left: 0;
        top: 105px;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        height: calc(100vh - 105px);
        max-height: calc(100vh - 105px);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 900;
    }

    body > .content,
    body > .job-create-wrap,
    body > .job-list-wrap,
    body > .rate-card-wrap,
    body > .update-status-wrap,
    body > .invoice-list-wrap,
    body > .invoice-view-wrap,
    body > .outstanding-wrap,
    body > .doc-wrap,
    body > .job-doc-wrap,
    body > .invoice-doc-wrap,
    body > .doc-upload-wrap,
    body > .dashboard-wrap,
    body > .billing-wrap,
    body > .cost-wrap,
    body > .report-wrap,
    body > .customer-wrap,
    body > .user-wrap,
    body > .setting-wrap {
        margin-left: 280px;
        width: calc(100% - 280px);
        max-width: calc(100% - 280px);
        padding: 22px;
        overflow-x: auto;
    }

    /* กันตารางดันหน้าออกด้านข้าง */
    .table-wrap,
    .table-scroll {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .content,
    .job-create-wrap,
    .job-list-wrap,
    .rate-card-wrap,
    .update-status-wrap,
    .invoice-list-wrap,
    .invoice-view-wrap,
    .outstanding-wrap,
    .doc-wrap,
    .job-doc-wrap,
    .invoice-doc-wrap,
    .doc-upload-wrap,
    .dashboard-wrap,
    .billing-wrap,
    .cost-wrap,
    .report-wrap,
    .customer-wrap,
    .user-wrap,
    .setting-wrap,
    .page-wrap {
        min-width: 0;
        max-width: 100%;
    }
}

/* มือถือให้กลับเป็นเรียงบนลงล่างตามเดิม */
@media (max-width: 980px) {
    body > .sidebar {
        position: static;
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: none;
    }

    body > .content,
    body > .job-create-wrap,
    body > .job-list-wrap,
    body > .rate-card-wrap,
    body > .update-status-wrap,
    body > .invoice-list-wrap,
    body > .invoice-view-wrap,
    body > .outstanding-wrap,
    body > .doc-wrap,
    body > .job-doc-wrap,
    body > .invoice-doc-wrap,
    body > .doc-upload-wrap,
    body > .dashboard-wrap,
    body > .billing-wrap,
    body > .cost-wrap,
    body > .report-wrap,
    body > .customer-wrap,
    body > .user-wrap,
    body > .setting-wrap {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 14px;
        overflow-x: auto;
    }
}

/* =====================================================
   RESPONSIVE OVERFLOW SAFETY
   Keep each page inside the viewport while preserving
   horizontal scrolling for wide tables and dense forms.
   ===================================================== */

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

.card-box,
.filter-card,
.table-card,
.report-card,
.hero-card,
.summary-card,
.summary-box,
.info-box,
.kpi-card,
.action-card,
.form-control,
.form-group {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.dashboard-wrap,
.billing-wrap,
.invoice-list-wrap,
.invoice-view-wrap,
.outstanding-wrap,
.update-status-wrap,
.job-create-wrap,
.job-list-wrap,
.rate-card-wrap,
.doc-wrap,
.job-doc-wrap,
.invoice-doc-wrap,
.doc-upload-wrap,
.cost-wrap,
.report-wrap,
.customer-wrap,
.user-wrap,
.setting-wrap,
.page-wrap {
    min-width: 0;
    max-width: 100%;
}

.dashboard-grid,
.form-grid,
.summary-grid,
.filter-grid,
.report-grid,
.info-grid,
.action-grid,
.two-col,
.two-column {
    min-width: 0;
}

.table-scroll,
.table-wrap {
    display: block;
    contain: inline-size;
}

.table-scroll table,
.table-wrap table {
    max-width: none;
}

.btn,
button,
input,
select,
textarea {
    max-width: 100%;
}

@media (max-width: 980px) {
    .top-banner {
        width: 100%;
        max-width: 100%;
        padding: 10px 12px;
        overflow-x: hidden;
    }

    .brand-box,
    .user-status-box {
        width: 100%;
        justify-content: center;
    }

    .brand-box img {
        flex: 0 0 auto;
        max-width: 42vw;
    }

    .page-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .content,
    .card,
    .card-box,
    .filter-card,
    .table-card,
    .report-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .table-scroll,
    .table-wrap {
        margin-left: -14px;
        margin-right: -14px;
        width: calc(100% + 28px);
        max-width: calc(100% + 28px);
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 560px) {
    .brand-box {
        flex-wrap: wrap;
    }

    .brand-text,
    .user-status-box {
        font-size: 11px;
    }

    .page-title {
        font-size: 20px;
    }
}

/* =====================================================
   MOBILE APP LAYOUT
   Compact header and off-canvas navigation for phones.
   ===================================================== */

.mobile-menu-backdrop {
    display: none;
}

@media (max-width: 980px) {
    body {
        overflow-x: hidden;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .top-banner {
        grid-template-columns: auto minmax(56px, auto) minmax(0, 1fr) minmax(90px, auto) !important;
        min-height: 54px;
        padding: 6px 8px;
        gap: 8px;
        text-align: left;
        align-items: center;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 0 10px;
        border: 1px solid rgba(255, 255, 255, .45);
        border-radius: 8px;
        background: rgba(255, 255, 255, .16);
        color: #fff;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
        white-space: nowrap;
    }

    .brand-box {
        width: auto;
        justify-content: flex-start;
        gap: 0;
    }

    .brand-box img,
    .top-banner .brand-box img {
        width: 58px !important;
        max-width: 58px !important;
        max-height: 36px !important;
        padding: 3px;
        border-radius: 7px;
    }

    .brand-text {
        display: none;
    }

    .page-title {
        font-size: 15px;
        line-height: 1.15;
        text-align: left;
        letter-spacing: 0;
        text-shadow: none;
    }

    .user-status-box {
        width: auto;
        max-width: 112px;
        padding: 4px 6px;
        border-radius: 8px;
        font-size: 9px;
        line-height: 1.25;
    }

    .user-status-box div:nth-child(3),
    .user-status-box div:nth-child(4) {
        display: none;
    }

    .layout {
        display: block;
        min-height: calc(100vh - 54px);
    }

    .sidebar,
    body > .sidebar,
    .layout > .sidebar {
        position: fixed !important;
        top: 54px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(82vw, 300px) !important;
        min-width: 0 !important;
        height: calc(100vh - 54px) !important;
        max-height: calc(100vh - 54px) !important;
        padding: 12px 10px;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateX(-105%);
        transition: transform .22s ease;
        z-index: 3500 !important;
        box-shadow: 10px 0 28px rgba(0, 0, 0, .28);
    }

    body.mobile-menu-open .sidebar,
    body.mobile-menu-open > .sidebar,
    body.mobile-menu-open .layout > .sidebar {
        transform: translateX(0);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 54px 0 0;
        display: block;
        background: rgba(0, 0, 0, .38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        z-index: 3400;
    }

    body.mobile-menu-open .mobile-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .content,
    .layout > .content,
    body > .content,
    body > .job-create-wrap,
    body > .job-list-wrap,
    body > .rate-card-wrap,
    body > .update-status-wrap,
    body > .invoice-list-wrap,
    body > .invoice-view-wrap,
    body > .outstanding-wrap,
    body > .doc-wrap,
    body > .job-doc-wrap,
    body > .invoice-doc-wrap,
    body > .doc-upload-wrap,
    body > .dashboard-wrap,
    body > .billing-wrap,
    body > .cost-wrap,
    body > .report-wrap,
    body > .customer-wrap,
    body > .user-wrap,
    body > .setting-wrap {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
        overflow-x: auto;
    }

    .card,
    .card-box,
    .filter-card,
    .table-card,
    .report-card,
    .hero-card {
        border-radius: 10px;
        padding: 12px !important;
        margin-bottom: 12px;
    }

    .dashboard-grid,
    .form-grid,
    .form-grid-2,
    .summary-grid,
    .filter-grid,
    .report-grid,
    .info-grid,
    .action-grid,
    .two-col,
    .two-column,
    .summary-total {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .page-header,
    .top-actions,
    .action-left,
    .action-right {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .kpi-value,
    .summary-value {
        font-size: 20px !important;
    }

    .table-scroll,
    .table-wrap {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
        max-width: calc(100% + 20px);
        padding-left: 10px;
        padding-right: 10px;
    }

    th,
    td {
        padding: 8px;
        font-size: 13px;
    }
}

@media (max-width: 430px) {
    .top-banner {
        grid-template-columns: auto minmax(0, 1fr) minmax(86px, auto) !important;
    }

    .brand-box {
        display: none;
    }

    .page-title {
        font-size: 14px;
    }

    .user-status-box {
        max-width: 96px;
        font-size: 8px;
    }
}

/* =====================================================
   MOBILE HEADER NORMALIZATION
   Keep billing pages and all other pages on the same
   mobile banner height. This comes last to override the
   earlier compact/mobile rules.
   ===================================================== */

:root {
    --mobile-banner-height: 78px;
}

@media (max-width: 980px) {
    .top-banner {
        grid-template-columns: auto minmax(58px, auto) minmax(0, 1fr) minmax(112px, auto) !important;
        min-height: var(--mobile-banner-height) !important;
        padding: 8px 10px !important;
        gap: 8px !important;
        align-items: center !important;
    }

    .top-banner .brand-box,
    .brand-box {
        display: flex !important;
        width: auto !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
    }

    .brand-box img,
    .top-banner .brand-box img {
        width: 72px !important;
        max-width: 72px !important;
        max-height: 50px !important;
    }

    .page-title {
        font-size: 17px !important;
        line-height: 1.18 !important;
    }

    .user-status-box {
        max-width: 128px !important;
        font-size: 10px !important;
        line-height: 1.25 !important;
        padding: 5px 7px !important;
    }

    .layout {
        min-height: calc(100vh - var(--mobile-banner-height)) !important;
    }

    .sidebar,
    body > .sidebar,
    .layout > .sidebar {
        top: var(--mobile-banner-height) !important;
        height: calc(100vh - var(--mobile-banner-height)) !important;
        max-height: calc(100vh - var(--mobile-banner-height)) !important;
    }

    .mobile-menu-backdrop {
        inset: var(--mobile-banner-height) 0 0 !important;
    }

    .mobile-menu-toggle {
        min-height: 44px !important;
        padding: 0 14px !important;
        border-radius: 10px !important;
        font-size: 15px !important;
        line-height: 1.2 !important;
    }

    .sidebar,
    body > .sidebar,
    .layout > .sidebar {
        width: min(88vw, 330px) !important;
        padding: 14px 12px !important;
    }

    .lang-switch button {
        min-height: 42px;
        font-size: 15px;
    }

    .menu-main {
        min-height: 48px;
        padding: 14px 13px;
        font-size: 17px;
        line-height: 1.25;
    }

    .submenu {
        padding-left: 10px;
    }

    .submenu a {
        min-height: 42px;
        padding: 12px 13px;
        font-size: 16px;
        line-height: 1.25;
    }
}

@media (max-width: 430px) {
    .top-banner {
        grid-template-columns: auto minmax(52px, auto) minmax(0, 1fr) !important;
    }

    .brand-box img,
    .top-banner .brand-box img {
        width: 58px !important;
        max-width: 58px !important;
        max-height: 42px !important;
    }

    .mobile-menu-toggle {
        min-height: 42px !important;
        padding: 0 12px !important;
        font-size: 15px !important;
    }

    .page-title {
        font-size: 16px !important;
        line-height: 1.18 !important;
    }

    .user-status-box {
        display: none !important;
    }
}

/* =====================================================
   MOBILE/TABLET NAVIGATION STANDARD
   Use the customer list page navigation size and behavior
   as the shared pattern across every page.
   ===================================================== */

@media (max-width: 1024px) {
    .top-banner {
        grid-template-columns: auto minmax(58px, auto) minmax(0, 1fr) minmax(112px, auto) !important;
        min-height: var(--mobile-banner-height) !important;
        padding: 8px 10px !important;
        gap: 8px !important;
        align-items: center !important;
        text-align: left !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 44px !important;
        padding: 0 14px !important;
        border: 1px solid rgba(255, 255, 255, .45) !important;
        border-radius: 10px !important;
        background: rgba(255, 255, 255, .16) !important;
        color: #fff !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    .top-banner .brand-box,
    .brand-box {
        display: flex !important;
        width: auto !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
    }

    .brand-box img,
    .top-banner .brand-box img {
        width: 72px !important;
        max-width: 72px !important;
        max-height: 50px !important;
        padding: 3px !important;
        border-radius: 7px !important;
    }

    .brand-text {
        display: none !important;
    }

    .page-title {
        font-size: 17px !important;
        line-height: 1.18 !important;
        text-align: left !important;
        letter-spacing: 0 !important;
        text-shadow: none !important;
    }

    .user-status-box {
        width: auto !important;
        max-width: 128px !important;
        padding: 5px 7px !important;
        border-radius: 8px !important;
        font-size: 10px !important;
        line-height: 1.25 !important;
    }

    .user-status-box div:nth-child(3),
    .user-status-box div:nth-child(4) {
        display: none !important;
    }

    .layout {
        display: block !important;
        min-height: calc(100vh - var(--mobile-banner-height)) !important;
    }

    .sidebar,
    body > .sidebar,
    .layout > .sidebar {
        position: fixed !important;
        top: var(--mobile-banner-height) !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(88vw, 330px) !important;
        min-width: 0 !important;
        height: calc(100vh - var(--mobile-banner-height)) !important;
        max-height: calc(100vh - var(--mobile-banner-height)) !important;
        padding: 14px 12px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
        z-index: 3500 !important;
        box-shadow: 10px 0 28px rgba(0, 0, 0, .28) !important;
    }

    body.mobile-menu-open .sidebar,
    body.mobile-menu-open > .sidebar,
    body.mobile-menu-open .layout > .sidebar {
        transform: translateX(0) !important;
    }

    .mobile-menu-backdrop {
        position: fixed !important;
        inset: var(--mobile-banner-height) 0 0 !important;
        display: block !important;
        background: rgba(0, 0, 0, .38) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity .22s ease !important;
        z-index: 3400 !important;
    }

    body.mobile-menu-open .mobile-menu-backdrop {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .lang-switch button {
        min-height: 42px !important;
        font-size: 15px !important;
    }

    .menu-main {
        min-height: 48px !important;
        padding: 14px 13px !important;
        border-radius: 9px !important;
        font-size: 17px !important;
        line-height: 1.25 !important;
    }

    .submenu {
        padding-left: 10px !important;
        margin: 4px 0 8px !important;
    }

    .submenu a {
        min-height: 42px !important;
        padding: 12px 13px !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        line-height: 1.25 !important;
    }
}

@media (max-width: 430px) {
    .top-banner {
        grid-template-columns: auto minmax(52px, auto) minmax(0, 1fr) !important;
    }

    .brand-box img,
    .top-banner .brand-box img {
        width: 58px !important;
        max-width: 58px !important;
        max-height: 42px !important;
    }

    .mobile-menu-toggle {
        min-height: 42px !important;
        padding: 0 12px !important;
        font-size: 15px !important;
    }

    .page-title {
        font-size: 16px !important;
    }

    .user-status-box {
        display: none !important;
    }
}
