/* ==========================================================================
   Layout v2 — page layouts (login, dashboards, cart, checkout, profile,
   settings, sales summary). Load AFTER catalog-theme.css.
   ========================================================================== */

/* ---------- Login: split screen ---------- */
.lx-login.login-section {
    min-height: 100vh;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    place-items: stretch;
    background: #fff;
}
.lx-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 52px;
    background: var(--color-deep-dark);
    color: #fff;
    font-family: var(--sec-font);
}
/* pill-capsule pattern built from CSS only */
.lx-brand::before {
    content: "";
    position: absolute;
    right: -110px;
    bottom: -130px;
    width: 440px;
    height: 440px;
    background: linear-gradient(135deg, var(--color-default), var(--color-light));
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='48'%3E%3Crect x='6' y='10' width='64' height='26' rx='13'/%3E%3C/svg%3E") 0 0 / 84px 48px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='48'%3E%3Crect x='6' y='10' width='64' height='26' rx='13'/%3E%3C/svg%3E") 0 0 / 84px 48px;
    opacity: .35;
    transform: rotate(-18deg);
}
.lx-brand > * { position: relative; z-index: 1; }
.lx-brand-top { display: flex; align-items: center; gap: 12px; }
.lx-brand-mark {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--color-default), var(--color-light));
    font-size: 1.25rem;
}
.lx-brand-name { font: 800 1.15rem var(--main-font); letter-spacing: .2px; }
.lx-brand-copy { max-width: 440px; }
.lx-brand-copy h1 {
    font: 700 2.4rem/1.15 var(--main-font);
    margin: 0 0 22px;
}
.lx-brand-copy ul { display: grid; gap: 12px; }
.lx-brand-copy li {
    display: flex; align-items: center; gap: 12px;
    font-size: .95rem; color: rgba(255,255,255,.85);
}
.lx-brand-copy li i {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    display: grid; place-items: center;
    background: rgba(255,255,255,.1); color: var(--color-light); font-size: .85rem;
}
.lx-brand-foot { font-size: .78rem; color: rgba(255,255,255,.55); }

.lx-login .login-card {
    align-self: center;
    justify-self: center;
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}
.lx-login .login-header { text-align: left; margin-bottom: 28px; }
.lx-login .login-logo { display: none; }
.lx-login .login-header h2 { font: 700 1.75rem var(--main-font); color: var(--cat-navy); }
.lx-login .login-header p { font-family: var(--sec-font); color: var(--cat-muted); }
.lx-login .form-group label { margin-left: 0; font-family: var(--sec-font); font-weight: 700; color: var(--cat-navy); }
.lx-login .form-control {
    height: 46px; border: 1px solid var(--cat-border); border-radius: 10px; background: #fff;
}
.lx-login .form-control:focus { border-color: var(--cat-blue); box-shadow: 0 0 0 3px rgba(40, 120, 104,.12); }
.lx-login .toggle-password { top: 50%; transform: translateY(-50%); }
.lx-login .btn-login {
    height: 46px; padding: 0; border-radius: 10px;
    background: var(--cat-blue); font-family: var(--sec-font); letter-spacing: 0;
}
.lx-login .btn-login:hover { background: var(--cat-blue-hover); opacity: 1; }

@media (max-width: 900px) {
    .lx-login.login-section { grid-template-columns: 1fr; }
    .lx-brand { padding: 28px 24px; gap: 18px; }
    .lx-brand-copy h1 { font-size: 1.6rem; margin-bottom: 0; }
    .lx-brand-copy ul, .lx-brand-foot { display: none; }
    .lx-brand::before { width: 240px; height: 240px; right: -70px; bottom: -90px; }
    .lx-login .login-card { padding: 28px 20px 40px; }
}

/* ---------- Shared page header + buttons ---------- */
.lx-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.lx-eyebrow {
    font: 700 .72rem var(--sec-font);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cat-blue);
    margin-bottom: 4px;
}
.lx-page-title { font: 700 1.6rem/1.2 var(--main-font); color: var(--cat-navy); margin: 0; }
.lx-page-sub { font: 400 .9rem var(--sec-font); color: var(--cat-muted); margin-top: 4px; }
.lx-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lx-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 600 .85rem var(--sec-font);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}
.lx-btn.primary { background: var(--cat-blue); color: #fff; }
.lx-btn.primary:hover { background: var(--cat-blue-hover); }
.lx-btn.ghost { background: #fff; color: var(--cat-navy); border-color: var(--cat-border); }
.lx-btn.ghost:hover { border-color: var(--cat-blue); color: var(--cat-blue); }

/* ---------- Dashboards ---------- */
.lx-dash .stats-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 20px;
}
/* last tile (sales) becomes the highlight tile */
.lx-dash .stats-row .stat-card:last-child {
    background: var(--cat-blue);
    border-color: var(--cat-blue);
}
.lx-dash .stats-row .stat-card:last-child .stat-icon { background: rgba(255,255,255,.18); color: #fff; }
.lx-dash .stats-row .stat-card:last-child .stat-label { color: rgba(255,255,255,.8); }
.lx-dash .stats-row .stat-card:last-child .stat-value { color: #fff; }
.lx-dash .stat-card { flex-direction: column; align-items: flex-start; gap: 12px; }
.lx-dash .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1rem; }

.lx-dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
    gap: 20px;
    align-items: start;
}
.lx-col-main, .lx-col-side { display: grid; gap: 20px; min-width: 0; }
.lx-dash .dash-panel { margin-bottom: 0; }
.lx-dash .dash-chart-body { padding: 14px 18px; }

/* credit account card (customer dashboard) */
.main .lx-credit { overflow: hidden; }
.lx-credit-top {
    padding: 20px 22px;
    background: var(--color-deep-dark);
    color: #fff;
}
.lx-credit-label { font: 600 .8rem var(--sec-font); color: rgba(255,255,255,.75); display: flex; gap: 8px; align-items: center; }
.lx-credit-label i { color: var(--color-light); }
.lx-credit-value { font: 700 1.75rem var(--main-font); margin-top: 6px; white-space: nowrap; }
.lx-credit-rows > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--cat-border);
    font: .85rem var(--sec-font);
}
.lx-credit-rows > div:last-child { border-bottom: 0; }
.lx-credit-rows span { color: var(--cat-muted); display: flex; gap: 10px; align-items: center; }
.lx-credit-rows span i { width: 16px; text-align: center; color: var(--cat-blue); }
.lx-credit-rows b { color: var(--cat-navy); font-weight: 700; white-space: nowrap; }
.lx-credit-rows > div[hidden] { display: none; }
.lx-credit-rows span i.fa-circle-exclamation { color: var(--cat-red); }
.lx-credit-rows .is-alert b, .lx-credit-rows b.is-red { color: var(--cat-red); }

