/* Noto Sans Lao — local fonts (no CDN) */
@font-face {
    font-family: 'Noto Sans Lao';
    src: url('../fonts/noto-sans-lao/NotoSansLao-Regular-static.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans Lao';
    src: url('../fonts/noto-sans-lao/NotoSansLao-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans Lao';
    src: url('../fonts/noto-sans-lao/NotoSansLao-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans Lao';
    src: url('../fonts/noto-sans-lao/NotoSansLao-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans Thai';
    src: url('../fonts/noto-sans-thai/NotoSansThai-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans Thai';
    src: url('../fonts/noto-sans-thai/NotoSansThai-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --brand: #0f6b4c;
    --brand-dark: #0a4d37;
    --brand-soft: #e7f3ee;
    --surface: #f3f6f4;
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 58px;
    --font-sans: 'Noto Sans Lao', 'Noto Sans Thai', 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
}

*, *::before, *::after { font-family: inherit; }

html, body {
    font-family: var(--font-sans);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.bg-app {
    background: linear-gradient(160deg, #eef5f1 0%, #f7f3ea 100%);
    min-height: 100vh;
    margin: 0;
}

body.has-shell { overflow-x: hidden; }

h1, h2, h3, h4, h5, h6, .btn, .form-control, .form-select, .form-label,
.nav-link, .badge, .alert, .table, .stat-card, .card, .nav-item {
    font-family: var(--font-sans);
}

h1, h2, h3 { font-weight: 700; }
.btn, .form-label { font-weight: 500; }

/* ===== Shell / Sidebar ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--brand-dark) 0%, #0c5a40 55%, #0f6b4c 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    transition: width .2s ease, transform .2s ease;
    box-shadow: 4px 0 24px rgba(10, 77, 55, .18);
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .75rem 0 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    min-width: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    overflow: hidden;
}

.brand-mark.has-logo {
    background: #fff;
    padding: 2px;
}

.brand-mark.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-toggle {
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.22); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem .6rem 1rem;
}

.nav-section {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .65;
    padding: .85rem .75rem .35rem;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .75rem;
    margin-bottom: .2rem;
    border-radius: 10px;
    color: rgba(255,255,255,.92);
    text-decoration: none;
    transition: background .15s ease;
    white-space: nowrap;
    position: relative;
}
.nav-item i {
    font-size: 1.15rem;
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
}
.nav-item > span:not(.nav-count) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-count {
    margin-left: auto;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: #f4c430;
    color: #1a2e24;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-count[hidden] { display: none !important; }
.nav-item.active .nav-count {
    background: var(--brand-dark, #0a4d36);
    color: #fff;
}
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand-dark); font-weight: 600; }
.nav-item.disabled {
    opacity: .45;
    cursor: not-allowed;
}
.nav-item.disabled:hover {
    background: transparent;
    color: rgba(255,255,255,.92);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: .65rem .7rem .75rem;
}

.sidebar-package {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    padding: .45rem .5rem;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(255, 215, 120, .18), rgba(255,255,255,.06));
    border: 1px solid rgba(255, 214, 120, .28);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

a.sidebar-package:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 215, 120, .28), rgba(255,255,255,.1));
    border-color: rgba(255, 214, 120, .45);
}

.sidebar-package.is-active {
    background: linear-gradient(135deg, rgba(255, 215, 120, .32), rgba(255,255,255,.12));
    border-color: rgba(255, 214, 120, .55);
}

.sidebar-package.is-muted {
    opacity: .7;
    cursor: default;
}

.sidebar-package-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b4500;
    background: linear-gradient(145deg, #ffe9a8 0%, #f0c14b 45%, #d4a017 100%);
    box-shadow: 0 2px 8px rgba(212, 160, 23, .35), inset 0 1px 0 rgba(255,255,255,.55);
    font-size: 1.05rem;
    line-height: 1;
}

.sidebar-package-badge .bi {
    color: inherit;
    line-height: 1;
}

.sidebar-package-label {
    font-size: .86rem;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .9rem;
    opacity: .9;
}
.sidebar-user i { font-size: 1.35rem; }

.topbar-user {
    align-items: center;
    gap: .4rem;
    max-width: 11rem;
    padding: .2rem .55rem .2rem .35rem;
    border-radius: 999px;
    background: rgba(15, 107, 76, .08);
    color: var(--brand-dark);
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.topbar-user i {
    font-size: 1.15rem;
    color: var(--brand);
    flex-shrink: 0;
}

.topbar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    transition: margin-left .2s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    --topbar-control-h: 42px;
    height: var(--topbar-h);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 107, 76, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    font-weight: 700;
    color: var(--brand-dark);
    min-width: 0;
    max-width: min(42vw, 16rem);
    font-size: .95rem;
    line-height: 1.25;
}

@media (min-width: 768px) {
    .topbar-title {
        max-width: min(36vw, 22rem);
        font-size: 1rem;
    }
}

.app-content {
    padding: 1.25rem 1.25rem 2rem;
}

/* Collapsed state (desktop) — persisted via html.sidebar-collapsed */
html.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .brand-text,
html.sidebar-collapsed .nav-section,
html.sidebar-collapsed .nav-item > span:not(.nav-count) {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}
html.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-left: .5rem;
    padding-right: .5rem;
}
html.sidebar-collapsed .nav-count {
    position: absolute;
    top: .2rem;
    right: .15rem;
    margin-left: 0;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 .28rem;
    font-size: .6rem;
    opacity: 1;
    width: auto;
    pointer-events: none;
    z-index: 1;
}
html.sidebar-collapsed .sidebar-brand {
    height: auto;
    min-height: var(--topbar-h);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: .35rem;
    padding: .45rem .4rem;
}
html.sidebar-collapsed .brand-link {
    justify-content: center;
    width: 100%;
    gap: 0;
}
html.sidebar-collapsed .brand-mark {
    width: 36px;
    height: 36px;
}
html.sidebar-collapsed .sidebar-toggle {
    width: 32px;
    height: 28px;
}
html.sidebar-collapsed .sidebar-package {
    justify-content: center;
    padding: .4rem;
}
html.sidebar-collapsed .sidebar-package-label {
    display: none;
}
html.sidebar-collapsed .sidebar-user { justify-content: center; }
html.sidebar-collapsed .sidebar-user .brand-text { display: none; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1035;
}

/* Mobile */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-105%);
        width: var(--sidebar-w);
    }
    .app-main { margin-left: 0; }
    html.sidebar-collapsed .app-sidebar { width: var(--sidebar-w); }
    html.sidebar-collapsed .app-main { margin-left: 0; }
    html.sidebar-collapsed .brand-text,
    html.sidebar-collapsed .nav-section,
    html.sidebar-collapsed .nav-item > span:not(.nav-count) {
        opacity: 1;
        width: auto;
        overflow: visible;
        pointer-events: auto;
    }
    html.sidebar-collapsed .nav-item { justify-content: flex-start; padding: .7rem .75rem; }
    html.sidebar-collapsed .nav-count {
        position: static;
        margin-left: auto;
        min-width: 1.35rem;
        height: 1.35rem;
        padding: 0 .4rem;
        font-size: .68rem;
    }
    html.sidebar-collapsed .sidebar-brand {
        height: var(--topbar-h);
        min-height: var(--topbar-h);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 0 .75rem 0 1rem;
    }
    html.sidebar-collapsed .brand-link {
        justify-content: flex-start;
        width: auto;
        gap: .6rem;
    }
    html.sidebar-collapsed .brand-mark {
        width: 34px;
        height: 34px;
    }
    html.sidebar-collapsed .sidebar-toggle {
        width: 34px;
        height: 34px;
    }
    html.sidebar-collapsed .sidebar-package {
        justify-content: flex-start;
        padding: .45rem .5rem;
    }
    html.sidebar-collapsed .sidebar-package-label {
        display: block;
    }

    body.sidebar-open-mobile .app-sidebar { transform: translateX(0); }
    body.sidebar-open-mobile .sidebar-backdrop { display: block; }
}

/* Cards / misc */
.card-soft {
    border: 0;
    box-shadow: 0 8px 24px rgba(15, 107, 76, 0.08);
    border-radius: 14px;
}
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand);
}
.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-outline-brand {
    background: #fff;
    border-color: var(--brand);
    color: var(--brand);
}
.btn-outline-brand:hover {
    background: rgba(15, 107, 76, .08);
    border-color: var(--brand-dark);
    color: var(--brand-dark);
}

.nav-pills-brand .nav-link {
    color: var(--brand);
    font-weight: 600;
    border-radius: .5rem;
    padding: .4rem .85rem;
}
.nav-pills-brand .nav-link:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
}
.nav-pills-brand .nav-link.active {
    background: var(--brand);
    color: #fff;
}

.login-wrap { max-width: 420px; margin: 8vh auto; }

/* ===== Login split page (70% banner / 30% form) ===== */
.login-page-body {
    margin: 0;
    min-height: 100vh;
    background: #0a4d37;
    overflow-x: hidden;
}

.login-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login-banner {
    position: relative;
    flex: 0 0 70%;
    width: 70%;
    min-height: 100vh;
    background: #0a4d37;
    overflow: hidden;
}

.login-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    padding: 7.5rem 3rem 6.5rem;
    box-sizing: border-box;
    transform: scale(0.96);
    transform-origin: center center;
}

