:root {
    color-scheme: light;

    /* HAS BossOne brand palette sampled from logo.jpg. */
    --brand-primary: #0090d0;
    --brand-primary-hover: #007bb3;
    --brand-primary-active: #00699a;
    --brand-primary-soft: #e6f6fc;
    --brand-primary-ring: rgba(0, 144, 208, .18);
    --brand-ink: #17445d;
    --brand-accent: #1080c0;

    /* Theme aliases: future themes should remap these values, not component CSS. */
    --theme-primary: var(--brand-primary);
    --theme-primary-hover: var(--brand-primary-hover);
    --theme-primary-active: var(--brand-primary-active);
    --theme-primary-soft: var(--brand-primary-soft);
    --theme-primary-ring: var(--brand-primary-ring);
    --theme-accent: var(--brand-accent);

    --bg: #f6f8fb;
    --panel: #ffffff;
    --text: #18202f;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-hover);
    --primary-active: var(--theme-primary-active);
    --accent: var(--theme-accent);
    --soft: var(--theme-primary-soft);
    --danger: #b42318;
    --shadow: 0 16px 40px rgba(24, 32, 47, .08);
    --font-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea, table { font: inherit; }
a { color: inherit; text-decoration: none; }

.login-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 9% 12%, rgba(255, 255, 255, .95) 0 1px, transparent 2px),
        radial-gradient(circle at 14% 26%, rgba(255, 255, 255, .55) 0 1px, transparent 2px),
        radial-gradient(circle at 21% 22%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
        radial-gradient(circle at 35% 10%, rgba(255, 255, 255, .85) 0 1px, transparent 2px),
        radial-gradient(circle at 41% 20%, rgba(255, 255, 255, .58) 0 1px, transparent 2px),
        radial-gradient(circle at 48% 27%, rgba(255, 255, 255, .65) 0 1px, transparent 2px),
        radial-gradient(circle at 62% 15%, rgba(255, 255, 255, .95) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 7%, rgba(255, 255, 255, .62) 0 1px, transparent 2px),
        radial-gradient(circle at 77% 24%, rgba(255, 255, 255, .72) 0 1px, transparent 2px),
        radial-gradient(circle at 91% 11%, rgba(255, 255, 255, .88) 0 1px, transparent 2px),
        radial-gradient(circle at 96% 29%, rgba(255, 255, 255, .58) 0 1px, transparent 2px),
        linear-gradient(to bottom, #02050b 0%, #050914 34%, #013b5f 69%, var(--brand-primary) 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}
.login-shell::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 46vh;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, .62) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, .78) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, .5) 0 1px, transparent 2px);
    background-size: 150px 110px, 230px 170px, 320px 210px, 410px 260px;
    background-position: 24px 14px, 90px 42px, 36px 82px, 180px 20px;
    opacity: .95;
}
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}
.login-card {
    width: min(100%, 440px);
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    padding: 28px;
    backdrop-filter: none;
}
.login-language-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}
.login-brand {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
.login-brand h1 { margin: 0 0 6px; font-size: 28px; color: #f6fbff; }
.login-brand p { margin: 0; color: #b8d7e8; line-height: 1.45; }
.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
}
.login-logo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: contain;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: 0 12px 32px rgba(0, 6, 14, .34);
}.login-form { display: grid; gap: 12px; }
.password-fields,
.otp-fields {
    display: grid;
    gap: 12px;
}
.login-method-label {
    color: #eaf7ff;
    font-weight: 400;
    margin-bottom: -4px;
}
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 5px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(148, 224, 255, .18);
    border-radius: 8px;
}
.segmented label {
    display: grid;
    place-items: center;
    min-height: 40px;
    border-radius: 6px;
    color: #b8d7e8;
    cursor: pointer;
}
.segmented label.active { background: rgba(0, 144, 208, .82); color: #fff; box-shadow: 0 10px 24px rgba(0, 144, 208, .28); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.field-label {
    display: block;
    color: #eaf7ff;
    font-weight: 400;
    margin: 0;
}
.text-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: var(--text);
}
.text-input::placeholder { color: #98a2b3; }
.text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--theme-primary-ring); }
.date-input-shell {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}
.date-input-shell .text-input {
    padding-right: 48px;
}
.date-picker-button {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.date-picker-button:hover,
.date-picker-button:focus-visible {
    background: rgba(0, 144, 208, .08);
    outline: none;
}
.date-picker-button:disabled {
    cursor: default;
    opacity: .55;
}
.native-date-picker {
    position: absolute;
    right: 6px;
    bottom: 4px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.login-shell .text-input {
    border-color: rgba(148, 224, 255, .28);
    background: rgba(2, 16, 28, .58);
    color: #f6fbff;
}
.login-shell .text-input::placeholder { color: rgba(232, 247, 255, .56); }
.login-shell .text-input:focus { border-color: #65d8ff; box-shadow: 0 0 0 3px rgba(101, 216, 255, .18); }
.field-error, .validation-summary { color: var(--danger); font-size: 14px; }
.hidden { display: none !important; }
.notice, .dev-otp {
    padding: 10px 12px;
    border-radius: 7px;
    background: rgba(0, 144, 208, .14);
    color: #dff7ff;
    border: 1px solid rgba(148, 224, 255, .22);
}
.dev-otp { border-style: dashed; }
.check-line { display: flex; align-items: center; gap: 8px; color: #b8d7e8; }
.check-line input { accent-color: var(--brand-primary); }
.primary-button {
    min-height: 46px;
    border: 1px solid rgba(148, 224, 255, .28);
    border-radius: 7px;
    background: linear-gradient(135deg, #00a7dc, #007bb3);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 144, 208, .24);
}
.primary-button:hover { background: linear-gradient(135deg, #16c2f5, #008fca); }
.primary-button.compact { min-height: 40px; padding: 0 14px; }
.primary-link { color: #65d8ff; font-weight: 700; }
.forgot-link,
.secondary-link {
    color: #65d8ff;
    font-weight: 400;
    justify-self: start;
    margin: 0 0 4px;
}
.secondary-link { justify-self: center; }
.login-hint { margin: 4px 0 0; color: #b8d7e8; font-size: 14px; line-height: 1.45; }
.login-copyright { margin: 4px 0 0; color: #b8d7e8; font-size: 13px; line-height: 1.45; text-align: center; }

.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--brand-ink);
    color: #f9fafb;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand small { display: block; color: #9ca3af; margin-top: 2px; }
.nav-list { display: grid; gap: 6px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #d1d5db;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255,255,255,.1);
    font-size: 13px;
    font-weight: 800;
}
.main-panel { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 68px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
}
.topbar-title span { color: var(--muted); margin-left: 8px; }
.topbar form { display: flex; align-items: center; gap: 10px; }
.user-name { color: var(--text) !important; font-weight: 650; }
.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}
.account-menu {
    position: relative;
}
.account-menu summary {
    list-style: none;
}
.account-menu summary::-webkit-details-marker {
    display: none;
}
.account-trigger {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(24, 32, 47, .06);
}
.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-ink));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    flex: 0 0 auto;
}
.user-avatar.large {
    width: 40px;
    height: 40px;
}
.account-trigger-text {
    display: grid;
    line-height: 1.15;
    min-width: 0;
}
.account-trigger-text strong,
.account-dropdown-head strong {
    color: var(--text);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-trigger-text small,
.account-dropdown-head small {
    color: var(--muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    z-index: 20;
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(24, 32, 47, .16);
}
.account-menu[open] .account-dropdown {
    display: grid;
    gap: 4px;
}
.account-dropdown-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}
.account-dropdown-head span:last-child {
    display: grid;
    min-width: 0;
}
.account-dropdown-item {
    min-height: 38px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    text-align: left;
}
.account-dropdown-item:hover {
    background: var(--soft);
    color: var(--brand-ink);
}
.account-dropdown-item.logout {
    color: var(--danger);
}
.account-dropdown-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex: 0 0 auto;
}
.content-wrap { padding: 24px; }
.toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}
.toolbar-row h1 { margin: 0 0 6px; font-size: 26px; }
.toolbar-row p { margin: 0; color: var(--muted); }
.branch-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(180px, 240px) 120px;
    gap: 10px;
    align-items: end;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.branch-filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.branch-add-button {
    justify-content: center;
    width: 100%;
}
.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.branch-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.card-head { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.branch-card-logo {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    object-fit: cover;
    border: 1px solid var(--line);
}
.status-dot { width: 9px; height: 9px; border-radius: 99px; background: #98a2b3; }
.status-dot.on { background: #12b76a; }
.status-dot.off { background: #f04438; }
.branch-card h2 { margin: 12px 0 16px; font-size: 20px; }
.branch-card dl,
.operation-admin-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}
.branch-card dl div,
.operation-admin-card dl div {
    display: grid;
    grid-template-columns: minmax(96px, .42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}
.branch-card dt,
.operation-admin-card dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.branch-card dd,
.operation-admin-card dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.operation-admin-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(140px, 170px) minmax(140px, 170px);
    gap: 10px;
    align-items: end;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.operation-admin-filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.role-admin-filters {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(150px, 190px) minmax(140px, 170px) 120px;
}
.user-admin-filters {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(150px, 190px) 120px;
}
.category-admin-filters {
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) minmax(150px, 190px) minmax(120px, 140px) minmax(120px, 140px) 86px 86px 86px;
}
.location-admin-filters {
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) minmax(150px, 190px) minmax(120px, 140px) 86px 86px 86px;
}
.partner-admin-filters {
    grid-template-columns: minmax(150px, 1.1fr) minmax(120px, .72fr) minmax(120px, .72fr) minmax(120px, .72fr) minmax(150px, .95fr) minmax(300px, 300px);
}
.sl-admin-filters {
    grid-template-columns: minmax(150px, 1fr) minmax(130px, .78fr) minmax(130px, .78fr) minmax(210px, 1.2fr) minmax(110px, .62fr) 110px;
}
.sl-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(150px, 1fr) minmax(130px, .78fr) minmax(130px, .78fr) minmax(210px, 1.2fr) minmax(110px, .62fr) 110px;
}
.sl-admin-filters .partner-filter-actions {
    grid-template-columns: 1fr;
}
.ba-admin-filters {
    grid-template-columns: minmax(190px, 1.4fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(120px, .7fr) minmax(120px, .7fr);
}
.ba-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(190px, 1.4fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(120px, .7fr) minmax(120px, .7fr);
}
.ba-admin-filters .partner-filter-actions {
    grid-template-columns: 1fr;
}
.partner-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(150px, 1.1fr) minmax(120px, .72fr) minmax(120px, .72fr) minmax(120px, .72fr) minmax(150px, .95fr) minmax(300px, 300px);
}
.item-admin-filters,
.item-admin-filters.has-tenant-filter,
.item-admin-filters.no-tenant-filter {
    grid-template-columns: minmax(150px, 1.2fr) minmax(128px, .72fr) minmax(128px, .72fr) minmax(128px, .72fr) minmax(160px, 1fr) minmax(300px, 300px);
}
.partner-filter-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-self: end;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
}
.partner-advanced-filter {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfdff;
}
.partner-advanced-filter summary,
.form-section-details summary {
    cursor: pointer;
    color: var(--brand-ink);
    font-weight: 750;
}
.partner-advanced-filter .form-grid,
.form-section-details .form-grid {
    margin-top: 12px;
}
@media (min-width: 980px) {
    .partner-advanced-filter .form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.form-section-details {
    margin-top: 12px;
    margin-bottom: 12px;
}
.partner-form-grid {
    align-items: start;
}
.partner-check-field {
    align-self: end;
    min-height: 40px;
    margin-top: 0;
    padding-bottom: 8px;
}
@media (min-width: 980px) {
    .form-grid.partner-form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .form-grid.partner-form-grid > .form-field {
        grid-column: span 1;
    }
    .form-grid.partner-form-grid > .form-field.long {
        grid-column: span 2;
    }
    .form-grid.partner-form-grid > .form-field.wide {
        grid-column: 1 / -1;
    }
    .form-grid.partner-form-grid > .partner-check-field {
        grid-column: span 1;
    }
    .form-panel .form-actions {
        justify-content: flex-end;
    }
}
.role-admin-filters .primary-button {
    align-self: end;
}
.user-admin-filters .primary-button {
    align-self: end;
}
.category-admin-filters .primary-button {
    align-self: end;
}
.partner-admin-filters .primary-button {
    align-self: end;
}
.partner-filter-actions .category-action-button {
    width: auto;
    justify-self: stretch;
}
.spa-admin-filters {
    grid-template-columns: repeat(auto-fit, minmax(180px, 240px)) max-content;
}
.spa-admin-filters .partner-filter-actions {
    grid-template-columns: max-content;
    justify-self: start;
    align-self: end;
    width: auto;
    min-width: max-content;
}
.spa-admin-filters .partner-filter-actions .category-action-button {
    width: max-content;
    min-width: max-content;
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
}
.item-filter-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
}
.item-filter-actions .category-action-button {
    width: auto;
    min-width: 0;
}
.item-advanced-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.range-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.category-card.partner-card dl {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 9px;
}
.category-card.partner-card dl div {
    display: contents;
}
.item-card-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 12px 0 14px;
}
.item-card-title img {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}
.item-card-title h2 {
    margin: 0;
}
.item-image-field {
    position: relative;
}
.item-form-section {
    margin-bottom: 14px;
}
.item-form-section h2 {
    margin: 0 0 12px;
    color: var(--brand-ink);
    font-size: 18px;
    line-height: 1.25;
}
.form-section-details.item-form-section summary {
    margin-bottom: 12px;
    color: var(--brand-ink);
    font-size: 18px;
    line-height: 1.25;
}
.item-hidden-grid-slot {
    visibility: hidden;
    min-height: 1px;
}
.item-image-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-height: 74px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.item-image-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.item-image-preview img {
    width: 56px;
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}
.item-image-preview span,
.item-image-controls small {
    color: var(--muted);
    overflow-wrap: anywhere;
}
.item-image-controls {
    display: grid;
    gap: 8px;
}
@media (max-width: 640px) {
    .partner-filter-actions {
        width: 100%;
    }
    .partner-filter-actions .category-action-button {
        flex: 1 1 0;
        width: auto;
    }
    .item-image-box {
        grid-template-columns: 1fr;
    }
    .item-advanced-filter-grid {
        grid-template-columns: 1fr;
    }
}
.category-admin-filters .category-action-button,
.partner-admin-filters .category-action-button,
.item-admin-filters .category-action-button,
.category-admin-filters .category-action-button:visited {
    min-height: 40px;
    min-width: 0;
    padding-inline: 10px;
    border: 1px solid rgba(148, 224, 255, .28);
    border-radius: 7px;
    background: linear-gradient(135deg, #00a7dc, #007bb3);
    color: #fff;
    font-weight: 750;
    box-shadow: 0 14px 30px rgba(0, 144, 208, .24);
    text-decoration: none;
}
.partner-admin-filters .category-action-button:visited {
    color: #fff;
}
.item-admin-filters .category-action-button:visited {
    color: #fff;
}
.category-admin-filters .category-action-button:hover,
.partner-admin-filters .category-action-button:hover,
.item-admin-filters .category-action-button:hover {
    background: linear-gradient(135deg, #16c2f5, #008fca);
    color: #fff;
}
.location-parent-picker {
    position: relative;
}
.autocomplete-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% - 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(24, 32, 47, .14);
}
.autocomplete-menu button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font: inherit;
}
.autocomplete-menu button:hover,
.autocomplete-menu button.active {
    background: #eef8fc;
}
.operation-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}
.category-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.operation-admin-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.category-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.category-card h2 {
    margin: 12px 0 14px;
    font-size: 18px;
    line-height: 1.25;
}
.category-card-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
}
.category-card-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-root-badge,
.category-card-head .status-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--theme-primary-soft);
    color: var(--brand-ink);
    font-size: 12px;
    font-weight: 750;
}
.category-card-head .status-label {
    margin-left: 0;
    border: 0;
}
.category-card dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 9px;
    margin: 0;
}
.category-card dl div {
    display: contents;
}
.category-card dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.category-card dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.category-card .card-actions {
    justify-content: space-between;
}
.category-card .card-actions .category-root-badge {
    min-height: 42px;
    padding-inline: 12px;
}
.operation-admin-card h2 {
    margin: 12px 0 14px;
    font-size: 18px;
    line-height: 1.25;
}
.operation-admin-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
}
.operation-admin-card-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.operation-admin-icon,
.operation-icon-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.operation-admin-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f8fafc;
    color: var(--brand-ink);
    font-size: 12px;
    font-weight: 800;
}
.operation-admin-icon img,
.operation-icon-preview img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.operation-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.operation-readonly-grid .text-input[readonly] {
    background: #f8fafc;
    color: var(--muted);
}
.operation-icon-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}
.operation-icon-current,
.operation-icon-picker {
    display: grid;
    gap: 10px;
    align-content: start;
    min-width: 0;
}
.operation-icon-preview span {
    overflow-wrap: anywhere;
    color: var(--muted);
}
.form-panel .form-check {
    color: #344054;
    font-weight: 750;
}
.form-panel .form-check span {
    color: #344054;
    font-weight: 750;
}
.operation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.operation-card,
.data-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.operation-card h2 {
    margin: 12px 0 14px;
    font-size: 19px;
}
.compact-card h2 { font-size: 17px; }
.order-workspace {
    display: grid;
    gap: 14px;
}
.dashboard-page {
    display: grid;
    gap: 16px;
}
.dashboard-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.dashboard-filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.dashboard-filters input,
.dashboard-filters select {
    min-height: 38px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    padding: 7px 9px;
}
.dashboard-filters button {
    min-height: 38px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.metric-card {
    min-height: 100px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.metric-card span {
    color: var(--muted);
    font-weight: 700;
}
.metric-card strong {
    color: var(--brand-ink);
    font-size: 24px;
    line-height: 1.1;
}
.metric-primary { border-top: 3px solid var(--primary); }
.metric-info { border-top: 3px solid #0ba5ec; }
.metric-success { border-top: 3px solid #12b76a; }
.metric-warning { border-top: 3px solid #f79009; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.dashboard-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.dashboard-panel-wide {
    grid-column: 1 / -1;
}
.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.panel-heading h2 {
    margin: 0;
    font-size: 18px;
}
.panel-heading span {
    color: var(--muted);
    font-size: 13px;
}
.trend-chart {
    min-height: 240px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(34px, 1fr);
    gap: 8px;
    align-items: end;
    overflow-x: auto;
    padding-top: 24px;
}
.trend-column {
    min-width: 34px;
    height: 210px;
    display: grid;
    grid-template-rows: 20px 1fr 18px;
    align-items: end;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}
.trend-column i {
    display: block;
    width: 100%;
    min-height: 8px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, #18b7e8, var(--primary));
}
.trend-value {
    opacity: 0;
    color: var(--brand-ink);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}
.trend-column:hover .trend-value {
    opacity: 1;
}
.bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.bar-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}
.bar-row b {
    color: var(--brand-ink);
}
.bar-row i {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}
.bar-row em {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}
.dashboard-table th,
.dashboard-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
}
.dashboard-table th {
    color: var(--muted);
    font-size: 13px;
}
.dashboard-table td:last-child,
.dashboard-table th:last-child {
    text-align: right;
}
.order-context {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
.context-tile {
    min-width: 150px;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.context-tile.active {
    border-color: rgba(0, 144, 208, .28);
    background: var(--soft);
    color: var(--brand-ink);
}
.context-tile span { color: var(--muted); }
.order-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}
.order-side,
.order-products,
.order-cart {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.order-side h2,
.order-cart h2 {
    margin: 0 0 12px;
    font-size: 18px;
}
.table-map,
.side-list {
    display: grid;
    gap: 8px;
}
.table-chip,
.side-list span {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    padding: 8px 10px;
    color: var(--text);
    text-align: left;
}
.table-chip.active {
    border-color: var(--primary);
    background: var(--soft);
    color: var(--brand-ink);
    font-weight: 750;
}
.side-list.staff { margin-top: 12px; }
.category-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
}
.category-strip span {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--brand-ink);
    font-weight: 700;
}
.product-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.product-pick-card {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.product-pick-grid.selectable .product-pick-card {
    cursor: pointer;
}
.product-pick-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.product-pick-card:has(input:checked),
.product-pick-card.selected {
    border-color: rgba(0, 144, 208, .45);
    background: var(--soft);
    box-shadow: inset 0 0 0 1px rgba(0, 144, 208, .16);
}
.product-pick-card span { color: var(--muted); font-size: 13px; }
.product-pick-card em { color: var(--primary); font-style: normal; font-weight: 800; }
.product-pick-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #eef7fb;
    color: var(--brand-ink);
    font-weight: 800;
    overflow: hidden;
}
.product-pick-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-pick-card button,
.order-submit {
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}
.order-submit {
    width: 100%;
    margin-top: 12px;
}
.cart-empty {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
}
.cart-empty strong { color: var(--text); }
.order-cart h3 {
    margin: 16px 0 8px;
    font-size: 15px;
}
.recent-orders {
    display: grid;
    gap: 6px;
}
.recent-orders span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
    border-radius: 7px;
    background: #f8fbfd;
}
.recent-orders small {
    color: var(--muted);
    grid-column: 1;
}
.recent-orders em {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-style: normal;
    font-weight: 800;
    color: var(--primary);
}
dl { display: grid; gap: 10px; margin: 0; }
dl div { display: grid; gap: 2px; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; }
.empty-state {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}
.empty-state h2 { margin-top: 0; }

@media (max-width: 780px) {
    .app-shell { display: block; }
    .sidebar { position: sticky; top: 0; z-index: 5; padding: 12px; gap: 12px; }
    .brand small { display: none; }
    .nav-list { display: flex; overflow-x: auto; padding-bottom: 4px; }
    .nav-link { flex: 0 0 auto; }
    .topbar { align-items: flex-start; padding: 14px; }
    .topbar-title span { display: block; margin-left: 0; margin-top: 4px; }
    .content-wrap { padding: 14px; }
    .toolbar-row { align-items: stretch; flex-direction: column; }
    .login-card { padding: 20px; }
}
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}
.secondary-button,
.danger-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
}
.secondary-button:hover { border-color: var(--primary); color: var(--primary); }
.danger-button { color: var(--danger); }
.danger-button:hover:not(:disabled) { background: #fff1f0; border-color: #fda29b; }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }
.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: #fff;
}
.alert.success { background: var(--theme-primary-soft); border-color: rgba(0, 144, 208, .22); color: var(--brand-ink); }
.alert.danger { background: #fff1f0; border-color: #fda29b; color: var(--danger); }
.alert.warning {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #713f12;
}
.temporary-password-alert {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) minmax(160px, 220px) auto;
    gap: 10px;
    align-items: end;
}
.temporary-password-alert > div:first-child,
.temporary-password-alert label {
    display: grid;
    gap: 5px;
}
.temporary-password-alert label span,
.temporary-password-alert > div:first-child span {
    font-size: 13px;
    color: #854d0e;
}
.temporary-password-alert input {
    background: #fff;
    font-weight: 750;
}
.temporary-password-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.status-label {
    margin-left: auto;
    font-size: 18px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
}
.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}
.card-actions form { margin: 0; }
.form-panel {
    width: 100%;
    max-width: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.entity-form { display: grid; gap: 18px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.form-field {
    display: grid;
    gap: 7px;
    font-weight: 400;
    color: #344054;
}
.form-field > span:first-child {
    font-weight: 400;
}
.required-marker {
    color: var(--danger);
    font-weight: 400;
}
.form-field .text-input {
    font-weight: 650;
}
.form-field .text-input::placeholder {
    font-weight: 400;
}
.field-hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}
.entity-form .form-check {
    color: #344054;
    font-weight: 750;
}
.entity-form .form-check span {
    color: #344054;
    font-weight: 750;
}
.entity-form .form-check input {
    accent-color: var(--primary);
}
.form-field.wide,
.form-grid > .wide { grid-column: 1 / -1; }
@media (min-width: 781px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.branch-logo-section {
    display: grid;
    gap: 10px;
}
.branch-logo-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    min-width: 0;
}
.branch-logo-section > span:first-child {
    color: #344054;
}
.branch-logo-current,
.branch-logo-picker {
    display: grid;
    gap: 10px;
    grid-template-rows: auto auto 1fr;
    align-content: start;
    min-width: 0;
}
.branch-logo-remove {
    margin-top: 0;
    align-self: start;
}
.file-input-native {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}
.branch-file-button {
    justify-self: start;
    min-height: 40px;
    padding: 0 14px;
    grid-row: 2;
}
.branch-logo-file-status {
    overflow-wrap: anywhere;
    min-height: 20px;
}
@media (min-width: 781px) {
    .branch-logo-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .operation-icon-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}
.branch-logo-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 500;
    min-width: 0;
}
.branch-logo-preview img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}
.branch-logo-preview span {
    overflow-wrap: anywhere;
}
.branch-logo-null {
    color: var(--muted);
    font-weight: 650;
}
.branch-logo-new-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    font-weight: 650;
    min-height: 58px;
}
.branch-logo-new-preview[hidden] {
    display: none;
}
.branch-logo-new-preview img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}
.branch-logo-new-preview span {
    overflow-wrap: anywhere;
}
.branch-logo-picker .field-hint:empty {
    display: none;
}
.form-check { margin-top: 2px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}
.account-panel h2 {
    margin-top: 0;
}
.user-list-panel {
    margin-top: 18px;
}
.temporary-password-box {
    max-width: 860px;
}
.temporary-password-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 14px;
    margin: 12px 0;
}
.temporary-password-grid code {
    font-size: 16px;
    font-weight: 800;
}
.table-wrap {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}
.data-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.table-actions {
    text-align: right !important;
}
.table-actions form {
    margin: 0;
}
.role-permission-link {
    color: #b42318;
    border-color: #fecdca;
    background: #fff;
}
.role-permission-link:hover {
    background: #fef3f2;
    border-color: #fda29b;
}
.role-permission-table td:first-child {
    min-width: 220px;
}
.role-permission-filters {
    grid-template-columns: minmax(220px, 320px) max-content max-content;
}
.permission-cell-flash {
    background: #e6f7fd;
    transition: background .45s ease;
}
.role-permission-table td:first-child small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}
.import-preview-table {
    min-width: 920px;
}
.import-preview-table th,
.import-preview-table td {
    vertical-align: top;
}
.import-row-error td {
    background: #fff7f7;
}
.import-error-list {
    margin: 6px 0 0;
    padding-left: 18px;
}
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    background: #eef2f6;
    color: var(--muted);
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
}
.badge.success {
    background: #ecfdf3;
    color: #027a48;
}
.badge.warning {
    background: #fffaeb;
    color: #b54708;
}
.badge.danger {
    background: #fff1f0;
    color: var(--danger);
}
.check-line.light {
    color: var(--text);
    font-weight: 650;
}
.product-page {
    display: grid;
    gap: 14px;
}
.product-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 110px 120px;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 32, 47, .04);
}
.product-filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.product-layout {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.product-form {
    max-width: none;
}
.product-form-heading {
    margin-bottom: 0;
}
.product-image-editor {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.product-image-preview,
.product-thumb {
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #eef7fb;
    color: var(--brand-ink);
    font-weight: 800;
}
.product-image-preview {
    width: 112px;
    height: 112px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}
.product-image-preview img,
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-thumb {
    width: 46px;
    height: 46px;
    border-radius: 7px;
}
.product-checks {
    align-content: start;
}
.product-table td strong + small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}
.row-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}
.row-actions form {
    display: inline-flex;
}
.primary-button.disabled,
.primary-button[aria-disabled="true"],
.secondary-button.disabled,
.secondary-button[aria-disabled="true"],
.danger-button.disabled,
.danger-button[aria-disabled="true"] {
    opacity: .45;
    pointer-events: none;
}
.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
}
.pager span {
    color: var(--muted);
    font-weight: 700;
}
.pagination-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 14px;
}
.check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.check-list .check-line {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
}
.check-list [hidden] {
    display: none;
}
.form-panel .user-active-check,
.form-panel .user-active-check span {
    color: #344054;
    font-weight: 750;
}
.form-panel .user-active-check {
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: transparent;
}