/* over-limit state: ordering blocked */
.lx-credit-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.lx-credit.is-blocked .lx-credit-top { background: #7a0f1f; }
.lx-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--cat-red-bg);
    color: #b42318;
    font: 700 .78rem var(--sec-font);
    white-space: nowrap;
}
.lx-credit-pill[hidden], .lx-credit-alert[hidden] { display: none; }
.lx-credit-alert {
    display: flex;
    gap: 14px;
    margin: 4px 14px 14px;
    padding: 16px 18px;
    border: 1px solid #f6c9c9;
    border-radius: 10px;
    background: var(--cat-red-bg);
    font: .82rem var(--sec-font);
    color: var(--cat-text);
}
.lx-credit-alert > i { color: #b42318; font-size: 1.1rem; margin-top: 2px; }
.lx-credit-alert-title { font: 700 .88rem var(--main-font); color: #b42318; }
.lx-credit-alert p { margin: 4px 0 0; line-height: 1.45; }
.lx-btn.blocked { background: var(--cat-grey); color: #fff; cursor: not-allowed; }

@media (max-width: 1200px) {
    .lx-dash .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .lx-dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .lx-dash .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lx-dash .stats-row .stat-card:last-child { grid-column: 1 / -1; }
    .lx-page-actions { width: 100%; }
    .lx-page-actions .lx-btn { flex: 1 1 0; justify-content: center; }
}
.lx-dash .dash-panel { min-width: 0; overflow: hidden; }
.lx-dash .dash-row-main { min-width: 0; }

/* ---------- Cart & checkout ---------- */
.main .cart-header {
    align-items: flex-end;
    margin-bottom: 18px;
}
.main .cart-header .cart-title { font-size: 1.6rem; }

/* Stepper → full-width progress bar card */
.main .cart-steps {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: 14px;
}
.main .cart-steps .cart-step-row { font: 600 .85rem var(--sec-font); color: var(--cat-muted); gap: 10px; }
.main .cart-steps .cart-step-row .num {
    width: 28px; height: 28px; font: 700 .8rem var(--sec-font);
    background: var(--cat-grey-bg); color: var(--cat-muted);
}
.main .cart-steps .cart-step-row.active { color: var(--cat-navy); }
.main .cart-steps .cart-step-row.active .num { box-shadow: 0 0 0 4px var(--cat-blue-bg); }
.main .cart-steps .cart-step-row.done { color: var(--cat-green); }
.main .cart-steps .cart-step-row.done .num { background: var(--cat-green); color: #fff; }
.main .cart-steps .cart-step-divider { flex: 1 1 auto; width: auto; height: 2px; border-radius: 2px; background: var(--cat-border); }

.main .cart-wrap { grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
.main .cart-wrap > div:first-child { display: grid; gap: 20px; align-content: start; }
.main .cart-wrap .cart-card:not(:last-child) { margin-bottom: 0; }
.main .cart-wrap .cart-summary { top: 120px; }

/* Line items: thumb | info | qty | subtotal | remove */
.main .cart-wrap .cart-items {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto 110px 36px;
    grid-template-areas: "thumb info qty sub remove";
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
}
.main .cart-wrap .cart-items-remove   { grid-area: remove; width: auto; }
.main .cart-wrap .cart-items-thumb    { grid-area: thumb; width: 76px; height: 76px; }
.main .cart-wrap .cart-items-info     { grid-area: info; }
.main .cart-wrap .cart-items-quantity { grid-area: qty; }
.main .cart-wrap .cart-items-subtotal { grid-area: sub; font-family: var(--main-font); font-size: 1rem; color: var(--cat-navy); }
.main .cart-wrap .cart-items-remove button {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    color: var(--cat-muted);
}
.main .cart-wrap .cart-items-remove button:hover { background: var(--cat-red-bg); color: var(--cat-red); }
.main .cart-wrap .cart-items.error { background: var(--cat-red-bg); }
.main .cart-name { font: 700 .95rem var(--sec-font); color: var(--cat-navy); }
.main .cart-sku { font: 600 .74rem var(--sec-font); color: var(--cat-muted); letter-spacing: .02em; }
.main .cart-price { font: .82rem var(--sec-font); color: var(--cat-muted); }
.main .cart-stock { font: 600 .74rem var(--sec-font); color: var(--cat-green); }

/* Summary */
.main .cart-wrap .cart-summary-body { padding: 18px 22px 22px; gap: 12px; }
.main .cart-wrap .cart-summary-row { font: .85rem var(--sec-font); color: var(--cat-muted); }
.main .cart-wrap .cart-summary-row span.val { color: var(--cat-navy); }
.main .cart-wrap .cart-summary-divider { background: var(--cat-border); }
.main .cart-wrap .cart-summary-row.grand {
    font: 700 1.2rem var(--main-font);
    color: var(--cat-navy);
    padding-top: 4px;
}
.main .cart-wrap .cart-promo-wrap { flex-direction: row; }
.main .cart-wrap .cart-promo-msg { flex-basis: 100%; }

/* Checkout: payment choices as catalog cards */
.main .pick-row .pick-card {
    min-height: 92px;
    border: 1px solid var(--cat-border);
    border-radius: 12px;
    background: #fff;
    font: 600 .82rem var(--sec-font);
    color: var(--cat-navy);
}
.main .pick-row .pick-card i { color: var(--cat-muted); }
.main .pick-row input[type="radio"]:checked + .pick-card {
    border-color: var(--cat-blue);
    background: var(--cat-blue-bg);
    color: var(--cat-blue);
    box-shadow: 0 0 0 3px rgba(40, 120, 104,.12);
}
.main .pick-row input[type="radio"]:checked + .pick-card i { color: var(--cat-blue); }
.main .pick-row input[type="radio"]:disabled + .pick-card { opacity: .5; cursor: not-allowed; }
.main .fill-button {
    margin-left: auto; height: 32px; padding: 0 12px; border-radius: 8px;
    background: var(--cat-blue-bg); color: var(--cat-blue); font: 600 .78rem var(--sec-font);
}
.main .cart-summary-header { display: flex; align-items: center; gap: 10px; }

@media (max-width: 980px) {
    .main .cart-wrap { grid-template-columns: 1fr; }
    .main .cart-wrap .cart-summary { position: static; }
}
@media (max-width: 640px) {
    .main .cart-steps { padding: 12px 14px; gap: 8px; }
    .main .cart-steps .cart-step-row { font-size: .78rem; }
    .main .cart-wrap .cart-items {
        grid-template-columns: 64px minmax(0, 1fr) 34px;
        grid-template-areas: "thumb info remove" "qty qty sub";
        gap: 12px; padding: 14px;
    }
    .main .cart-wrap .cart-items-thumb { width: 64px; height: 64px; }
    .main .cart-wrap .cart-items-subtotal { text-align: right; width: auto; }
    .main .pick-row.col-4 { grid-template-columns: repeat(2, 1fr); }
}
.main .cart-steps .cart-step-row.active .num { background: var(--cat-blue); color: #fff; }
.main .cart-wrap .cart-promo-input { min-width: 0; flex: 1 1 auto; width: auto; }
.main .cart-wrap .cart-promo-btn { flex: 0 0 auto; }

/* ---------- Profile ---------- */
.main .lx-profile {
    grid-template-columns: 320px minmax(0, 1fr);
}
.main .lx-profile > .lx-account { order: -1; position: sticky; top: 120px; }
.main .lx-profile > div:not(.lx-account) { display: grid; gap: 20px; }
.lx-account .cart-card { overflow: hidden; }
.lx-account-cover {
    height: 84px;
    background: var(--color-deep-dark);
    background-image: linear-gradient(135deg, var(--color-deep-dark) 40%, var(--color-default));
}
.lx-account .profile-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 0 22px 20px;
    margin-top: -40px;
    border-bottom: 1px solid var(--cat-border);
}
.lx-account .profile-avatar {
    width: 80px; height: 80px; font-size: 1.6rem;
    border: 4px solid #fff; border-radius: 50%;
    background: var(--cat-blue); color: #fff;
}
.lx-account .profile-head .name { font: 700 1.15rem var(--main-font); color: var(--cat-navy); }
.lx-account .profile-head .email { font: .85rem var(--sec-font); color: var(--cat-muted); }
.lx-account .profile-head .place {
    display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
    background: var(--cat-blue-bg); color: var(--cat-blue); font: 700 .72rem var(--sec-font); letter-spacing: .04em;
}
.lx-account-links a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 22px; border-bottom: 1px solid var(--cat-border);
    font: 600 .88rem var(--sec-font); color: var(--cat-navy); text-decoration: none;
}
.lx-account-links a:last-child { border-bottom: 0; }
.lx-account-links a:hover { background: #fafdfc; color: var(--cat-blue); }
.lx-account-links a i:first-child { width: 18px; text-align: center; color: var(--cat-blue); }
.lx-account-links a i:last-child { margin-left: auto; font-size: .75rem; color: var(--cat-grey); }
.main .lx-profile .form-btn { width: auto; min-width: 180px; height: 44px; margin-left: auto; }

/* ---------- Settings hub ---------- */
.lx-settings { display: grid; gap: 26px; }
.lx-set-head {
    font: 700 .74rem var(--main-font);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cat-muted);
    margin-bottom: 10px;
}
.lx-set-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.lx-set-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.lx-set-tile:hover { border-color: #d0e5e1; box-shadow: 0 6px 18px rgba(18, 63, 55,.08); }
.lx-set-icon {
    width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--cat-blue-bg); color: var(--cat-blue); font-size: 1.1rem;
    transition: background .15s, color .15s;
}
.lx-set-tile:hover .lx-set-icon { background: var(--cat-blue); color: #fff; }
.lx-set-text { display: grid; gap: 2px; min-width: 0; }
.lx-set-name { font: 700 .95rem var(--sec-font); color: var(--cat-navy); }
.lx-set-desc { font: .8rem var(--sec-font); color: var(--cat-muted); }
.lx-set-go { margin-left: auto; color: var(--cat-grey); font-size: .85rem; transition: transform .15s, color .15s; }
.lx-set-tile:hover .lx-set-go { color: var(--cat-blue); transform: translateX(3px); }

/* ---------- Change log ---------- */
.lx-log { display: grid; gap: 18px; max-width: 860px; }
.lx-log-day {
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: 14px;
    overflow: hidden;
}
.lx-log-date {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--cat-border);
    background: var(--cat-soft);
    font: 700 .9rem var(--main-font);
    color: var(--cat-navy);
}
.lx-log-date i { color: var(--cat-blue); }
.lx-log-list { list-style: none; margin: 0; padding: 0; }
.lx-log-list li {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--cat-border);
    font: .88rem/1.5 var(--sec-font);
    color: var(--cat-text);
}
.lx-log-list li:last-child { border-bottom: 0; }
.lx-log-tag {
    flex-shrink: 0;
    min-width: 76px;
    padding: 3px 10px;
    border-radius: 999px;
    text-align: center;
    font: 700 .72rem var(--sec-font);
    margin-top: 1px;
}
.lx-log-tag.t-new { background: var(--cat-green-bg); color: var(--cat-green); }
.lx-log-tag.t-improved { background: var(--cat-blue-bg); color: var(--cat-blue); }
.lx-log-tag.t-fixed { background: var(--cat-amber-bg); color: var(--cat-amber); }
@media (max-width: 520px) {
    .lx-log-list li { flex-direction: column; gap: 6px; padding: 12px 16px; }
    .lx-log-date { padding: 12px 16px; }
}

@media (max-width: 980px) {
    .main .lx-profile { grid-template-columns: 1fr; }
    .main .lx-profile > .lx-account { position: static; }
}

/* ---------- Sales summary ---------- */
.main .lx-ss-filter {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: 14px;
}
.lx-ss-dates { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.main .lx-ss-filter label { font: 700 .68rem var(--sec-font); letter-spacing: .06em; color: var(--cat-muted); }
/* presets as a segmented control */
.main .lx-ss-presets {
    margin-left: auto;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--cat-border);
    border-radius: 10px;
    background: var(--cat-soft);
}
.main .lx-ss-presets .ss-btn.alt {
    height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--cat-muted);
}
.main .lx-ss-presets .ss-btn.alt:hover { background: #fff; color: var(--cat-navy); }
.main .lx-ss-export { height: 40px; }

.main .ss-kpis { gap: 14px; margin-bottom: 20px; }
.main .ss-kpi { padding: 18px 20px; }
.main .ss-kpi .value { font-size: 1.5rem; }

.main .ss-grid { gap: 20px; margin-bottom: 20px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.main .ss-grid .ss-panel { margin-bottom: 0; min-width: 0; }
.main .lx-ss-tables { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lx-ss-hint { font: 500 .78rem var(--sec-font); color: var(--cat-muted); margin-left: auto; }
.main .ss-panel-head { gap: 10px; }
.lx-ss-chart { padding: 8px 12px 4px; }
.main .ss-table tfoot td { background: var(--cat-soft); color: var(--cat-navy); }

@media (max-width: 1100px) {
    .main .ss-grid, .main .lx-ss-tables { grid-template-columns: 1fr; }
    .main .lx-ss-presets { margin-left: 0; }
}

/* ---------- Phone-width fixes ---------- */
.lx-login .login-card { box-sizing: border-box; }
@media (max-width: 980px) {
    .main .cart-wrap { grid-template-columns: minmax(0, 1fr); }
    .main .cart-wrap > * { min-width: 0; }
}

/* ==========================================================================
   Editor & detail pages (.edit-wrap / .reset-wrap)
   users/edit, manage/new|edit, notify/new|edit, signboard/new|edit,
   products/view, orders/view, orders/items, my-orders/view, profile/reset
   ========================================================================== */

/* Header actions: one consistent toolbar */
.main .cart-header .form-btn-wrap { gap: 8px; }
.main .cart-header .form-back-btn {
    height: 40px;
    padding: 0 15px;
    border-radius: 9px;
    border: 1px solid var(--cat-border);
    background: #fff;
    color: var(--cat-navy);
    font: 600 .85rem var(--sec-font);
}
.main .cart-header .form-back-btn:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.main .cart-header .form-back-btn.second { background: var(--cat-blue); border-color: var(--cat-blue); color: #fff; }
.main .cart-header .form-back-btn.second:hover { background: var(--cat-blue-hover); color: #fff; }
.main .cart-header .form-back-btn.danger { background: #fff; border-color: #f3c4c0; color: var(--cat-red); }
.main .cart-header .form-back-btn.danger:hover { background: var(--cat-red-bg); border-color: var(--cat-red); }

/* Two columns; side column stays in view */
.main .edit-wrap {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}
.main .edit-wrap > div:not(.cart-summary) { display: grid; gap: 20px; min-width: 0; }
.main .edit-wrap > .cart-summary,
.main .edit-wrap > div:last-child:not(:first-child) {
    position: sticky;
    top: 120px;
    display: grid;
    gap: 20px;
}
.main .edit-wrap .cart-card { margin-bottom: 0; }
/* single-card editors use the full width, capped for readability */
.main .edit-wrap > :only-child,
.main .reset-wrap > :only-child { grid-column: 1 / -1; max-width: 860px; }
.main .reset-wrap { grid-template-columns: minmax(0, 1fr); }

/* Identity strip at the top of user/admin editors */
.main .edit-wrap .cart-card > .profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    background: linear-gradient(135deg, var(--color-deep-dark) 45%, var(--color-default));
    border-radius: 14px 14px 0 0;
}
.main .edit-wrap .profile-head .profile-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.9);
    background: var(--cat-blue); color: #fff;
    font: 700 1.2rem var(--main-font);
}
.main .edit-wrap .profile-head .name { font: 700 1.15rem var(--main-font); color: #fff; }
.main .edit-wrap .profile-head .email { font: .85rem var(--sec-font); color: rgba(255,255,255,.75); }

/* Read-only fields */
.main .form-group div.form-control,
.main .form-group .form-control[disabled],
.main .form-group .form-control[readonly] {
    background: var(--cat-soft);
    color: var(--cat-muted);
    border-style: dashed;
}

/* Side-card Save buttons */
.main .edit-wrap .form-btn { height: 44px; }

/* Label / value rows (order + product details) */
.main .edit-wrap .cart-summary-row { gap: 16px; }
.main .edit-wrap .cart-summary-row > span:first-child { color: var(--cat-muted); flex-shrink: 0; }
.main .edit-wrap .cart-summary-row span.val {
    color: var(--cat-navy);
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}
.main .edit-wrap .customer-info-body .cart-summary-row {
    padding: 4px 0;
    border-bottom: 1px dashed var(--cat-border);
}
.main .edit-wrap .customer-info-body .cart-summary-row:last-child { border-bottom: 0; }

/* Order header card */
.main .cart-wrap .cart-summary-status {
    margin-bottom: 0;
    padding: 20px 22px;
    border: 1px solid var(--cat-border);
}
.main .cart-wrap .cart-summary-icon { border-radius: 12px; background: var(--cat-blue); }
.main .cart-wrap .cart-summary-info .title { font-size: 1.15rem; }
.main .cart-wrap .cart-summary-info .sub span { color: var(--cat-navy); }

/* Item tables inside detail pages */
.main .items-search-wrap input {
    height: 40px;
    border: 1px solid var(--cat-border);
    border-radius: 9px;
    background: #fff;
    font: 500 .85rem var(--sec-font);
}
.main .order-items-table th,
.main .edit-items-table th {
    background: var(--cat-soft);
    font: 700 .7rem var(--main-font);
    letter-spacing: .05em;
    color: var(--cat-muted);
}
.main .order-items-table td,
.main .edit-items-table td { border-bottom: 1px solid var(--cat-border); font-family: var(--sec-font); color: var(--cat-text); }

/* Uploader boxes (product image, announcement document) */
.main .form-group .uploader-wrap,
.main .form-group .uploader-box-single {
    border: 1.5px dashed #d0e5e1;
    border-radius: 12px;
    background: var(--cat-soft);
}
.main .form-group .uploader-wrap:hover { border-color: var(--cat-blue); background: var(--cat-blue-bg); }
.main .form-group .uploader-empty i { color: var(--cat-blue); }

@media (max-width: 1100px) {
    .main .edit-wrap { grid-template-columns: minmax(0, 1fr); }
    .main .edit-wrap > .cart-summary,
    .main .edit-wrap > div:last-child:not(:first-child) { position: static; }
}
@media (max-width: 640px) {
    .main .cart-header .form-btn-wrap { width: 100%; }
    .main .cart-header .form-btn-wrap .form-back-btn { flex: 1 1 auto; justify-content: center; }
}
/* date pickers are readonly inputs but still clickable — keep them looking editable */
.main .form-group .form-control.flatpickr-input[readonly] {
    background: #fff;
    color: var(--cat-navy);
    border-style: solid;
    cursor: pointer;
}
/* profile keeps its own column order (account card on the left) */
.main .edit-wrap.lx-profile { grid-template-columns: 320px minmax(0, 1fr); }
@media (max-width: 980px) { .main .edit-wrap.lx-profile { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .main .edit-wrap .cart-summary-row span.val { text-align: left; } }
.main .edit-wrap .lx-account .cart-card > .profile-head {
    flex-direction: column;
    background: none;
    border-radius: 0;
    padding: 0 22px 20px;
    margin-top: -40px;
}
.main .edit-wrap .lx-account .profile-head .profile-avatar { width: 80px; height: 80px; border: 4px solid #fff; font-size: 1.6rem; }
.main .edit-wrap .lx-account .profile-head .name { color: var(--cat-navy); }
.main .edit-wrap .lx-account .profile-head .email { color: var(--cat-muted); }

/* ==========================================================================
   Public order pages — Order Confirm (.cfm-*) and Order Receipt (.rcpt-*)
   Screen only: the pages' own print rules stay in charge when printing.
   ========================================================================== */
@media screen {
    html body .cfm-page,
    html body .rcpt-page { padding: 40px 16px 56px; }
    html body .cfm-wrap,
    html body .rcpt-wrap { max-width: 640px; }

    html body .cfm-card,
    html body .rcpt-card {
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--cat-border);
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(18, 63, 55, .08);
        font-family: var(--sec-font);
    }
    /* navy header band */
    html body .cfm-head,
    html body .rcpt-head {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 16px;
        align-items: center;
        text-align: left;
        margin: 0;
        padding: 26px 30px;
        background: var(--color-deep-dark);
        background-image: linear-gradient(135deg, var(--color-deep-dark) 50%, var(--color-default));
    }
    html body .cfm-head .logo,
    html body .rcpt-head .logo {
        grid-row: span 2;
        width: 52px; height: 52px; margin: 0;
        border-radius: 14px;
        background: rgba(255,255,255,.14);
    }
    html body .cfm-head .store,
    html body .rcpt-head .store {
        font: 700 1.2rem var(--main-font);
        letter-spacing: 0;
        text-transform: none;
        color: #fff;
    }
    html body .cfm-head .desc,
    html body .rcpt-head .desc { margin-top: 4px; font-size: .8rem; color: rgba(255,255,255,.72); }

    /* everything below the band gets the card padding */
    html body .cfm-card > :not(.cfm-head):not(.cfm-sep):not(.cfm-foot),
    html body .rcpt-card > :not(.rcpt-head):not(.rcpt-sep):not(.rcpt-foot) { margin-left: 30px; margin-right: 30px; }
    html body .cfm-sep,
    html body .rcpt-sep { margin: 20px 0; border-top: 1px solid var(--cat-border); }
    html body .cfm-head + .cfm-sep,
    html body .rcpt-head + .rcpt-sep { display: none; }

    html body .cfm-meta .order-status,
    html body .rcpt-meta .order-status { white-space: nowrap; }
    /* order no / date / status as three tiles */
    html body .cfm-meta,
    html body .rcpt-meta {
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
        gap: 10px;
        margin-top: 22px;
    }
    html body .cfm-meta .row,
    html body .rcpt-meta .row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 14px;
        border: 1px solid var(--cat-border);
        border-radius: 12px;
        background: var(--cat-soft);
        font: 600 .7rem var(--sec-font);
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--cat-muted);
    }
    html body .cfm-meta .row .val,
    html body .rcpt-meta .row .val {
        text-align: left;
        font: 700 .92rem var(--sec-font);
        letter-spacing: 0;
        text-transform: none;
        color: var(--cat-navy);
    }

    html body .cfm-title,
    html body .rcpt-title {
        font: 700 .72rem var(--main-font);
        letter-spacing: .08em;
        color: var(--cat-muted);
        margin-bottom: 12px;
    }

    /* delivery info as a two-column grid */
    html body .cfm-info,
    html body .rcpt-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 24px;
    }
    html body .cfm-info .line,
    html body .rcpt-info .line { display: grid; gap: 2px; }
    html body .cfm-info .line .k,
    html body .rcpt-info .line .k { font: 600 .74rem var(--sec-font); color: var(--cat-muted); text-transform: none; letter-spacing: 0; }
    html body .cfm-info .line .v,
    html body .rcpt-info .line .v { font: 600 .9rem var(--sec-font); color: var(--cat-navy); }
    html body .cfm-info .line:has(#cAddress),
    html body .rcpt-info .line:has(#rAddress) { grid-column: 1 / -1; }

    /* items as rows in a soft list */
    html body .cfm-items,
    html body .rcpt-items {
        gap: 0;
        border: 1px solid var(--cat-border);
        border-radius: 12px;
        overflow: hidden;
    }
    html body .cfm-item,
    html body .rcpt-items > * {
        padding: 12px 16px;
        border-bottom: 1px solid var(--cat-border);
        background: #fff;
    }
    html body .cfm-item:last-child,
    html body .rcpt-items > *:last-child { border-bottom: 0; }
    html body .cfm-item .name,
    html body .rcpt-items .name { font: 700 .9rem var(--sec-font); color: var(--cat-navy); }
    html body .cfm-item .qty {
        background: var(--cat-blue-bg);
        color: var(--cat-blue);
        border-radius: 999px;
        font: 700 .8rem var(--sec-font);
    }

    /* totals */
    html body .rcpt-totals .row { font: .88rem var(--sec-font); color: var(--cat-muted); }
    html body .rcpt-totals .row .val { color: var(--cat-navy); }
    html body .rcpt-totals .row.grand {
        margin-top: 6px;
        padding: 14px 16px;
        border-radius: 12px;
        background: var(--cat-blue);
        color: #fff;
        font: 700 1.1rem var(--main-font);
    }
    html body .rcpt-totals .row.grand .val { color: #fff; }

    /* confirm action + notes */
    html body .cfm-btn {
        height: 48px;
        border-radius: 10px;
        background: var(--cat-blue);
        font: 700 .95rem var(--sec-font);
    }
    html body .cfm-note { border-radius: 12px; font-family: var(--sec-font); }

    html body .cfm-foot,
    html body .rcpt-foot {
        margin-top: 4px;
        margin-bottom: 0;
        padding: 18px 30px 22px;
        background: var(--cat-soft);
        border-top: 1px solid var(--cat-border);
        font: .78rem/1.6 var(--sec-font);
        color: var(--cat-muted);
        text-align: center;
    }
    html body .cfm-card > .cfm-foot,
    html body .rcpt-card > .rcpt-foot { margin-left: 0; margin-right: 0; }
    html body .cfm-confirm + .cfm-foot,
    html body .rcpt-sep:has(+ .rcpt-foot) { margin-top: 22px; }
    html body .rcpt-sep:has(+ .rcpt-foot) { border-top: 0; margin-bottom: 0; }
}
@media screen and (max-width: 560px) {
    html body .cfm-page, html body .rcpt-page { padding: 0; }
    html body .cfm-card, html body .rcpt-card { border-radius: 0; border-left: 0; border-right: 0; }
    html body .cfm-head, html body .rcpt-head { padding: 22px 18px; }
    html body .cfm-card > :not(.cfm-head):not(.cfm-sep):not(.cfm-foot),
    html body .rcpt-card > :not(.rcpt-head):not(.rcpt-sep):not(.rcpt-foot) { margin-left: 18px; margin-right: 18px; }
    html body .cfm-meta, html body .rcpt-meta { grid-template-columns: 1fr 1fr; }
    html body .cfm-meta .row:last-child, html body .rcpt-meta .row:last-child { grid-column: 1 / -1; }
    html body .cfm-info, html body .rcpt-info { grid-template-columns: 1fr; }
}

/* verify page reuses the login split screen; keep its state icons visible */
.lx-login .login-logo.success,
.lx-login .login-logo.warning { display: flex; margin: 0 0 16px; }
.lx-login .form-hint { font: .78rem var(--sec-font); color: var(--cat-muted); margin: 6px 0 0 2px; }
.lx-login a.btn-login { display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; }

/* ---------- Order placed (orders/summary): success banner ---------- */
.main #summaryContent #statusList {
    padding: 26px 26px;
    border: 1px solid #bfe3cb;
    background: var(--cat-green-bg);
}
.main #summaryContent #statusList .cart-summary-icon {
    width: 60px; height: 60px; font-size: 1.6rem;
    border-radius: 50%;
    background: var(--cat-green);
    box-shadow: 0 0 0 6px rgba(21,128,61,.12);
}
.main #summaryContent #statusList .title { font-size: 1.3rem; color: var(--cat-green); }
.main #summaryContent #statusList .sub { font-size: .88rem; }
.main #summaryContent > div:first-child { display: grid; gap: 20px; }
/* items with no image ("" or the literal "undefined" some pages write) show the box placeholder */
.main .cart-wrap .cart-items-thumb { position: relative; border: 1px solid var(--cat-border); border-radius: 10px; background: var(--cat-soft); }
.main .cart-wrap .cart-items-thumb img[src="undefined"],
.main .cart-wrap .cart-items-thumb img[src="null"] { visibility: hidden; }
.main .cart-wrap .cart-items-thumb:has(img[src="undefined"])::after,
.main .cart-wrap .cart-items-thumb:has(img[src="null"])::after {
    content: "\f49e"; font: 900 1.2rem "Font Awesome 6 Free"; color: var(--cat-grey);
    position: absolute; inset: 0; display: grid; place-items: center;
}

/* ---------- Data synchronization ---------- */
.main .sync-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.main .sync-card-header { padding: 20px 22px; gap: 14px; }
.main .sync-card-icon { width: 48px; height: 48px; font-size: 1.2rem; }
.main .sync-card-title { font: 700 1.02rem var(--main-font); color: var(--cat-navy); }
.main .sync-card-sub { font: .8rem var(--sec-font); color: var(--cat-muted); }
.main .sync-card-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px;
    font: 600 .75rem var(--sec-font);
    background: var(--cat-green-bg); color: var(--cat-green);
}
.main .sync-card-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.main .sync-card-status.is-off { background: var(--cat-grey-bg); color: var(--cat-muted); }
.main .sync-btn:disabled { opacity: .5; cursor: not-allowed; }
.main .sync-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px 22px 4px;
}
.main .sync-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--cat-border);
    border-radius: 12px;
    background: var(--cat-soft);
}
.main .sync-row:last-child { border-bottom: 1px solid var(--cat-border); }
.main .sync-row-label { font: 600 .74rem var(--sec-font); color: var(--cat-muted); }
.main .sync-row-label i { color: var(--cat-blue); }
.main .sync-row-value { text-align: left; font: 700 .95rem var(--sec-font); color: var(--cat-navy); }
.main .sync-card-footer { padding: 16px 22px 22px; }
.main .sync-btn { height: 44px; border-radius: 10px; background: var(--cat-blue); font: 700 .9rem var(--sec-font); }
.main .sync-btn:hover { background: var(--cat-blue-hover); filter: none; }
@media (max-width: 480px) { .main .sync-card-body { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .main #summaryContent .cart-items,
    .main .cart-wrap .cart-items:not(:has(.cart-items-quantity)) {
        grid-template-columns: 64px minmax(0, 1fr);
        grid-template-areas: "thumb info" "thumb sub";
    }
    .main #summaryContent .cart-items-subtotal { text-align: left; }
}
@media (max-width: 640px) {
    .main .cart-wrap .cart-items:has(.cart-items-quantity) { grid-template-columns: 64px minmax(0, 1fr) auto; }
    .main .cart-wrap .cart-items-remove { justify-self: end; }
}

/* ==========================================================================
   Navigation — sidebar, topbar, ticker, user menu
   ========================================================================== */

/* Variables referenced by the older stylesheets but never defined */
:root {
    --primary: var(--cat-blue);
    --primary-default: var(--cat-blue);
    --primary-light: var(--color-light);
    --color: var(--cat-blue);
    --text-sub: var(--color-text-sub);
    --text-muted: var(--color-text-muted);
    --font-main: var(--main-font);
    --font-sec: var(--sec-font);
    --topbar-h: var(--nav-topbar-height);
    --transition: var(--transition-sidebar);
}

/* ---------- Sidebar ---------- */
.nav-sidebar { font-family: var(--sec-font); }
.nav-sidebar .nav-header { gap: 12px; padding: 0 18px; border-bottom-color: rgba(255,255,255,.08); }
.nav-sidebar .nav-header-icon { width: 38px; height: 38px; border-radius: 11px; }
.nav-sidebar .nav-header-icon i { font-size: 1.05rem; }
.nav-sidebar .nav-header-text { display: grid; line-height: 1.15; }
.nav-sidebar .nav-brand { font: 800 1rem var(--main-font); color: #fff; }
.nav-sidebar .nav-role { font: 600 .7rem var(--sec-font); color: rgba(255,255,255,.55); letter-spacing: .02em; }

.nav-sidebar .nav-body { padding: 12px 0 16px; }
.nav-sidebar .nav-section-label {
    padding: 16px 22px 6px;
    font: 700 .64rem var(--sec-font);
    letter-spacing: .12em;
    color: rgba(255,255,255,.42);
}
.nav-sidebar .nav-section-divider { margin: 8px 18px; background: rgba(255,255,255,.07); }

/* items become rounded pills inset from the edge */
.nav-sidebar .nav-items {
    margin: 2px 10px;
    padding: 10px 12px;
    gap: 12px;
    border-left: 0;
    border-radius: 10px;
    font: 600 .875rem var(--sec-font);
    color: rgba(255,255,255,.72);
}
.nav-sidebar .nav-items .nav-icon {
    width: 30px; height: 30px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 8px;
    font-size: .88rem;
    color: rgba(255,255,255,.6);
    transition: background var(--transition-sidebar), color var(--transition-sidebar);
}
.nav-sidebar .nav-items:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-sidebar .nav-items:hover .nav-icon { color: #fff; }
.nav-sidebar .nav-items.active {
    background: var(--cat-blue);
    color: #fff;
    border-left: 0;
    box-shadow: 0 6px 16px rgba(40, 120, 104,.35);
}
.nav-sidebar .nav-items.active .nav-icon { background: rgba(255,255,255,.18); color: #fff; }

.nav-sidebar .nav-section-footer { border-top-color: rgba(255,255,255,.08); height: auto; padding: 14px 16px; }
.nav-sidebar .nav-copyright { font-size: .68rem; line-height: 1.5; color: rgba(255,255,255,.5); }
.nav-sidebar .nav-copyright span { color: rgba(255,255,255,.7); }

/* collapsed: center the icons */
.nav-sidebar.minimize .nav-items { margin: 2px 8px; padding: 8px 9px; justify-content: center; gap: 0; }
.nav-sidebar.minimize .nav-header { padding: 0 13px; }

/* ---------- Topbar ---------- */
.nav-topbar { box-shadow: none; border-bottom: 1px solid var(--cat-border); gap: 14px; }
.nav-topbar .nav-toggle { border: 1px solid var(--cat-border); border-radius: 10px; color: var(--cat-navy); }
.nav-topbar .nav-toggle:hover { background: var(--cat-soft); color: var(--cat-blue); }
.nav-topbar .nav-title { font: 700 1.02rem var(--main-font); color: var(--cat-navy); }
.nav-topbar .nav-path { font: 500 .75rem var(--sec-font); color: var(--cat-muted); }
.nav-topbar .nav-path a { color: inherit; text-decoration: none; }
.nav-topbar .nav-path a:hover { color: var(--cat-blue); }

.nav-topbar .nav-credit {
    height: 42px;
    gap: 10px;
    padding: 0 14px 0 6px;
    border: 1px solid var(--cat-border);
    border-radius: 12px;
}
.nav-topbar .nav-credit > i {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--cat-blue-bg); color: var(--cat-blue); font-size: .85rem;
}
.nav-topbar .nav-credit-text { display: grid; line-height: 1.1; }
.nav-topbar .nav-credit .nav-credit-label { font: 600 .66rem var(--sec-font); letter-spacing: .04em; text-transform: uppercase; color: var(--cat-muted); }
.nav-topbar .nav-credit .nav-credit-value,
.nav-topbar .nav-credit .nav-credit-value span { font: 700 .88rem var(--sec-font); color: var(--cat-navy); }

.nav-topbar .nav-user { height: 42px; box-sizing: border-box; padding: 5px 12px 5px 5px; border: 1px solid var(--cat-border); border-radius: 12px; }
.nav-topbar .nav-user:hover { border-color: var(--cat-blue); background: #fff; }
.nav-topbar .nav-user-avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--cat-blue); font-family: var(--sec-font); }
.nav-topbar .nav-user-name { font: 700 .85rem var(--sec-font); color: var(--cat-navy); }

/* user dropdown */
.nav-dropdown .nav-dropdown-menu.user {
    border: 1px solid var(--cat-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(18, 63, 55,.14);
    overflow: hidden;
}
.nav-dropdown .nav-dropdown-menu.user .user-menu-item { font: 600 .85rem var(--sec-font); color: var(--cat-navy); border-left: 0; }
.nav-dropdown .nav-dropdown-menu.user .user-menu-item:hover { background: var(--cat-soft); color: var(--cat-blue); }
.nav-dropdown .nav-dropdown-menu.user .user-menu-item.logout { color: var(--cat-red); }
.nav-dropdown .nav-dropdown-menu.user .user-menu-item.logout:hover { background: var(--cat-red-bg); }

/* ---------- Announcement ticker ---------- */
.nav-ticker {
    background: #fff;
    border-top: 0;
    border-bottom: 1px solid var(--cat-border);
    box-shadow: none;
}
.nav-ticker .nav-ticker-icon {
    width: 26px; height: 26px; border-radius: 7px;
    display: grid; place-items: center;
    background: transparent; color: var(--cat-blue); font-size: .85rem;
}
.nav-ticker .nav-ticker-content span { font: 600 .8rem var(--sec-font); color: var(--cat-text); }
.nav-ticker .nav-ticker-content span:not(:last-child)::after { color: var(--cat-blue); }

/* phones: the old rule targeted a class that doesn't exist (.topbar-user-name) */
@media (max-width: 480px) {
    .nav-topbar { padding: 0 14px; gap: 10px; }
    .nav-topbar .nav-user-name, .nav-topbar .nav-user .user-chevron { display: none; }
    .nav-topbar .nav-user { padding: 4px; }
    .nav-topbar .nav-credit .nav-credit-label { display: none; }
    .nav-topbar .nav-breadcrumb .nav-path { display: none; }
}
/* denser items so the full admin menu fits a laptop screen */
.nav-sidebar .nav-items { padding: 7px 12px; margin: 1px 10px; }
.nav-sidebar .nav-items .nav-icon { width: 28px; height: 28px; }
.nav-sidebar .nav-section-label { padding: 12px 22px 4px; }
.nav-sidebar .nav-section-divider { margin: 6px 18px; }
.nav-topbar .nav-breadcrumb { min-width: 0; }
.nav-topbar .nav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-topbar .nav-action { flex-shrink: 0; }
@media (max-width: 480px) {
    .nav-topbar .nav-credit { padding: 0 10px; }
    .nav-topbar .nav-credit > i { display: none; }
}

/* ==========================================================================
   Pop-ups — confirm dialogs (popOptionsJS), success / error / loading
   (responseJS), announcement pop-out, add / remove item dialogs
   ========================================================================== */
.ns-modal {
    background: rgba(13, 27, 75, .38);
    backdrop-filter: blur(3px);
    padding: 16px;
    font-family: var(--sec-font);
}
.ns-modal .ns-box {
    max-width: 420px;
    padding: 26px 26px 22px;
    border: 1px solid var(--cat-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(13, 27, 75, .22);
    animation: popIn .18s ease;
    justify-content: stretch;
    text-align: left;
}
/* dialog copy */
.ns-modal .ns-box .title { font: 700 1.12rem var(--main-font); color: var(--cat-navy); margin-bottom: 4px; }
.ns-modal .ns-box .sub { font: .88rem/1.5 var(--sec-font); color: var(--cat-muted); margin-bottom: 14px; }
.ns-modal .ns-box select,
.ns-modal .ns-box .form-control,
.ns-modal .ns-box input[type="text"] {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--cat-border);
    border-radius: 10px;
    background: #fff;
    font: 500 .9rem var(--sec-font);
    color: var(--cat-navy);
    outline: none;
}
.ns-modal .ns-box select:focus,
.ns-modal .ns-box .form-control:focus,
.ns-modal .ns-box input[type="text"]:focus { border-color: var(--cat-blue); box-shadow: 0 0 0 3px rgba(40, 120, 104,.12); }
.ns-modal .ns-box .form-group { margin: 0; }

/* buttons */
.ns-modal .ns-action-wrap { gap: 8px; margin-top: 4px; }
.ns-modal .ns-action-wrap .form-back-btn {
    height: 42px;
    min-width: 96px;
    padding: 0 16px;
    justify-content: center;
    border: 1px solid var(--cat-border);
    border-radius: 10px;
    background: #fff;
    color: var(--cat-navy);
    font: 600 .88rem var(--sec-font);
}
.ns-modal .ns-action-wrap .form-back-btn:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.ns-modal .ns-action-wrap .form-back-btn.second { background: var(--cat-blue); border-color: var(--cat-blue); color: #fff; }
.ns-modal .ns-action-wrap .form-back-btn.second:hover { background: var(--cat-blue-hover); color: #fff; }
.ns-modal .ns-action-wrap .form-back-btn.danger { background: var(--cat-red); border-color: var(--cat-red); color: #fff; }
.ns-modal .ns-action-wrap .form-back-btn.danger:hover { background: #b42318; color: #fff; }

/* success / error / loading */
.ns-modal.progress .ns-box {
    max-width: 340px;
    padding: 30px 26px 26px;
    text-align: center;
    justify-content: center;
    row-gap: 6px;
}
.ns-modal.progress .ns-box p { font: 600 .95rem/1.45 var(--sec-font); color: var(--cat-navy); }
.ns-modal.progress .ns-box .pop { width: 64px; height: 64px; margin: 4px auto 12px; box-shadow: none; }
.ns-modal.progress .ns-box .pop.success { background: var(--cat-green); }
.ns-modal.progress .ns-box .pop.success .ripple { background: rgba(21, 128, 61, .35); }
.ns-modal.progress .ns-box .pop.error { background: var(--cat-red); }
.ns-modal.progress .ns-box .pop.error .ripple { background: rgba(217, 45, 32, .35); }
/* responseJS gives the loading icon the class "load", the old CSS only styled ".loading" */
.ns-modal.progress .ns-box .pop.load,
.ns-modal.progress .ns-box .pop.loading { background: var(--cat-blue-bg); }
.ns-modal.progress .ns-box .pop.load .ripple { background: transparent; }
.ns-modal.progress .ns-box .pop.load .icon,
.ns-modal.progress .ns-box .pop.loading .icon { font-size: 28px; color: var(--cat-blue); opacity: 1; }

/* announcement pop-out keeps its wide box */
.ns-modal.memo-modal .ns-box { max-width: 960px; padding: 0; }
.ns-modal.memo-modal .memo-modal-header { padding: 16px 22px; font-family: var(--main-font); }
.ns-modal.memo-modal .memo-modal-header .title { margin: 0; font-size: 1rem; }
.ns-modal.memo-modal .memo-slide-frame { border-color: var(--cat-border); border-radius: 12px; background: var(--cat-soft); }
.ns-modal.memo-modal .memo-nav-btn { border-color: var(--cat-border); color: var(--cat-navy); }
.ns-modal.memo-modal .memo-dot.active { background: var(--cat-blue); }
.dash-memo-fab { background: var(--cat-blue); box-shadow: 0 10px 26px rgba(40, 120, 104,.4); }

/* add / remove item dialogs (order items editor) */
#addItemModal .ns-box,
#removeItemModal .ns-box { max-width: 620px; }
.ns-modal .add-item-wrap .add-item-results {
    position: static;
    margin-top: 10px;
    max-height: 320px;
    border: 1px solid var(--cat-border);
    border-radius: 12px;
    box-shadow: none;
}
.ns-modal .add-item-head { background: var(--cat-soft); font: 700 .68rem var(--main-font); color: var(--cat-muted); border-bottom-color: var(--cat-border); }
.ns-modal .add-item-result { font-family: var(--sec-font); border-bottom-color: var(--cat-border); }
.ns-modal .add-item-result:hover { background: #fafdfc; }
.ns-modal .remove-item-list { border: 1px solid var(--cat-border); border-radius: 12px; }

@media (max-width: 480px) {
    .ns-modal .ns-box { padding: 22px 18px 18px; }
    .ns-modal .ns-action-wrap .form-back-btn { flex: 1 1 0; }
}
/* the announcement viewer sizes its PDF from the content width — keep the original centering */
.ns-modal.memo-modal .ns-box { justify-content: center; }
.ns-modal.memo-modal .memo-modal-header,
.ns-modal.memo-modal .memo-modal-nav { justify-self: stretch; }
/* announcement box sized to the document instead of a wide box with a narrow strip */
.ns-modal.memo-modal .ns-box { max-width: 500px; grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
/* renderPDF() sets the canvas CSS size to (frame width × quality) on desktop, i.e. double width.
   Pin it to the frame; the extra pixels still make it sharp. */

/* ---------- Remove Item pop-up ---------- */
#removeItemModal .ns-box { max-width: 560px; }
#removeItemModal .ns-box .title,
#removeItemModal .ns-box .sub { text-align: left; }
#removeItemModal .remove-item-list {
    max-height: 360px;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
}
#removeItemModal .ri-head,
#removeItemModal .remove-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px auto;
    align-items: center;
    gap: 14px;
}
#removeItemModal .ri-head {
    position: sticky; top: 0; z-index: 1;
    padding: 9px 14px;
    background: var(--cat-soft);
    border: 1px solid var(--cat-border);
    border-radius: 12px 12px 0 0;
    font: 700 .68rem var(--main-font);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cat-muted);
}
#removeItemModal .ri-head .num { text-align: center; }
#removeItemModal .remove-item-row {
    padding: 12px 14px;
    border: 1px solid var(--cat-border);
    border-top: 0;
    background: #fff;
}
#removeItemModal .remove-item-row:last-child { border-radius: 0 0 12px 12px; border-bottom: 1px solid var(--cat-border); }
#removeItemModal .ri-name { font: 700 .9rem var(--sec-font); color: var(--cat-navy); }
#removeItemModal .ri-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 3px; }
#removeItemModal .item-sku { font: .75rem var(--sec-font); color: var(--cat-muted); }
#removeItemModal .ri-tag {
    padding: 2px 8px; border-radius: 999px;
    font: 700 .66rem var(--sec-font); letter-spacing: .02em;
}
#removeItemModal .ri-tag.saved { background: var(--cat-blue-bg); color: var(--cat-blue); }
#removeItemModal .ri-tag.new { background: var(--cat-amber-bg); color: var(--cat-amber); }
#removeItemModal .ri-qty {
    justify-self: center;
    min-width: 36px; padding: 4px 8px; box-sizing: border-box;
    border-radius: 8px; background: var(--cat-soft);
    font: 700 .85rem var(--sec-font); color: var(--cat-navy); text-align: center;
}
#removeItemModal .remove-item-btn {
    width: auto; height: 34px; padding: 0 12px; gap: 6px;
    border: 1px solid #f3c4c0; border-radius: 9px;
    background: #fff; color: var(--cat-red);
    font: 600 .8rem var(--sec-font);
}
#removeItemModal .remove-item-btn:hover { background: var(--cat-red); border-color: var(--cat-red); color: #fff; }
#removeItemModal .remove-item-btn:focus-visible { outline: 3px solid rgba(217,45,32,.3); outline-offset: 2px; }

/* "removed — undo" note */
#removeItemModal .ri-note {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 12px; padding: 11px 12px 11px 14px;
    border: 1px solid #f6d7a7; border-radius: 12px;
    background: var(--cat-amber-bg);
    font: .82rem/1.45 var(--sec-font); color: #7a3e06;
}
#removeItemModal .ri-note i { margin-top: 3px; color: var(--cat-amber); }
#removeItemModal .ri-note span { flex: 1 1 auto; }
#removeItemModal .ri-undo {
    flex-shrink: 0; height: 30px; padding: 0 12px;
    border: 1px solid var(--cat-amber); border-radius: 8px;
    background: #fff; color: var(--cat-amber);
    font: 700 .8rem var(--sec-font); cursor: pointer;
}
#removeItemModal .ri-undo:hover { background: var(--cat-amber); color: #fff; }