.login-banner-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 55, 40, .72) 0%, rgba(8, 55, 40, .18) 28%, rgba(8, 55, 40, .08) 55%, rgba(8, 55, 40, .55) 100%),
        linear-gradient(90deg, rgba(10, 77, 55, .08) 0%, rgba(10, 77, 55, .28) 100%);
    pointer-events: none;
}

.login-banner-copy {
    position: absolute;
    left: 50%;
    top: 2.75rem;
    bottom: auto;
    transform: translateX(-50%);
    z-index: 2;
    color: #fff;
    max-width: min(40rem, calc(100% - 3rem));
    width: 100%;
    text-align: center;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.login-banner-headline {
    margin: 0 0 .5rem;
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .01em;
}

.login-banner-sub {
    margin: 0 auto;
    max-width: 32rem;
    font-size: 1.02rem;
    font-weight: 400;
    line-height: 1.55;
    opacity: .88;
}

.login-banner-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .02em;
    margin-bottom: .55rem;
}

.login-banner-logo {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .55rem;
    object-fit: cover;
    background: #fff;
}

.login-banner-meta {
    position: absolute;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .35rem .9rem;
    font-size: .84rem;
    color: rgba(255, 255, 255, .92);
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    max-width: calc(100% - 3rem);
    padding: .65rem 1.1rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .12);
}