@media (max-width: 780px) {
    .card-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
    .card-actions > *,
    .card-actions button,
    .form-actions > *,
    .form-actions button {
        width: 100%;
    }
    .form-grid { grid-template-columns: 1fr; }
    .form-panel { padding: 16px; }
    .account-trigger-text { display: none; }
    .account-dropdown { right: 0; width: min(86vw, 260px); }
    .order-layout { grid-template-columns: 1fr; }
    .order-side,
    .order-products,
    .order-cart { padding: 12px; }
    .product-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-pick-card { padding: 10px; }
    .branch-filters,
    .operation-admin-filters,
    .partner-admin-filters,
    .partner-admin-filters.has-tenant-filter,
    .partner-admin-filters.no-tenant-filter,
    .operation-readonly-grid,
    .product-filters,
    .product-layout,
    .product-image-editor {
        grid-template-columns: 1fr;
    }
    .partner-filter-actions {
        width: 100%;
    }
    .partner-filter-actions .category-action-button {
        flex: 1 1 0;
        width: auto;
    }
    .category-admin-filters,
    .location-admin-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .category-admin-filters label,
    .location-admin-filters label {
        grid-column: 1 / -1;
    }
    .category-admin-filters .category-action-button,
    .location-admin-filters .category-action-button {
        width: 100%;
        min-width: 0;
    }
    .operation-admin-grid {
        grid-template-columns: 1fr;
    }
    .category-card-grid {
        grid-template-columns: 1fr;
    }
    .category-card .card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .branch-card dl div,
    .operation-admin-card dl div,
    .category-card dl div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .category-card dl {
        grid-template-columns: 1fr;
    }
    .category-card:not(.partner-card) dl {
        grid-template-columns: max-content minmax(0, 1fr);
        column-gap: 10px;
        row-gap: 9px;
    }
    .category-card:not(.partner-card) dl div {
        display: contents;
    }
    .product-image-preview {
        width: 100%;
        max-width: 180px;
        justify-self: center;
    }
    .row-actions {
        display: grid;
        justify-content: stretch;
    }
    .row-actions > *,
    .row-actions button {
        width: 100%;
    }
    .pagination-row {
        justify-content: stretch;
    }
    .pager {
        align-items: stretch;
        flex-direction: column;
    }
    .temporary-password-alert {
        grid-template-columns: 1fr;
    }
    .temporary-password-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .pagination-row .secondary-button {
        flex: 1;
    }
}
 .public-language {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    border: 1px solid rgba(148, 224, 255, .22);
    border-radius: 999px;
    background: rgba(3, 18, 31, .5);
    box-shadow: 0 10px 24px rgba(0, 5, 12, .22);
    backdrop-filter: blur(10px);
}
.language-option {
    min-height: 34px;
    width: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--muted);
    padding: 4px;
    font-size: 18px;
    font-weight: 750;
    transition: background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.language-option.active {
    background: rgba(0, 144, 208, .34);
    box-shadow: inset 0 0 0 1px rgba(148, 224, 255, .24);
}
.language-flag {
    width: 30px;
    height: 22px;
    display: block;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(24, 32, 47, .12);
    filter: saturate(.72);
    opacity: .62;
}
.language-option.active .language-flag {
    filter: saturate(1.08);
    opacity: 1;
}
.language-option:hover .language-flag {
    opacity: 1;
}@media (max-width: 780px) {
    .public-language { top: 10px; right: 10px; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .language-option { padding: 4px; }
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Hierarchical application menu */
.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 7px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}
.sidebar-toggle.mobile {
    display: none;
    color: var(--text);
    background: #fff;
    border-color: var(--line);
}
.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.menu-group {
    border-radius: 8px;
}
.menu-group-title {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #e5e7eb;
    cursor: pointer;
    padding: 7px 8px;
    border-radius: 8px;
    font-weight: 750;
    list-style: none;
}
.menu-group-title::-webkit-details-marker { display: none; }
.menu-group-title::after {
    content: '›';
    margin-left: auto;
    transform: rotate(90deg);
    transition: transform .18s ease;
}
.menu-group:not([open]) .menu-group-title::after { transform: rotate(0deg); }
.menu-group-items {
    display: grid;
    gap: 4px;
    padding: 2px 0 8px 12px;
}
.menu-icon-img {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    object-fit: contain;
    border-radius: 4px;
}
.nav-link {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 13px;
}
.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.topbar-title > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.current-branch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    min-width: 0;
    color: var(--brand-ink);
    font-size: 15px;
    font-weight: 750;
}
.topbar-title .current-branch-pill,
.topbar-title .current-branch-pill span {
    margin-left: 0;
    margin-top: 0;
    color: var(--brand-ink);
}
.current-branch-pill img,
.current-branch-logo {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    color: var(--primary);
    font-size: 10px;
    font-weight: 850;
    box-shadow: none;
}
.current-branch-pill > span:last-child {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.mobile-title-stack {
    display: contents;
}
.mobile-page-name {
    display: none;
}
.page-title-with-tip {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    cursor: help;
    white-space: nowrap;
}
.page-title-text {
    color: var(--brand-primary) !important;
    white-space: nowrap;
}
.shortcut-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.shortcut-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(24, 32, 47, .06);
    min-width: 0;
}
.shortcut-next-indicator {
    display: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
.shortcut-scroll {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}
.shortcut-scroll::-webkit-scrollbar { height: 4px; }
.shortcut-scroll::-webkit-scrollbar-thumb { background: #b8d7e8; border-radius: 999px; }
.shortcut-icon-shell {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    scroll-snap-align: start;
}
.shortcut-icon-link {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--brand-ink);
    background: transparent;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.shortcut-icon-link:hover,
.shortcut-icon-link.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(0, 144, 208, .22);
}
.shortcut-icon-link svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}
.shortcut-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.shortcut-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 17px;
    height: 17px;
    display: none;
    place-items: center;
    border: 1px solid #fff;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.shortcut-icon-shell:hover .shortcut-remove {
    display: grid;
}
.shortcut-manager {
    position: relative;
    flex: 0 0 auto;
}
.shortcut-manager summary {
    list-style: none;
}
.shortcut-manager summary::-webkit-details-marker {
    display: none;
}
.shortcut-manage-button {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--soft);
    color: var(--brand-ink);
    cursor: pointer;
}
.shortcut-manage-button:hover,
.shortcut-manager[open] .shortcut-manage-button {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.shortcut-manage-button svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}
.shortcut-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: min(420px, 88vw);
    display: none;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(24, 32, 47, .16);
}
.shortcut-manager[open] .shortcut-panel {
    display: grid;
}
.shortcut-search {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    outline: none;
}
.shortcut-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--theme-primary-ring);
}
.shortcut-menu-list {
    display: grid;
    gap: 6px;
    max-height: min(54vh, 440px);
    overflow-y: auto;
}
.shortcut-menu-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 6px;
    border-radius: 7px;
}
.shortcut-menu-row:hover {
    background: var(--soft);
}
.shortcut-row-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--brand-ink);
    background: #eef7fb;
}
.shortcut-row-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.shortcut-row-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.shortcut-row-text {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}
.shortcut-row-text strong,
.shortcut-row-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shortcut-row-text small {
    color: var(--muted);
}
.shortcut-row-button {
    min-height: 32px;
    border: 1px solid var(--primary);
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    padding: 0 10px;
}
.shortcut-row-button.remove {
    border-color: var(--line);
    background: #fff;
    color: var(--danger);
}
.language-switcher.compact {
    background: #f8fbfd;
    border-color: var(--line);
    box-shadow: none;
    backdrop-filter: none;
}
.account-language-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
    color: var(--muted);
    font-weight: 650;
}
.account-shortcut-manager {
    position: relative;
}
.account-branch-manager {
    position: relative;
}
.account-shortcut-manager summary {
    list-style: none;
}
.account-branch-manager summary {
    list-style: none;
}
.account-shortcut-manager summary::-webkit-details-marker {
    display: none;
}
.account-branch-manager summary::-webkit-details-marker {
    display: none;
}
.account-shortcut-trigger::after {
    content: '›';
    margin-left: auto;
    color: var(--muted);
    font-size: 18px;
}
.account-branch-trigger::after {
    content: '›';
    margin-left: auto;
    color: var(--muted);
    font-size: 18px;
}
.account-shortcut-manager[open] .account-shortcut-trigger {
    background: var(--soft);
    color: var(--brand-ink);
}
.account-branch-manager[open] .account-branch-trigger {
    background: var(--soft);
    color: var(--brand-ink);
}
.account-shortcut-manager[open] .account-shortcut-trigger::after {
    transform: rotate(90deg);
}
.account-branch-manager[open] .account-branch-trigger::after {
    transform: rotate(90deg);
}
.account-branch-panel {
    display: none;
    gap: 6px;
    padding: 8px;
    margin: 0 0 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.account-branch-manager[open] .account-branch-panel {
    display: grid;
}
.branch-choice {
    width: 100%;
    min-height: 40px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    padding: 6px 8px;
    text-align: left;
}
.branch-choice:hover,
.branch-choice.active {
    border-color: rgba(0, 144, 208, .28);
    background: var(--soft);
    color: var(--brand-ink);
}
.branch-choice:disabled {
    cursor: default;
}
.branch-choice img,
.branch-choice > span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #fff;
    object-fit: contain;
    color: var(--primary);
    font-size: 10px;
    font-weight: 850;
    box-shadow: 0 0 0 1px var(--line);
}
.branch-choice strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-shortcut-panel {
    position: static;
    width: 100%;
    display: none;
    padding: 8px;
    margin: 0 0 4px;
    border-radius: 8px;
    box-shadow: none;
}
.account-shortcut-manager[open] .account-shortcut-panel {
    display: grid;
}
.account-shortcut-panel .shortcut-menu-list {
    max-height: min(48vh, 360px);
}
.notification-button {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-ink);
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(24, 32, 47, .06);
}
.notification-button:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.notification-button svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}
.notification-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #f04438;
}
.menu-backdrop {
    display: none;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, .38);
}