/* empty state */
#removeItemModal .ri-empty {
    display: grid; justify-items: center; gap: 6px;
    padding: 28px 20px;
    border: 1px dashed #d0e5e1; border-radius: 12px;
    background: var(--cat-soft);
    text-align: center;
    font: .84rem/1.5 var(--sec-font); color: var(--cat-muted);
}
#removeItemModal .ri-empty i { font-size: 1.6rem; color: var(--cat-grey); margin-bottom: 4px; }
#removeItemModal .ri-empty > b { color: var(--cat-navy); font-size: .92rem; }
#removeItemModal .ri-empty span b { color: var(--cat-navy); }

@media (max-width: 480px) {
    #removeItemModal .ri-head,
    #removeItemModal .remove-item-row { grid-template-columns: minmax(0, 1fr) 44px auto; gap: 10px; }
    #removeItemModal .remove-item-btn span { display: none; }
    #removeItemModal .remove-item-btn { width: 34px; padding: 0; justify-content: center; }
}

/* ---------- Add Item pop-up ---------- */
#addItemModal .ns-box { max-width: 640px; }
#addItemModal .ns-box .title,
#addItemModal .ns-box .sub { text-align: left; }

#addItemModal .ai-search { position: relative; }
#addItemModal .ai-search > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--cat-muted); font-size: .9rem; pointer-events: none;
}
#addItemModal .ai-search input { height: 46px; padding: 0 42px 0 40px; font-size: .95rem; }
#addItemModal .ai-spin { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--cat-blue); }