.login-banner-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.login-banner-meta i {
    opacity: .9;
    font-size: .9em;
}

.login-mobile-logo {
    width: 2rem;
    height: 2rem;
    border-radius: .45rem;
    object-fit: cover;
}

.login-contact {
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eee9;
    color: #5b6b64;
    font-size: .82rem;
    line-height: 1.55;
}

.login-contact-title {
    font-weight: 700;
    color: #0a4d37;
    margin-bottom: .35rem;
    font-size: .85rem;
}

.login-contact i {
    width: 1.1rem;
    display: inline-block;
    color: var(--brand);
}

.login-panel {
    flex: 0 0 30%;
    width: 30%;
    min-height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 1.75rem;
    box-shadow: -18px 0 48px rgba(8, 40, 28, .14);
    position: relative;
    z-index: 3;
}

.login-panel-inner {
    width: 100%;
    max-width: 340px;
}

.login-lang {
    display: inline-flex;
    gap: .2rem;
    flex-wrap: wrap;
    padding: .22rem;
    border-radius: .65rem;
    background: #eef4f0;
    border: 1px solid #e2ebe6;
}

.login-lang-btn {
    border: 0;
    background: transparent;
    color: #5b6b64;
    border-radius: .45rem;
    padding: .32rem .6rem;
    font-size: .74rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    transition: background .15s ease, color .15s ease;
}