body.menu-collapsed.app-shell {
    grid-template-columns: 76px 1fr;
}
body.menu-collapsed .sidebar {
    padding: 14px 10px;
}
body.menu-collapsed .brand-text,
body.menu-collapsed .brand-logo,
body.menu-collapsed .menu-group-title span,
body.menu-collapsed .nav-link span {
    display: none;
}
body.menu-collapsed .menu-group-title,
body.menu-collapsed .nav-link {
    justify-content: center;
    padding-left: 7px;
    padding-right: 7px;
}
body.menu-collapsed .menu-group-title::after { display: none; }
body.menu-collapsed .menu-group-items { padding-left: 0; }

@media (max-width: 780px) {
    .dashboard-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-filters button {
        grid-column: 1 / -1;
    }
    .dashboard-metrics,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .metric-card {
        min-height: 82px;
    }
    .metric-card strong {
        font-size: 20px;
    }
    .panel-heading {
        align-items: start;
        flex-direction: column;
    }
    .trend-chart {
        min-height: 210px;
    }
    .dashboard-table {
        font-size: 13px;
    }
    .sidebar {
        position: fixed;
        inset: var(--mobile-menu-offset, 0px) auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-105%);
        transition: transform .2s ease;
        overflow-y: auto;
        z-index: 14;
    }
    body.menu-open .sidebar { transform: translateX(0); }
    body.menu-collapsed .sidebar { transform: translateX(-105%); }
    body.menu-open .menu-backdrop {
        display: block;
        position: fixed;
        inset: var(--mobile-menu-offset, 0px) 0 0 0;
        z-index: 4;
    }
    body.menu-collapsed.app-shell { display: block; }
    .sidebar-toggle.mobile { display: inline-grid; place-items: center; }
    .sidebar .sidebar-toggle { display: inline-grid; place-items: center; }
    .nav-list { display: grid; overflow: visible; padding-bottom: 0; }
    .nav-link { flex: unset; }
    .topbar {
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
        z-index: 16;
    }
    .topbar-title {
        flex: 1 1 calc(100% - 98px);
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 6px;
        min-height: 48px;
    }
    .topbar-title > div {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: 22px 22px;
        align-items: center;
        align-content: center;
        min-width: 0;
        gap: 4px 8px;
        height: 48px;
        white-space: nowrap;
    }
    .topbar-title span {
        display: inline-flex !important;
        align-items: center;
        margin: 0 !important;
        line-height: 42px;
    }
    .sidebar-toggle.mobile {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        align-self: center;
    }
    .current-branch-pill {
        display: grid !important;
        grid-column: 1 / -1;
        grid-row: 1 / span 2;
        grid-template-columns: 42px minmax(0, 1fr);
        grid-template-rows: 22px 22px;
        align-items: center;
        max-width: none;
        min-width: 0;
        overflow: hidden;
        position: relative;
        z-index: 2;
        font-size: 15px;
        line-height: 1;
        gap: 0 8px;
        height: 48px;
    }
    .topbar-title .mobile-title-stack {
        display: grid !important;
        grid-column: 2;
        grid-row: 1 / span 2;
        grid-template-rows: 22px 22px;
        align-items: center;
        min-width: 0;
        height: 48px;
        row-gap: 4px;
    }
    .topbar-title .mobile-branch-name,
    .topbar-title .mobile-page-name {
        display: inline-flex !important;
        align-items: center;
        margin: 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 22px;
        line-height: 22px;
        align-self: center;
        transform: translateY(0);
        font-size: 15px;
        text-align: left;
        justify-content: flex-start;
    }
    .topbar-title .mobile-branch-name {
        color: var(--brand-ink) !important;
        font-weight: 750;
    }
    .topbar-title .mobile-page-name {
        color: var(--brand-primary) !important;
        font-weight: 750;
    }
    .current-branch-pill img,
    .current-branch-logo {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 42px;
        height: 42px;
        border-radius: 0;
        align-self: center;
    }
    .page-title-with-tip {
        display: none !important;
        align-items: center;
        grid-column: 2;
        grid-row: 2;
        max-width: none;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 15px;
        line-height: 1;
        height: 22px;
        position: relative;
        z-index: 3;
    }
    .topbar-title .page-title-with-tip,
    .topbar-title .page-title-text {
        display: none !important;
        align-items: center;
        min-width: 0;
        max-width: 100%;
        height: 22px;
        margin: 0;
        line-height: 22px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .topbar-actions {
        display: contents;
    }
    .shortcut-wrap {
        order: 3;
        width: 100%;
        max-width: none;
        flex: 1 0 100%;
        justify-content: stretch;
        gap: 4px;
        min-width: 0;
    }
    .shortcut-bar {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .shortcut-scroll {
        flex: 1 1 auto;
        max-width: 100%;
    }
    .shortcut-icon-link {
        flex: 0 0 auto;
        width: 34px;
        height: 34px;
    }
    .shortcut-manage-button,
    .account-trigger,
    .notification-button {
        width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 2px;
    }
    .shortcut-manage-button {
        flex: 0 0 38px;
        width: 34px;
        height: 34px;
        min-height: 34px;
    }
    .account-menu {
        order: 2;
        flex: 0 0 auto;
    }
    .notification-button {
        order: 1;
        flex: 0 0 38px;
    }
    .notification-dot {
        top: 7px;
        right: 8px;
    }
    .shortcut-panel {
        right: -94px;
        width: calc(100vw - 28px);
        max-height: calc(100vh - 92px);
    }
    .shortcut-menu-row {
        grid-template-columns: 32px minmax(0, 1fr) 66px;
        align-items: center;
    }
    .shortcut-menu-row form {
        grid-column: auto;
        justify-self: end;
    }
    .shortcut-row-button {
        width: 62px;
        min-height: 30px;
        padding: 0 6px;
        font-size: 12px;
    }
    .account-dropdown {
        right: -4px;
        width: min(96vw, 360px);
    }
    .account-shortcut-panel .shortcut-menu-row {
        width: 100%;
        grid-template-columns: 34px minmax(0, 1fr) 78px;
        align-items: center;
        gap: 8px;
    }
    .account-shortcut-panel .shortcut-menu-row form {
        grid-column: auto;
        justify-self: end;
        width: 78px;
        display: flex;
        justify-content: flex-end;
    }
    .account-shortcut-panel .shortcut-row-button {
        position: relative;
        z-index: 1;
        width: 74px;
        min-width: 74px;
    }
}

@media (max-width: 780px) {
    .account-menu .account-dropdown {
        overflow: visible;
    }
    .account-menu .account-shortcut-panel {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
    }
    .account-menu .account-shortcut-panel .shortcut-menu-list {
        width: 100%;
        overflow-x: hidden;
    }
    .account-menu .account-shortcut-panel .shortcut-menu-row {
        display: grid !important;
        width: 100%;
        grid-template-columns: 34px minmax(0, 1fr) 82px !important;
        align-items: center;
        gap: 8px;
    }
    .account-menu .account-shortcut-panel .shortcut-row-text {
        min-width: 0;
    }
    .account-menu .account-shortcut-panel .shortcut-menu-row form {
        display: flex !important;
        width: 82px !important;
        min-width: 82px !important;
        justify-content: flex-end;
        grid-column: auto !important;
    }
    .account-menu .account-shortcut-panel .shortcut-row-button {
        width: 78px !important;
        min-width: 78px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        visibility: visible !important;
    }
}

/* ===================== POS / Orders ===================== */
.pos-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px 0 24px;
}
.pos-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 12px;
}
.pos-zone-title {
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--brand-ink);
}
.pos-zone-count {
    color: var(--muted);
    font-weight: 400;
    font-size: 13px;
}
.pos-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.pos-table-form,
.pos-reserve-form {
    margin: 0;
    padding: 0;
}
.pos-reserve-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}
.pos-reserve-form .text-input {
    min-width: 0;
}
.pos-reserve-form button {
    grid-column: 1 / -1;
}
.pos-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    color: var(--brand-ink);
    min-height: 110px;
    width: 100%;
    text-align: left;
    font: inherit;
    transition: all .15s;
}
.pos-table:hover { border-color: #4a90e2; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.pos-table-free { background: #f6fff7; border-color: #bce5c0; }
.pos-table-occupied { background: #fff7e6; border-color: #f0c060; }
.pos-table-reserved { background: #eef4ff; border-color: #b0c4f0; }
.status-reserved { background: #eef4ff; color: #1d4ed8; }
.pos-table-cleaning, .pos-table-maintenance { background: #f0f0f0; opacity: .8; }
.pos-table-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px;
}
.pos-table-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(0,0,0,.06);
}
.pos-table-meta {
    display: flex; gap: 8px; color: var(--muted); font-size: 12px;
}
.pos-table-meta .capacity { color: #999; }
.pos-table-time {
    align-items: baseline;
}
.pos-table-elapsed {
    color: var(--brand-ink);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}
.pos-table-total {
    font-size: 20px;
    font-weight: 600;
    color: #d94f00;
    margin-top: auto;
}
.pos-reservations {
    order: 999;
    padding-bottom: 4px;
}
.pos-reservation-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.pos-reservation-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    color: var(--brand-ink);
    text-decoration: none;
}
.pos-reservation-card:hover {
    border-color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, .12);
}
.pos-reservation-time {
    min-width: 58px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #eef4ff;
    color: #1d4ed8;
    text-align: center;
    font-weight: 700;
}
.pos-reservation-time span,
.pos-reservation-main span,
.pos-reservation-main small,
.pos-reservation-meta span {
    display: block;
}
.pos-reservation-main {
    min-width: 0;
}
.pos-reservation-main strong,
.pos-reservation-main span,
.pos-reservation-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-reservation-main span {
    margin-top: 2px;
    color: #0f172a;
    font-weight: 600;
}
.pos-reservation-main small,
.pos-reservation-meta {
    color: #64748b;
}
.pos-reservation-meta {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}
@media (max-width: 600px) {
    .pos-page-actions .primary-button { width: 100%; justify-content: center; }
    .pos-reservation-list { grid-template-columns: 1fr; }
}
.pos-table-cta {
    margin-top: auto;
    color: #2e7d32;
    font-size: 13px;
    font-weight: 500;
}

/* Edit page */
.pos-edit { display: flex; flex-direction: column; gap: 12px; }
.pos-edit-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
}
.pos-edit-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.pos-edit-status {
    padding: 3px 10px; border-radius: 8px; font-weight: 600; font-size: 12px;
    background: #eef4ff; color: #1d4ed8;
}
.pos-edit-status.status-paid { background: #e7f8eb; color: #2e7d32; }
.pos-edit-status.status-cancelled { background: #fbe7e7; color: #c0392b; }
.pos-edit-status.status-open, .pos-edit-status.status-inkitchen { background: #fff4d6; color: #b76e00; }

.pos-edit-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
}
@media (max-width: 980px) {
    .pos-edit-body { grid-template-columns: 1fr; }
}
.pos-edit-left, .pos-edit-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pos-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
}
.pos-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--brand-ink); }
.pos-customer-grid { gap: 8px; }
.pos-customer-grid .form-field { margin: 0; }