/* inline notes (added / can't add) */
#addItemModal .ai-note {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 10px; padding: 10px 12px;
    border-radius: 10px; font: .84rem/1.45 var(--sec-font);
}
#addItemModal .ai-note[hidden] { display: none; }
#addItemModal .ai-note i { margin-top: 3px; }
#addItemModal .ai-note.ok { background: var(--cat-green-bg); border: 1px solid #bfe3cb; color: #14532d; }
#addItemModal .ai-note.ok i { color: var(--cat-green); }
#addItemModal .ai-note.error { background: var(--cat-red-bg); border: 1px solid #f3c4c0; color: #7f1d1d; }
#addItemModal .ai-note.error i { color: var(--cat-red); }

/* results */
#addItemModal .add-item-results { max-height: 360px; }
#addItemModal .add-item-head,
#addItemModal .add-item-result {
    grid-template-columns: minmax(0, 1fr) 92px 80px 32px;
    gap: 12px;
    padding: 10px 14px;
}
#addItemModal .add-item-head > div:last-child { grid-column: 3; }
#addItemModal .add-item-result {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--cat-border);
    background: #fff;
    text-align: left;
    font: .85rem var(--sec-font);
    color: var(--cat-text);
    cursor: pointer;
}
#addItemModal .add-item-result:hover { background: #fafdfc; }
#addItemModal .add-item-result:focus-visible { outline: 3px solid rgba(40, 120, 104,.35); outline-offset: -3px; }
#addItemModal .add-item-result .num { font-weight: 700; color: var(--cat-navy); }
#addItemModal .ai-name { font: 700 .88rem var(--sec-font); color: var(--cat-navy); }
#addItemModal .ai-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 2px; }
#addItemModal .item-sku { font: .74rem var(--sec-font); color: var(--cat-muted); }
#addItemModal .ai-chip {
    padding: 1px 8px; border-radius: 999px;
    background: var(--cat-green-bg); color: var(--cat-green);
    font: 700 .68rem var(--sec-font);
}
#addItemModal .ai-plus {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--cat-blue-bg); color: var(--cat-blue); font-size: .8rem;
    transition: background .15s, color .15s;
}
#addItemModal .add-item-result:hover .ai-plus { background: var(--cat-blue); color: #fff; }
#addItemModal .add-item-result.in-order { background: #fbfefc; }
#addItemModal .add-item-result.out-of-stock { opacity: 1; cursor: not-allowed; background: #fff; }
#addItemModal .add-item-result.out-of-stock .ai-name,
#addItemModal .add-item-result.out-of-stock .num { color: var(--cat-muted); }
#addItemModal .add-item-result.out-of-stock .ai-plus { background: var(--cat-grey-bg); color: var(--cat-grey); }
#addItemModal .ai-oos {
    padding: 2px 8px; border-radius: 999px; white-space: nowrap;
    background: var(--cat-red-bg); color: var(--cat-red); font: 700 .7rem var(--sec-font);
}
#addItemModal .ai-more {
    padding: 9px 14px; background: var(--cat-soft);
    font: .78rem var(--sec-font); color: var(--cat-muted); text-align: center;
}
#addItemModal .ai-empty {
    display: grid; justify-items: center; gap: 4px;
    padding: 26px 16px; text-align: center;
    font: .84rem var(--sec-font); color: var(--cat-muted);
}
#addItemModal .ai-empty i { font-size: 1.3rem; color: var(--cat-grey); margin-bottom: 4px; }
#addItemModal .ai-empty b { color: var(--cat-navy); }
#addItemModal .add-item-empty { padding: 14px; text-align: center; font: .84rem var(--sec-font); color: var(--cat-muted); }