.login-lang-btn:hover {
    color: var(--brand);
    background: rgba(255, 255, 255, .7);
}

.login-lang-btn.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 107, 76, .25);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    text-align: center;
    color: var(--brand-dark);
    margin-bottom: 1.1rem;
}

.login-brand strong {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
}

.login-brand-logo {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: .85rem;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 107, 76, .16);
}

.login-banner-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: .85rem;
    background: var(--brand);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
}

.login-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0a4d37;
    margin: 0 0 .3rem;
    text-align: center;
}

.login-subtitle {
    color: #6b7c74;
    font-size: .88rem;
    line-height: 1.45;
    margin-bottom: 1.35rem;
    text-align: center;
}

.login-form .form-label {
    font-size: .82rem;
    font-weight: 600;
    color: #3f534a;
    margin-bottom: .35rem;
}

.login-form .form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.login-form .form-check-label {
    font-size: .86rem;
    color: #5b6b64;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap > i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8a9a92;
    z-index: 2;
    pointer-events: none;
}

.login-input-wrap .form-control {
    padding-left: 2.45rem;
    border-color: #d7e3dd;
    border-radius: .65rem;
    background: #fff;
    min-height: 3rem;
}

.login-input-wrap.has-toggle .form-control {
    padding-right: 2.75rem;
}

.login-pass-toggle {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #6b7c74;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: pointer;
}

.login-pass-toggle:hover {
    color: var(--brand);
    background: rgba(15, 107, 76, .08);
}

.login-input-wrap .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(15, 107, 76, .15);
}

.login-submit {
    font-weight: 700;
    border-radius: .65rem;
    padding: .78rem 1rem;
    box-shadow: 0 10px 24px rgba(15, 107, 76, .28);
}

.login-register-wrap {
    margin-top: .85rem;
    display: flex;
    justify-content: center;
}

.login-register-btn {
    font-weight: 600;
    font-size: .82rem;
    border-radius: .5rem;
    padding: .38rem .95rem;
    border: 1px solid #c9dbd2;
    color: #3f534a;
    background: transparent;
    width: auto;
}

.login-register-btn:hover {
    background: rgba(15, 107, 76, .06);
    color: var(--brand-dark);
    border-color: var(--brand);
}

.login-lang-bottom {
    margin-top: 1.5rem;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    padding-top: 1.15rem;
    border-top: 1px solid #e6eee9;
}

.login-coming-soon {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f4faf7;
}

.login-coming-soon-card {
    text-align: center;
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 12px 36px rgba(15, 107, 76, .12);
}

.login-coming-soon-card h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0a4d37;
    margin: .5rem 0 .75rem;
}

.login-coming-soon-card p {
    color: #6b7c74;
    margin-bottom: 1.5rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.login-footer a {
    color: #7a8b83;
    font-size: .8rem;
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--brand);
}