.pos-search { position: relative; }
.pos-item-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    max-height: 320px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.pos-item-results button {
    display: flex; gap: 10px; justify-content: space-between; align-items: center;
    width: 100%; padding: 8px 12px; border: 0; background: transparent; cursor: pointer;
    text-align: left; border-bottom: 1px solid #f0f0f0;
}
.pos-item-results button:hover { background: #f6f9ff; }
.pos-item-results button .num { color: #d94f00; font-weight: 600; }

.pos-lines-wrap { overflow-x: auto; }
.pos-lines-table { width: 100%; }
.pos-lines-table th, .pos-lines-table td { padding: 6px 8px; vertical-align: middle; }
.pos-lines-table .num { text-align: right; }
.pos-lines-table .qty, .pos-lines-table .price { width: 100px; text-align: right; }
.pos-lines-table tr.line-printed { background: #fafff5; }
.pos-lines-table .station-name,
.so-lines-table .station-name {
    background: #f1f5f9;
    color: #334155;
    font-weight: 400;
    border-radius: 6px;
}
.pos-lines-table .station-name[data-station-code*="KITCHEN"],
.so-lines-table .station-name[data-station-code*="KITCHEN"] { background: #fff7ed; color: #9a3412; }
.pos-lines-table .station-name[data-station-code*="BAR"],
.so-lines-table .station-name[data-station-code*="BAR"] { background: #eff6ff; color: #1d4ed8; }
.pos-lines-table .station-name[data-station-code*="SPA"],
.so-lines-table .station-name[data-station-code*="SPA"] { background: #fdf2f8; color: #be185d; }
.pos-lines-table .station-name[data-station-code*="COUNTER"],
.so-lines-table .station-name[data-station-code*="COUNTER"] { background: #ecfdf5; color: #047857; }
.pos-lines-table .line-note { display: block; color: #666; font-size: 11px; }
.line-status { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 400; background: #eee; }
.line-status.status-ordered { background: #eef4ff; color: #1d4ed8; }
.line-status.status-inkitchen { background: #fff4d6; color: #b76e00; }
.line-status.status-ready { background: #e7f8eb; color: #2e7d32; }
.line-status.status-served { background: #d9d9d9; color: #555; }

.pos-totals {
    background: #fafbff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}
.pos-total-row {
    display: flex; justify-content: space-between; padding: 4px 0;
    font-size: 13px;
}
.pos-total-row.total-final {
    border-top: 1px dashed #ccc;
    margin-top: 6px; padding-top: 8px;
    font-weight: 700; font-size: 16px; color: #d94f00;
}
.pos-total-row.remaining { color: #c0392b; font-weight: 600; }

.pos-actions { display: flex; flex-direction: column; gap: 8px; }
.pos-actions button { width: 100%; }
.pos-actions .danger { color: #c0392b; border-color: #c0392b; }

.pos-payments { list-style: none; margin: 0; padding: 0; }
.pos-payments li {
    display: grid; grid-template-columns: 1fr auto auto;
    gap: 6px; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #f0f0f0;
}
.pos-payments li:last-child { border-bottom: 0; }
.pos-payments li small { display: block; color: var(--muted); font-size: 11px; }
.pos-payments .num { color: #2e7d32; font-weight: 600; }
.pos-payments strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.pos-modal[hidden] { display: none; }
.pos-modal-card {
    background: #fff; border-radius: 12px; padding: 20px;
    width: min(420px, calc(100% - 32px));
    display: flex; flex-direction: column; gap: 10px;
}
.pos-modal-card h3 { margin: 0 0 4px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state.small { padding: 18px; }

.muted { color: var(--muted); }
.link-button.danger { color: #c0392b; }

/* ===================== Kitchen Display ===================== */
.kitchen-stations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.kitchen-station-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: var(--brand-ink);
    min-height: 140px;
    transition: all .15s;
}
.kitchen-station-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: #4a90e2; }
.kitchen-station-card h2 { margin: 0; font-size: 16px; }
.kitchen-station-card.has-pending { border-color: #f0c060; background: #fff8e6; }
.kitchen-station-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.kitchen-station-meta .big { font-size: 36px; font-weight: 700; color: #d94f00; line-height: 1; }
.kitchen-station-meta .lbl { font-size: 12px; color: var(--muted); }
.kitchen-station-meta.sub { font-size: 12px; color: var(--muted); margin-top: auto; }

.kitchen-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}
.kitchen-toolbar-meta {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
}
.kitchen-toolbar-meta .separator { color: #ccc; }
.kitchen-status-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: #999;
}
.kitchen-status-dot.ok { background: #2e7d32; }
.kitchen-status-dot.warn { background: #f0c060; }
.kitchen-status-dot.err { background: #c0392b; }

.kitchen-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    padding: 4px 0 30px;
}

.kitchen-ticket {
    background: #fffbeb;
    border: 2px solid #f0c060;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: kitchen-pop .35s ease-out;
}
@keyframes kitchen-pop {
    from { transform: scale(.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.kitchen-ticket-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 10px 12px;
    background: #f8d77a;
    border-bottom: 1px solid #e0b855;
}
.kitchen-ticket-head strong { font-size: 18px; color: var(--brand-ink); display: block; }
.kitchen-ticket-head small { color: #6b5a20; font-size: 12px; }
.kitchen-ticket-meta { text-align: right; }
.kitchen-ticket-meta .time { display: block; font-weight: 600; }
.kitchen-ticket-meta .elapsed { display: block; font-size: 11px; color: #6b5a20; }

.kitchen-ticket-lines { list-style: none; margin: 0; padding: 0; }
.kitchen-ticket-lines li {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f5e4b3;
    background: #fffdf5;
}
.kitchen-ticket-lines li:last-child { border-bottom: 0; }
.kitchen-ticket-lines li.line-ready { background: #e7f8eb; }
.kitchen-ticket-lines li .qty {
    background: #d94f00; color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
}
.kitchen-ticket-lines li .info strong { font-size: 15px; }
.kitchen-ticket-lines li .info small { display: block; color: #888; font-size: 11px; font-style: italic; }
.kitchen-ticket-lines li .actions button { white-space: nowrap; }

.kitchen-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.kitchen-empty-icon { font-size: 64px; opacity: .4; }
.kitchen-empty h2 { margin: 12px 0 4px; color: var(--muted); font-weight: 500; }

/* Display QR controls trên POS edit */
.display-qr-group {
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px;
    background: #f0f4ff;
    border: 1px solid #c8d4ee;
    border-radius: 6px;
}
.display-qr-group select { font-size: 12px; padding: 4px 6px; }

/* Spa specific */
.pos-table.spa-room.pos-table-free { background: #f3eafe; border-color: #b691f0; }
.pos-table.spa-room.pos-table-occupied { background: #ffeef5; border-color: #f08fbb; }
.spa-lines-table th, .spa-lines-table td { padding: 4px 6px; font-size: 12px; }
.spa-lines-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spa-lines-title-row h3 { margin: 0; }
.spa-full-toggle { white-space: nowrap; }
.spa-lines-table .spa-full-col,
.pos-edit .spa-order-full-block,
.pos-edit .spa-order-tax-block { display: none; }
.pos-edit.spa-show-full .spa-lines-table .spa-full-col { display: table-cell; }
.pos-edit.spa-show-full .spa-order-full-block { display: flex; }
.pos-edit.spa-show-full .spa-order-tax-block { display: block; }
.spa-lines-table .spa-aggregate-row th {
    background: #eef8fc;
    color: #0f4c68;
    font-weight: 700;
    border-bottom: 1px solid #cfe8f2;
}
.spa-lines-table .qty,
.spa-lines-table .price,
.spa-lines-table .discount,
.spa-lines-table .discount-percent,
.spa-lines-table .discount-amount,
.spa-lines-table .tax-percent {
    min-width: 82px;
    width: 92px;
    text-align: right;
}
.spa-lines-table .tax-percent { width: 72px; min-width: 68px; }
.spa-lines-table .discount,
.spa-lines-table .discount-amount { width: 96px; min-width: 90px; }
.spa-lines-table .station-name {
    width: 82px;
    max-width: 82px;
    min-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-edit.spa-show-full .spa-lines-table th:nth-child(2),
.pos-edit.spa-show-full .spa-lines-table td:nth-child(2) {
    min-width: 210px;
}
.pos-edit.spa-show-full .spa-lines-table .qty,
.pos-edit.spa-show-full .spa-lines-table .discount-percent,
.pos-edit.spa-show-full .spa-lines-table .tax-percent {
    width: 62px;
    min-width: 58px;
    padding-left: 4px;
    padding-right: 4px;
}
.pos-edit.spa-show-full .spa-lines-table .discount,
.pos-edit.spa-show-full .spa-lines-table .discount-amount {
    width: 78px;
    min-width: 72px;
    padding-left: 4px;
    padding-right: 4px;
}
.pos-edit.spa-show-full .spa-lines-table .station-name {
    width: 88px;
    max-width: 88px;
    min-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-edit.spa-show-full .spa-lines-table .line-status {
    display: inline-block;
    min-width: 88px;
    text-align: center;
}
.spa-lines-table .therapist-sel { font-size: 11px; padding: 2px 4px; min-width: 100px; }
.spa-lines-table .service-time { font-size: 10px; color: #666; }
.spa-lines-table .service-time small { display: block; }
.spa-lines-table .actions-cell { white-space: nowrap; }
.spa-lines-table .start-line { color: #2e7d32; font-size: 16px; }
.spa-lines-table .complete-line { color: #1d4ed8; font-size: 16px; }
.line-status.status-inprogress { background: #fff4d6; color: #b76e00; }
.line-status.status-completed { background: #e7f8eb; color: #2e7d32; }
.spa-product-total-row {
    font-weight: 700;
}
.spa-charge-row {
    align-items: center;
    gap: 8px;
}
.spa-charge-row .order-charge-input {
    width: 120px;
    text-align: right;
    padding: 5px 7px;
}
.spa-top-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.spa-top-actions .compact {
    width: 100%;
    justify-content: center;
}

/* ===================== Realtime Orders Dashboard ===================== */
.rt-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0 30px;
}

.rt-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.rt-filters {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.rt-filters label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.rt-filters label span { opacity: .9; }
.rt-filters select { font-size: 13px; padding: 5px 8px; }

.rt-clock {
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
    text-align: right;
}
.rt-date { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
.rt-time { font-size: 28px; font-weight: 700; letter-spacing: 1px; line-height: 1; font-variant-numeric: tabular-nums; }
.rt-conn { display: flex; gap: 5px; align-items: center; font-size: 11px; opacity: .9; margin-top: 4px; }
.rt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #888; }
.rt-dot.ok { background: #10b981; }
.rt-dot.warn { background: #f59e0b; }
.rt-dot.err { background: #ef4444; }
.rt-trigger { font-style: italic; opacity: .85; transition: opacity .3s; }
.rt-trigger.pulse { opacity: 1; color: #fbbf24; animation: rt-pulse .8s ease-out; }
@keyframes rt-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }

.rt-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 640px) { .rt-kpis { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 1024px) { .rt-kpis { grid-template-columns: repeat(6, 1fr); } }

.rt-kpi {
    padding: 14px 12px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border-left: 4px solid #999;
    transition: transform .2s;
}
.rt-kpi-total    { border-left-color: #3b82f6; }
.rt-kpi-serving  { border-left-color: #f59e0b; background: #fff7e6; }
.rt-kpi-completed{ border-left-color: #10b981; background: #ecfdf5; }
.rt-kpi-revenue  { border-left-color: #dc2626; }
.rt-kpi-avg      { border-left-color: #a855f7; }
.rt-kpi-time     { border-left-color: #06b6d4; }

.rt-kpi-label { font-size: 11px; color: #666; margin-bottom: 4px; text-transform: uppercase; }
.rt-kpi-value {
    font-size: 28px; font-weight: 700; color: #111; line-height: 1;
    font-variant-numeric: tabular-nums;
}
@media (min-width: 640px) { .rt-kpi-value { font-size: 32px; } }
.rt-kpi-sub { font-size: 12px; color: #666; margin-top: 4px; }
.rt-kpi-sub span { color: #111; font-weight: 600; }

.rt-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 900px) { .rt-charts { grid-template-columns: 1.4fr 1fr; } }

.rt-chart-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex; flex-direction: column;
}
.rt-chart-card h3 { margin: 0 0 8px; font-size: 14px; color: #1d4ed8; }
.rt-chart-wrap {
    position: relative;
    height: 240px;
    width: 100%;
}
@media (min-width: 640px) { .rt-chart-wrap { height: 280px; } }
@media (min-width: 1024px) { .rt-chart-wrap { height: 320px; } }

/* ServiceLocations card */
.sl-status-badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.sl-status-badge.sl-status-free { background: #e7f8eb; color: #2e7d32; }
.sl-status-badge.sl-status-occupied { background: #fff4d6; color: #b76e00; }
.sl-status-badge.sl-status-reserved { background: #eef4ff; color: #1d4ed8; }
.sl-status-badge.sl-status-cleaning { background: #f0f0f0; color: #666; }
.sl-status-badge.sl-status-maintenance { background: #fbe7e7; color: #c0392b; }
.sl-card.sl-status-occupied { border-color: #f0c060; }
.sl-card.sl-status-maintenance { opacity: .85; }

/* BankAccounts */
.ba-card.ba-default { border-color: #f0c060; box-shadow: 0 2px 6px rgba(240,192,96,.2); }
.ba-default-badge {
    margin-left: auto;
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    background: #fff3c4; color: #b76e00;
}
.ba-account-num { font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace; letter-spacing: 0.5px; }
.ba-card.ba-type-cash    { border-left: 4px solid #10b981; }
.ba-card.ba-type-bank    { border-left: 4px solid #1d4ed8; }
.ba-card.ba-type-card    { border-left: 4px solid #a855f7; }
.ba-card.ba-type-ewallet { border-left: 4px solid #f59e0b; }

/* MasterConfigs */
.mc-admin-filters {
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(120px, .9fr) 110px max-content;
}
.mc-table th, .mc-table td { padding: 6px 8px; font-size: 12px; vertical-align: middle; }
.mc-table .row-inactive { opacity: .55; }
.mc-table .mc-config-type {
    font-weight: 600; color: #1d4ed8;
    background: #eef4ff; padding: 2px 8px; border-radius: 8px;
    font-size: 11px;
}
.mc-table .mc-input-value {
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    background: #f7f7f7; padding: 2px 6px; border-radius: 4px;
    font-size: 11px; max-width: 320px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-table .mc-vartype {
    padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600;
    text-transform: uppercase;
}
.mc-table .mc-vartype-text { background: #eef4ff; color: #1d4ed8; }
.mc-table .mc-vartype-bool { background: #e7f8eb; color: #2e7d32; }
.mc-table .mc-vartype-number { background: #fff4d6; color: #b76e00; }
.mc-table .mc-vartype-json { background: #fbe7e7; color: #c0392b; }
.status-pill {
    padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.status-pill.on { background: #e7f8eb; color: #2e7d32; }
.status-pill.off { background: #f0f0f0; color: #999; }

/* Đảm bảo nút Hủy (link-button) đủ cao trên mobile để chạm/thấy */
.form-actions .link-button,
.form-actions a.secondary-button {
    min-height: 40px;
    line-height: 1.2;
    padding: 8px 14px;
}
@media (max-width: 780px) {
    .form-actions .link-button,
    .form-actions a.secondary-button {
        min-height: 44px;        /* touch target chuẩn iOS/Android */
        font-size: 14px;
    }
}

/* MasterConfigs card grid */
.mc-card-grid { gap: 12px; }
.mc-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px;
}
.mc-card.mc-inactive { opacity: .55; }
.mc-card .category-card-head {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.mc-card .mc-var-name {
    margin: 4px 0 0; font-size: 17px;
    word-break: break-word;
}
.mc-input-value-block {
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    background: #f5f7fa; border-radius: 6px;
    padding: 8px 10px; font-size: 12px;
    color: #333;
    word-break: break-all;
    line-height: 1.4;
    border: 1px solid #e3e8ef;
    max-height: 120px; overflow-y: auto;
}
.mc-card-meta {
    margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px; font-size: 12px;
}
@media (max-width: 480px) { .mc-card-meta { grid-template-columns: 1fr; } }
.mc-card-meta div { display: flex; justify-content: space-between; gap: 8px; }
.mc-card-meta dt { color: #666; font-weight: 400; }
.mc-card-meta dd { margin: 0; color: #111; font-weight: 500; word-break: break-word; text-align: right; }
.mc-card .card-actions { margin-top: 6px; }

/* MasterConfigs filter — auto wrap nice trên mobile, mỗi cái 1 hàng */
@media (max-width: 780px) {
    .mc-admin-filters {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .mc-admin-filters .partner-filter-actions { width: 100%; }
    .mc-admin-filters .partner-filter-actions a { width: 100%; }
}

/* MasterConfig — đồng nhất với partner-card chuẩn */
.mc-card dd.mc-mono {
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    word-break: break-all;
}

/* BankAccounts filter mobile-first — mỗi filter 1 hàng + nút Thêm full width */
@media (max-width: 780px) {
    .ba-admin-filters,
    .ba-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .ba-admin-filters .partner-filter-actions { width: 100%; }
    .ba-admin-filters .partner-filter-actions a { width: 100%; }
}

/* ServiceLocations filter mobile-first — mỗi filter 1 hàng + nút Thêm full width */
@media (max-width: 780px) {
    .sl-admin-filters,
    .sl-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .sl-admin-filters .partner-filter-actions { width: 100%; }
    .sl-admin-filters .partner-filter-actions a { width: 100%; }
}

/* Items + Employees filter mobile-first
   - Mỗi filter 1 hàng (1fr)
   - 3 nút Thêm / Tải lên / Tải về vẫn trên cùng 1 hàng (flex equal width) */
@media (max-width: 780px) {
    .item-admin-filters,
    .item-admin-filters.has-tenant-filter,
    .item-admin-filters.no-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .item-filter-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .item-filter-actions .category-action-button {
        width: auto;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
        white-space: nowrap;
    }
    .item-advanced-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Stores filter + cards */
.st-admin-filters {
    grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(110px, .7fr) minmax(120px, .8fr);
}
.st-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(110px, .7fr) minmax(120px, .8fr);
}
.st-admin-filters .partner-filter-actions {
    grid-template-columns: 1fr;
}
@media (max-width: 780px) {
    .st-admin-filters,
    .st-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .st-admin-filters .partner-filter-actions { width: 100%; }
    .st-admin-filters .partner-filter-actions a { width: 100%; }
}

.st-card.st-type-main    { border-left: 4px solid #1d4ed8; }
.st-card.st-type-bar     { border-left: 4px solid #a855f7; }
.st-card.st-type-kitchen { border-left: 4px solid #dc2626; }
.st-card.st-type-spa     { border-left: 4px solid #ec4899; }
.st-card.st-type-retail  { border-left: 4px solid #10b981; }
.st-card.st-type-transit { border-left: 4px solid #f59e0b; }

.st-flag {
    display: inline-block;
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    margin-right: 4px; margin-top: 2px;
}
.st-flag-inv      { background: #e7f8eb; color: #2e7d32; }
.st-flag-delivery { background: #eef4ff; color: #1d4ed8; }
.st-flag-offer    { background: #fff4d6; color: #b76e00; }

/* Currencies filter + cards */
.cur-admin-filters {
    grid-template-columns: minmax(220px, 1.8fr) minmax(160px, 1fr) minmax(120px, .8fr) minmax(120px, .8fr);
}
.cur-admin-filters .partner-filter-actions {
    grid-template-columns: 1fr;
}
@media (max-width: 780px) {
    .cur-admin-filters {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .cur-admin-filters .partner-filter-actions { width: 100%; }
    .cur-admin-filters .partner-filter-actions a { width: 100%; }
}

.cur-card { border-left: 4px solid #0ea5e9; }
.cur-card.is-base { border-left-color: #f59e0b; background: linear-gradient(180deg, #fffaf0 0%, #ffffff 60%); }
.cur-card .cur-symbol {
    display: inline-block;
    margin-left: 6px;
    padding: 0 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}
.cur-card .badge.base-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}
.cur-card .cur-rate { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Sales Orders (/sales-orders) */
.so-admin-filters {
    /* Search | OrderDate | Cashier | Status | Branch | [Add] */
    grid-template-columns: minmax(180px, 1.4fr) 140px minmax(140px, 1fr) 130px minmax(140px, 1fr) max-content;
}
.so-admin-filters.has-tenant-filter {
    /* Search | OrderDate | Cashier | Status | Branch | Tenant | [Add] */
    grid-template-columns: minmax(160px, 1.2fr) 140px minmax(140px, 1fr) 130px minmax(140px, 1fr) minmax(140px, 1fr) max-content;
}

/* /sales-details — Report UI */
.sd-admin-filters {
    grid-template-columns: minmax(180px, 1.6fr) 130px 130px minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 130px 130px 130px 130px;
}
.sd-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(160px, 1.4fr) 130px 130px minmax(130px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 130px 130px 130px 130px;
}
@media (max-width: 780px) {
    .sd-admin-filters, .sd-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Summary cards */
.sd-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px; margin: 12px 0;
}
.sd-summary .sd-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 12px 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.sd-summary .sd-card.primary { border-color: #0ea5e9; background: linear-gradient(180deg, #f0f9ff 0%, #fff 60%); }
.sd-summary .sd-card .lbl { font-size: 11px; color: #64748b; text-transform: uppercase; font-weight: 600; }
.sd-summary .sd-card .val { font-size: 22px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; margin: 4px 0; }
.sd-summary .sd-card .sub { font-size: 11px; color: #64748b; }

/* View mode toggle */
.sd-view-toggle {
    display: flex; gap: 6px; align-items: center;
    margin: 16px 0 12px; flex-wrap: wrap;
}
.sd-toggle-btn {
    padding: 6px 14px; border-radius: 6px;
    background: #f1f5f9; color: #475569; text-decoration: none;
    font-size: 13px; font-weight: 600; border: 1px solid #e2e8f0;
}
.sd-toggle-btn.active { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.sd-result-count { margin-left: auto; font-size: 12px; color: #64748b; }

/* Header card mode */
.sd-card-order { border-left: 4px solid #0ea5e9; }
.sd-card-order.is-return { border-left-color: #dc2626; background: linear-gradient(180deg, #fef2f2 0%, #fff 60%); }
.sd-card-order .sd-return-badge {
    display: inline-block; padding: 2px 8px; margin-left: 6px;
    background: #fee2e2; color: #b91c1c; border-radius: 10px;
    font-size: 11px; font-weight: 700;
}
.sd-card-order .sd-total { font-weight: 700; color: #0f172a; }
.sd-card-order .sd-total.negative { color: #dc2626; }
.sd-card-order .sd-remain { color: #dc2626; font-weight: 600; }

/* Line view — table desktop, cards mobile */
.sd-line-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 8px;
    overflow: hidden;
}
.sd-line-table th, .sd-line-table td {
    padding: 8px 10px; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.sd-line-table th { background: #f8fafc; font-weight: 600; color: #475569; text-align: left; }
.sd-line-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sd-line-table tr.is-return { background: #fef2f2; }
.sd-line-table .negative { color: #dc2626; font-weight: 600; }
.sd-line-table .sd-return-badge {
    background: #fee2e2; color: #b91c1c; padding: 1px 6px;
    border-radius: 8px; font-size: 11px; font-weight: 700; margin-left: 4px;
}
.sd-line-cards { display: none; }

@media (max-width: 980px) {
    .sd-line-table { display: none; }
    .sd-line-cards { display: grid; gap: 8px; }
    .sd-line-card {
        background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
        padding: 10px 12px; border-left: 4px solid #0ea5e9;
    }
    .sd-line-card.is-return { border-left-color: #dc2626; background: linear-gradient(180deg, #fef2f2 0%, #fff 60%); }
    .sd-line-card .head { display: flex; gap: 6px; align-items: center; font-size: 13px; }
    .sd-line-card .head .date { margin-left: auto; color: #64748b; font-size: 12px; }
    .sd-line-card .sd-return-badge { background: #fee2e2; color: #b91c1c; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
    .sd-line-card .body .item-name { font-weight: 600; margin: 4px 0; }
    .sd-line-card .body .item-name small { color: #64748b; font-weight: 400; }
    .sd-line-card .body .meta { display: flex; gap: 8px; font-size: 13px; align-items: center; flex-wrap: wrap; }
    .sd-line-card .body .meta .total { margin-left: auto; font-weight: 700; }
    .sd-line-card .body .meta .total.negative { color: #dc2626; }
    .sd-line-card .body .foot { font-size: 11px; color: #64748b; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
}

/* /sales-reports — Light pivot + charts */
.sr-admin-filters {
    grid-template-columns: 130px 130px minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) 130px 130px 130px 130px;
}
.sr-admin-filters.has-tenant-filter {
    grid-template-columns: 130px 130px minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) 130px 130px 130px 130px;
}
@media (max-width: 780px) {
    .sr-admin-filters, .sr-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.sr-charts {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 12px; margin: 16px 0;
}
@media (max-width: 980px) {
    .sr-charts { grid-template-columns: 1fr; }
}
.sr-chart-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 12px 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
    min-height: 250px;
}
.sr-chart-card h4 { margin: 0 0 8px 0; font-size: 14px; color: #475569; }
.sr-chart-trend canvas { max-height: 250px; }
.sr-chart-topItems canvas, .sr-chart-topBranches canvas { max-height: 250px; }

.sr-pivot-wrap { margin-top: 16px; }
.sr-pivot-title { font-size: 16px; margin: 0 0 8px 0; color: #0f172a; }
.sr-pivot-title small { font-weight: 400; color: #64748b; font-size: 13px; margin-left: 8px; }
.sr-pivot-table-wrap {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    overflow-x: auto; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.sr-pivot-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    min-width: 600px;
}
.sr-pivot-table th, .sr-pivot-table td {
    padding: 8px 10px; border-bottom: 1px solid #f1f5f9;
}
.sr-pivot-table thead th {
    background: #f8fafc; font-weight: 600; color: #475569;
    position: sticky; top: 0; z-index: 2;
}
.sr-pivot-table tfoot td {
    background: #f8fafc; font-weight: 700; color: #0f172a;
}
.sr-pivot-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-pivot-row-head, .sr-pivot-row-label {
    background: #f8fafc; font-weight: 600; position: sticky; left: 0; z-index: 1;
}
.sr-pivot-row-total, .sr-pivot-total-head, .sr-pivot-grand {
    background: #f0f9ff; font-weight: 700; color: #0c4a6e;
}
.sr-pivot-grand { background: #0ea5e9; color: #fff; font-size: 14px; }

/* /targets — KPI input */
.tg-admin-filters {
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) 130px 140px max-content;
}
.tg-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) 130px 140px max-content;
}
@media (max-width: 780px) {
    .tg-admin-filters, .tg-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr; gap: 8px;
    }
    .tg-admin-filters .partner-filter-actions { width: 100%; }
    .tg-admin-filters .partner-filter-actions a { width: 100%; }
}

.tg-batch-form {
    margin: 12px 0; padding: 10px 14px;
    background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px;
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.tg-batch-form small { color: #475569; font-size: 12px; }

.tg-card { border-left: 4px solid #94a3b8; }
.tg-card.achievement-ok { border-left-color: #10b981; }
.tg-card.achievement-warn { border-left-color: #f59e0b; }
.tg-card.achievement-bad { border-left-color: #dc2626; }
.tg-card.achievement-neutral { border-left-color: #64748b; }
.tg-card-head-stack {
    align-items: center;
}
.tg-title-block {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.tg-title-block strong {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.2;
    white-space: normal;
}
.tg-period-badge {
    flex: 0 0 auto;
    background: #f1f5f9; color: #475569;
    padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.tg-achievement {
    margin-left: 8px; font-weight: 700; font-size: 14px;
    padding: 2px 8px; border-radius: 6px;
}
.tg-achievement-ok { background: #dcfce7; color: #15803d; }
.tg-achievement-warn { background: #fef3c7; color: #92400e; }
.tg-achievement-bad { background: #fee2e2; color: #b91c1c; }
.tg-achievement-neutral { background: #f1f5f9; color: #475569; }
.tg-actual { font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }

.tg-progress { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; margin: 6px 0 10px; }
.tg-progress-bar { height: 100%; border-radius: 3px; transition: width .3s; }
.tg-progress-bar.tg-progress-ok { background: #10b981; }
.tg-progress-bar.tg-progress-warn { background: #f59e0b; }
.tg-progress-bar.tg-progress-bad { background: #dc2626; }
.tg-progress-bar.tg-progress-neutral { background: #94a3b8; }

.tg-card code {
    background: #f1f5f9; padding: 1px 6px; border-radius: 4px;
    font-size: 11px; color: #475569;
}
.inline-form { display: inline; margin: 0; }
.link-button.danger { color: #dc2626; font-size: 18px; padding: 0 6px; }

/* /kpis — Mobile-first KPI dashboard */
.kp-admin-filters {
    grid-template-columns: minmax(140px, 1fr) 130px 140px;
}
.kp-admin-filters.has-tenant-filter {
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 130px 140px;
}
@media (max-width: 780px) {
    .kp-admin-filters, .kp-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr; gap: 8px;
    }
}

.kp-cards {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    margin-top: 16px;
}
@media (max-width: 600px) {
    .kp-cards { grid-template-columns: 1fr; gap: 10px; }
}

.kp-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 16px; box-shadow: 0 2px 6px rgba(15,23,42,.06);
    border-left: 5px solid #94a3b8;
    display: flex; flex-direction: column; gap: 10px;
}
.kp-card.achievement-ok { border-left-color: #10b981; }
.kp-card.achievement-warn { border-left-color: #f59e0b; }
.kp-card.achievement-bad { border-left-color: #dc2626; }
.kp-card.achievement-neutral { border-left-color: #94a3b8; }

.kp-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.kp-card-head h3 { margin: 0; font-size: 15px; color: #0f172a; }
.kp-period { font-size: 12px; color: #64748b; padding: 2px 8px; background: #f1f5f9; border-radius: 10px; }

.kp-main { margin: 6px 0; }
.kp-current { font-weight: 700; }
.kp-num { font-size: 28px; color: #0f172a; font-variant-numeric: tabular-nums; }
.kp-unit { font-size: 14px; color: #64748b; margin-left: 4px; }
.kp-target-info { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.kp-target-info small { color: #64748b; }
.kp-achievement {
    font-weight: 700; padding: 2px 10px; border-radius: 6px;
    font-size: 13px;
}
.kp-achievement-ok { background: #dcfce7; color: #15803d; }
.kp-achievement-warn { background: #fef3c7; color: #92400e; }
.kp-achievement-bad { background: #fee2e2; color: #b91c1c; }
.kp-achievement-neutral { background: #f1f5f9; color: #475569; }

.kp-progress { height: 8px; background: #f1f5f9; border-radius: 4px; margin: 6px 0 0; overflow: hidden; }
.kp-progress-bar { height: 100%; border-radius: 4px; transition: width .3s; }
.kp-progress-bar.kp-progress-ok { background: #10b981; }
.kp-progress-bar.kp-progress-warn { background: #f59e0b; }
.kp-progress-bar.kp-progress-bad { background: #dc2626; }
.kp-progress-bar.kp-progress-neutral { background: #94a3b8; }

.kp-compare { display: flex; gap: 8px; flex-wrap: wrap; }
.kp-cmp-chip {
    flex: 1; min-width: 110px;
    padding: 8px 10px; border-radius: 8px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    display: flex; flex-direction: column; gap: 2px;
}
.kp-cmp-chip .lbl { font-size: 10px; color: #64748b; text-transform: uppercase; font-weight: 600; }
.kp-cmp-chip .val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kp-cmp-chip small { color: #94a3b8; font-size: 11px; }
.kp-cmp-up .val { color: #15803d; }
.kp-cmp-up { border-color: #86efac; background: #f0fdf4; }
.kp-cmp-down .val { color: #b91c1c; }
.kp-cmp-down { border-color: #fca5a5; background: #fef2f2; }
.kp-cmp-neutral .val { color: #475569; }

.kp-sparkline { height: 56px; margin: 4px 0; }
.kp-spark-canvas { height: 56px !important; max-height: 56px; }

.kp-tops { display: grid; gap: 10px; }
.kp-top-section h4 { margin: 0 0 6px 0; font-size: 12px; color: #475569; font-weight: 600; }
.kp-top-section ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.kp-top-section li {
    display: grid; grid-template-columns: minmax(70px, 1fr) minmax(40px, 80px) auto;
    align-items: center; gap: 8px;
    font-size: 12px;
}
.kp-top-label { color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-top-bar {
    height: 8px; background: #f1f5f9; border-radius: 4px; position: relative; overflow: hidden;
}
.kp-top-bar > span {
    display: block; height: 100%; background: #0ea5e9; border-radius: 4px;
    transition: width .3s;
}
.kp-top-val { color: #64748b; font-variant-numeric: tabular-nums; text-align: right; font-size: 11px; }

.kp-rule { margin-top: 4px; color: #94a3b8; }
.kp-rule code {
    background: #f1f5f9; padding: 1px 6px; border-radius: 3px;
    font-size: 10px; color: #475569;
}

/* Placeholder "coming soon" pages */
.placeholder-card {
    max-width: 520px; margin: 48px auto;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 32px 24px; text-align: center;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.placeholder-icon { display: flex; justify-content: center; margin-bottom: 16px; }
.placeholder-title { font-size: 22px; margin: 0 0 8px 0; color: #0f172a; }
.placeholder-text { color: #475569; margin: 0 0 24px 0; line-height: 1.5; }
.placeholder-card .secondary-button { display: inline-block; }
@media (max-width: 780px) {
    .so-admin-filters, .so-admin-filters.has-tenant-filter {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .so-admin-filters .partner-filter-actions { width: 100%; }
    .so-admin-filters .partner-filter-actions a,
    .so-admin-filters .partner-filter-actions button { width: 100%; }
}

.sales-card { border-left: 4px solid #0ea5e9; }
.sales-card.status-draft     { border-left-color: #94a3b8; }
.sales-card.status-reserved  { border-left-color: #1d4ed8; background: linear-gradient(180deg, #eef4ff 0%, #fff 64%); }
.sales-card.status-open      { border-left-color: #0ea5e9; }
.sales-card.status-served    { border-left-color: #6366f1; }
.sales-card.status-paid      { border-left-color: #10b981; background: linear-gradient(180deg, #f0fdf4 0%, #fff 60%); }
.sales-card.status-closed    { border-left-color: #16a34a; }
.sales-card.status-cancelled { border-left-color: #dc2626; opacity: .7; }
.sales-card .sales-total  { font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.sales-card .sales-remain { font-weight: 700; color: #dc2626; font-variant-numeric: tabular-nums; }

.sales-return-edit .sr-currency-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    color: #475569;
}

.sales-return-edit .sr-pay-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
    gap: 8px;
    align-items: center;
}

.sales-return-edit .pay-amount {
    color: #dc2626;
    font-weight: 700;
    text-align: right;
}

.sales-return-edit .sr-print-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.sales-return-edit .sr-print-sizes {
    display: grid;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.sales-return-edit .sr-print-sizes button {
    border: 1px solid #d5e0ee;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-weight: 700;
    min-height: 38px;
    cursor: pointer;
}

.sales-return-edit .sr-aggregate th {
    background: #e8f7fb;
    color: #064e6b;
    font-weight: 700;
}

.sales-return-edit.so-edit-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.sales-return-edit .sr-left-panel {
    min-width: 0;
}

.sales-return-edit .sr-lines-card {
    margin-top: 12px;
}

.sales-return-edit .sr-line-wrap {
    overflow-x: auto;
}

.sales-return-edit .sr-item-grid {
    max-height: 300px;
}

.sales-return-edit .sr-summary-list {
    margin: 0 0 12px;
    padding: 14px;
    background: #fafbff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.sales-return-edit .sr-summary-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
    gap: 10px;
    align-items: center;
    padding: 4px 0;
}

.sales-return-edit .sr-summary-list dt {
    color: #0f172a;
    font-size: 13px;
}

.sales-return-edit .sr-summary-list dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sales-return-edit .sr-summary-list input {
    width: 130px;
    text-align: right;
}

.sales-return-edit .sr-summary-list .final {
    border-top: 1px dashed #cbd5e1;
    margin-top: 6px;
    padding-top: 8px;
    font-weight: 700;
    color: #d94f00;
}

.sales-return-edit .sr-summary-list .remaining {
    color: #c0392b;
    font-weight: 700;
}

.sales-return-edit .sr-print-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 74px;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.sales-return-edit .sr-print-now {
    justify-content: center;
    min-height: 34px;
    width: 74px;
    padding-left: 6px;
    padding-right: 6px;
    white-space: nowrap;
}

.sales-return-edit .sr-print-group .so-bill-size {
    width: 100%;
    min-width: 0;
}

.sales-return-edit .pos-actions button {
    width: 100%;
}

@media (max-width: 980px) {
    .sales-return-edit.so-edit-layout {
        grid-template-columns: 1fr;
    }
}

/* Edit layout */
.so-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 980px) {
    .so-edit-layout { grid-template-columns: 1fr; }
}
.so-edit-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.so-edit-header h3 { margin: 0; font-size: 16px; }
.so-edit-header small { color: #64748b; }
.so-status-pill.so-status-reserved { background: #eef4ff; color: #1d4ed8; }

.so-create-form {
    max-width: 980px;
}
.so-create-section + .so-create-section {
    margin-top: 14px;
}
.so-create-section h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #0f172a;
}
.so-create-mode {
    max-width: 360px;
}
.so-create-mode label {
    color: #0f172a;
    font-weight: 700;
}
.so-create-mode label:not(.active):hover {
    background: #eef8fc;
    color: var(--brand-ink);
}
.so-create-mode label.active {
    color: #fff;
}
.so-order-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.so-order-summary span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}
.so-order-summary strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 13px;
}
@media (max-width: 700px) {
    .so-order-summary { grid-template-columns: 1fr 1fr; }
}

.so-add-modes { display: grid; gap: 12px; }
.so-mode-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; background: #fff; }
.so-mode-card label > span { display: block; font-size: 12px; color: #475569; margin-bottom: 4px; font-weight: 600; }

/* Sticky barcode bar — luôn ở trên cùng panel trái, scroll vẫn thấy */
.so-barcode-sticky {
    position: sticky; top: 0; z-index: 20;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 10px; margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(15,23,42,.04);
}
.so-mode-tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.so-mode-tab {
    background: none; border: 0; padding: 6px 12px;
    color: #64748b; font-size: 13px; cursor: pointer;
    border-bottom: 2px solid transparent; font-weight: 600;
}
.so-mode-tab:hover { color: #0f172a; }
.so-mode-tab.active { color: #0ea5e9; border-bottom-color: #0ea5e9; }
.so-mode-pane[hidden] { display: none; }
.so-hint { color: #64748b; font-size: 11px; }
.so-image-filters {
    display: grid;
    grid-template-columns: minmax(160px, .75fr) minmax(220px, 1.25fr);
    gap: 8px;
    align-items: end;
}
.so-image-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}
@media (max-width: 640px) {
    .so-image-filters { grid-template-columns: 1fr; }
}

/* Collapsible sections */
.so-collapse { margin-bottom: 10px; }
.so-collapse > summary {
    cursor: pointer; font-weight: 700; font-size: 13px;
    padding: 6px 0; color: #334155;
    list-style: none;
}
.so-collapse > summary::before { content: '▸ '; transition: transform .15s; display: inline-block; }
.so-collapse[open] > summary::before { transform: rotate(90deg); }

/* Phone autocomplete (reuses .so-autocomplete-results positioning) */
.so-phone-wrap { position: relative; }
.so-phone-wrap > .so-autocomplete-results {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
    margin-top: 4px; max-height: 260px; overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
}
.so-customer-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.so-barcode-row { display: flex; gap: 8px; align-items: center; }
.so-barcode-row input { flex: 1; }
.so-barcode-status { font-size: 12px; min-width: 120px; }
.so-barcode-status.ok { color: #16a34a; }
.so-barcode-status.err { color: #dc2626; }

.so-autocomplete { position: relative; }
.so-autocomplete-results {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
    margin-top: 4px; max-height: 260px; overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
}
.so-search-item {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(78px, .42fr) minmax(72px, .34fr) minmax(86px, auto);
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 7px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.so-search-item:hover,
.so-search-item.selected {
    background: #e8f6fb;
}
.so-search-name {
    color: #07152a;
    font-weight: 800;
}
.so-search-name,
.so-search-code,
.so-search-unit {
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.so-search-code,
.so-search-unit {
    color: #64748b;
    font-size: 12px;
}
.so-search-price,
.so-search-item em {
    color: #0b7ea8;
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .so-search-item {
        grid-template-columns: minmax(120px, 1fr) minmax(62px, .36fr) minmax(58px, .28fr) minmax(74px, auto);
        gap: 6px;
        padding: 7px 8px;
    }
}

.item-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 8px;
    max-height: 60vh;
    overflow-y: auto;
}
.item-tile {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 6px; cursor: pointer; text-align: left;
    display: flex; flex-direction: column;
    transition: transform .08s, box-shadow .08s;
}
.item-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.08); border-color: #0ea5e9; }
.item-tile-img {
    width: 100%; aspect-ratio: 1 / 1;
    background-size: cover; background-position: center;
    background-color: #f8fafc;
    border-radius: 6px;
}
.item-tile-name { font-size: 12px; font-weight: 600; margin-top: 4px; line-height: 1.2; min-height: 28px; }
.item-tile-price { font-size: 12px; color: #0ea5e9; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Lines + payments */
.so-meta-row,
.so-customer-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; margin-bottom: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}
.so-customer-row { grid-template-columns: 1fr 1fr 1fr; }
.so-meta-row button,
.so-customer-row button { grid-column: 1 / -1; justify-self: end; }
.spa-order-info .so-meta-row,
.spa-order-info .so-customer-row {
    margin-bottom: 8px;
}
.spa-order-info .form-field {
    min-width: 0;
}
.spa-order-info .text-input {
    width: 100%;
}
.spa-order-info .so-customer-actions {
    padding-top: 2px;
}
.spa-order-info .spa-note-actions {
    grid-column: auto;
    align-self: end;
    justify-self: stretch;
    justify-content: flex-end;
    padding-top: 0;
}
@media (max-width: 600px) {
    .so-meta-row, .so-customer-row { grid-template-columns: 1fr; }
    .spa-order-info .spa-note-actions {
        justify-content: flex-start;
    }
}

.so-lines-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
}
.so-lines-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.so-lines-table th, .so-lines-table td { padding: 6px 4px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: middle; }
.so-lines-table th { background: #f8fafc; font-size: 12px; color: #475569; }
.so-lines-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.so-lines-table input.compact { padding: 4px 6px; width: 80px; }
.so-lines-table input.compact.num { text-align: right; }
.pos-edit.spa-show-full .so-lines-table input.compact {
    width: 70px;
}
.pos-edit.spa-show-full .so-lines-table .price {
    width: 82px;
}
.pos-edit.spa-show-full .so-lines-table .discount-amount {
    width: 82px;
}
.so-lines-table th:last-child,
.so-lines-table td:last-child {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
}
.so-line-del {
    color: #dc2626;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.so-line-unit { font-size: 12px; color: #475569; white-space: nowrap; }

.so-totals { margin-top: 12px; padding: 10px; background: #f8fafc; border-radius: 8px; }
.so-totals .row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.so-totals .row.grand { font-size: 16px; font-weight: 700; border-top: 1px solid #cbd5e1; padding-top: 6px; margin-top: 4px; }
.so-totals .row.remain strong { color: #dc2626; }

.so-payments { margin-top: 16px; }
.so-payments h4 { margin: 0 0 8px 0; font-size: 14px; }
.so-pay-row { display: grid; grid-template-columns: 120px 1fr 120px 1fr auto; gap: 6px; align-items: center; }
@media (max-width: 780px) { .so-pay-row { grid-template-columns: 1fr 1fr; } .so-pay-row button { grid-column: 1 / -1; } }

.spa-print-group {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 8px;
    align-items: center;
}
.spa-print-title {
    color: #0b789c;
    font-weight: 800;
    grid-column: 1 / -1;
}
.spa-print-option {
    justify-content: flex-start;
}
.spa-paper-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(46px, 1fr));
    gap: 6px;
    grid-column: 1 / -1;
}
.spa-paper-row .compact {
    justify-content: center;
    min-width: 0;
}
.spa-payment-card {
    width: 100%;
    margin: 4px 0;
}
.spa-pay-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.spa-pay-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    align-items: center;
}
.spa-pay-inline.spa-pay-amount {
    grid-template-columns: minmax(0, 1fr) auto;
}
.spa-pay-amount-input {
    color: #dc2626;
    font-weight: 800;
}
.spa-pay-confirm {
    width: 100%;
    justify-content: center;
}
.spa-payment-display-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.spa-payment-display-row .display-qr-group {
    margin: 0;
}
.spa-payment-display-row .spa-display-group {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}
.spa-payment-display-row .spa-qr-toggle {
    white-space: nowrap;
}
.spa-payment-display-row #btnOpenCustomerDisplay {
    width: 100%;
    justify-content: center;
}
.spa-pay-inline select,
.spa-pay-inline input {
    min-width: 0;
}

@media (max-width: 780px) {
    .spa-print-group {
        grid-template-columns: 1fr;
    }
    .spa-print-title,
    .spa-paper-row {
        grid-column: auto;
    }
    .spa-pay-inline {
        grid-template-columns: 1fr;
    }
}
.so-payments-list { list-style: none; padding: 0; margin: 8px 0 0 0; }
.so-payments-list li { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed #e2e8f0; }
.so-payments-list .pay-bank { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-payments-list .pay-amount { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.so-pay-del { color: #dc2626; font-size: 16px; }

.so-edit-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.so-print-group { display: inline-flex; gap: 4px; align-items: center; margin-right: auto; flex-wrap: wrap; }
.sales-order-print-group { flex-wrap: wrap; overflow-x: visible; max-width: 100%; row-gap: 8px; }
.sales-order-print-group .compact,
.sales-order-print-group .so-preview-toggle { flex: 0 0 auto; }
.sales-order-print-group .so-bill-size {
    width: 38px;
    min-width: 38px;
    padding-left: 6px;
    padding-right: 6px;
}
.so-print-label { font-size: 12px; color: #475569; font-weight: 600; }
.so-print-group #soPrintNow small { font-weight: 400; opacity: .85; margin-left: 4px; }

/* Split button "Phiếu Chế biến" + dropdown */
.so-kitchen-print { position: relative; display: inline-flex; gap: 1px; }
.so-kitchen-print > button.primary-button { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.so-kitchen-print > #soKitchenPrintToggle,
.so-kitchen-print > #orderKitchenPrintToggle { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 10px; }
.so-dropdown-menu {
    position: absolute; top: 100%; right: 0; margin-top: 4px; min-width: 240px;
    background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.12); z-index: 100;
    padding: 6px 0;
}
.so-dropdown-item {
    display: block; width: 100%; text-align: left;
    background: none; border: 0; padding: 8px 12px;
    cursor: pointer; font-size: 13px;
}
.so-dropdown-item:hover { background: #f1f5f9; }
.so-dropdown-item small { color: #64748b; font-weight: 400; }
.so-dropdown-sep {
    padding: 6px 12px 2px 12px; font-size: 11px; font-weight: 700;
    color: #94a3b8; text-transform: uppercase; border-top: 1px solid #f1f5f9; margin-top: 4px;
}

/* Checkbox "Xem trước" cạnh nút Phiếu Chế biến */
.so-preview-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 8px; padding: 4px 10px;
    background: #f1f5f9; border-radius: 6px;
    font-size: 13px; color: #475569; cursor: pointer;
    user-select: none;
}
.so-preview-toggle input { margin: 0; cursor: pointer; }

/* Panel preview hiển thị split kết quả */
.so-kitchen-preview {
    margin-top: 12px; padding: 12px;
    background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
}
.so-preview-group {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 10px 12px; margin-bottom: 10px;
}
.so-preview-group:last-child { margin-bottom: 0; }
.so-preview-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    border-bottom: 1px dashed #e2e8f0; padding-bottom: 6px; margin-bottom: 6px;
    font-size: 14px;
}
.so-preview-head small { color: #64748b; font-weight: 400; }
.so-preview-count {
    margin-left: auto; padding: 2px 10px;
    background: #ecfdf5; color: #15803d; border-radius: 12px;
    font-size: 12px; font-weight: 700;
}
.so-preview-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.so-preview-lines th, .so-preview-lines td { padding: 4px 6px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.so-preview-lines th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 12px; }
.so-preview-lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.so-preview-lines small { color: #94a3b8; font-style: italic; }
.so-preview-filter-note {
    background: #fef3c7; border-left: 3px solid #f59e0b;
    padding: 8px 10px; margin-bottom: 10px; border-radius: 4px;
    font-size: 12px; color: #92400e;
}
.so-preview-open {
    margin-left: 8px; padding: 2px 10px;
    background: #0ea5e9; color: #fff; border-radius: 12px;
    text-decoration: none; font-size: 12px; font-weight: 600;
}
.so-preview-open:hover { background: #0284c7; }
.so-setup-link { font-size: 13px; padding: 4px 8px; text-decoration: none; color: #475569; white-space: nowrap; }
.so-setup-link:hover { color: #0ea5e9; }

/* Print setup guide page */
.print-setup { max-width: 800px; margin: 0 auto; padding: 16px; }
.print-setup h3 { margin-top: 28px; }
.print-setup .setup-callout {
    padding: 14px 16px; border-radius: 8px;
    border-left: 4px solid #f59e0b; background: #fffbeb;
    margin: 12px 0;
}
.print-setup .setup-callout.warn { border-left-color: #f59e0b; background: #fffbeb; }
.print-setup .setup-callout.danger { border-left-color: #dc2626; background: #fef2f2; }
.print-setup .setup-callout.danger a { color: #dc2626; font-weight: 700; }
.print-setup .setup-callout p { margin: 6px 0 0 0; color: #475569; }
.print-setup details {
    margin: 10px 0; padding: 10px 14px;
    border: 1px solid #e2e8f0; border-radius: 8px; background: #fff;
}
.print-setup details summary { cursor: pointer; padding: 4px 0; font-weight: 600; }
.print-setup .setup-steps li { margin: 8px 0; line-height: 1.6; }
.print-setup .setup-code {
    background: #0f172a; color: #f1f5f9; padding: 10px 12px;
    border-radius: 6px; margin: 6px 0; overflow-x: auto;
    font-family: Consolas, Menlo, monospace; font-size: 12px;
    white-space: pre-wrap; word-break: break-all;
}
.print-setup kbd {
    background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
    border: 1px solid #cbd5e1; font-family: Consolas, monospace; font-size: 11px;
}
.print-setup .setup-tip {
    background: #ecfeff; border-left: 4px solid #0ea5e9;
    padding: 14px 16px; border-radius: 8px; margin: 14px 0;
}
.print-setup .setup-tip ol { margin: 8px 0 0 0; padding-left: 20px; }
.print-setup .setup-test-result {
    padding: 12px 16px; margin: 12px 0;
    border-radius: 8px; min-height: 20px; font-weight: 600;
}
.print-setup .setup-test-result.ok { background: #dcfce7; color: #15803d; border-left: 4px solid #16a34a; }
.print-setup .setup-test-result.warn { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.print-setup .setup-actions { margin-top: 24px; }
@media (max-width: 600px) {
    .so-print-group { width: 100%; margin: 0 0 8px 0; }
    .so-print-group .secondary-button { flex: 1; text-align: center; }
}
.so-status-pill {
    padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700;
    background: #e2e8f0; color: #0f172a;
}
.so-status-pill.so-status-draft { background: #f1f5f9; }
.so-status-pill.so-status-open { background: #e0f2fe; color: #0369a1; }
.so-status-pill.so-status-paid { background: #dcfce7; color: #15803d; }
.so-status-pill.so-status-closed { background: #d1fae5; color: #047857; }
.so-status-pill.so-status-cancelled { background: #fee2e2; color: #b91c1c; }

.empty-state.small p { font-size: 13px; color: #64748b; padding: 8px 0; }
/* Label cha (chỉ first-level span, không áp lên .required-marker hay span con khác)
   font-size 1rem = 16px = bằng font input (.text-input inherit body 16px) */
.form-field > span:first-child { display: block; font-size: 1rem; color: #344054; margin-bottom: 6px; font-weight: 500; }
.form-field > span:first-child .required-marker { display: inline; margin-left: 2px; font-weight: 400; }
.form-field { display: block; }

/* Audit logs */
.audit-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.audit-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    background: #f8fbff;
    width: fit-content;
}
.audit-tab {
    padding: 9px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: #0f4f71;
    font-weight: 700;
}
.audit-tab.active {
    background: #0aa0d0;
    color: #fff;
    box-shadow: 0 8px 18px rgba(10, 160, 208, .18);
}
.audit-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(160px, .7fr) minmax(150px, .6fr) minmax(150px, .6fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    background: #fff;
}
.audit-warning-filters {
    grid-template-columns: minmax(130px, .7fr) minmax(130px, .7fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(130px, .7fr) minmax(160px, auto);
}
.audit-user-filters {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.audit-user-filters .audit-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}
.audit-user-filters label:nth-of-type(5),
.audit-user-filters label:nth-of-type(7) {
    grid-column: span 2;
}
.audit-keyword-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.audit-keyword-actions label {
    min-width: 0;
}
.audit-user-filters .audit-filter-actions > * {
    min-width: 0;
    white-space: nowrap;
}
.audit-filters label span {
    display: block;
    margin-bottom: 5px;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
}
.audit-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.audit-panel {
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.audit-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5edf5;
    background: #f8fbff;
}
.audit-panel-head h2 {
    margin: 0;
    font-size: 18px;
    color: #0f3554;
}
.audit-panel-head span {
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
}
.audit-kpi-grid,
.audit-warning-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
}
.audit-warning-card {
    position: relative;
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    padding: 14px;
    background: linear-gradient(180deg, #fff, #f8fbff);
    min-height: 118px;
    box-shadow: 0 8px 18px rgba(15, 53, 84, .05);
    overflow: hidden;
}
.audit-warning-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #0aa0d0;
}
.audit-kpi-grid .audit-warning-card:nth-child(2)::before { background: #2563eb; }
.audit-kpi-grid .audit-warning-card:nth-child(3)::before { background: #16a34a; }
.audit-kpi-grid .audit-warning-card:nth-child(4)::before { background: #7c3aed; }
.audit-kpi-grid .audit-warning-card:nth-child(5)::before { background: #f97316; }
.audit-kpi-grid .audit-warning-card:nth-child(6)::before { background: #ef4444; }
.audit-kpi-grid .audit-warning-card:nth-child(2) strong { color: #1d4ed8; }
.audit-kpi-grid .audit-warning-card:nth-child(3) strong { color: #15803d; }
.audit-kpi-grid .audit-warning-card:nth-child(4) strong { color: #6d28d9; }
.audit-kpi-grid .audit-warning-card:nth-child(5) strong { color: #c2410c; }
.audit-kpi-grid .audit-warning-card:nth-child(6) strong { color: #b91c1c; }
.audit-warning-card span,
.audit-warning-card small {
    display: block;
    color: #64748b;
    font-weight: 600;
}
.audit-warning-card strong {
    display: block;
    margin: 8px 0;
    color: #0f3554;
    font-size: 26px;
    line-height: 1.1;
}
.audit-warning-card.audit-warning-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}
.audit-warning-card.audit-warning-warning::before {
    background: #f59e0b;
}
.audit-warning-card.audit-warning-good strong {
    color: #15803d;
}
.audit-warning-card.audit-warning-good::before {
    background: #16a34a;
}
.audit-warning-card.audit-warning-critical {
    border-color: #ef4444;
    background: #fff1f2;
}
.audit-warning-card.audit-warning-critical::before {
    background: #ef4444;
}
.audit-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 14px;
    padding: 0 16px 16px;
}
.audit-chart-card {
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 53, 84, .04);
}
.audit-chart-wide {
    grid-column: span 2;
}
.audit-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.audit-chart-head h3,
.audit-recommendations h3 {
    margin: 0;
    color: #0f3554;
    font-size: 16px;
    font-weight: 800;
}
.audit-chart-head span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}
.audit-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding: 10px 0 0;
    border-bottom: 1px solid #d9e6f2;
}
.audit-daily-bar {
    display: flex;
    flex: 1;
    min-width: 6px;
    height: 100%;
    align-items: flex-end;
    position: relative;
}
.audit-daily-bar > span {
    display: block;
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #0aa0d0, #0f4f71);
}
.audit-daily-bar > small {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #64748b;
}
.audit-chart-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}
.audit-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.audit-dot-info { background: #0aa0d0; }
.audit-dot-warning { background: #f59e0b; }
.audit-dot-critical { background: #ef4444; }
.audit-dimension-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.audit-dimension-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    color: #0f3554;
}
.audit-dimension-label strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f2937;
    font-weight: 700;
}
.audit-dimension-label span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.audit-dimension-track {
    height: 8px;
    border-radius: 999px;
    background: #eaf2f8;
    overflow: hidden;
}
.audit-dimension-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0aa0d0;
}
.audit-dimension-row:nth-child(2n) .audit-dimension-track span { background: #16a34a; }
.audit-dimension-row:nth-child(3n) .audit-dimension-track span { background: #f59e0b; }
.audit-dimension-row:nth-child(4n) .audit-dimension-track span { background: #7c3aed; }
.audit-dimension-row:nth-child(5n) .audit-dimension-track span { background: #ef4444; }
.audit-crosstab-card {
    margin: 0 16px 16px;
}
.audit-crosstab-table {
    min-width: 980px;
}
.audit-number {
    text-align: right !important;
    white-space: nowrap;
}
.audit-warning-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.audit-warning-pill-good {
    background: #dcfce7;
    color: #15803d;
}
.audit-warning-pill-info {
    background: #e0f2fe;
    color: #0369a1;
}
.audit-warning-pill-warning {
    background: #fef3c7;
    color: #92400e;
}
.audit-warning-pill-critical {
    background: #fee2e2;
    color: #b91c1c;
}
.audit-recommendations {
    margin: 0 16px 16px;
    padding: 14px 16px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
}
.audit-recommendations ul {
    margin: 10px 0 0;
    padding-left: 20px;
    color: #0f3554;
    font-weight: 700;
}
.audit-warning-note {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 0 16px 16px;
    color: #475569;
    font-size: 14px;
}
.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #eef3f8;
    background: #fff;
}
.audit-pagination span {
    color: #475569;
    font-weight: 800;
}
.audit-pagination .disabled {
    pointer-events: none;
    opacity: .45;
}
.audit-table-wrap {
    overflow-x: auto;
}
.audit-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}
.audit-table th,
.audit-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef3f8;
    text-align: left;
    vertical-align: top;
}
.audit-table th {
    background: #f1f7fc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.audit-table td small {
    display: block;
    color: #64748b;
    margin-top: 2px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.audit-nowrap {
    white-space: nowrap;
}
.audit-version {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
}
.audit-description {
    white-space: pre-line;
    color: #334155;
    max-width: 560px;
}
.audit-description code {
    white-space: pre-wrap;
    word-break: break-word;
    color: #334155;
    font-size: 12px;
}
.audit-action,
.audit-severity {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.audit-action-create { background: #dcfce7; color: #15803d; }
.audit-action-update { background: #e0f2fe; color: #0369a1; }
.audit-action-delete,
.audit-action-cancel,
.audit-action-void { background: #fee2e2; color: #b91c1c; }
.audit-action-print { background: #fef3c7; color: #92400e; }
.audit-severity-info { background: #f1f5f9; color: #475569; }
.audit-severity-warning { background: #fef3c7; color: #92400e; }
.audit-severity-critical { background: #fee2e2; color: #b91c1c; }

@media (max-width: 900px) {
    .audit-tabs {
        width: 100%;
    }
    .audit-tab {
        flex: 1;
        text-align: center;
    }
    .audit-filters {
        grid-template-columns: 1fr;
    }
    .audit-kpi-grid,
    .audit-warning-grid,
    .audit-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .audit-chart-wide {
        grid-column: auto;
    }
    .audit-filter-actions {
        justify-content: stretch;
    }
    .audit-filter-actions > * {
        flex: 1;
        text-align: center;
    }
    .audit-user-filters .audit-filter-actions {
        grid-template-columns: 1fr;
    }
    .audit-keyword-actions {
        grid-template-columns: 1fr;
    }
}

.locked-period-panel {
    border: 1px solid #d9e6f2;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    margin-bottom: 16px;
}
.locked-period-filters {
    grid-template-columns: minmax(180px, 1.15fr) minmax(180px, 1.05fr) minmax(130px, .7fr) minmax(220px, 1.25fr) minmax(180px, 220px);
    margin: 0;
}
.locked-period-filters .partner-filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.locked-period-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.locked-period-head h2 {
    margin: 0;
    color: #0f3554;
    font-size: 18px;
}
.locked-period-head p {
    margin: 4px 0 0;
    color: #64748b;
}
.locked-period-create {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(240px, 1.4fr) auto;
    gap: 12px;
    align-items: end;
}
.locked-period-create label,
.locked-period-filters label {
    display: grid;
    gap: 6px;
}
.locked-period-create label span,
.locked-period-filters label span {
    color: #475569;
    font-weight: 800;
}
.locked-period-create-button {
    min-width: 110px;
    height: 50px;
}
.locked-period-table td {
    vertical-align: middle;
}
.locked-period-unlock {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 300px;
}

@media (max-width: 1100px) {
    .locked-period-create {
        grid-template-columns: 1fr 1fr;
    }
    .locked-period-reason {
        grid-column: 1 / -1;
    }
    .locked-period-create-button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .locked-period-filters {
        grid-template-columns: 1fr;
    }
    .locked-period-filters .partner-filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .locked-period-create,
    .locked-period-unlock {
        grid-template-columns: 1fr;
    }
}