@media (max-width: 480px) {
    #addItemModal .add-item-head,
    #addItemModal .add-item-result { grid-template-columns: minmax(0, 1fr) auto 30px; gap: 10px; padding: 10px 12px; }
    #addItemModal .add-item-head .stock-col,
    #addItemModal .add-item-result .stock-col { display: none; }
    #addItemModal .add-item-head > div:last-child { grid-column: 2; }
    #addItemModal .add-item-result.out-of-stock .num::after { content: " · Out of stock"; color: var(--cat-red); font-weight: 600; }
}

/* ---------- My Cart: notes, item problems, checkout state ---------- */
.main .cart-notice:empty { display: none; }
.main .cart-notice { display: grid; gap: 8px; padding: 14px 22px 0; }
.main .cart-note {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 12px 11px 14px; border-radius: 12px;
    font: .85rem/1.45 var(--sec-font);
}
.main .cart-note i { margin-top: 3px; }
.main .cart-note span { flex: 1 1 auto; }
.main .cart-note.removed { background: var(--cat-soft); border: 1px solid var(--cat-border); color: var(--cat-navy); }
.main .cart-note.removed i { color: var(--cat-blue); }
.main .cart-note.problem { background: var(--cat-red-bg); border: 1px solid #f3c4c0; color: #7f1d1d; }
.main .cart-note.problem i { color: var(--cat-red); }
.main .cart-undo {
    flex-shrink: 0; height: 30px; padding: 0 12px;
    border: 1px solid var(--cat-blue); border-radius: 8px;
    background: #fff; color: var(--cat-blue);
    font: 700 .8rem var(--sec-font); cursor: pointer;
}
.main .cart-undo:hover { background: var(--cat-blue); color: #fff; }

/* item flagged: soft red edge instead of a heavy fill */
.main .cart-wrap .cart-items.error { background: #fffafa; box-shadow: inset 3px 0 0 var(--cat-red); }
.main .cart-issue {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-top: 6px; padding: 4px 10px; border-radius: 8px;
    background: var(--cat-red-bg); color: var(--cat-red);
    font: 600 .76rem var(--sec-font);
}
.main .cart-fix {
    height: 24px; padding: 0 9px; border-radius: 6px;
    border: 1px solid var(--cat-red); background: #fff; color: var(--cat-red);
    font: 700 .74rem var(--sec-font); cursor: pointer;
}
.main .cart-fix:hover { background: var(--cat-red); color: #fff; }
.main .cart-stock.low { color: var(--cat-amber); }
.main .cart-wrap .cart-items-quantity input:disabled { color: var(--cat-grey); background: transparent; }
.main .cart-wrap .cart-items-quantity button:disabled { opacity: .4; cursor: not-allowed; }

/* summary */
.main .cart-wrap .cart-checkout:disabled { background: var(--cat-grey); opacity: 1; cursor: not-allowed; }
.main .cart-checkout-hint { margin-top: -4px; font: .78rem var(--sec-font); color: var(--cat-muted); text-align: center; }
.main .cart-wrap .cart-promo-msg { font: 600 .76rem var(--sec-font); }
.main .cart-wrap .cart-promo-msg.error { color: var(--cat-red); }

/* empty cart */
.main .cart-wrap .cart-empty { padding: 48px 22px; gap: 6px; }
.main .cart-wrap .cart-empty i { color: var(--cat-grey); opacity: 1; font-size: 2.4rem; }
.main .cart-wrap .cart-empty .title { font: 700 1.05rem var(--main-font); color: var(--cat-navy); }
.main .cart-wrap .cart-empty a {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
    height: 40px; padding: 0 16px; border-radius: 9px;
    background: var(--cat-blue); color: #fff; font: 600 .85rem var(--sec-font);
}
.main .cart-wrap .cart-empty a:hover { background: var(--cat-blue-hover); }
@media (max-width: 640px) { .main .cart-notice { padding: 12px 14px 0; } }
.main .cart-wrap .cart-promo-wrap { flex-wrap: wrap; }
.main .cart-wrap .cart-promo-msg { flex-basis: 100%; margin-top: 0; }
.main .cart-wrap .cart-empty { justify-items: center; }
.main .cart-wrap .cart-empty a { justify-self: center; }

/* ---------- Checkout ---------- */
.main .pick-row .pick-card { position: relative; }
.main .pick-soon {
    display: block; margin-top: 2px;
    font: 600 .66rem var(--sec-font); letter-spacing: .03em; text-transform: uppercase;
    color: var(--cat-muted);
}
.main .cart-form-hint {
    margin-top: -4px; padding: 8px 10px; border-radius: 8px;
    background: var(--cat-red-bg); color: var(--cat-red);
    font: 600 .78rem var(--sec-font); text-align: center;
}
.main .cart-wrap .cart-checkout:disabled .spin-pulse { color: #fff; }
.main .form-group span.error { font-family: var(--sec-font); font-weight: 600; font-size: .76rem; color: var(--cat-red); margin-left: 2px; }
.main .form-group:has(span.error:not(:empty)) .form-control { border-color: var(--cat-red); }
.main .cart-note a.cart-undo { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Announcement pop-out (memo.js) ---------- */
.ns-modal.memo-modal .ns-box {
    max-width: 580px; width: 100%; padding: 0; row-gap: 0;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 32px); overflow: hidden;
}
.ns-modal.memo-modal .memo-modal-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--cat-border);
}
.ns-modal.memo-modal .memo-modal-header .title {
    display: flex; align-items: center; gap: 10px; margin: 0;
    font: 700 1.02rem var(--main-font); color: var(--cat-navy);
}
.ns-modal.memo-modal .memo-modal-header .title i {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
    background: var(--cat-blue); color: #fff; font-size: .85rem; margin: 0;
}
.ns-modal.memo-modal .memo-count {
    padding: 2px 9px; border-radius: 999px; background: var(--cat-soft);
    font: 700 .74rem var(--sec-font); color: var(--cat-muted);
}
.ns-modal.memo-modal .memo-count:empty { display: none; }
.ns-modal.memo-modal .memo-modal-close { width: 34px; height: 34px; border-radius: 9px; color: var(--cat-muted); }
.ns-modal.memo-modal .memo-modal-close:hover { background: var(--cat-soft); color: var(--cat-navy); }

.ns-modal.memo-modal .memo-slide-viewport { min-height: 0; flex: 1 1 auto; display: flex; overflow: hidden; }
.ns-modal.memo-modal .memo-slide { display: flex; flex-direction: column; width: 100%; min-height: 0; padding: 14px 20px 0; box-sizing: border-box; }
.ns-modal.memo-modal .memo-slide-name {
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
    margin: 0 0 10px; white-space: normal;
    font: 700 .95rem var(--sec-font); color: var(--cat-navy);
}
.ns-modal.memo-modal .memo-new {
    padding: 2px 8px; border-radius: 999px; background: var(--cat-green-bg); color: var(--cat-green);
    font: 700 .68rem var(--sec-font); letter-spacing: .03em; text-transform: uppercase;
}
.ns-modal.memo-modal .memo-slide-frame {
    display: grid; gap: 10px; align-content: start; justify-content: stretch;
    max-height: min(62vh, 760px); overflow-y: auto; cursor: default;
    padding: 10px; border: 1px solid var(--cat-border); border-radius: 12px; background: var(--cat-soft);
}
.memo-slide-frame canvas.memo-page {
    background: #fff;
}
.ns-modal.memo-modal .memo-state {
    display: grid; justify-items: center; gap: 8px; padding: 60px 16px; text-align: center;
    font: .88rem var(--sec-font); color: var(--cat-muted);
}
.ns-modal.memo-modal .memo-state i { font-size: 1.6rem; color: var(--cat-blue); }
.ns-modal.memo-modal .memo-state.error i { color: var(--cat-red); }
.ns-modal.memo-modal .memo-state b { color: var(--cat-navy); }
.ns-modal.memo-modal .memo-state a { color: var(--cat-blue); font-weight: 700; }

.ns-modal.memo-modal .memo-modal-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 20px 16px;
}
.ns-modal.memo-modal .memo-foot-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ns-modal.memo-modal .memo-open {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
    border: 1px solid var(--cat-border); border-radius: 9px; text-decoration: none;
    font: 600 .82rem var(--sec-font); color: var(--cat-navy);
}
.ns-modal.memo-modal .memo-open:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.ns-modal.memo-modal .memo-pages { font: .76rem var(--sec-font); color: var(--cat-muted); }
.ns-modal.memo-modal .memo-modal-nav { display: flex; align-items: center; gap: 10px; padding: 0; }
.ns-modal.memo-modal .memo-nav-btn { width: 36px; height: 36px; border: 1px solid var(--cat-border); border-radius: 9px; background: #fff; color: var(--cat-navy); }
.ns-modal.memo-modal .memo-nav-btn:hover:not(:disabled) { border-color: var(--cat-blue); color: var(--cat-blue); background: #fff; }
.ns-modal.memo-modal .memo-dot { width: 8px; height: 8px; background: #d0e5e1; }
.ns-modal.memo-modal .memo-dot.active { width: 20px; border-radius: 4px; background: var(--cat-blue); }

/* button on the dashboard: badge only when there's something new */
.dash-memo-fab .dash-memo-badge { background: var(--cat-red); }

@media (max-width: 480px) {
    .ns-modal.memo-modal { padding: 10px; }
    .ns-modal.memo-modal .memo-slide { padding: 12px 14px 0; }
    .ns-modal.memo-modal .memo-modal-header,
    .ns-modal.memo-modal .memo-modal-foot { padding-left: 14px; padding-right: 14px; }
    .ns-modal.memo-modal .memo-slide-frame { max-height: 58vh; padding: 8px; }
    .ns-modal.memo-modal .memo-modal-foot { flex-direction: column-reverse; align-items: stretch; }
    .ns-modal.memo-modal .memo-modal-nav { justify-content: space-between; }
    .ns-modal.memo-modal .memo-open { justify-content: center; }
}
.ns-modal.memo-modal .memo-slide-frame { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ns-modal.memo-modal .memo-slide { min-width: 0; }
.ns-modal.memo-modal .memo-slide-frame { box-sizing: border-box; width: 100%; }

/* ---------- Announcement viewer: tallest possible page ---------- */
.ns-modal.memo-modal {
    /* flex (not grid) so the box can take 100% of the visible height */
    display: flex; align-items: center; justify-content: center;
    padding: 12px;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.ns-modal.memo-modal .ns-box {
    width: min(1040px, 100%); max-width: none;
    height: 100%; max-height: 100%;
}
/* header, title and toolbar keep their size; only the page area shrinks */
.ns-modal.memo-modal .memo-modal-header,
.ns-modal.memo-modal .memo-slide-name,
.ns-modal.memo-modal .memo-modal-foot { flex: 0 0 auto; }
.ns-modal.memo-modal .memo-slide { flex: 1 1 auto; padding: 12px 16px 0; }
.ns-modal.memo-modal .memo-slide-name { margin-bottom: 8px; }
.ns-modal.memo-modal .memo-slide-frame {
    flex: 1 1 auto; max-height: none; height: 0; /* fills what's left of the box */
    display: block; overflow: auto; text-align: center;
    padding: 12px; background: #525a66; border-color: #4a525d; border-radius: 10px;
}
.ns-modal.memo-modal .memo-slide-frame:focus-visible { outline: 3px solid rgba(40, 120, 104,.45); outline-offset: 2px; }
.memo-slide-frame canvas.memo-page {
    display: block; margin: 0 auto 12px; max-width: none !important;
    width: auto; height: auto; /* sized by memo.js */
    border-radius: 2px; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.memo-slide-frame canvas.memo-page:last-child { margin-bottom: 0; }
.ns-modal.memo-modal .memo-slide-frame .memo-state { color: #e9efee; }
.ns-modal.memo-modal .memo-slide-frame .memo-state b { color: #fff; }
.ns-modal.memo-modal .memo-slide-frame .memo-state a { color: #9fd0c4; }
.ns-modal.memo-modal .memo-slide-frame .memo-state i { color: #9fd0c4; }

/* toolbar */
.ns-modal.memo-modal .memo-modal-foot { padding: 10px 16px 12px; gap: 10px; }
.ns-modal.memo-modal .memo-foot-info { flex: 1 1 auto; gap: 8px; }
.ns-modal.memo-modal .memo-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ns-modal.memo-modal .memo-tools.disabled { opacity: .45; pointer-events: none; }
.ns-modal.memo-modal .memo-tool {
    height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--cat-border); border-radius: 8px; background: #fff; cursor: pointer;
    font: 600 .8rem var(--sec-font); color: var(--cat-navy);
}
.ns-modal.memo-modal .memo-tool.icon { width: 34px; padding: 0; justify-content: center; }
.ns-modal.memo-modal .memo-tool:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.ns-modal.memo-modal .memo-tool.active { background: var(--cat-blue-bg); border-color: var(--cat-blue); color: var(--cat-blue); }
.ns-modal.memo-modal .memo-tool-sep { width: 1px; height: 22px; background: var(--cat-border); margin: 0 4px; }
.ns-modal.memo-modal .memo-zoom { min-width: 46px; text-align: center; font: 700 .8rem var(--sec-font); color: var(--cat-navy); }
.ns-modal.memo-modal .memo-pageno { margin-left: 8px; font: 600 .78rem var(--sec-font); color: var(--cat-muted); white-space: nowrap; }
.ns-modal.memo-modal .memo-open { height: 34px; }

@media (max-width: 640px) {
    .ns-modal.memo-modal {
        padding: 6px;
        padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
    }
    .ns-modal.memo-modal .ns-box { height: 100%; max-height: 100%; border-radius: 14px; }
    .ns-modal.memo-modal .memo-modal-header { padding: 10px 12px; }
    .ns-modal.memo-modal .memo-slide { padding: 10px 10px 0; }
    .ns-modal.memo-modal .memo-slide-frame { padding: 8px; }
    .ns-modal.memo-modal .memo-tool span, .ns-modal.memo-modal .memo-open span { display: none; }
    .ns-modal.memo-modal .memo-tool:not(.icon), .ns-modal.memo-modal .memo-open { width: 34px; padding: 0; justify-content: center; }
    .ns-modal.memo-modal .memo-modal-foot { flex-direction: column-reverse; align-items: stretch; padding: 8px 10px 10px; }
    .ns-modal.memo-modal .memo-foot-info { justify-content: space-between; }
}

/* ---------- Statement of Account (/statement/account) ---------- */
.main.st-page { --st-r: 14px; }
.st-page .st-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.st-page .st-head-actions { display: flex; gap: 8px; }
.st-page .st-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px;
    border: 1px solid var(--cat-blue); background: var(--cat-blue); color: #fff; font: 600 .85rem var(--sec-font); cursor: pointer;
}
.st-page .st-btn:hover:not(:disabled) { background: var(--cat-blue-hover); }
.st-page .st-btn.alt { background: #fff; color: var(--cat-navy); border-color: var(--cat-border); }
.st-page .st-btn.alt:hover:not(:disabled) { border-color: var(--cat-blue); color: var(--cat-blue); background: #fff; }
.st-page .st-btn.sm { height: 32px; padding: 0 12px; font-size: .8rem; }
.st-page .st-btn:disabled { opacity: .45; cursor: not-allowed; }

.st-page .st-toolbar {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px;
    background: #fff; border: 1px solid var(--cat-border); border-radius: var(--st-r);
}
.st-page .st-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-page .st-field label { font: 600 .72rem var(--sec-font); letter-spacing: .04em; text-transform: uppercase; color: var(--cat-muted); }
.st-page .st-month-box { display: flex; align-items: center; height: 40px; border: 1px solid var(--cat-border); border-radius: 9px; overflow: hidden; background: #fff; }
.st-page .st-month-box:focus-within, .st-page .st-cust-box:focus-within { border-color: var(--cat-blue); box-shadow: 0 0 0 3px var(--cat-blue-bg); }
.st-page .st-month-box input { height: 100%; border: 0; outline: 0; padding: 0 10px; font: 600 .9rem var(--sec-font); color: var(--cat-navy); min-width: 170px; background: transparent; }
.st-page .st-step { width: 38px; height: 100%; border: 0; background: var(--cat-soft); color: var(--cat-navy); cursor: pointer; }
.st-page .st-step:hover:not(:disabled) { color: var(--cat-blue); }
.st-page .st-step:disabled { color: var(--cat-grey); cursor: not-allowed; }
.st-page .st-quick { display: flex; gap: 6px; padding-bottom: 4px; }
.st-page .st-chip {
    height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--cat-border); background: #fff;
    font: 600 .8rem var(--sec-font); color: var(--cat-muted); cursor: pointer;
}
.st-page .st-chip:hover { color: var(--cat-blue); border-color: var(--cat-blue); }
.st-page .st-chip.on { background: var(--cat-blue-bg); color: var(--cat-blue); border-color: transparent; }

.st-page .st-cust { flex: 1 1 300px; max-width: 420px; }
.st-page .st-cust-box { position: relative; display: flex; align-items: center; height: 40px; border: 1px solid var(--cat-border); border-radius: 9px; background: #fff; padding: 0 10px; gap: 8px; }
.st-page .st-cust-box > i { color: var(--cat-muted); font-size: .85rem; }
.st-page .st-cust-box input { flex: 1; min-width: 0; border: 0; outline: 0; height: 100%; font: 500 .9rem var(--sec-font); color: var(--cat-navy); background: transparent; }
.st-page .st-cust-clear { border: 0; background: none; color: var(--cat-muted); cursor: pointer; width: 26px; height: 26px; border-radius: 6px; }
.st-page .st-cust-clear:hover { background: var(--cat-soft); color: var(--cat-red); }
.st-page .st-cust-list {
    position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 320px; overflow: auto;
    background: #fff; border: 1px solid var(--cat-border); border-radius: 10px; box-shadow: 0 12px 28px rgba(15, 30, 60, .14); padding: 4px;
}
.st-page .st-cust-opt { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.st-page .st-cust-opt b { font: 600 .88rem var(--sec-font); color: var(--cat-navy); }
.st-page .st-cust-opt span { font-size: .76rem; color: var(--cat-muted); }
.st-page .st-cust-opt:hover, .st-page .st-cust-opt.on { background: var(--cat-blue-bg); }
.st-page .st-cust-none { padding: 12px; font-size: .85rem; color: var(--cat-muted); }

.st-page .st-alert {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px;
    background: var(--cat-red-bg); color: var(--cat-red); font: 600 .88rem var(--sec-font);
}
.st-page .st-alert span { flex: 1; }

/* Sheet */
.st-page .st-sheet { background: #fff; border: 1px solid var(--cat-border); border-radius: var(--st-r); padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.st-page .st-letterhead, .st-page .st-printnote { display: none; }
.st-page .st-details { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.st-page .st-cap { font: 600 .72rem var(--sec-font); text-transform: uppercase; letter-spacing: .05em; color: var(--cat-muted); margin-bottom: 6px; }
.st-page .st-name { font: 700 1.2rem var(--main-font); color: var(--cat-navy); margin-bottom: 4px; }
.st-page .st-line { font-size: .86rem; color: var(--cat-text); line-height: 1.5; }
.st-page .st-meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding: 14px 16px; background: var(--cat-soft); border-radius: 12px; }
.st-page .st-meta dt { font: 600 .7rem var(--sec-font); text-transform: uppercase; letter-spacing: .04em; color: var(--cat-muted); }
.st-page .st-meta dd { margin: 2px 0 0; font: 600 .9rem var(--sec-font); color: var(--cat-navy); }

.st-page .st-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.st-page .st-tile { border: 1px solid var(--cat-border); border-radius: 12px; padding: 14px 16px; border-top: 3px solid var(--cat-grey); }
.st-page .st-tile.debit { border-top-color: var(--cat-blue); }
.st-page .st-tile.credit { border-top-color: var(--cat-green); }
.st-page .st-tile.closing { border-top-color: var(--cat-amber); background: var(--cat-amber-bg); border-color: transparent; border-top: 3px solid var(--cat-amber); }
.st-page .st-tile.closing.is-credit { background: var(--cat-green-bg); border-top-color: var(--cat-green); }
.st-page .st-tile-k { font: 600 .74rem var(--sec-font); text-transform: uppercase; letter-spacing: .04em; color: var(--cat-muted); }
.st-page .st-tile-v { font: 700 1.35rem var(--main-font); color: var(--cat-navy); margin: 4px 0 2px; white-space: nowrap; }
.st-page .st-tile-s { font-size: .78rem; color: var(--cat-muted); }

.st-page .st-aging { display: flex; align-items: stretch; border: 1px solid var(--cat-border); border-radius: 12px; overflow: hidden; }
.st-page .st-aging-k { display: flex; align-items: center; padding: 0 16px; background: var(--cat-soft); font: 700 .74rem var(--sec-font); text-transform: uppercase; letter-spacing: .05em; color: var(--cat-muted); }
.st-page .st-age { flex: 1; padding: 10px 14px; border-left: 1px solid var(--cat-border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-page .st-age span { font-size: .74rem; color: var(--cat-muted); }
.st-page .st-age b { font: 700 .95rem var(--sec-font); color: var(--cat-navy); }
.st-page .st-age b.zero { color: var(--cat-grey); }

.st-page .st-table-wrap { border: 1px solid var(--cat-border); border-radius: 12px; overflow: auto; }
.st-page .st-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.st-page .st-table th { position: sticky; top: 0; background: var(--cat-soft); text-align: left; padding: 10px 12px; font: 700 .72rem var(--sec-font); text-transform: uppercase; letter-spacing: .04em; color: var(--cat-muted); border-bottom: 1px solid var(--cat-border); white-space: nowrap; }
.st-page .st-table td { padding: 10px 12px; border-bottom: 1px solid var(--cat-border); color: var(--cat-text); white-space: nowrap; vertical-align: middle; }
.st-page .st-table td.desc { white-space: normal; min-width: 180px; }
.st-page .st-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.st-page .st-table td.credit { color: var(--cat-green); }
.st-page .st-table td.strong { font-weight: 700; color: var(--cat-navy); }
.st-page .st-table td.mono { font-family: var(--trd-font); font-weight: 600; color: var(--cat-navy); }
.st-page .st-table tbody tr:not(.st-empty-row):not(.st-skel):hover td { background: #fcfdfd; }
.st-page .st-table tr.st-bf td { background: var(--cat-soft); font-style: italic; }
.st-page .st-table tfoot td { background: var(--cat-navy); color: #fff; font-weight: 700; border: 0; }
.st-page .st-sheet.is-empty .st-table tfoot td { background: var(--cat-soft); color: var(--cat-grey); }
.st-page .st-type { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 700 .72rem var(--sec-font); background: var(--cat-grey-bg); color: var(--cat-muted); }
.st-page .st-type.iv { background: var(--cat-blue-bg); color: var(--cat-blue); }
.st-page .st-type.pm { background: var(--cat-green-bg); color: var(--cat-green); }
.st-page .st-type.cn { background: var(--cat-amber-bg); color: var(--cat-amber); }
.st-page .st-type.dn { background: var(--cat-violet-bg); color: var(--cat-violet); }

/* Empty layout + loading */
.st-page .st-sheet.is-empty .st-details, .st-page .st-sheet.is-empty .st-tiles, .st-page .st-sheet.is-empty .st-aging { color: var(--cat-grey); }
.st-page .st-sheet.is-empty .st-name, .st-page .st-sheet.is-empty .st-meta dd, .st-page .st-sheet.is-empty .st-tile-v,
.st-page .st-sheet.is-empty .st-age b, .st-page .st-sheet.is-empty .st-line { color: var(--cat-grey); }
.st-page .st-sheet.is-empty .st-tile { border-top-color: var(--cat-border); background: #fff; }
.st-page .st-sheet.is-empty .st-tile.closing { border: 1px solid var(--cat-border); border-top: 3px solid var(--cat-border); }
.st-page .st-table td:has(.st-empty) { white-space: normal; border-bottom: 0; }
.st-page .st-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 54px 16px; gap: 6px; }
.st-page .st-empty.small { padding: 30px 16px; }
.st-page .st-empty-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--cat-blue-bg); color: var(--cat-blue); font-size: 1.4rem; margin-bottom: 6px; }
.st-page .st-empty-t { font: 700 1rem var(--main-font); color: var(--cat-navy); }
.st-page .st-empty-s { font-size: .86rem; color: var(--cat-muted); max-width: 380px; }
.st-page .st-skel td span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--cat-grey-bg), #f8fbfa, var(--cat-grey-bg)); background-size: 200% 100%; animation: stShimmer 1.2s infinite linear; }
.st-page .st-sheet.is-loading .st-details, .st-page .st-sheet.is-loading .st-tiles, .st-page .st-sheet.is-loading .st-aging { opacity: .5; }
@keyframes stShimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
    .st-page .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .st-page .st-details { grid-template-columns: minmax(0, 1fr); }
    .st-page .st-sheet { padding: 14px; gap: 14px; }
    .st-page .st-aging { flex-wrap: wrap; }
    .st-page .st-aging-k { flex: 1 0 100%; padding: 8px 14px; }
    .st-page .st-age { flex: 1 0 33%; border-left: 0; border-top: 1px solid var(--cat-border); }
    .st-page .st-toolbar { padding: 12px; }
    .st-page .st-cust { max-width: none; flex-basis: 100%; }
    .st-page .st-month { flex: 1 1 100%; }
    .st-page .st-quick { padding-bottom: 0; }
    .st-page .st-month-box input { min-width: 0; flex: 1; }
}
@media (max-width: 640px) {
    .st-page .st-head-actions .st-btn span { display: none; }
    .st-page .st-head-actions .st-btn { width: 40px; padding: 0; justify-content: center; }
    .st-page .st-tile-v { font-size: 1.1rem; }
    .st-page .st-meta { grid-template-columns: 1fr 1fr; }
    /* Table becomes cards */
    .st-page .st-table-wrap { border: 0; overflow: visible; }
    .st-page .st-table thead { display: none; }
    .st-page .st-table, .st-page .st-table tbody, .st-page .st-table tfoot { display: block; }
    .st-page .st-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; border: 1px solid var(--cat-border); border-radius: 12px; margin-bottom: 8px; }
    .st-page .st-table td { display: flex; flex-direction: column; align-items: flex-start; padding: 0; border: 0; white-space: normal; background: none !important; }
    .st-page .st-table tr { gap: 6px 12px; }
    .st-page .st-table td::before { content: attr(data-l); font: 600 .66rem var(--sec-font); text-transform: uppercase; letter-spacing: .04em; color: var(--cat-muted); }
    .st-page .st-table td.num { text-align: left; }
    .st-page .st-table td:empty, .st-page .st-table td.num:empty { display: none; }
    .st-page .st-table td.desc { grid-column: 1 / -1; min-width: 0; }
    .st-page .st-table tr.st-bf { background: var(--cat-soft); }
    .st-page .st-table tr.st-empty-row, .st-page .st-table tr.st-skel { display: block; }
    .st-page .st-table tr.st-skel td { margin: 6px 0; }
    .st-page .st-table tr.st-skel td::before { content: none; }
    .st-page .st-table tfoot tr { background: var(--cat-navy); border-color: var(--cat-navy); }
    .st-page .st-table tfoot td[colspan] { grid-column: 1 / -1; }
    .st-page .st-table tfoot td::before { color: rgba(255,255,255,.7); }
    .st-page .st-sheet.is-empty .st-table tfoot tr { background: var(--cat-soft); border-color: var(--cat-border); }
}

@media print {
    @page { size: A4; margin: 12mm 10mm; }
    html, body { background: #fff !important; }
    .nav-sidebar, .nav-topbar, .nav-ticker, .st-page .st-head, .st-page .st-toolbar, #stNotice { display: none !important; }
    .main.st-page { margin: 0 !important; padding: 0 !important; width: auto !important; max-width: none !important; }
    .st-page .st-sheet { border: 0; padding: 0; gap: 10px; }
    .st-page .st-letterhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid #000; }
    .st-page .st-co { font: 700 13pt var(--main-font); color: #000; }
    .st-page .st-co-sub { font-size: 7.5pt; color: #333; max-width: 120mm; }
    .st-page .st-doc-title { font: 700 12pt var(--main-font); letter-spacing: .06em; color: #000; white-space: nowrap; }
    .st-page .st-details { grid-template-columns: 1.2fr 1fr; gap: 12px; }
    .st-page .st-meta { background: none; border: 1px solid #999; border-radius: 0; padding: 6px 8px; gap: 4px 10px; }
    .st-page .st-tiles { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .st-page .st-tile, .st-page .st-tile.closing, .st-page .st-tile.closing.is-credit { background: none; border: 1px solid #999; border-top: 1px solid #999; border-radius: 0; padding: 6px 8px; }
    .st-page .st-tile.closing { border: 2px solid #000; }
    .st-page .st-tile-v { font-size: 11pt; }
    .st-page .st-aging, .st-page .st-table-wrap { border-radius: 0; border-color: #999; overflow: visible; }
    .st-page .st-aging { flex-wrap: nowrap; }
    .st-page .st-aging-k { background: none; flex: 0 0 auto; padding: 0 10px; }
    .st-page .st-age { flex: 1; border-left: 1px solid #999; border-top: 0; padding: 4px 8px; }
    .st-page .st-table { font-size: 8pt; }
    .st-page .st-table th { position: static; background: #eee !important; color: #000; padding: 4px 6px; }
    .st-page .st-table td { padding: 4px 6px; color: #000 !important; border-color: #ccc; }
    .st-page .st-table thead { display: table-header-group; }
    .st-page .st-table tr { break-inside: avoid; }
    .st-page .st-table tfoot { display: table-row-group; }
    .st-page .st-table tfoot td { background: #eee !important; color: #000; border-top: 2px solid #000; }
    .st-page .st-type { background: none !important; color: #000 !important; padding: 0; font-weight: 600; }
    .st-page .st-printnote { display: block; font-size: 7.5pt; color: #444; margin-top: 4px; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Statement: admin all-customers view */
.st-page .st-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--cat-border); background: #fff; color: var(--cat-navy); font: 600 .8rem var(--sec-font); cursor: pointer; margin-bottom: -4px; }
.st-page .st-back:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.st-page .st-cust-opt.all { border-bottom: 1px solid var(--cat-border); border-radius: 8px 8px 0 0; margin-bottom: 2px; }
.st-page .st-cust-opt.all i { color: var(--cat-blue); margin-right: 4px; }
.st-page .st-listbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: -6px; }
.st-page .st-filter { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--cat-border); border-radius: 9px; flex: 0 1 280px; background: #fff; }
.st-page .st-filter:focus-within { border-color: var(--cat-blue); box-shadow: 0 0 0 3px var(--cat-blue-bg); }
.st-page .st-filter i { color: var(--cat-muted); font-size: .8rem; }
.st-page .st-filter input { flex: 1; min-width: 0; border: 0; outline: 0; font: 500 .86rem var(--sec-font); color: var(--cat-navy); background: transparent; }
.st-page .st-toggle { display: inline-flex; align-items: center; gap: 6px; font: 600 .82rem var(--sec-font); color: var(--cat-text); cursor: pointer; }
.st-page .st-toggle input { accent-color: var(--cat-blue); width: 16px; height: 16px; }
.st-page .st-listinfo { margin-left: auto; font-size: .8rem; color: var(--cat-muted); }
.st-page .st-sheet.is-empty .st-listbar { opacity: .5; }
.st-page .st-sum th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.st-page .st-sum th button::after { content: "\f0dc"; font: 900 .65rem "Font Awesome 6 Free"; color: var(--cat-grey); }
.st-page .st-sum th button.on { color: var(--cat-blue); }
.st-page .st-sum th button.on::after { content: "\f0de"; color: var(--cat-blue); }
.st-page .st-sum th button.on.desc::after { content: "\f0dd"; }
.st-page .st-sum th button:focus-visible { outline: 2px solid var(--cat-blue); outline-offset: 2px; border-radius: 4px; }
.st-page .st-sum td.desc b { color: var(--cat-navy); font-weight: 600; }
.st-page .st-sum td.cr { color: var(--cat-green); }
.st-page .st-sum tr.st-click { cursor: pointer; }
.st-page .st-sum tr.st-click:focus-visible td { background: var(--cat-blue-bg); outline: 0; }
.st-page .st-sum th.act, .st-page .st-sum td.act { width: 1%; text-align: right; }
.st-page .st-open { display: inline-flex; align-items: center; gap: 6px; font: 600 .8rem var(--sec-font); color: var(--cat-blue); opacity: .55; }
.st-page .st-sum tr.st-click:hover .st-open { opacity: 1; }
.st-page .st-sum tr.st-click:hover td { background: var(--cat-blue-bg) !important; }
@media (max-width: 640px) {
    .st-page .st-listbar { gap: 10px; }
    .st-page .st-filter { flex: 1 1 100%; }
    .st-page .st-sum td.act { grid-column: 1 / -1; align-items: flex-end; width: auto; }
    .st-page .st-sum td.act::before { content: none; }
    .st-page .st-sum td.desc { grid-column: 2 / -1; order: -1; }
    .st-page .st-sum td.desc::before { content: none; }
    .st-page .st-sum td.mono { order: -2; }
    .st-page .st-sum td.mono::before { content: none; }
    .st-page .st-sum .st-open { opacity: 1; }
}
@media print {
    .st-page .st-back, .st-page .st-listbar, .st-page .st-sum .act, .st-page .st-sum th button::after { display: none !important; }
    .st-page .st-sheet[hidden] { display: none !important; }
    .st-page .st-sum th button, .st-page .st-sum td.desc b { color: #000 !important; }
}
.st-page .st-sheet[hidden] { display: none !important; }

/* Outstanding: refresh button (top bar, every page) */
.nav-topbar .nav-credit { position: relative; padding-right: 6px; }
.nav-topbar .nav-credit-refresh {
    width: 28px; height: 28px; margin-left: 2px; border: 0; border-radius: 8px; background: transparent;
    color: var(--cat-muted); display: grid; place-items: center; cursor: pointer; font-size: .8rem; flex-shrink: 0;
}
.nav-topbar .nav-credit-refresh:hover { background: var(--cat-blue-bg); color: var(--cat-blue); }
.nav-topbar .nav-credit-refresh:focus-visible { outline: 2px solid var(--cat-blue); outline-offset: 1px; }
.nav-topbar .nav-credit-refresh:disabled { cursor: progress; }
.nav-topbar .nav-credit .nav-credit-refresh span { color: inherit; }
.nav-topbar .nav-credit-refresh.spin span { animation: navCreditSpin .7s linear infinite; color: var(--cat-blue); }
@keyframes navCreditSpin { to { transform: rotate(360deg); } }
.nav-topbar .nav-credit-value.flash span { animation: navCreditFlash 1.4s ease; }
@keyframes navCreditFlash { 0%, 40% { color: var(--cat-green); } 100% { color: var(--cat-navy); } }
.nav-topbar .nav-credit .nav-credit-toast {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; white-space: nowrap;
    padding: 6px 10px; border-radius: 8px; background: var(--cat-navy); color: #fff; font: 600 .76rem var(--sec-font);
    box-shadow: 0 8px 20px rgba(15, 30, 60, .18); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: .18s ease;
}
.nav-topbar .nav-credit .nav-credit-toast.show { opacity: 1; transform: none; }
.nav-topbar .nav-credit .nav-credit-toast.ok::before { content: "\f00c"; font: 900 .7rem "Font Awesome 6 Free"; margin-right: 6px; color: #7ee2a8; }
.nav-topbar .nav-credit .nav-credit-toast.err { background: var(--cat-red); }
@media (max-width: 480px) {
    .nav-topbar .nav-credit { padding: 0 4px 0 10px; gap: 4px; }
    .nav-topbar .nav-credit-refresh { width: 26px; height: 26px; }
}
.nav-topbar .nav-credit.is-locked .nav-credit-refresh { color: var(--cat-grey); opacity: .45; cursor: not-allowed; background: transparent; }
.nav-topbar .nav-credit.is-stale .nav-credit-value span { color: var(--cat-muted); }
.nav-topbar .nav-credit.is-stale .nav-credit-label::after { content: " \00b7  not updated"; text-transform: none; letter-spacing: 0; color: var(--cat-amber); }
@media print { .nav-credit-refresh, .nav-credit-toast { display: none !important; } }

/* e-Invoice profile flag (Customer Management list + Edit User) */
.einv-flag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font: 700 .74rem var(--sec-font); white-space: nowrap; }
.einv-flag::before { font: 900 .62rem "Font Awesome 6 Free"; }
.einv-flag.on { background: var(--cat-green-bg); color: var(--cat-green); }
.einv-flag.on::before { content: "\f00c"; }
.einv-flag.off { background: var(--cat-red-bg); color: var(--cat-red); }
.einv-flag.off::before { content: "\f00d"; }
.einv-note { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--cat-soft); font-size: .78rem; color: var(--cat-muted); line-height: 1.45; }
.einv-note i { margin-right: 4px; color: var(--cat-grey); }
.einv-note .einv-ok { color: var(--cat-green); font-weight: 600; }
.einv-note .einv-err { color: var(--cat-red); font-weight: 600; }

/* ---------- Analysis pages (Sales Summary + Product Summary) ---------- */
.an-page .an-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.an-page .an-switch { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--cat-border); border-radius: 10px; background: #fff; color: var(--cat-navy); font: 600 .84rem var(--sec-font); text-decoration: none; }
.an-page .an-switch:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.an-page .lx-ss-presets .ss-btn.alt.on { background: #fff; color: var(--cat-blue); box-shadow: 0 1px 3px rgba(15, 30, 60, .1); }
.an-page .an-chips { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.an-page .an-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--cat-blue-bg); color: var(--cat-blue); font: 600 .82rem var(--sec-font); }
.an-page .an-chip small { color: var(--cat-muted); font-weight: 600; }
.an-page .an-chip a { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--cat-blue); text-decoration: none; }
.an-page .an-chip a:hover { background: #fff; color: var(--cat-red); }
.an-page .ss-kpis { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.an-page .ss-kpi { padding: 16px 18px; min-width: 0; }
.an-page .ss-kpi .value { font-size: 1.35rem; }
.an-page .an-kpi-sub { margin-top: 6px; font: 500 .76rem var(--sec-font); color: var(--cat-muted); }
.an-page .ss-kpi.xmain .an-kpi-sub { color: rgba(255, 255, 255, .75); }
.an-page .an-kpi-text { font-size: 1rem !important; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.an-page .an-trend { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font: 700 .72rem var(--sec-font); white-space: nowrap; }
.an-page .an-trend.up { background: var(--cat-green-bg); color: var(--cat-green); }
.an-page .an-trend.down { background: var(--cat-red-bg); color: var(--cat-red); }
.an-page .an-trend.flat { background: var(--cat-grey-bg); color: var(--cat-muted); }
.an-page .an-trend.new { background: var(--cat-violet-bg); color: var(--cat-violet); }
.an-page .ss-kpi.xmain .an-trend { background: rgba(255, 255, 255, .16); color: #fff; }
.an-page .an-customers { margin-bottom: 20px; }
.an-page .an-customers .ss-panel-head { flex-wrap: wrap; }
.an-page .an-customers .lx-ss-hint { margin-left: 0; margin-right: auto; }
.an-page .an-tools { display: flex; align-items: center; gap: 8px; }
.an-page .an-search { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--cat-border); border-radius: 9px; background: #fff; }
.an-page .an-search:focus-within { border-color: var(--cat-blue); box-shadow: 0 0 0 3px var(--cat-blue-bg); }
.an-page .an-search i { color: var(--cat-muted); font-size: .78rem; }
.an-page .an-search input { border: 0; outline: 0; width: 170px; font: 500 .84rem var(--sec-font); color: var(--cat-navy); background: transparent; }
.an-page .an-info { font-size: .76rem; color: var(--cat-muted); }
.an-page .an-csv { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; }
.an-page .ss-panel-head .an-csv { margin-left: auto; }
.an-page .an-tools .an-csv { margin-left: 0; }
.an-page .an-more { margin-left: auto; font: 600 .8rem var(--sec-font); color: var(--cat-blue); text-decoration: none; }
.an-page .an-table th[data-type] { user-select: none; }
.an-page .an-table th[data-type]::after { content: "\f0dc"; font: 900 .6rem "Font Awesome 6 Free"; color: var(--cat-grey); margin-left: 5px; }
.an-page .an-table th[data-dir="asc"]::after { content: "\f0de"; color: var(--cat-blue); }
.an-page .an-table th[data-dir="desc"]::after { content: "\f0dd"; color: var(--cat-blue); }
.an-page .an-table th[data-type]:focus-visible { outline: 2px solid var(--cat-blue); outline-offset: -2px; }
.an-page .an-hide { display: none; }
.an-page .an-rank, .an-page .an-rank-h { width: 1%; color: var(--cat-muted); font-variant-numeric: tabular-nums; }
.an-page .an-name { font-weight: 600; color: var(--cat-navy); }
.an-page .an-sub { font-size: .74rem; color: var(--cat-muted); margin-top: 1px; }
.an-page .an-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--cat-violet-bg); color: var(--cat-violet); font: 700 .66rem var(--sec-font); vertical-align: 1px; }
.an-page .an-strong { font-weight: 700; color: var(--cat-navy); }
.an-page .an-mono { font-family: var(--trd-font); font-weight: 600; }
.an-page .an-share { min-width: 140px; white-space: nowrap; }
.an-page .an-share > span:last-child { display: inline-block; width: 46px; text-align: right; font-size: .78rem; color: var(--cat-muted); font-variant-numeric: tabular-nums; }
.an-page .an-bar { display: inline-block; vertical-align: middle; width: 80px; height: 8px; border-radius: 4px; background: var(--cat-grey-bg); overflow: hidden; }
.an-page .an-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--cat-blue); }
.an-page tr[data-href] { cursor: pointer; }
.an-page tr[data-href]:hover td { background: var(--cat-blue-bg); }
.an-page tr[data-href]:focus-visible td { background: var(--cat-blue-bg); outline: 0; }
.an-page .an-go { width: 1%; white-space: nowrap; color: var(--cat-grey); text-align: right; }
.an-page .an-go a { margin-right: 10px; color: var(--cat-muted); }
.an-page .an-go a:hover { color: var(--cat-blue); }
.an-page tr[data-href]:hover .an-go > i { color: var(--cat-blue); }
.an-page .an-product { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 18px; background: #fff; border: 1px solid var(--cat-border); border-radius: 14px; }
.an-page .an-product-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--cat-blue-bg); color: var(--cat-blue); font-size: 1.2rem; flex-shrink: 0; }
.an-page .an-product-name { font: 700 1.1rem var(--main-font); color: var(--cat-navy); }
.an-page .an-back { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--cat-border); border-radius: 9px; color: var(--cat-navy); font: 600 .8rem var(--sec-font); text-decoration: none; white-space: nowrap; }
.an-page .an-back:hover { border-color: var(--cat-blue); color: var(--cat-blue); }
.an-page .ps-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.an-page .an-table th, .an-page .an-table td { padding-left: 10px; padding-right: 10px; }
.an-page .an-table td:has(> .an-name) { min-width: 210px; }
.an-page .an-table .an-bar { width: 56px; }
.an-page .an-table .an-share { min-width: 0; }
@media (max-width: 1100px) { .an-page .ps-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .an-page .an-table td:has(> .an-name) { min-width: 150px; } }
.an-page .an-note { padding: 10px 16px; font-size: .78rem; color: var(--cat-muted); border-top: 1px solid var(--cat-border); }
@media (max-width: 640px) {
    .an-page .an-tools { flex-basis: 100%; }
    .an-page .an-search { flex: 1; }
    .an-page .an-search input { width: 100%; }
    .an-page .an-product { flex-wrap: wrap; }
    .an-page .an-back { margin-left: 0; }
}

/* ---------- Sample data (layout parts whose API isn't connected yet; see js/sampleData.js) ---------- */
.sample-tag {
    display: inline-flex; align-items: center; gap: 5px; flex: none;
    padding: 2px 9px; border-radius: 999px;
    background: var(--cat-amber-bg); color: var(--cat-amber);
    font: 700 .68rem var(--sec-font); letter-spacing: .02em; white-space: nowrap; vertical-align: middle;
    cursor: help;
}
.sample-tag i { font-size: .65rem; }
.st-page .st-alert.st-sample { background: var(--cat-amber-bg); color: var(--cat-amber); }
.st-page .st-alert.st-sample span.sample-tag { flex: none; background: #fff; }
.einv-flag.is-sample { outline: 1px dashed currentColor; outline-offset: 1px; }

/* Customer editor: locked sign-in email */
.form-control.is-locked { background: var(--cat-grey-bg); color: var(--cat-muted); cursor: not-allowed; }
.form-control.is-locked:focus { box-shadow: none; border-color: var(--cat-border); }
.lx-locked { margin-left: 4px; color: var(--cat-grey); font-size: .75em; }