@media (max-width: 991.98px) {
    .login-split {
        flex-direction: column;
    }

    .login-banner {
        flex: none;
        width: 100%;
        min-height: 38vh;
        max-height: 44vh;
    }

    .login-banner-img {
        padding: 4.5rem 1.25rem 4rem;
        transform: scale(1);
    }

    .login-banner-copy {
        left: 50%;
        top: 1rem;
        bottom: auto;
        transform: translateX(-50%);
        max-width: calc(100% - 2rem);
    }

    .login-banner-headline {
        font-size: 1.35rem;
    }

    .login-banner-sub {
        font-size: .82rem;
        line-height: 1.4;
    }

    .login-banner-meta {
        left: 50%;
        bottom: .75rem;
        transform: translateX(-50%);
        font-size: .72rem;
        max-width: calc(100% - 1.5rem);
        gap: .2rem .55rem;
        padding: .45rem .75rem;
        border-radius: .75rem;
    }

    .login-banner-meta-item {
        white-space: normal;
    }

    .login-panel {
        flex: 1 1 auto;
        width: 100%;
        min-height: 58vh;
        box-shadow: none;
        align-items: flex-start;
        padding-top: 1.5rem;
    }
}

.feature-badge { font-size: .75rem; }
.table thead th { white-space: nowrap; }
.lang-switch .btn { font-weight: 500; }

/* Shift chip in topbar */
.shift-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-decoration: none;
    border-radius: 12px;
    padding: .35rem .7rem .35rem .4rem;
    border: 1px solid transparent;
    max-width: min(420px, 58vw);
    line-height: 1.15;
}
.shift-chip.is-open {
    background: #e8f7ef;
    border-color: #b7e4c7;
    color: #0a4d37;
}
.shift-chip.is-closed {
    background: #f4f4f4;
    border-color: #e0e0e0;
    color: #555;
}
.shift-chip:hover { filter: brightness(0.98); color: inherit; }
.shift-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.shift-chip.is-open .shift-chip-icon { background: #0f6b4c; color: #fff; }
.shift-chip.is-closed .shift-chip-icon { background: #9aa0a6; color: #fff; }
.shift-chip-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    justify-content: center;
}
.shift-chip-label {
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shift-chip-no {
    opacity: .7;
    margin-left: .25rem;
    font-weight: 500;
}
.shift-chip-money {
    font-size: .86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shift-chip-money strong { font-weight: 700; }
.text-muted-chip { opacity: .7; font-size: .78rem; }

/* Equal height: kitchen / shift chip / language / logout in topbar */
.app-topbar .shift-chip {
    height: var(--topbar-control-h);
    padding: 0 .65rem 0 .3rem;
    box-sizing: border-box;
}

.app-topbar .shift-chip-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: .95rem;
}

.app-topbar .shift-chip-label {
    font-size: .7rem;
    line-height: 1.1;
}

.app-topbar .shift-chip-money {
    font-size: .76rem;
    line-height: 1.15;
}

.app-topbar .text-muted-chip {
    font-size: .7rem;
}

.app-topbar .lang-switch .btn,
.app-topbar form .btn,
.app-topbar > .d-flex > .btn,
.app-topbar > .d-flex > a.btn {
    height: var(--topbar-control-h);
    min-height: var(--topbar-control-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.2;
    box-sizing: border-box;
}

.kitchen-header-btn,
.low-stock-header-btn {
    position: relative;
    gap: .4rem;
}
.low-stock-header-btn {
    cursor: pointer;
    z-index: 2;
}
.low-stock-header-btn > i {
    color: #e6a700;
    font-size: 1.05em;
}
.low-stock-header-btn.is-active > i,
.low-stock-header-btn.btn-brand > i {
    color: #ffe566;
}
.kitchen-header-btn .header-count,
.low-stock-header-btn .header-count {
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #f4c430;
    color: #1a2e24;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kitchen-header-btn.btn-brand .header-count,
.low-stock-header-btn.btn-brand .header-count,
.low-stock-header-btn.is-active .header-count {
    background: #fff;
    color: var(--brand-dark, #0a4d36);
}
.kitchen-header-btn .header-count[hidden],
.low-stock-header-btn .header-count[hidden] {
    display: none !important;
}
.low-stock-header-btn.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.app-topbar .lang-switch .dropdown-toggle {
    gap: .35rem;
}
.app-topbar .lang-switch .lang-switch-label {
    font-weight: 600;
}
.app-topbar .lang-switch .dropdown-menu {
    min-width: 7rem;
    z-index: 1080;
}
.app-topbar .lang-switch .dropdown-item.active {
    background: var(--brand);
    color: #fff;
}

@media (max-width: 575.98px) {
    .shift-chip { max-width: 46vw; padding-right: .45rem; }
    .text-muted-chip { display: none; }
}

/* Mobile topbar: avoid fixed height clipping / overlap */
@media (max-width: 991.98px) {
    .app-topbar {
        height: auto;
        min-height: var(--topbar-h);
        padding: .45rem .7rem;
        flex-wrap: wrap;
        align-items: center;
        gap: .4rem .55rem;
        row-gap: .45rem;
    }

    .app-topbar > .d-flex {
        min-width: 0;
    }

    .app-topbar > .d-flex:last-child {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: .35rem !important;
        row-gap: .35rem;
    }

    .app-topbar .shift-chip-money {
        display: none;
    }

    .app-topbar .shift-chip {
        max-width: none;
        padding-right: .5rem;
    }

    .app-topbar .lang-switch .btn {
        padding-left: .4rem;
        padding-right: .4rem;
        font-size: .75rem;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        --topbar-control-h: 36px;
        padding: .4rem .55rem;
        gap: .35rem;
    }

    .app-topbar > .d-flex:first-child {
        flex: 0 0 auto;
    }

    .app-topbar > .d-flex:last-child {
        flex: 1 1 calc(100% - 3.25rem);
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-end;
        padding-bottom: 1px;
    }

    .app-topbar > .d-flex:last-child::-webkit-scrollbar {
        display: none;
    }

    .app-topbar .lang-switch {
        flex: 0 0 auto;
    }

    .app-topbar .lang-switch .btn {
        padding-left: .4rem;
        padding-right: .4rem;
        font-size: .75rem;
        min-width: 0;
    }

    .app-topbar .lang-switch .lang-switch-label {
        display: none;
    }

    .app-topbar .shift-chip-label .shift-chip-no {
        display: none;
    }

    .app-topbar form {
        flex: 0 0 auto;
    }

    .app-content {
        padding: .85rem .75rem 1.5rem;
    }
}

/* ========== Toast notifications ========== */
.toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    width: min(380px, calc(100vw - 1.5rem));
    pointer-events: none;
}
.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: #fff;
    border-radius: 14px;
    padding: .9rem 1rem;
    box-shadow: 0 12px 40px rgba(15, 40, 30, .16);
    border: 1px solid rgba(15, 107, 76, .08);
    opacity: 0;
    transform: translateY(-10px) scale(.98);
    transition: opacity .25s ease, transform .25s ease;
    font-family: var(--font-sans);
}
.app-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.app-toast-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: .1rem;
}
.app-toast-success .app-toast-icon { color: #0f6b4c; }
.app-toast-error .app-toast-icon { color: #c0392b; }
.app-toast-warning .app-toast-icon { color: #d68910; }
.app-toast-info .app-toast-icon { color: #2471a3; }
.app-toast-body {
    flex: 1;
    font-size: .95rem;
    color: #1f2a24;
    white-space: pre-line;
    line-height: 1.4;
}
.app-toast-close {
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    color: #88928c;
    padding: 0 .15rem;
    cursor: pointer;
}
.app-toast-success { border-left: 4px solid #0f6b4c; }
.app-toast-error { border-left: 4px solid #c0392b; }
.app-toast-warning { border-left: 4px solid #d68910; }
.app-toast-info { border-left: 4px solid #2471a3; }

/* ========== Confirm modal ========== */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 4100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.confirm-modal.open { display: flex; }
.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 28, 22, .45);
    backdrop-filter: blur(2px);
}
.confirm-dialog {
    position: relative;
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 1.5rem 1.35rem 1.25rem;
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
    text-align: center;
    font-family: var(--font-sans);
    animation: confirmIn .2s ease;
}
@keyframes confirmIn {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to { opacity: 1; transform: none; }
}
.confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto .85rem;
    border-radius: 50%;
    background: var(--brand-soft, #e7f3ee);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}
.confirm-icon.is-danger {
    background: #fdecea;
    color: #c0392b;
}
.confirm-icon.is-warning {
    background: #fef5e7;
    color: #d68910;
}
.confirm-icon.is-info {
    background: #eaf2f8;
    color: #2471a3;
}
.confirm-icon.is-success {
    background: var(--brand-soft, #e7f3ee);
    color: var(--brand);
}
.confirm-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand-dark);
    margin-bottom: .4rem;
}
.confirm-message {
    color: #445049;
    font-size: .95rem;
    line-height: 1.45;
    margin-bottom: 1.2rem;
}
.confirm-actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
}
.confirm-actions .btn { min-width: 110px; }
body.confirm-open { overflow: hidden; }

/* Feature matrix (shop type) */
.feature-matrix td { vertical-align: middle; }
.feature-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
}
.feature-mark.feature-yes,
.feature-mark.feature-yes::before {
    color: #0f6b4c !important;
}
.feature-mark.feature-no,
.feature-mark.feature-no::before {
    color: #e74c3c !important;
}

/* Products */
.product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    display: inline-block;
}
.product-thumb-empty {
    background: #eef2f0;
    color: #8a968f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.product-preview {
    max-height: 160px;
    max-width: 100%;
    border-radius: 10px;
    object-fit: cover;
}
.product-image-box {
    min-height: 120px;
    border: 1px dashed rgba(15, 107, 76, .25);
    border-radius: 12px;
    background: #f7faf8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    overflow: hidden;
}
.product-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    color: #8a968f;
    font-size: .9rem;
}
.product-image-placeholder i { font-size: 1.75rem; }

.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(12, 28, 22, .55);
}
.camera-modal.open { display: flex; }
.camera-dialog {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.camera-header,
.camera-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #f7faf8;
}
.camera-body {
    background: #111;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .5rem;
}
.camera-body video {
    width: 100%;
    max-height: 55vh;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
}

@media (max-width: 575.98px) {
    .toast-host { top: .75rem; right: .75rem; left: .75rem; width: auto; }
}

/* Kitchen station */
.kitchen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.kitchen-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem .5rem;
    border-bottom: 1px solid rgba(15, 107, 76, .08);
}
.kitchen-table-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-dark, #0a4d36);
    line-height: 1.2;
}
.kitchen-zone {
    display: inline-block;
    font-size: .78rem;
    color: #6b7c74;
    margin-top: .15rem;
}
.kitchen-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
}
.kitchen-card-body {
    padding: .65rem .85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.kitchen-item {
    border: 1px solid rgba(15, 107, 76, .12);
    border-radius: 10px;
    padding: .65rem .75rem;
    background: #fff;
}
.kitchen-item.is-cooking {
    border-color: rgba(212, 160, 23, .45);
    background: #fffbeb;
}
.kitchen-item.is-served {
    opacity: .72;
    background: #f4faf7;
}
.kitchen-item.is-cancelled {
    opacity: .75;
    background: #fdf2f2;
    border-color: rgba(200, 60, 60, .25);
}
.kitchen-item-top {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    align-items: flex-start;
}
.kitchen-item-name {
    font-weight: 600;
    color: #1a2e24;
}
.kitchen-item-qty {
    font-weight: 700;
    color: var(--brand-dark, #0a4d36);
    white-space: nowrap;
}
.kitchen-item-extras {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    margin-top: .25rem;
    font-size: .8rem;
    color: #5a6b63;
}
.kitchen-item-note {
    margin-top: .25rem;
    font-size: .82rem;
    color: #8a5a00;
}
.kitchen-item-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .5rem;
}
.kitchen-item-time {
    font-size: .78rem;
    color: #7a8a82;
}
.kitchen-item-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: .35rem;
}
.kitchen-act-btn {
    min-width: 7.5rem;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.kitchen-queue-badge {
    display: inline-flex;
    align-items: center;
    margin-right: .4rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    background: var(--brand-dark, #0a4d36);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
}
.kitchen-item-queue {
    display: inline-block;
    margin-right: .35rem;
    color: var(--brand-dark, #0a4d36);
    font-weight: 700;
    font-size: .85rem;
}
.kitchen-item-meta {
    font-size: .82rem;
    font-weight: 600;
}
#kitchenSoundBtn.is-muted,
#kitchenPrintBtn.is-muted {
    opacity: .7;
    border-color: #adb5bd;
    color: #6c757d;
}
.kitchen-switch {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid #c9d7d0;
    background: #fff;
    color: #335248;
    border-radius: 999px;
    padding: .28rem .4rem .28rem .7rem;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
    user-select: none;
}
.kitchen-switch:hover {
    border-color: var(--brand);
}
.kitchen-switch-info {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}
.kitchen-switch-info i {
    font-size: .95rem;
}
.kitchen-switch-name {
    display: none;
}
@media (min-width: 576px) {
    .kitchen-switch-name { display: inline; }
}
.kitchen-switch-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 3.4rem;
    height: 1.55rem;
    border-radius: 999px;
    background: #c5cec9;
    padding: 0 .4rem;
    transition: background .18s ease;
}
.kitchen-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: left .18s ease;
}
.kitchen-switch-state {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: right;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
    padding-right: .1rem;
}
.kitchen-switch.is-on {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.kitchen-switch.is-on .kitchen-switch-track {
    background: var(--brand);
}
.kitchen-switch.is-on .kitchen-switch-thumb {
    left: calc(100% - 1.25rem - 2px);
}
.kitchen-switch.is-on .kitchen-switch-state {
    text-align: left;
    padding-left: .15rem;
    padding-right: 0;
}
.kitchen-switch.is-off {
    color: #6c757d;
    border-color: #ced4da;
    background: #f8f9fa;
}
.kitchen-switch.is-off .kitchen-switch-state {
    color: #5a6268;
    text-align: right;
}
.kitchen-item-meta-line {
    font-size: .78rem;
    color: #6b7c74;
    margin-top: .2rem;
}
.kitchen-history-table thead th {
    white-space: nowrap;
    font-size: .82rem;
    background: #f4f8f6;
}
.kitchen-history-table td {
    vertical-align: top;
    font-size: .88rem;
}
.kitchen-hist-cancel {
    background: #fff5f5;
}
.kitchen-hist-served {
    background: #f6fbf8;
}

/* POS cart kitchen badges */
.pos-cart-kitchen-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin-left: .35rem;
    padding: .1rem .4rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
}
.pos-cart-kitchen-badge.is-cooking {
    background: #fff3cd;
    color: #856404;
}
.pos-cart-kitchen-badge.is-served {
    background: #d1e7dd;
    color: #0f5132;
}
.pos-cart-kitchen-badge.is-cancelled {
    background: #f8d7da;
    color: #842029;
    cursor: pointer;
}
.pos-cart-kitchen-badge.is-pending {
    display: none;
}

/* Reports */
.reports-header-btn {
    font-weight: 600;
}
.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}
.report-kpi {
    padding: 1rem 1.1rem;
}
.report-kpi-label {
    font-size: .82rem;
    color: #6b7c74;
    margin-bottom: .25rem;
}
.report-kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}
.report-kpi-sub {
    font-size: .75rem;
    margin-top: .2rem;
}
.report-stat {
    padding: .85rem 1rem;
}
.report-table td {
    padding: .45rem .75rem;
}
.report-table tr:last-child td {
    border-bottom: 0;
}

