:root {
    color-scheme: light;
    --ink: #202226;
    --muted: #6d7380;
    --line: #dde2e8;
    --surface: #ffffff;
    --soft: #f6f3ee;
    --soft-blue: #eef6f7;
    --brand: #a93631;
    --brand-dark: #7b2523;
    --mint: #2f7d6b;
    --gold: #c8892f;
    --blue: #356b9d;
    --danger: #b84444;
    --shadow: 0 16px 40px rgba(32, 34, 38, .08);
    --shadow-soft: 0 10px 24px rgba(32, 34, 38, .06);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: linear-gradient(180deg, #fffaf4 0, #f6f8f7 360px, #f4f6f8 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.page-loading > *:not(.page-load-overlay) {
    filter: blur(10px);
    transform: scale(1.004);
    pointer-events: none;
    transition: filter .34s ease, transform .34s ease;
}

body:not(.page-loading) > *:not(.page-load-overlay) {
    transition: filter .34s ease, transform .34s ease;
}

.page-load-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .42);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

body.page-loading .page-load-overlay {
    opacity: 1;
}

.page-load-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(169, 54, 49, .18);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: button-spin .7s linear infinite;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

button.is-busy {
    gap: 8px;
    pointer-events: none;
}

.button-spinner {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin .7s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pending-payment-blink {
    0%,
    100% {
        background: #dc2626;
        box-shadow: 0 0 0 rgba(220, 38, 38, 0);
    }

    50% {
        background: #991b1b;
        box-shadow: 0 0 0 4px rgba(220, 38, 38, .18);
    }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px 24px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid rgba(221, 226, 232, .82);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 34px rgba(32, 34, 38, .07);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
    min-width: 220px;
    padding: 4px 0;
}

.brand-logo {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 96, 0, .14);
    box-shadow: 0 10px 22px rgba(255, 96, 0, .18);
}

.brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.1;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #d79035);
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(169, 54, 49, .22);
}

.brand small,
.session,
.eyebrow {
    color: var(--muted);
}

.brand small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    align-items: center;
    min-width: 0;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
    border: 1px solid rgba(221, 226, 232, .82);
    border-radius: 14px;
    background: rgba(246, 248, 250, .86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
}

.mobile-menu-toggle {
    display: none;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    margin: 3px 0;
    border-radius: 999px;
    background: currentColor;
    transition: transform .16s ease, opacity .16s ease;
}

.topbar.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.topbar.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

.topbar.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.nav-link,
.tab,
.ghost,
.text-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    border-radius: 7px;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 850;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.nav-link:hover {
    background: #fff;
    color: var(--brand-dark);
    box-shadow: 0 8px 18px rgba(32, 34, 38, .07);
}

.cart-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.nav-link.active,
.tab.active {
    background: #fff;
    color: var(--brand-dark);
}

.nav-link.active {
    box-shadow: 0 8px 18px rgba(169, 54, 49, .12);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: var(--brand);
}

.manager-link {
    margin-left: 0;
}

.mobile-bottom-nav {
    display: none;
}

.bottom-nav-link {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
}

.session {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 190px;
    font-size: 14px;
}

#welcomeText {
    max-width: 170px;
    overflow: hidden;
    color: var(--ink);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-portal="partner"]:not(.partner-logged-in) #welcomeText,
body[data-portal="partner-login"] #welcomeText,
body[data-portal="partner-register"] #welcomeText,
body[data-portal="partner-reset"] #welcomeText {
    display: none !important;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 64px;
}

.admin-shell {
    width: min(1280px, calc(100% - 32px));
}

body[data-portal="management"] {
    background: #f3f5f7;
}

body[data-portal="management"] .topbar {
    grid-template-columns: auto 1fr auto;
}

.manager-login-card {
    padding: 24px;
}

.manager-login-card h1 {
    max-width: 320px;
    margin: 0;
    line-height: 1.08;
}

.admin-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 7px;
    padding: 14px;
    min-height: calc(100vh - 118px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.admin-sidebar-title {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 4px 4px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.admin-sidebar-title small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.small-mark {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.admin-sidebar .nav-link {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 10px;
    color: #434952;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.admin-sidebar .nav-link > span:last-child {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
    overflow-wrap: anywhere;
}

.admin-sidebar .nav-link.active {
    background: var(--brand);
    color: #fff;
}

.menu-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #f1e7e2;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
}

.menu-count {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 26px;
    padding: 0 7px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    border: 1px solid rgba(220, 38, 38, .35);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.menu-count[hidden] {
    display: none;
}

.menu-count[data-menu-count="products"] {
    background: #16a34a;
    border-color: rgba(22, 163, 74, .38);
    color: #fff;
}

.menu-icon i {
    line-height: 1;
}

.admin-sidebar .nav-link.active .menu-icon {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.admin-sidebar .nav-link.active .menu-count {
    background: #b91c1c;
    color: #fff;
    border-color: rgba(255, 255, 255, .32);
}

.admin-sidebar .nav-link.active .menu-count[data-menu-count="products"] {
    background: #15803d;
    border-color: rgba(255, 255, 255, .32);
}

.admin-content {
    min-width: 0;
}

.admin-page-title {
    margin-top: 2px;
}

.sticky-editor {
    position: sticky;
    top: 84px;
}

.hero-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 26px;
    align-items: center;
    min-height: 320px;
    padding: 42px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .70)),
        radial-gradient(circle at 80% 18%, rgba(47, 125, 107, .30), transparent 30%),
        radial-gradient(circle at 92% 84%, rgba(200, 137, 47, .24), transparent 24%),
        linear-gradient(135deg, #f5d7ad, #d8eeee 72%);
    border: 1px solid rgba(221, 226, 232, .9);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.hero-band h1,
.section-title h1,
.section-title h2,
.panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.hero-band h1 {
    max-width: 650px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1;
}

.hero-band p {
    max-width: 620px;
    line-height: 1.7;
}

.hero-logo {
    width: clamp(92px, 14vw, 132px);
    height: auto;
    display: block;
    margin: 0 0 18px;
    border-radius: 14px;
    box-shadow: 0 16px 32px rgba(255, 96, 0, .18);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-visual {
    display: grid;
    place-items: center;
    min-height: 190px;
}

.brand-showcase {
    position: relative;
    min-height: 260px;
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .90), rgba(255, 244, 235, .72)),
        radial-gradient(circle at 88% 12%, rgba(255, 96, 0, .16), transparent 34%);
    border: 1px solid rgba(255, 255, 255, .82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 22px 40px rgba(45, 36, 29, .10);
}

.brand-showcase > img {
    width: min(230px, 70%);
    height: auto;
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(255, 96, 0, .22);
}

.hero-carousel {
    overflow: hidden;
}

.hero-carousel-track {
    position: absolute;
    inset: 0;
}

.hero-carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 14px;
    object-fit: cover;
    opacity: 0;
    transition: opacity .45s ease;
}

.hero-carousel-slide.active {
    opacity: 1;
}

.hero-carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 2;
    display: flex;
    gap: 7px;
    transform: translateX(-50%);
}

.hero-carousel-dots button {
    width: 9px;
    height: 9px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 0 0 1px rgba(99, 79, 69, .18);
}

.hero-carousel-dots button.active {
    width: 24px;
    background: var(--brand);
}

body[data-portal="partner"] .storefront-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 18px;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body[data-portal="partner"] .storefront-carousel .hero-carousel-track,
body[data-portal="partner"] .storefront-carousel .hero-carousel-slide {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

body[data-portal="partner"] .storefront-carousel .hero-carousel-slide {
    padding: 0;
    object-fit: cover;
    object-position: center center;
    background: transparent;
}

body[data-portal="partner"] .hero-band {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: #fff;
}

body[data-portal="partner"] .hero-band > div:first-child {
    display: none;
}

body[data-portal="partner"] .hero-visual,
body[data-portal="partner"] .brand-showcase {
    width: 100%;
    max-width: 100%;
}

body[data-portal="partner"] .brand-showcase {
    aspect-ratio: var(--hero-carousel-ratio, 16 / 9);
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

body[data-portal="partner"] .hero-carousel-slide {
    padding: 0;
    object-fit: cover;
    object-position: center center;
    background: #fff;
}

.tray {
    position: relative;
    width: 280px;
    height: 150px;
    border-radius: 8px;
    background: #9d6a45;
    box-shadow: inset 0 -18px 0 rgba(0, 0, 0, .1), 0 22px 30px rgba(69, 44, 31, .18);
}

.tray::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 22px;
    height: 20px;
    background: rgba(255, 255, 255, .22);
    border-radius: 8px;
}

.tray span {
    position: absolute;
    bottom: 52px;
    width: 58px;
    height: 74px;
    border-radius: 50% 50% 12px 12px;
    background: linear-gradient(#f0bd6c, #ba6a34);
    box-shadow: inset -10px -12px 0 rgba(111, 55, 22, .16);
}

.tray span:nth-child(1) { left: 30px; }
.tray span:nth-child(2) { left: 82px; height: 90px; }
.tray span:nth-child(3) { left: 144px; }
.tray span:nth-child(4) { left: 200px; height: 86px; }

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
    font-weight: 800;
    color: var(--brand-dark);
}

.auth-panel {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.auth-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: min(560px, 100%);
}

.auth-option {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
}

.auth-option.active {
    border-color: rgba(169, 54, 49, .35);
    background: #f1e7e2;
    color: var(--brand-dark);
}

.auth-card {
    width: min(760px, 100%);
}

.auth-grid,
.product-admin-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.auth-grid.compact {
    grid-template-columns: minmax(280px, 430px);
    justify-content: center;
    min-height: 64vh;
    align-items: center;
}

.auth-page {
    width: min(1080px, calc(100% - 32px));
    margin: 32px auto 64px;
}

.wide-auth {
    width: min(980px, calc(100% - 32px));
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 24px;
    align-items: center;
    min-height: calc(100vh - 160px);
}

.login-copy {
    display: grid;
    align-content: center;
    min-height: 420px;
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .72)),
        radial-gradient(circle at 85% 25%, rgba(200, 137, 47, .34), transparent 32%),
        linear-gradient(135deg, #f5d9bc, #d9eeee 72%);
    box-shadow: var(--shadow);
}

.login-copy h1 {
    max-width: 620px;
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.04;
}

.login-copy p {
    max-width: 560px;
    color: var(--muted);
    line-height: 1.7;
}

.login-card,
.registration-card {
    padding: 24px;
}

.form-section {
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.form-section h2 {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 14px;
    padding: 6px 12px;
    border-left: 4px solid var(--brand);
    border-radius: 0 8px 8px 0;
    background: linear-gradient(90deg, #fff1e7, rgba(255, 247, 236, .3));
    color: var(--brand-dark);
    font-size: 18px;
    font-weight: 900;
}

.form-subsection {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid rgba(99, 79, 69, .18);
}

.form-subsection h3 {
    margin: 0 0 12px;
    color: var(--brand-dark);
    font-size: 15px;
}

.profile-settings-form .form-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.profile-settings-actions {
    justify-content: flex-end;
}

.profile-settings-form input:disabled,
.profile-settings-form select:disabled {
    border-color: #e3e6ea;
    background: #f1f3f5;
    color: #6b7280;
    opacity: 1;
}

.form-actions,
.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.form-actions {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.field-hint {
    margin-left: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: none;
}

.password-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.password-toggle {
    min-width: 72px;
}

.password-toggle.icon-only-btn {
    width: 46px;
    min-width: 46px;
    padding: 0;
}

.check-row {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    font-weight: 700;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.panel,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 18px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0 14px;
}

.panel .section-title {
    margin-top: 0;
}

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

label {
    display: grid;
    gap: 6px;
    color: #3d4148;
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #cad2dc;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

.phone-field {
    display: grid;
    grid-template-columns: minmax(116px, .42fr) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.phone-field select,
.phone-field input {
    width: 100%;
}

input:focus,
select:focus {
    outline: 3px solid rgba(47, 125, 107, .18);
    border-color: var(--mint);
}

.primary,
.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
}

.primary:disabled,
.ghost:disabled {
    cursor: not-allowed;
    opacity: .48;
    filter: grayscale(.25);
    box-shadow: none;
}

.primary {
    margin-top: 14px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 20px rgba(169, 54, 49, .18);
}

.primary:hover {
    background: var(--brand-dark);
}

.ghost {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.ghost:hover {
    border-color: rgba(169, 54, 49, .28);
    background: #fff8f1;
}

.danger-action {
    color: var(--danger);
}

.danger-action:hover {
    border-color: rgba(184, 68, 68, .35);
    background: #fff1f1;
}

.partner-row-actions {
    gap: 5px;
}

.compact-action {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
}

.text-button {
    display: inline-flex;
    margin-top: 10px;
    padding: 0;
    color: var(--blue);
}

.link-button {
    text-decoration: none;
}

.full-button {
    width: 100%;
}

body[data-portal="partner-login"] {
    min-height: 100vh;
    background:
        radial-gradient(circle at 96% 18%, rgba(255, 96, 0, .10), transparent 10%),
        radial-gradient(circle at 8% 80%, rgba(200, 137, 47, .12), transparent 18%),
        linear-gradient(135deg, #fff8f0 0%, #fffdf9 48%, #fff4e9 100%);
}

body[data-portal="partner"],
body[data-portal="partner-login"],
body[data-portal="partner-register"],
body[data-portal="partner-reset"] {
    padding-top: var(--partner-topbar-offset, 86px);
}

body[data-portal="partner-login"] {
    --partner-topbar-offset: 136px;
}

body[data-portal="partner"] .topbar,
body[data-portal="partner-login"] .topbar,
body[data-portal="partner-register"] .topbar,
body[data-portal="partner-reset"] .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

body[data-portal="partner-login"] .topbar {
    grid-template-columns: minmax(260px, auto) 1fr;
    min-height: 112px;
    padding: 14px 34px;
    border: 0;
    border-radius: 0 0 28px 28px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 42px rgba(88, 58, 39, .08);
}

body[data-portal="partner-login"] .brand {
    gap: 18px;
    min-width: 360px;
}

body[data-portal="partner-login"] .brand-logo {
    width: 92px;
    height: 92px;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(255, 96, 0, .18);
}

body[data-portal="partner-login"] .brand strong {
    color: #4b2e21;
    font-size: 28px;
    letter-spacing: 0;
}

body[data-portal="partner-login"] .brand small {
    color: #5f4437;
    font-size: 15px;
    letter-spacing: .08em;
}

body[data-portal="partner-login"] .nav {
    justify-self: end;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body[data-portal="partner-login"] .nav-link {
    min-width: 92px;
    min-height: 58px;
    justify-content: center;
    border-radius: 14px;
    color: #4f372c;
    font-size: 16px;
}

body[data-portal="partner-login"] .nav-link.active {
    color: #ff5b00;
    background: #fff6ef;
    box-shadow: 0 12px 24px rgba(255, 91, 0, .10);
}

body[data-portal="partner-login"] .nav-link.active::after {
    left: 22px;
    right: 22px;
    bottom: 8px;
    background: #ff5b00;
}

body[data-portal="partner-login"] .auth-page {
    width: min(1240px, calc(100% - 56px));
    margin: 72px auto 22px;
}

body[data-portal="partner-login"] .login-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
    gap: 34px;
    align-items: stretch;
    min-height: 0;
}

body[data-portal="partner-login"] .login-copy {
    position: relative;
    min-height: 610px;
    overflow: hidden;
    padding: 82px 46px;
    border: 1px solid rgba(91, 61, 41, .10);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(255, 250, 242, .96) 0%, rgba(255, 250, 242, .76) 47%, rgba(255, 250, 242, .18) 100%),
        radial-gradient(circle at 88% 44%, rgba(182, 98, 36, .34), transparent 34%),
        radial-gradient(ellipse at 82% 76%, rgba(255, 96, 0, .20), transparent 28%),
        linear-gradient(135deg, #f7dfbd, #fffaf3);
    box-shadow: 0 18px 38px rgba(83, 54, 34, .12);
}

body[data-portal="partner-login"] .login-copy::before {
    content: "";
    position: absolute;
    right: -44px;
    bottom: -26px;
    width: min(58%, 430px);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 24%, #f4b154 0 15%, transparent 16%),
        radial-gradient(ellipse at 35% 40%, #c87529 0 12%, transparent 13%),
        radial-gradient(ellipse at 62% 45%, #e8a13e 0 16%, transparent 17%),
        radial-gradient(ellipse at 45% 65%, #8c5a32 0 12%, transparent 13%),
        radial-gradient(circle at 50% 50%, rgba(123, 78, 42, .22), transparent 55%);
    opacity: .92;
    filter: saturate(1.1);
}

body[data-portal="partner-login"] .login-copy::after {
    content: "";
    position: absolute;
    right: 36px;
    bottom: 42px;
    width: min(42%, 330px);
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6b14b, #b86522);
    box-shadow: inset -30px -22px 0 rgba(110, 59, 29, .18), 0 22px 34px rgba(111, 74, 42, .16);
    transform: rotate(-8deg);
}

body[data-portal="partner-login"] .login-copy .eyebrow,
body[data-portal="partner-login"] .login-copy h1,
body[data-portal="partner-login"] .login-copy p,
body[data-portal="partner-login"] .bakery-divider {
    position: relative;
    z-index: 1;
}

body[data-portal="partner-login"] .login-copy .eyebrow {
    color: #ff5b00;
    font-size: 15px;
    letter-spacing: .22em;
}

body[data-portal="partner-login"] .login-copy h1 {
    max-width: 520px;
    color: #4b2e21;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 5vw, 58px);
    line-height: 1.08;
}

body[data-portal="partner-login"] .login-copy p {
    max-width: 360px;
    color: #5f6670;
    font-size: 18px;
}

.bakery-divider {
    display: block;
    width: 120px;
    height: 2px;
    margin: 28px 0 22px;
    background: #ff5b00;
}

body[data-portal="partner-login"] .login-card {
    display: grid;
    align-content: center;
    gap: 18px;
    padding: 44px 34px;
    border: 0;
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 54px rgba(76, 52, 36, .12);
}

.login-card-head {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.login-card-logo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(255, 96, 0, .18);
}

.login-card-head h2 {
    margin: 10px 0 0;
    color: #4b2e21;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
}

.secure-divider {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ff5b00;
    font-weight: 900;
}

.secure-divider::before,
.secure-divider::after {
    content: "";
    width: 56px;
    height: 1px;
    background: #ff8a3d;
}

body[data-portal="partner-login"] .login-card label {
    gap: 10px;
    color: #4b4650;
    font-weight: 900;
}

body[data-portal="partner-login"] .login-card input {
    min-height: 56px;
    border-color: #eaded7;
    border-radius: 8px;
    background: #fff;
}

body[data-portal="partner-login"] .password-wrap {
    gap: 10px;
}

body[data-portal="partner-login"] .password-toggle {
    min-height: 56px;
    min-width: 82px;
    border-color: #eaded7;
}

body[data-portal="partner-login"] .check-row {
    margin: 4px 0 0;
    color: #4b4650;
    font-weight: 700;
}

body[data-portal="partner-login"] .login-submit {
    min-height: 58px;
    margin-top: 4px;
    border-color: #ff5b00;
    border-radius: 8px;
    background: #ff5b00;
    font-size: 20px;
    box-shadow: 0 16px 28px rgba(255, 91, 0, .20);
}

body[data-portal="partner-login"] .login-submit:hover {
    background: #e95000;
}

body[data-portal="partner-login"] .auth-links {
    justify-content: center;
    gap: 22px;
    margin-top: 8px;
}

body[data-portal="partner-login"] .auth-links .text-button {
    color: #ff5b00;
    font-weight: 850;
}

.login-footer {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin: 30px 0 0;
    color: #6c564a;
    font-weight: 800;
    text-align: center;
}

.login-footer > span {
    width: min(300px, 70vw);
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6b19 25%, #ff6b19 75%, transparent);
}

.no-margin {
    margin-top: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef4f1;
    color: var(--mint);
    font-size: 12px;
    font-weight: 900;
}

.pill.accent {
    background: #fff0db;
    color: #946018;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search {
    width: min(220px, 42vw);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    align-items: stretch;
    gap: 18px;
}

.product-card {
    display: grid;
    grid-template-rows: 165px 1fr;
    min-height: 375px;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transition: transform .16s ease, box-shadow .16s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(32, 34, 38, .10);
}

.product-art {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 165px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .6), transparent 24%),
        linear-gradient(135deg, rgba(168, 54, 49, .12), transparent 60%),
        linear-gradient(90deg, #f8dfb9, #d6eeee);
    background-size: cover;
    background-position: center center;
}

.product-art::before {
    content: "";
    width: 88px;
    height: 64px;
    border-radius: 38px 38px 10px 10px;
    background: linear-gradient(#f3c576, #bd7040);
    box-shadow: inset -12px -10px 0 rgba(111, 55, 22, .15);
}

.product-art.has-product-image::before {
    display: none;
}

.product-art-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    background: #fff;
}

.product-art[style*="background-image"] {
    background-size: cover;
    background-position: center;
}

.product-art[style*="background-image"]::before {
    display: none;
}

.product-thumb {
    display: grid;
    place-items: center;
    width: 54px;
    height: 46px;
    flex: 0 0 54px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .64), transparent 24%),
        linear-gradient(135deg, rgba(168, 54, 49, .12), transparent 60%),
        linear-gradient(90deg, #f8dfb9, #d6eeee);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.product-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-list-row {
    grid-template-columns: 54px minmax(0, 1fr) auto;
}

.image-upload-field {
    position: relative;
    display: grid;
    gap: 8px;
}

.image-upload-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.image-upload-preview {
    display: grid;
    min-height: 150px;
    place-items: center;
    border: 1.5px dashed rgba(99, 79, 69, .32);
    border-radius: 8px;
    background: #f8fafb;
    background-size: cover;
    background-position: center;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
    overflow: hidden;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.image-upload-preview:hover {
    border-color: var(--brand);
    box-shadow: 0 12px 28px rgba(32, 34, 38, .08);
    transform: translateY(-1px);
}

.image-upload-preview.has-image {
    border-style: solid;
    color: #fff;
}

.image-upload-preview.has-image span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(32, 34, 38, .72);
}

.logo-upload-preview {
    min-height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
}

.carousel-upload-preview.has-file {
    border-style: solid;
    background: #fff8f1;
    color: var(--ink);
}

.carousel-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.carousel-preview-list figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.carousel-preview-list img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.carousel-preview-list figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.carousel-remove-btn {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(184, 68, 68, .18);
    border-radius: 7px;
    background: #fff5f5;
    color: var(--danger);
    cursor: pointer;
}

.new-carousel-slide {
    outline: 2px dashed rgba(169, 54, 49, .28);
    outline-offset: -4px;
}

.payment-receipt-modal {
    width: min(520px, 100%);
}

.receipt-upload-field {
    text-align: left;
}

.receipt-upload-preview {
    min-height: 170px;
    background-size: contain;
    background-repeat: no-repeat;
}

.receipt-upload-preview.has-file {
    border-style: solid;
    background: #fff8f1;
    color: var(--ink);
}

.receipt-upload-preview.has-file span {
    max-width: 100%;
    padding: 10px 14px;
    overflow-wrap: anywhere;
}

.payment-receipt-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
    gap: 18px;
    align-items: center;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(99, 79, 69, .22);
    border-radius: 8px;
    background: #fffaf4;
}

.payment-receipt-panel h3 {
    margin: 2px 0 6px;
    color: var(--ink);
}

.receipt-viewer {
    display: grid;
    place-items: center;
    min-height: 120px;
    border: 1px solid rgba(99, 79, 69, .18);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.receipt-viewer img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.payment-note-box {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #f2c9b4;
    border-radius: 8px;
    background: #fff5ed;
}

.payment-note-box strong {
    color: var(--ink);
    line-height: 1.45;
}

.payment-note-total {
    padding-top: 8px;
    border-top: 1px solid rgba(99, 79, 69, .16);
    color: var(--danger);
    font-weight: 900;
}

.receipt-file-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px 18px;
    color: var(--brand);
    font-weight: 900;
    text-decoration: none;
}

.checkout-confirm-modal {
    width: min(460px, 100%);
}

.checkout-confirm-date {
    display: grid;
    gap: 6px;
    margin: 14px 0;
    padding: 16px;
    border: 1px solid rgba(255, 90, 0, .28);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff8f0, #fff);
    text-align: left;
}

.checkout-confirm-date {
    font-weight: 900;
}

.checkout-confirm-date input {
    width: 100%;
    margin-top: 8px;
    border: 1px solid rgba(99, 79, 69, .22);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 20px;
    font-weight: 900;
}

.checkout-confirm-date span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.checkout-confirm-date strong {
    color: var(--brand);
    font-size: 24px;
}

.modal-receipt-viewer {
    margin: 14px 0 18px;
    min-height: 180px;
    max-height: min(62vh, 520px);
}

.modal-receipt-viewer img {
    max-height: min(62vh, 520px);
}

.product-form-modal {
    width: min(760px, 100%);
    max-height: min(90vh, 860px);
    overflow: auto;
}

.product-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.product-modal-grid .image-upload-field {
    grid-column: 1 / -1;
}

.product-modal-actions {
    justify-content: flex-end;
    margin-top: 16px;
}

.payment-sent-stack {
    display: grid;
    gap: 18px;
}

.sales-report-page {
    display: grid;
    gap: 18px;
}

.sales-upload-panel,
.sales-report-browser {
    overflow: hidden;
}

.sales-report-upload-form {
    display: grid;
    grid-template-columns: 180px minmax(260px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.sales-file-upload .image-upload-preview {
    min-height: 48px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
}

.sales-file-upload .image-upload-preview i {
    color: #15803d;
    font-size: 20px;
}

.sales-report-picker {
    min-width: 220px;
}

.sales-report-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.sales-receipt-list {
    display: grid;
    gap: 8px;
    max-height: 720px;
    overflow: auto;
    padding-right: 4px;
}

.sales-receipt-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.sales-receipt-card.active {
    border-color: rgba(169, 54, 49, .45);
    background: #fff7f4;
    box-shadow: 0 8px 20px rgba(169, 54, 49, .08);
}

.sales-receipt-card span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sales-receipt-card strong {
    font-size: 14px;
}

.sales-receipt-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-receipt-card b {
    color: var(--mint);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sales-receipt-preview {
    min-width: 0;
    background: #f6f7f5;
}

.sales-receipt-paper {
    display: grid;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid #ddd5cd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(32, 24, 18, .08);
}

.sales-receipt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--brand-dark);
}

.sales-receipt-head h2 {
    margin: 2px 0;
    color: var(--brand-dark);
    font-size: 30px;
}

.sales-receipt-head strong {
    color: var(--mint);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sales-receipt-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.sales-receipt-meta span {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f8faf9;
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.sales-receipt-meta b {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.sales-receipt-items {
    border-radius: 8px;
}

.sales-receipt-totals {
    display: grid;
    gap: 7px;
    justify-self: end;
    min-width: min(280px, 100%);
}

.sales-receipt-totals span {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding: 8px 0;
    border-bottom: 1px solid #eee5dd;
}

.sales-receipt-totals b {
    color: var(--muted);
    text-transform: uppercase;
}

.sales-receipt-totals strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.sales-receipt-totals .gst-row {
    color: var(--brand-dark);
    font-weight: 900;
}

.sales-receipt-totals .grand {
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: #fff0ea;
    color: var(--brand-dark);
    font-size: 16px;
    font-weight: 950;
}

.payment-history-card .inline-filter {
    margin: 0;
}

.payment-history-card {
    border-color: rgba(47, 125, 107, .42);
    background: linear-gradient(180deg, #dff6ea 0%, #f0fbf5 42%, #ffffff 100%);
    box-shadow: 0 16px 34px rgba(47, 125, 107, .12);
}

.payment-history-card .eyebrow,
.payment-history-card .section-title h2 {
    color: #16694f;
}

.payment-history-card .report-filter,
.payment-history-card .inline-filter {
    border-color: rgba(47, 125, 107, .32);
    background: #e7f8ee;
}

.paid-history-groups {
    display: grid;
    gap: 12px;
}

.paid-partner-group {
    overflow: hidden;
    border: 1px solid rgba(47, 125, 107, .36);
    border-radius: 10px;
    background: #fff;
}

.paid-partner-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, #d8f3e4, #effbf4);
}

.paid-partner-group summary::-webkit-details-marker {
    display: none;
}

.paid-partner-group summary::after {
    content: "\f078";
    color: #16694f;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform .18s ease;
}

.paid-partner-group[open] summary::after {
    transform: rotate(180deg);
}

.paid-partner-group summary div {
    display: grid;
    gap: 3px;
}

.paid-partner-group summary strong {
    color: var(--ink);
    font-size: 16px;
}

.paid-partner-group summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.paid-partner-group summary em {
    margin-left: auto;
    color: #16694f;
    font-style: normal;
    font-size: 16px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.paid-partner-table {
    border-top: 1px solid var(--line);
}

.compact-empty {
    padding: 14px;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.badge.unavailable {
    background: var(--danger);
}

.product-body {
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 13px;
    padding: 16px;
}

.product-body h3 {
    display: -webkit-box;
    min-height: 46px;
    margin: 0;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.price-row,
.qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.qty-row {
    align-self: end;
    margin-top: auto;
    padding-top: 4px;
}

.qty-row input,
.qty-row select {
    width: 62px;
}

.custom-qty-field[hidden] {
    display: none !important;
}

.custom-qty-field input {
    width: 76px;
}

.line-gst {
    display: block;
    margin-top: 3px;
    color: var(--danger);
    font-size: 12px;
}

.money-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.print-only {
    display: none;
}

.invoice-print-doc {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.invoice-print-doc .screen-only {
    margin: 0 0 16px;
}

.invoice-print-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.invoice-company {
    display: flex;
    gap: 12px;
    align-items: center;
}

.invoice-logo {
    width: 74px;
    height: 54px;
    object-fit: contain;
}

.invoice-company h1,
.invoice-detail-grid h3 {
    margin: 0;
}

.invoice-company p {
    margin: 3px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.invoice-title-block {
    display: grid;
    gap: 4px;
    text-align: right;
}

.invoice-title-block strong {
    color: var(--brand);
    font-size: 28px;
    text-transform: uppercase;
}

.invoice-title-block span {
    color: var(--ink);
    font-weight: 900;
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 14px;
    margin: 0 0 16px;
}

.invoice-detail-grid section {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.invoice-detail-grid h3 {
    margin-bottom: 10px;
    color: var(--brand);
    font-size: 14px;
    text-transform: uppercase;
}

.invoice-detail-grid p {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    margin: 6px 0;
}

.invoice-detail-grid span {
    color: var(--muted);
    font-weight: 800;
}

.invoice-detail-grid strong {
    color: var(--ink);
}

.invoice-detail-grid .highlight-delivery-date {
    align-items: center;
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, .24);
    border-radius: 8px;
    background: #fff4e8;
}

.invoice-detail-grid .highlight-delivery-date span {
    color: #8f2d25;
}

.invoice-detail-grid .highlight-delivery-date strong {
    color: #dc2626;
    font-size: 18px;
}

.invoice-detail-grid .editable-delivery-date-field input {
    width: min(220px, 100%);
    padding: 8px 10px;
    border: 1px solid rgba(220, 38, 38, .28);
    border-radius: 8px;
    background: #ffffff;
    color: #8f2d25;
    font: inherit;
    font-weight: 800;
}

.invoice-print-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-weight: 800;
}

.invoice-footer-contact {
    color: var(--ink);
    text-align: right;
}

.invoice-remarks-panel {
    margin-top: 16px;
    page-break-inside: avoid;
}

.invoice-remarks-panel label {
    display: grid;
    gap: 8px;
    color: var(--brand-dark);
    font-weight: 900;
}

.invoice-remarks-panel textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.invoice-remarks-panel textarea:disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.invoice-remarks-panel h3 {
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 14px;
    text-transform: uppercase;
}

.invoice-remarks-panel p,
.invoice-remarks-print {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf9;
    color: var(--ink);
}

.invoice-remarks-print {
    display: none;
}

.invoice-remarks-print span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.invoice-remarks-print strong {
    font-weight: 800;
    white-space: pre-wrap;
}

.invoice-total-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-top: 16px;
    padding: 16px 0 0;
}

.invoice-qty-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.invoice-qty-summary span {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.invoice-qty-summary strong {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.invoice-qty-summary em {
    color: var(--ink);
    font-style: normal;
    font-size: 18px;
    font-weight: 900;
}

.invoice-total-rows {
    width: min(360px, 100%);
    margin-left: auto;
    padding: 6px 12px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.invoice-total-rows div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.invoice-total-rows span {
    color: var(--muted);
    font-weight: 800;
}

.invoice-total-rows strong {
    color: var(--ink);
    font-size: 16px;
    text-align: right;
}

.invoice-total-rows .grand-total {
    border-bottom: 2px solid var(--ink);
}

.invoice-total-rows .grand-total span,
.invoice-total-rows .grand-total strong,
.invoice-total-rows [data-gst-total] {
    color: var(--danger);
}

.settings-form {
    max-width: 780px;
}

.settings-section {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(221, 226, 232, .95);
    border-radius: 10px;
    background: #fff;
}

.settings-section h3 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 15px;
}

.gst-settings-section {
    border-color: rgba(169, 54, 49, .2);
    background: #fff7ec;
}

.compact-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 220px));
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-grid .span-2 {
    grid-column: 1 / -1;
}

.report-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
}

.report-summary {
    margin-top: 4px;
}

.report-section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.report-section-title h3 {
    margin: 0;
    color: var(--ink);
}

.report-section-title span {
    color: var(--muted);
    font-weight: 800;
}

.report-table + .report-section-title {
    margin-top: 24px;
}

.report-collapse-stack {
    display: grid;
    gap: 12px;
}

.report-collapse-card {
    overflow: hidden;
    border: 1px solid rgba(221, 226, 232, .95);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(32, 34, 38, .05);
}

.report-collapse-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, #fffaf4, #f8fafb);
}

.report-collapse-card summary::-webkit-details-marker {
    display: none;
}

.report-collapse-card summary::after {
    content: "\f078";
    color: var(--brand);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform .18s ease;
}

.report-collapse-card[open] summary::after {
    transform: rotate(180deg);
}

.report-collapse-card summary div {
    display: grid;
    gap: 3px;
}

.report-collapse-card summary strong {
    color: var(--ink);
    font-size: 16px;
}

.report-collapse-card summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.report-collapse-card summary em {
    margin-left: auto;
    color: var(--danger);
    font-style: normal;
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.report-collapse-card .report-table {
    border-top: 1px solid var(--line);
}

.report-partner-groups {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.report-partner-group {
    overflow: hidden;
    border: 1px solid rgba(221, 226, 232, .95);
    border-radius: 8px;
    background: #fff;
}

.report-partner-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    cursor: pointer;
    list-style: none;
    background: #f8fafb;
}

.report-partner-group summary::-webkit-details-marker {
    display: none;
}

.report-partner-group summary::after {
    content: "\f078";
    color: var(--brand);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform .18s ease;
}

.report-partner-group[open] summary::after {
    transform: rotate(180deg);
}

.report-partner-group summary div {
    display: grid;
    gap: 3px;
}

.report-partner-group summary strong {
    color: var(--ink);
}

.report-partner-group summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.report-partner-group summary em {
    margin-left: auto;
    color: var(--danger);
    font-style: normal;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.report-partner-group tfoot th {
    background: #fff7ec;
    color: var(--ink);
    font-weight: 900;
}

.report-total-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(169, 54, 49, .16);
    border-radius: 8px;
    background: #fff7ec;
}

.report-total-strip span {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid rgba(99, 79, 69, .1);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 900;
}

.report-total-strip b {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.right {
    text-align: right;
}

.settings-grid textarea {
    width: 100%;
    resize: vertical;
}

.settings-form .image-upload-field {
    margin-top: 12px;
}

.partner-detail-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.partner-detail-form {
    display: grid;
    gap: 4px;
}

.partner-detail-form .form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.partner-detail-subsection {
    margin-top: 6px;
}

.partner-detail-card div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.partner-detail-card label {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.partner-detail-card span,
.partner-detail-card label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.partner-detail-card strong {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.partner-password-reset-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto;
    gap: 10px;
    align-items: end;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(169, 54, 49, .16);
    border-radius: 8px;
    background: #fffaf8;
}

.partner-password-reset-card > div:first-child {
    display: grid;
    gap: 4px;
}

.partner-password-reset-card strong {
    color: var(--ink);
    font-size: 13px;
}

.partner-password-reset-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.partner-password-reset-card input {
    min-height: 42px;
}

.editable-detail-card input,
.editable-detail-card select {
    min-height: 36px;
}

.editable-detail-card input:disabled,
.editable-detail-card select:disabled {
    border-color: #e3e6ea;
    background: #f1f3f5;
    color: #6b7280;
    opacity: 1;
}

.partner-product-price-card {
    display: grid;
    gap: 14px;
}

.partner-product-price-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.partner-product-price-summary span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(99, 79, 69, .16);
    border-radius: 8px;
    background: #fff7ec;
    color: var(--ink);
    font-weight: 900;
}

.partner-product-price-summary b {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.partner-status-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.partner-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 78px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.partner-status-card span {
    color: var(--muted);
    font-weight: 900;
}

.partner-status-card strong {
    color: var(--brand);
    font-size: 30px;
    line-height: 1;
}

.partner-status-card.active {
    border-color: rgba(168, 54, 49, .35);
    background: #fff7f7;
}

.partner-status-card.pending-card strong {
    color: var(--brand);
}

.partner-status-card.active-card strong {
    color: var(--mint);
}

.partner-status-card.frozen-card strong {
    color: #946018;
}

.partner-status-card.banned-card strong {
    color: var(--danger);
}

.partner-status-section {
    margin-bottom: 18px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

#adminTable:has(.partner-status-section) {
    overflow: visible;
}

.partner-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
}

.partner-group-title h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
}

.partner-group-title span {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: #fff;
    color: var(--danger);
    font-size: 18px;
    font-weight: 900;
}

.partner-status-section table {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.table-action-caption {
    caption-side: top;
    padding: 0 0 12px;
    text-align: left;
}

.payment-total-note {
    display: grid;
    gap: 8px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid #f2c9b4;
    border-radius: 8px;
    background: #fff5ed;
    color: var(--ink);
    font-weight: 900;
}

.payment-total-note > span,
.payment-note-box > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.payment-total-note > strong {
    color: var(--danger);
    font-size: 1.25rem;
}

.payment-selection-list,
.payment-note-lines {
    display: grid;
    gap: 5px;
}

.payment-selection-list em,
.payment-note-lines p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding-top: 5px;
    border-top: 1px solid rgba(99, 79, 69, .12);
    color: var(--ink);
    font-style: normal;
}

.payment-selection-list b,
.payment-note-lines b {
    color: var(--danger);
    font-variant-numeric: tabular-nums;
}

.cart-table {
    table-layout: fixed;
    min-width: 900px;
}

.cart-col-no { width: 58px; }
.cart-col-product { width: auto; }
.cart-col-qty { width: 92px; }
.cart-col-rate { width: 118px; }
.cart-col-gst { width: 112px; }
.cart-col-amount { width: 128px; }
.cart-col-action { width: 118px; }

.cart-table th,
.cart-table td {
    white-space: nowrap;
}

.cart-table th:nth-child(2),
.cart-table td:nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.cart-table [data-cart-qty] {
    width: 58px;
    min-height: 36px;
}

.cart-table th:nth-child(4),
.cart-table td:nth-child(4),
.cart-table th:nth-child(5),
.cart-table td:nth-child(5),
.cart-table th:nth-child(6),
.cart-table td:nth-child(6) {
    text-align: right;
}

.cart-table th:nth-child(7),
.cart-table td:nth-child(7) {
    text-align: right;
}

.cart-table tfoot th[colspan] {
    text-align: left;
}

.cart-table tfoot th[id] {
    text-align: right;
}

.cart-table td:nth-child(7) .ghost {
    min-height: 34px;
    padding: 0 10px;
}

.cart-mobile-total-label {
    display: none;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f7f3ed;
    color: #4a515b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

tfoot th {
    background: #fff7ec;
    color: var(--ink);
}

.date-field {
    min-width: 220px;
}

.checkout-note {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.checkout-date-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0 0;
    padding: 16px;
    border: 2px solid rgba(169, 54, 49, .28);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255, 247, 236, .98), rgba(239, 248, 246, .92));
    box-shadow: var(--shadow);
}

.checkout-date-panel .date-field {
    min-width: min(280px, 100%);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 12px;
}

.tab {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 800;
}

.profile-tab-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.profile-tab-badge[hidden] {
    display: none !important;
}

body[data-portal="partner"] .tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 12px;
    padding: 6px;
    border: 1px solid rgba(221, 226, 232, .82);
    border-radius: 14px;
    background: rgba(255, 255, 255, .74);
    box-shadow: var(--shadow-soft);
}

body[data-portal="partner"] .tab {
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    text-align: center;
    white-space: normal;
}

body[data-portal="partner"] .tab.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 20px rgba(169, 54, 49, .18);
}

.profile-table-wrap {
    display: none;
}

.profile-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.profile-bulk-pay {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}

.profile-month-groups {
    display: grid;
    gap: 12px;
}

.profile-month-group {
    overflow: hidden;
    border: 1px solid rgba(221, 226, 232, .95);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(32, 34, 38, .05);
}

.profile-month-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, #fffaf4, #f8fafb);
}

.profile-month-group summary::-webkit-details-marker {
    display: none;
}

.profile-month-group summary::after {
    content: "\f078";
    color: var(--brand);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform .18s ease;
}

.profile-month-group[open] summary::after {
    transform: rotate(180deg);
}

.profile-month-group summary div {
    display: grid;
    gap: 3px;
}

.profile-month-group summary strong {
    color: var(--ink);
    font-size: 15px;
}

.profile-month-group summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.profile-month-group summary em {
    margin-left: auto;
    color: var(--danger);
    font-style: normal;
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.profile-month-group .invoice-card-grid {
    padding: 12px;
}

.profile-invoice-card,
.profile-product-card,
.profile-empty-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(221, 226, 232, .92);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(32, 34, 38, .06);
}

.profile-invoice-card {
    gap: 9px;
    padding: 12px;
}

.profile-invoice-card .profile-card-head strong {
    font-size: 14px;
}

.profile-invoice-card .profile-card-kicker {
    margin-bottom: 2px;
    font-size: 10px;
}

.profile-invoice-card .profile-card-total {
    font-size: 20px;
}

.profile-invoice-card .profile-card-meta {
    gap: 7px;
}

.profile-invoice-card .profile-card-meta span {
    padding: 7px 8px;
    font-size: 12px;
}

.profile-invoice-card .profile-card-meta b {
    margin-bottom: 2px;
    font-size: 10px;
}

.profile-invoice-card .profile-card-statuses {
    gap: 5px;
}

.profile-invoice-card .status-chip {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 11px;
}

.profile-invoice-card .status-chip.profile-status-large,
.profile-table-wrap .status-chip.profile-status-large {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 13px;
    letter-spacing: .01em;
}

.profile-invoice-card .profile-card-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(34px, 1fr);
    gap: 6px;
}

.icon-only-btn,
.profile-invoice-card .profile-card-actions .ghost.icon-only-btn {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 0;
    border-radius: 7px;
    font-size: 12px;
}

.icon-only-btn i {
    font-size: 14px;
    line-height: 1;
}

.profile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.profile-card-head > div {
    min-width: 0;
}

.profile-card-head strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.22;
}

.profile-card-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.profile-card-total {
    color: var(--brand);
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
}

.profile-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.profile-card-meta span,
.profile-card-meta label {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f8faf9;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
}

.profile-card-meta b {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.profile-card-statuses,
.profile-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.profile-select-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    min-height: 32px;
    padding: 0 9px;
    border: 1px solid #f1d2c3;
    border-radius: 999px;
    background: #fff7f2;
    color: var(--brand-dark);
    white-space: nowrap;
}

.profile-select-pill input {
    width: 16px;
    min-height: 16px;
}

.product-price-meta {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.profile-product-image {
    display: grid;
    place-items: center;
    min-height: 124px;
    border: 1px solid rgba(99, 79, 69, .12);
    border-radius: 10px;
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .7), transparent 28%),
        linear-gradient(180deg, #fff8f2, #f7f9f8);
    overflow: hidden;
}

.profile-product-img {
    width: 100%;
    height: 124px;
    object-fit: contain;
    padding: 6px;
}

.profile-product-image:not(.has-product-image)::before {
    content: "";
    width: 84px;
    height: 58px;
    border-radius: 34px 34px 10px 10px;
    background: linear-gradient(#f3c576, #bd7040);
    box-shadow: inset -12px -10px 0 rgba(111, 55, 22, .15);
}

.product-price-meta .price-input {
    width: 100%;
    margin-top: 2px;
    background: #fff;
}

.product-price-meta .price-input:disabled,
.profile-table-wrap .price-input:disabled {
    border-color: transparent;
    background: #f3f5f4;
    color: var(--ink);
    opacity: 1;
}

.profile-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid rgba(221, 226, 232, .82);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(32, 34, 38, .05);
}

.profile-card-grid + .profile-pagination {
    margin: 12px 0 0;
}

.profile-pagination span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.profile-pagination div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-pagination .ghost {
    min-width: 34px;
    min-height: 32px;
    padding: 0 9px;
    border-radius: 8px;
}

.profile-pagination .page-number.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    max-width: 380px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #202226;
    color: #fff;
    box-shadow: var(--shadow);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.stat {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.stat:nth-child(1) {
    border-left: 4px solid var(--brand);
}

.stat:nth-child(2) {
    border-left: 4px solid var(--gold);
}

.stat:nth-child(3) {
    border-left: 4px solid var(--mint);
}

.stat:nth-child(4) {
    border-left: 4px solid var(--blue);
}

.workflow-total-stat {
    border-color: rgba(169, 54, 49, .24);
    background: linear-gradient(135deg, #fff7ec, #fff);
}

.workflow-total-stat strong {
    color: var(--danger);
}

.stat strong {
    display: block;
    font-size: 26px;
    color: #dc2626;
    line-height: 1;
}

.stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.dashboard-insights {
    margin: 0 0 16px;
}

.dashboard-kpi-panel {
    padding: 16px;
    border: 1px solid rgba(221, 226, 232, .9);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #fbfcfb);
    box-shadow: var(--shadow-soft);
}

.dashboard-snapshot-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
    align-items: end;
}

.dashboard-snapshot-filter label {
    display: grid;
    gap: 5px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-snapshot-filter select {
    min-height: 38px;
    min-width: 0;
    border-radius: 8px;
    background: #fff;
    font-weight: 850;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
}

.dashboard-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 104px;
    padding: 13px;
    border: 1px solid rgba(99, 79, 69, .12);
    border-radius: 9px;
    background: #fff;
}

.dashboard-kpi-card > span {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff4ee;
    color: var(--brand);
    flex: 0 0 auto;
}

.dashboard-kpi-card.profit > span,
.dashboard-kpi-card.approval > span {
    background: #eaf7f1;
    color: var(--mint);
}

.dashboard-kpi-card.expense > span,
.dashboard-kpi-card.payment > span {
    background: #fff7e6;
    color: #946018;
}

.dashboard-kpi-card.production > span,
.dashboard-kpi-card.orders > span {
    background: #eef4fb;
    color: var(--blue);
}

.dashboard-kpi-card strong {
    display: block;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.1;
}

.dashboard-kpi-card p {
    margin: 5px 0 3px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 900;
}

.dashboard-kpi-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.chart {
    min-height: 390px;
    padding: 18px;
    border: 1px solid rgba(99, 79, 69, .14);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #fbfcfb 100%);
    overflow-x: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.graph-year-form {
    display: grid;
    gap: 10px;
    margin: -4px 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
}

.graph-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(99, 79, 69, .12);
    border-radius: 8px;
    background: #fff;
}

.graph-editor-toolbar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.graph-year-form[hidden] {
    display: none;
}

.graph-year-form label {
    margin: 0;
}

.graph-month-inputs {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
}

.graph-year-card {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(99, 79, 69, .2);
    border-radius: 8px;
    background: #fff;
}

.graph-year-card-1 {
    border-color: rgba(169, 54, 49, .55);
    background: linear-gradient(180deg, #ffe5df, #fff6f3);
}

.graph-year-card-2 {
    border-color: rgba(47, 102, 88, .55);
    background: linear-gradient(180deg, #dff4e9, #f3fbf6);
}

.graph-year-card-3 {
    border-color: rgba(47, 95, 137, .55);
    background: linear-gradient(180deg, #dceeff, #f2f8ff);
}

.graph-year-card legend {
    padding: 0 6px;
    color: var(--brand-dark);
    font-weight: 900;
}

.graph-year-card-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.graph-year-card-head label {
    width: min(180px, 100%);
}

.graph-year-card-head .mini-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.graph-year-card-1 legend {
    color: var(--brand);
}

.graph-year-card-2 legend {
    color: var(--mint);
}

.graph-year-card-3 legend {
    color: var(--blue);
}

.graph-month-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(86px, 1fr));
    gap: 9px;
}

.graph-year-form button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: end;
}

.graph-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 6px;
    border: 1px solid rgba(221, 226, 232, .86);
    border-radius: 12px;
    background: #f8fafb;
}

.graph-tabs .tab {
    min-height: 34px;
    border: 0;
}

.chart-scope-title {
    color: var(--brand-dark);
    font-size: 15px;
    font-weight: 900;
}

.line-chart-wrap {
    min-width: 720px;
    display: grid;
    gap: 8px;
}

.line-chart {
    display: block;
    width: 100%;
    height: auto;
}

.chart-plot {
    fill: #fff;
    stroke: rgba(99, 79, 69, .08);
    stroke-width: 1;
}

.chart-area {
    opacity: .055;
}

.chart-grid {
    stroke: rgba(99, 79, 69, .11);
    stroke-width: 1;
    stroke-dasharray: 5 5;
}

.chart-axis {
    stroke: rgba(49, 40, 35, .42);
    stroke-width: 1.5;
}

.chart-x,
.chart-y,
.chart-axis-label {
    fill: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.chart-axis-label {
    fill: var(--ink);
    font-size: 14px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-left: 82px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(99, 79, 69, .12);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.chart-legend strong {
    color: var(--brand);
    font-size: 14px;
    font-weight: 950;
}

.chart-legend i {
    width: 24px;
    height: 5px;
    border-radius: 999px;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.dashboard-chart-card {
    min-height: 270px;
}

.compact-title {
    margin-bottom: 8px;
}

.compact-title h2 {
    font-size: 18px;
}

.product-add-left {
    justify-self: start;
    margin-right: auto;
}

.mini-chart {
    min-height: 200px;
}

.metric-bars {
    display: grid;
    gap: 14px;
}

.metric-bar {
    display: grid;
    gap: 6px;
}

.metric-bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.metric-bar-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-bar-label strong {
    color: #dc2626;
}

.metric-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1ef;
}

.metric-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--gold));
}

.mini-columns {
    display: grid;
    grid-template-columns: repeat(12, minmax(22px, 1fr));
    align-items: end;
    gap: 8px;
    min-height: 205px;
}

.mini-column {
    display: grid;
    align-items: end;
    justify-items: center;
    gap: 6px;
    height: 190px;
}

.mini-column span {
    position: relative;
    width: 100%;
    min-height: 8px;
    border-radius: 7px 7px 2px 2px;
    background: linear-gradient(180deg, var(--mint), var(--blue));
}

.mini-column b {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 5px);
    transform: translateX(-50%);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.mini-column small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.donut-wrap {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.donut {
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.donut span {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #fff;
    color: #dc2626;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 0 0 1px rgba(99, 79, 69, .1);
}

.donut-legend {
    display: grid;
    gap: 10px;
}

.donut-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.donut-legend i {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.donut-legend strong {
    color: var(--ink);
}

.status-select {
    min-width: 160px;
}

.mini-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.detail-subtitle {
    margin-top: 5px;
    color: var(--muted);
    font-weight: 900;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef4f1;
    color: var(--mint);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.partner-status-top {
    min-height: 26px;
    padding: 0 9px;
}

.order-status {
    background: #eef4f1;
    color: var(--mint);
}

.payment-status {
    background: #fff0db;
    color: #946018;
}

.pending-payment-alert {
    background: #dc2626;
    color: #fff;
    animation: pending-payment-blink 1.05s ease-in-out infinite;
}

.request-status {
    background: #f1e7e2;
    color: var(--brand-dark);
}

.ready-status {
    background: #e9f0f7;
    color: var(--blue);
}

.paid-status {
    background: #eef4f1;
    color: var(--mint);
}

.banned-status {
    background: #fff1f1;
    color: var(--danger);
}

.row-menu {
    position: relative;
    z-index: 40;
}

.row-menu.is-open {
    z-index: 1400;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(32, 34, 38, .42);
}

.confirm-modal {
    width: min(420px, 100%);
    padding: 22px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.confirm-modal h2 {
    margin: 4px 0 8px;
}

.confirm-modal .mini-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.reset-modal {
    display: grid;
    gap: 14px;
}

.reset-modal label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.reset-modal .muted {
    margin: 0;
    line-height: 1.55;
}

.danger-primary {
    background: var(--danger);
}

.danger-primary:hover {
    background: #9f3030;
}

.row-menu .ghost {
    gap: 8px;
}

.row-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    display: grid;
    min-width: 130px;
    margin-top: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.row-menu-panel button {
    justify-content: flex-start;
    min-height: 34px;
    border: 0;
    background: transparent;
    color: var(--ink);
}

.row-menu-panel button:hover {
    background: #f8fafb;
}

.price-input {
    width: 120px;
    min-height: 36px;
}

.qty-input {
    width: 90px;
    min-height: 36px;
}

.ready-qty-check {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    background: #fff7f7;
    color: #dc2626;
    font-size: 16px;
    font-weight: 900;
}

.locked-row {
    background: #f1f3f5;
    color: #858b93;
}

.locked-row input,
.locked-row select {
    background: #e9ecef;
    color: #69707a;
    border-color: #d7dce2;
}

[data-supplied-cell]:has([data-supplied-qty]:disabled) {
    background: #f1f3f5;
}

[data-supplied-cell] [data-supplied-qty]:disabled {
    background: #e9ecef;
    color: #69707a;
    border-color: #d7dce2;
    opacity: 1;
}

.finalise-invoice-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(99, 79, 69, .14);
    border-radius: 8px;
    background: #fff7ec;
}

.finalise-invoice-bar.split-actions {
    justify-content: space-between;
    align-items: center;
}

.finalise-invoice-bar .left-actions,
.finalise-invoice-bar .right-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.finalise-invoice-bar .right-actions {
    justify-content: flex-end;
}

.partner-retail-modal {
    width: min(960px, 100%);
    max-height: min(88vh, 820px);
    overflow: auto;
}

.partner-retail-modal-body {
    display: grid;
    gap: 14px;
}

.partner-retail-modal .custom-retail-price strong {
    display: inline-flex;
    min-width: 76px;
    justify-content: flex-end;
    padding: 5px 10px;
    border: 1px solid #7f1111;
    border-radius: 6px;
    background: #fff0f0;
    color: #7f1111;
    font-weight: 900;
}

.invoice-product-name-cell {
    display: grid;
    justify-items: start;
    gap: 5px;
}

.custom-retail-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border: 1px solid #7f1111;
    border-radius: 999px;
    background: #fff0f0;
    color: #7f1111;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.custom-retail-badge:hover,
.custom-retail-badge:focus-visible {
    background: #7f1111;
    color: #ffffff;
}

.custom-retail-price-modal {
    width: min(520px, 100%);
}

.custom-retail-price-body {
    display: grid;
    gap: 14px;
}

.custom-retail-price-summary {
    display: grid;
    gap: 10px;
}

.custom-retail-price-summary div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfaf8;
}

.custom-retail-price-summary span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.custom-retail-price-summary strong {
    color: var(--ink);
    text-align: right;
}

.custom-retail-price-summary .custom-price-value {
    border-color: #7f1111;
    background: #fff0f0;
}

.custom-retail-price-summary .custom-price-value strong {
    color: #7f1111;
    font-size: 1.15rem;
    font-weight: 900;
}

.invoice-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.invoice-summary span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
    color: var(--muted);
}

.invoice-summary strong {
    color: var(--ink);
}

.access-control-page {
    display: grid;
    gap: 16px;
}

.access-level-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.access-level-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 102px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.access-level-card span,
.access-user-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #fff4ee;
    color: var(--brand);
    font-size: 20px;
    flex: 0 0 auto;
}

.access-level-card.manager span {
    background: #eef7f2;
    color: var(--mint);
}

.access-level-card.viewer span {
    background: #f3f4f6;
    color: #5f6670;
}

.access-level-card strong {
    display: block;
    color: var(--danger);
    font-size: 30px;
    line-height: 1;
}

.access-level-card p {
    margin: 4px 0 2px;
    color: var(--ink);
    font-weight: 900;
}

.access-level-card small {
    color: var(--muted);
    font-weight: 750;
}

.access-user-form {
    display: grid;
    gap: 16px;
}

.access-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.access-form-grid label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.access-form-grid input,
.access-form-grid select {
    min-height: 44px;
    text-transform: none;
}

.access-form-actions {
    justify-content: flex-end;
}

.access-user-list {
    display: grid;
    gap: 10px;
}

.access-user-card {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.access-user-card summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.access-user-card summary::-webkit-details-marker {
    display: none;
}

.access-user-chevron {
    color: var(--muted);
    transition: transform .18s ease;
}

.access-user-card[open] .access-user-chevron {
    transform: rotate(180deg);
}

.access-user-card strong,
.access-user-card p {
    overflow-wrap: anywhere;
}

.access-user-card p {
    margin: 3px 0;
    color: var(--muted);
    font-weight: 800;
}

.access-user-card small {
    color: var(--muted);
}

.access-user-card .compact-action {
    min-width: 42px;
    padding: 0 12px;
}

.access-user-detail-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.access-user-detail-form input:disabled,
.access-user-detail-form select:disabled {
    border-color: #e3e6ea;
    background: #f1f3f5;
    color: #6b7280;
    opacity: 1;
}

.access-user-actions {
    justify-content: flex-end;
}

.salary-management-page {
    display: grid;
    gap: 16px;
}

.salary-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
}

.salary-summary-grid article {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.salary-summary-grid span,
.salary-record-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eef7f2;
    color: var(--mint);
    font-size: 18px;
    flex: 0 0 auto;
}

.salary-summary-grid article.net span {
    background: #fff1f1;
    color: var(--danger);
}

.salary-summary-grid strong {
    display: block;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
}

.salary-summary-grid p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.salary-add-panel,
.salary-record-form {
    display: grid;
    gap: 14px;
}

.salary-add-collapsed-panel {
    gap: 12px;
}

.salary-month-generator {
    display: grid;
    grid-template-columns: minmax(180px, 280px) auto minmax(180px, 1fr);
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(47, 102, 88, .16);
    border-radius: 10px;
    background: #fbfdfc;
}

.salary-month-generator label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.salary-month-generator input {
    min-height: 42px;
    text-transform: none;
}

.salary-month-generator small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.salary-manual-add {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.salary-manual-add > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 950;
    list-style: none;
}

.salary-manual-add > summary::-webkit-details-marker {
    display: none;
}

.salary-manual-add > summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.salary-manual-add[open] > summary {
    border-bottom: 1px solid var(--line);
    background: #fffaf5;
}

.salary-manual-add[open] > summary .salary-record-chevron {
    transform: rotate(180deg);
}

.salary-manual-add > .salary-record-form {
    padding: 14px;
}

.salary-filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
    align-items: end;
    gap: 18px;
    border-color: rgba(169, 54, 49, .18);
    background: linear-gradient(135deg, #fffaf5 0%, #ffffff 58%, #f5fbf8 100%);
}

.salary-filter-panel h2 {
    margin: 3px 0 4px;
    color: var(--ink);
    font-size: 24px;
}

.salary-filter-panel label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.salary-filter-panel select {
    min-height: 46px;
}

.salary-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.salary-form-grid label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.salary-form-grid .span-2 {
    grid-column: span 2;
}

.salary-form-grid input,
.salary-form-grid select,
.salary-form-grid textarea {
    min-height: 44px;
    text-transform: none;
}

.salary-form-grid textarea {
    resize: vertical;
}

.salary-form-actions {
    justify-content: flex-end;
}

.salary-item-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.salary-item-box {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(47, 102, 88, .14);
    border-radius: 10px;
    background: #fbfdfc;
}

.salary-item-box.deductions {
    border-color: rgba(169, 54, 49, .16);
    background: #fffafa;
}

.salary-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.salary-item-head strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.salary-item-head span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.salary-item-head small {
    display: block;
    margin-top: 3px;
    color: #7b716b;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.35;
}

.salary-item-head b {
    color: var(--mint);
}

.salary-item-box.deductions .salary-item-head b {
    color: var(--danger);
}

.salary-item-rows {
    display: grid;
    gap: 8px;
}

.salary-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px 42px;
    gap: 8px;
    align-items: center;
}

.salary-item-row input {
    min-height: 40px;
}

.salary-item-row input[data-salary-item-amount] {
    text-align: right;
}

.salary-net-strip {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f1f8f5, #fff7f0);
    color: var(--ink);
    font-weight: 950;
}

.salary-net-strip span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.salary-net-strip strong {
    color: var(--brand-dark);
    font-size: 22px;
}

.salary-record-list {
    display: grid;
    gap: 10px;
}

.salary-month-list {
    gap: 14px;
}

.salary-month-group {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(47, 102, 88, .18);
    border-radius: 10px;
    background: #f8fbfa;
    box-shadow: var(--shadow-soft);
}

.salary-month-group > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.salary-month-group > summary::-webkit-details-marker {
    display: none;
}

.salary-month-group > summary strong {
    display: block;
    color: var(--brand-dark);
    font-size: 20px;
    line-height: 1.1;
}

.salary-month-group > summary span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.salary-month-group > summary em {
    color: var(--mint);
    font-size: 20px;
    font-style: normal;
    font-weight: 950;
    white-space: nowrap;
}

.salary-month-group.is-finalised {
    border-color: rgba(47, 102, 88, .36);
    background: #f2faf6;
}

.salary-month-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.salary-month-actions .compact-action {
    margin: 0;
    min-height: 38px;
}

.salary-month-group[open] > summary .salary-record-chevron {
    transform: rotate(180deg);
}

.salary-month-records {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.salary-record-card {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.salary-record-card.is-payroll-locked {
    background: #f4f5f4;
}

.salary-record-card.is-editing {
    border-color: rgba(47, 102, 88, .45);
    background: #fbfffd;
}

.salary-record-card summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.salary-record-card summary::-webkit-details-marker {
    display: none;
}

.salary-record-card summary strong,
.salary-record-card summary p {
    overflow-wrap: anywhere;
}

.salary-record-card summary p {
    margin: 3px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.salary-record-card summary b {
    color: var(--mint);
    font-size: 18px;
    white-space: nowrap;
}

.salary-record-chevron {
    color: var(--muted);
    transition: transform .18s ease;
}

.salary-record-card[open] .salary-record-chevron {
    transform: rotate(180deg);
}

.salary-record-card .salary-record-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.salary-record-form input:disabled,
.salary-record-form select:disabled,
.salary-record-form textarea:disabled {
    border-color: #e3e6ea;
    background: #f1f3f5;
    color: #6b7280;
    opacity: 1;
}

.attendance-management-page {
    display: grid;
    gap: 18px;
}

.attendance-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.attendance-toolbar h2 {
    margin: 2px 0 4px;
    color: var(--ink);
}

.attendance-month-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.attendance-month-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 800;
}

.attendance-month-form input {
    min-width: 170px;
}

.attendance-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 10px;
}

.attendance-summary-grid article {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(53, 38, 29, 0.06);
}

.attendance-summary-grid span {
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.attendance-summary-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    color: var(--ink);
}

.attendance-summary-grid .attendance-status-present strong,
.attendance-status-pill.attendance-status-present {
    color: #1f7a55;
}

.attendance-summary-grid .attendance-status-absent strong,
.attendance-status-pill.attendance-status-absent {
    color: #a93631;
}

.attendance-summary-grid .attendance-status-pending strong,
.attendance-status-pill.attendance-status-pending {
    color: #a36a19;
}

.attendance-staff-list {
    display: grid;
    gap: 14px;
}

.attendance-staff-group {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(53, 38, 29, 0.08);
    overflow: hidden;
}

.attendance-staff-group > summary {
    list-style: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
    background: linear-gradient(135deg, #fffaf4, #f8fbf8);
}

.attendance-staff-group > summary::-webkit-details-marker {
    display: none;
}

.attendance-staff-group > summary strong,
.attendance-staff-group > summary p {
    margin: 0;
}

.attendance-staff-group > summary p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 3px;
}

.attendance-staff-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.attendance-staff-badges > span:first-child {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
    font-weight: 900;
    font-size: 0.8rem;
}

.attendance-status-pill {
    border-radius: 999px;
    padding: 7px 10px;
    background: #f6f2ed;
    font-size: 0.78rem;
    font-weight: 900;
}

.attendance-staff-group[open] > summary .salary-record-chevron {
    transform: rotate(180deg);
}

.attendance-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    padding: 18px;
}

.attendance-day-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: #fff;
    display: grid;
    gap: 14px;
}

.attendance-day-card.is-overtime {
    border-color: rgba(31, 122, 85, 0.3);
    box-shadow: 0 12px 28px rgba(31, 122, 85, 0.08);
}

.attendance-day-card.is-overtime-excess {
    border-color: rgba(169, 54, 49, 0.35);
}

.attendance-day-card.attendance-friday-blocked {
    border-color: #b0443d;
    background: #fff8f6;
}

.attendance-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    gap: 8px;
}

.attendance-day-head strong {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff4ed;
    color: var(--brand);
    font-size: 1.1rem;
}

.attendance-day-head em {
    margin-left: auto;
    border-radius: 999px;
    padding: 5px 8px;
    background: #fff2df;
    color: #8a4b10;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 950;
    text-transform: uppercase;
}

.attendance-day-card label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.78rem;
}

.attendance-day-card input,
.attendance-day-card select {
    width: 100%;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 8px 10px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
}

.attendance-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.attendance-hours-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.attendance-hour-box {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: #faf8f5;
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(53, 38, 29, 0.05);
}

.attendance-hour-box em,
.attendance-hour-box small {
    display: block;
    font-style: normal;
}

.attendance-hour-box em {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.attendance-hour-box b {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    line-height: 1;
}

.attendance-hour-box small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.attendance-hour-box.duty {
    background: #f0f8f4;
    border-color: #cfe7da;
}

.attendance-hour-box.duty b {
    color: #1f7a55;
}

.attendance-hour-box.overtime {
    background: #fff7ea;
    border-color: #f0d5aa;
}

.attendance-hour-box.overtime b {
    color: #a36a19;
}

.attendance-hour-box.total {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    background: #f7f3ef;
}

.attendance-hour-box.total em,
.attendance-hour-box.total small {
    grid-column: 1;
}

.attendance-hour-box.total b {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    color: var(--brand-dark);
    font-size: 1.75rem;
}

.attendance-day-card.is-overtime .attendance-hour-box.overtime {
    background: #fff0e7;
    border-color: #edb98a;
    box-shadow: 0 10px 22px rgba(163, 106, 25, 0.14);
}

.attendance-day-card.is-overtime .attendance-hour-box.overtime b {
    color: #b0443d;
}

.attendance-day-card.is-overtime-excess .attendance-hour-box.overtime {
    background: #fff0ef;
    border-color: #efc7c3;
}

.attendance-day-card.is-overtime-excess .attendance-hour-box.overtime b {
    color: #a93631;
}

.attendance-log-list {
    display: grid;
    gap: 8px;
}

.attendance-log-row {
    display: grid;
    grid-template-columns: 110px 110px minmax(0, 1fr) 38px;
    align-items: end;
    gap: 10px;
    border: 1px solid #eee5dd;
    border-radius: 12px;
    padding: 10px;
    background: #fffdf9;
}

.attendance-log-row .icon-only-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    align-self: end;
}

.attendance-add-session {
    min-height: 38px;
    justify-content: center;
}

.attendance-friday-warning {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    border-radius: 10px;
    padding: 8px 9px;
    background: #fff6e8;
    color: #8a4b10;
    font-size: 0.76rem;
    font-weight: 900;
}

@media (max-width: 760px) {
    .attendance-toolbar {
        display: grid;
        align-items: stretch;
    }

    .attendance-month-form {
        justify-content: stretch;
    }

    .attendance-month-form label,
    .attendance-month-form input,
    .attendance-month-form .compact-action {
        width: 100%;
    }

    .attendance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .attendance-staff-group > summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .attendance-staff-badges {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .attendance-day-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 12px;
    }

    .attendance-day-card {
        padding: 14px;
    }

    .attendance-hours-panel {
        grid-template-columns: 1fr;
    }

    .attendance-hour-box.total {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .attendance-hour-box b {
        font-size: 1.4rem;
    }

    .attendance-hour-box.total b {
        font-size: 1.55rem;
    }

    .attendance-log-row {
        grid-template-columns: 1fr 1fr 38px;
    }

    .attendance-log-row label:nth-child(3) {
        grid-column: 1 / -1;
    }

    .attendance-log-row .icon-only-btn {
        grid-column: 3;
        grid-row: 1;
    }
}

.payslip-preview-modal {
    width: min(920px, calc(100vw - 28px));
    max-height: 92vh;
    overflow: auto;
}

.payslip-preview-content {
    display: grid;
    justify-items: center;
    padding: 12px;
    background: #f4f2ef;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.payslip-doc {
    width: 100%;
    max-width: 760px;
    min-height: 940px;
    padding: 34px;
    border: 1px solid #d8d1c9;
    background: #fff;
    color: #2b201b;
    box-shadow: 0 18px 45px rgba(46, 33, 24, .12);
    box-sizing: border-box;
    overflow: hidden;
}

.payslip-letterhead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #d8d1c9;
}

.payslip-brand-block {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.payslip-brand-block img,
.payslip-logo-fallback {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    border-radius: 10px;
    object-fit: contain;
    background: #fff7f0;
}

.payslip-logo-fallback {
    display: inline-grid;
    place-items: center;
    color: var(--brand);
    font-weight: 950;
}

.payslip-brand-block strong {
    display: block;
    margin-bottom: 5px;
    color: var(--brand-dark);
    font-size: 24px;
    line-height: 1.1;
}

.payslip-brand-block span {
    display: block;
    color: #62564e;
    font-size: 13px;
    line-height: 1.45;
}

.payslip-meta {
    min-width: 150px;
    text-align: right;
}

.payslip-meta span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.payslip-meta strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    font-size: 14px;
}

.payslip-title {
    margin: 22px 0 18px;
    padding: 11px 14px;
    border-top: 2px solid #2b201b;
    border-bottom: 2px solid #2b201b;
    text-align: center;
    font-size: 20px;
    letter-spacing: .14em;
}

.payslip-info-table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border: 1px solid #e2dbd4;
    border-collapse: collapse;
    table-layout: fixed;
    box-sizing: border-box;
}

.payslip-info-table th,
.payslip-info-table td {
    padding: 8px 10px;
    border-top: 1px solid #ece5df;
    color: #302722;
    font-size: 13px;
    line-height: 1.35;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payslip-info-table tr:first-child th,
.payslip-info-table tr:first-child td {
    border-top: 0;
}

.payslip-info-table th {
    width: 124px;
    background: #fcfaf7;
    color: #71675f;
    font-weight: 800;
    text-align: left;
}

.payslip-info-table td {
    font-weight: 850;
    overflow-wrap: anywhere;
}

.payslip-info-table .payslip-info-colon {
    width: 12px;
    padding-right: 0;
    padding-left: 0;
    color: #71675f;
    font-weight: 850;
    text-align: center;
}

.payslip-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.payslip-breakdown {
    width: 100%;
    max-width: 100%;
    border: 1px solid #d8d1c9;
    overflow: hidden;
}

.payslip-breakdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 150px);
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 10px 12px;
    border-top: 1px solid #e8e0d8;
    color: #111827;
    font-size: 14px;
    line-height: 1.3;
}

.payslip-breakdown-row:first-child {
    border-top: 0;
}

.payslip-breakdown-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.payslip-breakdown-row strong {
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.payslip-breakdown-head {
    background: #f5efe7;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.payslip-breakdown-head strong {
    color: var(--brand-dark);
}

.payslip-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border: 1px solid #d8d1c9;
    table-layout: fixed;
    box-sizing: border-box;
}

.payslip-description-col {
    width: auto;
}

.payslip-amount-col {
    width: 150px;
}

.payslip-table th:last-child,
.payslip-table td:last-child {
    width: 150px;
}

.payslip-table th,
.payslip-table td {
    padding: 10px 12px;
    border-top: 1px solid #e8e0d8;
    text-align: left;
    font-size: 14px;
    line-height: 1.28;
    overflow: visible;
    overflow-wrap: anywhere;
}

.payslip-table th {
    background: #f5efe7;
    color: var(--brand-dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.payslip-table th:last-child,
.payslip-table td:last-child {
    text-align: right;
    white-space: nowrap;
    overflow-wrap: normal;
    font-variant-numeric: tabular-nums;
}

.payslip-subtotal td,
.payslip-breakdown-row.payslip-subtotal {
    background: #fbf8f4;
    font-weight: 900;
}

.payslip-net td,
.payslip-breakdown-row.payslip-net {
    background: #fff3ee;
    color: var(--brand-dark);
    font-size: 16px;
    font-weight: 950;
}

.payslip-amount-words {
    display: grid;
    gap: 5px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #d8d1c9;
    background: #fcfaf7;
    text-align: center;
}

.payslip-amount-words strong {
    color: var(--mint);
    font-size: 22px;
}

.payslip-amount-words span {
    color: #2f2925;
    font-weight: 850;
}

.payslip-remarks {
    min-height: 62px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid #d8d1c9;
    color: #5c514a;
}

.payslip-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 38px;
    margin-top: 60px;
    color: #4e453f;
    font-weight: 850;
}

.payslip-footer span {
    padding-top: 10px;
    border-top: 1px solid #4e453f;
}

.payslip-footer span:last-child {
    text-align: right;
}

.payslip-system-note {
    margin: 34px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.payslip-preview-actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.bulk-payslip-modal {
    width: min(560px, calc(100vw - 28px));
}

.signature-upload-field {
    margin-top: 16px;
}

.signature-upload-preview {
    min-height: 150px;
    background: #fffdf9;
}

.signature-upload-preview img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.signature-upload-preview span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 760px) {
    .sales-report-upload-form {
        grid-template-columns: 1fr;
    }

    .sales-report-picker {
        width: 100%;
        min-width: 0;
    }

    .sales-report-layout {
        grid-template-columns: 1fr;
    }

    .sales-receipt-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        padding-right: 0;
    }

    .sales-receipt-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .sales-receipt-paper {
        padding: 14px;
    }

    .sales-receipt-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .sales-receipt-head h2 {
        font-size: 24px;
    }

    .sales-receipt-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .salary-filter-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .salary-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .salary-form-grid .span-2 {
        grid-column: auto;
    }

    .salary-item-editor {
        grid-template-columns: 1fr;
    }

    .salary-item-row {
        grid-template-columns: minmax(0, 1fr) 104px 40px;
    }

    .salary-month-group > summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .salary-month-group > summary em,
    .salary-month-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .salary-month-actions .compact-action {
        flex: 1 1 150px;
    }

    .salary-record-card summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .salary-record-card summary .status-pill {
        grid-column: 2 / 3;
        justify-self: start;
    }

    .salary-record-card summary b {
        grid-column: 2 / 3;
        justify-self: start;
    }

    .salary-record-card summary .salary-record-chevron {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
    }

    .payslip-preview-modal {
        width: calc(100vw - 16px);
        padding: 14px;
    }

    .payslip-preview-content {
        padding: 8px;
        border-radius: 10px;
    }

    .payslip-doc {
        min-height: auto;
        padding: 14px;
    }

    .payslip-letterhead,
    .payslip-brand-block {
        display: grid;
    }

    .payslip-letterhead {
        grid-template-columns: 1fr;
    }

    .payslip-brand-block {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .payslip-brand-block img,
    .payslip-logo-fallback {
        width: 64px;
        height: 64px;
    }

    .payslip-meta {
        text-align: left;
    }

    .payslip-info-table th,
    .payslip-info-table td {
        padding: 6px 5px;
        font-size: 11px;
    }

    .payslip-info-table th {
        width: 78px;
    }

    .payslip-info-table .payslip-info-colon {
        width: 9px;
    }

    .payslip-table th,
    .payslip-table td {
        padding: 6px 5px;
        font-size: 10.5px;
    }

    .payslip-breakdown-row {
        grid-template-columns: minmax(0, 1fr) minmax(82px, 92px);
        gap: 8px;
        padding: 7px 6px;
        font-size: 11px;
    }

    .payslip-breakdown-head {
        font-size: 10px;
        letter-spacing: .03em;
    }

    .payslip-table th:last-child,
    .payslip-table td:last-child {
        width: 92px;
        max-width: 92px;
    }

    .payslip-net td {
        font-size: 12px;
    }

    .payslip-footer {
        gap: 18px;
        margin-top: 36px;
    }

    .payslip-preview-actions {
        justify-content: stretch;
    }

    .payslip-preview-actions button {
        flex: 1 1 auto;
    }
}

.staff-management-page {
    display: grid;
    gap: 16px;
}

.staff-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
}

.staff-summary-grid article {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.staff-summary-grid span,
.staff-record-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eef7f2;
    color: var(--mint);
    font-size: 18px;
    flex: 0 0 auto;
}

.staff-summary-grid article.allowance span {
    background: #fff1f1;
    color: var(--danger);
}

.staff-summary-grid strong {
    display: block;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
}

.staff-summary-grid p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-add-panel,
.staff-record-form {
    display: grid;
    gap: 14px;
}

.staff-add-details {
    padding: 0;
    overflow: hidden;
}

.staff-add-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    cursor: pointer;
    list-style: none;
}

.staff-add-details summary::-webkit-details-marker {
    display: none;
}

.staff-add-details summary .section-title {
    margin: 0;
}

.staff-add-details summary > div:last-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.staff-add-details > .staff-record-form {
    padding: 0 18px 18px;
}

.staff-add-details[open] .staff-record-chevron {
    transform: rotate(180deg);
}

.staff-profile-panel {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(47, 102, 88, .16);
    border-radius: 8px;
    background: linear-gradient(135deg, #f7fbf9 0%, #fff8f1 100%);
}

.staff-profile-photo {
    display: grid;
    place-items: center;
    width: 112px;
    height: 128px;
    border: 3px solid #fff;
    border-radius: 8px;
    background: #eef2f1;
    background-position: center;
    background-size: cover;
    color: var(--mint);
    box-shadow: 0 12px 24px rgba(47, 102, 88, .14);
    font-size: 34px;
    overflow: hidden;
}

.staff-profile-photo.has-photo {
    background-color: #fff;
}

.staff-profile-copy {
    min-width: 0;
}

.staff-profile-copy h3 {
    margin: 3px 0;
    color: var(--ink);
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.08;
}

.staff-profile-copy span {
    display: inline-flex;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.staff-section-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.staff-section-heading span {
    white-space: nowrap;
}

.staff-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.staff-form-grid label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-form-grid input,
.staff-form-grid select,
.staff-form-grid textarea {
    min-height: 44px;
    text-transform: none;
}

.staff-expiry-field {
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.staff-expiry-field input {
    font-weight: 900;
}

.staff-expiry-note {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    line-height: 1.1;
    text-transform: none;
}

.staff-expiry-orange {
    border-color: rgba(245, 138, 7, .42);
    background: #fff7e8;
    box-shadow: 0 8px 18px rgba(245, 138, 7, .08);
}

.staff-expiry-orange input,
.staff-expiry-orange .staff-expiry-note {
    color: #a45500;
}

.staff-expiry-orange .staff-expiry-note {
    background: rgba(245, 138, 7, .13);
}

.staff-expiry-red,
.staff-expiry-expired {
    border-color: rgba(194, 35, 35, .46);
    background: #fff0f0;
    box-shadow: 0 8px 18px rgba(194, 35, 35, .1);
}

.staff-expiry-red input,
.staff-expiry-expired input,
.staff-expiry-red .staff-expiry-note,
.staff-expiry-expired .staff-expiry-note {
    color: #b42323;
}

.staff-expiry-red .staff-expiry-note,
.staff-expiry-expired .staff-expiry-note {
    background: rgba(194, 35, 35, .13);
}

.staff-expiry-expired {
    animation: staffExpiryBlink 1.1s ease-in-out infinite;
}

@keyframes staffExpiryBlink {
    0%, 100% {
        background: #fff0f0;
        border-color: rgba(194, 35, 35, .46);
    }
    50% {
        background: #ffd6d6;
        border-color: rgba(194, 35, 35, .88);
    }
}

.staff-form-actions {
    justify-content: flex-end;
}

.staff-document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
}

.staff-document-upload {
    min-width: 0;
    gap: 6px;
}

.staff-document-preview {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border-style: solid;
    border-color: rgba(47, 102, 88, .16);
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.staff-document-preview.has-file {
    border-style: solid;
    border-color: rgba(47, 102, 88, .3);
    color: var(--ink);
    background: linear-gradient(135deg, #f7fbf9 0%, #fff 100%);
}

.staff-document-preview i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(47, 102, 88, .1);
    color: var(--mint);
    font-size: 16px;
}

.staff-document-preview small {
    justify-self: end;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff7f0;
    color: var(--brand);
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.staff-document-preview.has-file small {
    background: rgba(47, 102, 88, .1);
    color: var(--mint);
}

.staff-document-title {
    min-width: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 950;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.staff-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(47, 102, 88, .18);
    border-radius: 999px;
    background: #f7fbf9;
    color: var(--mint);
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.staff-doc-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-record-list {
    display: grid;
    gap: 14px;
}

.staff-status-group {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(47, 102, 88, .18);
    border-radius: 10px;
    background: #f8fbfa;
    box-shadow: var(--shadow-soft);
}

.staff-status-group.staff-status-resigned {
    border-color: rgba(182, 123, 37, .28);
    background: #fffaf1;
}

.staff-status-group.staff-status-terminated {
    border-color: rgba(169, 54, 49, .24);
    background: #fff6f5;
}

.staff-status-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.staff-status-group > summary::-webkit-details-marker {
    display: none;
}

.staff-status-group > summary strong {
    display: block;
    color: var(--brand-dark);
    font-size: 19px;
}

.staff-status-group > summary span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.staff-status-group[open] > summary .staff-record-chevron {
    transform: rotate(180deg);
}

.staff-status-records {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.staff-empty-group {
    padding: 16px;
    border: 1px dashed rgba(99, 79, 69, .2);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    font-weight: 850;
}

.staff-record-card {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.staff-record-card.staff-status-resigned {
    border-color: rgba(182, 123, 37, .28);
}

.staff-record-card.staff-status-terminated {
    border-color: rgba(169, 54, 49, .24);
    background: #fffbfb;
}

.staff-record-card summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.staff-record-card summary::-webkit-details-marker {
    display: none;
}

.staff-record-card summary strong,
.staff-record-card summary p {
    overflow-wrap: anywhere;
}

.staff-record-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.staff-contact-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.staff-contact-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 26px;
    padding: 5px 9px;
    border: 1px solid #e8ece9;
    border-radius: 999px;
    background: #ffffff;
    color: #5f6368;
    font-size: 11px;
    font-weight: 820;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.staff-contact-row i {
    color: var(--mint);
    font-size: 10px;
}

.staff-expiry-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.staff-tenure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid rgba(47, 102, 88, .18);
    border-radius: 999px;
    background: #f7fbf8;
    color: var(--mint);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.staff-tenure-badge i {
    font-size: 10px;
}

.staff-id-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid rgba(99, 79, 69, .14);
    border-radius: 999px;
    background: #fffaf5;
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.staff-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid rgba(47, 102, 88, .18);
    border-radius: 999px;
    background: #f7fbf8;
    color: var(--mint);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.staff-status-badge.staff-status-resigned {
    border-color: rgba(182, 123, 37, .22);
    background: #fff8ed;
    color: #9a6216;
}

.staff-status-badge.staff-status-terminated {
    border-color: rgba(169, 54, 49, .22);
    background: #fff5f5;
    color: var(--danger);
}

.staff-data-badge-slot {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

.staff-complete-badge,
.staff-missing-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 5px 6px 5px 10px;
    border: 1px solid rgba(99, 79, 69, .14);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 14px rgba(30, 41, 59, .06);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.staff-complete-badge {
    border-color: rgba(47, 102, 88, .22);
    background: #dcfce7;
    color: var(--mint);
}

.staff-complete-badge i {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--mint);
    color: #fff;
    font-size: 15px;
}

.staff-complete-badge span,
.staff-missing-badge span {
    transform: translateY(1px);
}

.staff-missing-badge {
    border-color: rgba(180, 35, 35, .26);
    background: #fee2e2;
    color: #7f1d1d;
    animation: staffMissingPulse 1.35s ease-in-out infinite;
}

.staff-missing-badge i {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b42323;
    font-size: 10px;
}

.staff-missing-badge b {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: #b42323;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 15px;
    font-weight: 950;
    line-height: 1;
    text-shadow: none;
    box-shadow: 0 0 0 2px rgba(180, 35, 35, .14), 0 2px 6px rgba(127, 29, 29, .14);
}

.staff-complete-badge b {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--mint);
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}

/* Retained for older cached markup without the complete count element. */
.staff-complete-badge:not(:has(b)) {
    padding-right: 10px;
}

/* legacy override */
.staff-complete-badge::before,
.staff-missing-badge::before {
    display: none;
}

@keyframes staffMissingPulse {
    0%, 100% {
        border-color: rgba(180, 35, 35, .28);
        box-shadow: 0 6px 14px rgba(30, 41, 59, .06);
    }
    50% {
        border-color: rgba(180, 35, 35, .72);
        box-shadow: 0 0 0 3px rgba(180, 35, 35, .14), 0 8px 18px rgba(180, 35, 35, .12);
    }
}

.staff-status-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.staff-status-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.staff-status-control select {
    min-height: 34px;
    padding: 6px 32px 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: none;
}

.staff-expiry-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.staff-expiry-badge b {
    font-size: 13px;
}

.staff-expiry-badge.expiring {
    border-color: rgba(164, 85, 0, .2);
    background: #fff8ed;
    color: #a45500;
}

.staff-expiry-badge.about {
    border-color: rgba(180, 35, 35, .18);
    background: #fff0f0;
    color: #b42323;
}

.staff-expiry-badge.expired {
    gap: 9px;
    min-height: 36px;
    padding: 8px 14px;
    border-color: rgba(169, 21, 21, .2);
    background: #ffe3e3;
    color: #a91515;
    font-size: 13px;
    letter-spacing: .02em;
    animation: staffExpiryBadgeBlink 1.1s ease-in-out infinite;
}

.staff-expiry-badge.expired b,
.staff-record-card summary .staff-expiry-badge.expired b {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: #b42323;
    color: #fff;
    font-size: 15px;
    font-weight: 950;
    line-height: 1;
}

@keyframes staffExpiryBadgeBlink {
    0%, 100% {
        background: #ffd6d6;
        box-shadow: 0 0 0 0 rgba(194, 35, 35, .18);
    }
    50% {
        background: #ffb8b8;
        box-shadow: 0 0 0 4px rgba(194, 35, 35, .1);
    }
}

.staff-record-card summary p {
    margin: 3px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.staff-record-card summary b {
    color: var(--mint);
    font-size: 18px;
    white-space: nowrap;
}

.staff-record-card summary .staff-expiry-badge b {
    color: inherit;
    font-size: 13px;
}

.staff-record-chevron {
    color: var(--muted);
    transition: transform .18s ease;
}

.staff-record-card[open] .staff-record-chevron {
    transform: rotate(180deg);
}

.staff-record-card .staff-record-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.staff-record-form input:disabled,
.staff-record-form select:disabled,
.staff-record-form textarea:disabled {
    border-color: #e3e6ea;
    background: #f1f3f5;
    color: #6b7280;
    opacity: 1;
}

.product-admin-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
}

.list-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child {
    border-bottom: 0;
}

.muted {
    color: var(--muted);
}

.danger {
    color: var(--danger);
}

.empty-state {
    padding: 28px;
    color: var(--muted);
}

.empty-state h2 {
    color: var(--ink);
    margin-bottom: 8px;
}

.admin-date-filter {
    min-width: 190px;
}

.admin-date-filter input {
    min-height: 40px;
}

.kitchen-summary {
    margin-bottom: 16px;
}

.kitchen-range-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}

.kitchen-range-summary span {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 72px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(169, 54, 49, .14);
    border-radius: 10px;
    background: #fff;
    color: var(--brand-dark);
    font-size: 22px;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 10px 22px rgba(61, 43, 31, .05);
}

.kitchen-range-summary b {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}

.kitchen-days {
    display: grid;
    gap: 20px;
}

.kitchen-pagination {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 10px;
    border: 1px solid rgba(99, 79, 69, .16);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(61, 43, 31, .05);
}

.kitchen-pagination div {
    display: grid;
    gap: 2px;
    justify-items: center;
    min-width: 0;
}

.kitchen-pagination strong {
    color: var(--ink);
    font-size: 15px;
}

.kitchen-pagination span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.kitchen-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.kitchen-day-card {
    display: grid;
    gap: 16px;
    padding: clamp(12px, 2vw, 18px);
    border: 1px solid rgba(99, 79, 69, .38);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #fffdf9 100%);
    box-shadow: 0 14px 30px rgba(61, 43, 31, .08);
}

.kitchen-day-card:not([open]) {
    gap: 0;
}

.kitchen-day-card:not([open]) .kitchen-day-title {
    margin-bottom: 0;
}

.kitchen-day-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    align-content: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff7ec 0%, #f7fbf9 100%);
    border: 1px solid rgba(169, 54, 49, .18);
    cursor: pointer;
    list-style: none;
}

.kitchen-day-title::-webkit-details-marker {
    display: none;
}

.kitchen-day-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.kitchen-day-title strong {
    display: block;
    color: var(--brand-dark);
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.18;
    white-space: nowrap;
}

.kitchen-day-title span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(99, 79, 69, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1.35;
}

.kitchen-day-title .has-items-count {
    border-color: rgba(220, 38, 38, .22);
    background: #fff1f1;
    color: #dc2626;
}

.kitchen-day-actions {
    display: grid;
    grid-template-columns: auto auto 38px 18px;
    align-items: center;
    align-content: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.kitchen-save-btn,
.kitchen-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 7px;
    height: 38px;
    min-height: 38px;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: 8px;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}

.kitchen-edit-btn {
    padding: 0 11px;
    background: #fff;
}

.kitchen-day-card.kitchen-day-locked {
    border-color: rgba(107, 114, 128, .36);
    background: linear-gradient(180deg, #f7f8fa 0%, #f1f3f5 100%);
}

.kitchen-day-card.kitchen-day-locked .kitchen-day-title {
    border-color: rgba(107, 114, 128, .22);
    background: linear-gradient(135deg, #f1f3f5 0%, #e9edf0 100%);
}

.kitchen-day-card.kitchen-day-locked .prep-item,
.kitchen-day-card.kitchen-day-locked .kitchen-day-note {
    border-color: rgba(107, 114, 128, .24);
    background: #eef1f4;
}

.kitchen-day-card.kitchen-day-locked .prep-qty-tile {
    border-color: rgba(107, 114, 128, .2);
    background: #e7ebef;
}

.kitchen-day-card.kitchen-day-locked .prep-qty-tile span,
.kitchen-day-card.kitchen-day-locked .prep-item-head span,
.kitchen-day-card.kitchen-day-locked .kitchen-day-note label {
    color: #6b7280;
}

.kitchen-day-card.kitchen-day-locked input,
.kitchen-day-card.kitchen-day-locked textarea {
    background: #e1e5ea;
    border-color: rgba(107, 114, 128, .24);
    color: #6b7280;
    cursor: not-allowed;
}

.kitchen-day-card.kitchen-day-locked .kitchen-save-btn {
    opacity: .55;
}

.kitchen-day-actions .icon-only-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    box-sizing: border-box;
    margin: 0;
}

.kitchen-day-chevron {
    color: var(--muted);
    font-size: 14px;
    transition: transform .18s ease;
}

.kitchen-day-card[open] .kitchen-day-chevron {
    transform: rotate(180deg);
}

.kitchen-day-note {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid rgba(99, 79, 69, .16);
    border-radius: 8px;
    background: #f8faf9;
}

.kitchen-day-note label {
    display: grid;
    gap: 6px;
    margin: 0;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.kitchen-day-note textarea {
    min-height: 48px;
    width: 100%;
    resize: vertical;
    text-transform: none;
}

.kitchen-day-note-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.prep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 14px;
}

.prep-item {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
    padding: 14px;
    min-width: 0;
    border: 1px solid rgba(99, 79, 69, .2);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #f9fbfa 100%);
    box-shadow: 0 10px 22px rgba(61, 43, 31, .06);
}

.prep-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-right: 58px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 79, 69, .12);
}

.prep-item-head strong {
    display: block;
    color: var(--ink);
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.prep-item-head span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.prep-item-head em {
    position: absolute;
    top: 10px;
    right: 10px;
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: #f1e7e2;
    color: var(--brand-dark);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
}

.prep-qty-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 10px;
}

.prep-qty-tile {
    display: grid;
    gap: 4px;
    align-items: center;
    align-content: center;
    justify-items: center;
    min-width: 0;
    padding: 11px 10px;
    border-radius: 8px;
    background: #fff7ec;
    border: 1px solid rgba(169, 54, 49, .14);
    text-align: center;
}

.prep-qty-tile span {
    width: 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.prep-qty-tile b {
    width: 100%;
    color: #dc2626;
    font-size: clamp(23px, 3vw, 28px);
    line-height: 1;
    overflow-wrap: anywhere;
    text-align: center;
}

.requested-qty-tile {
    background: #fff4e8;
    border-color: rgba(169, 54, 49, .18);
}

.requested-qty-tile b {
    color: #dc2626;
}

.kitchen-qty-tile {
    background: #eef5ff;
    border-color: rgba(37, 99, 235, .18);
}

.kitchen-qty-tile b {
    color: #2563eb;
}

.muted-tile {
    background: #eef4f1;
    border-color: rgba(47, 102, 88, .16);
}

.muted-tile b {
    color: var(--mint);
}

.ready-qty-tile {
    background: #eef8f2;
    border-color: rgba(47, 102, 88, .18);
}

.ready-qty-tile b {
    color: #2f6658;
}

.ready-qty-card-input {
    width: 100%;
    max-width: 100%;
    justify-self: center;
    align-self: center;
    min-height: 38px;
    border-color: rgba(47, 102, 88, .22);
    background: #fff;
    color: var(--mint);
    font-size: 22px;
    font-weight: 900;
    text-align: center;
}

.prepared-field {
    display: grid;
    gap: 6px;
    margin: 0;
    color: var(--ink);
    font-weight: 900;
}

.prepared-field input {
    width: 100%;
    min-height: 42px;
    font-size: 18px;
    font-weight: 900;
}

.prep-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.prep-actions .icon-only-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
}

.kitchen-day-actions .icon-text-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 10px 13px;
    border-radius: 8px;
    white-space: nowrap;
}

.kitchen-day-actions .icon-only-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
}

.dispatch-ready-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: 10px;
}

.dispatch-ready-panel {
    padding: 0;
    overflow: hidden;
}

.dispatch-products-collapse,
.dispatch-date-group {
    border: 1px solid rgba(47, 102, 88, .18);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.dispatch-products-collapse > summary,
.dispatch-date-group > summary {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f5faf8 0%, #fffaf3 100%);
    cursor: pointer;
    list-style: none;
}

.dispatch-products-collapse > summary {
    grid-template-columns: minmax(0, 1fr) auto;
}

.dispatch-date-group > summary {
    grid-template-columns: minmax(0, 1fr) auto 18px;
}

.dispatch-products-collapse > summary::-webkit-details-marker,
.dispatch-date-group > summary::-webkit-details-marker {
    display: none;
}

.dispatch-products-collapse > summary h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
}

.dispatch-ready-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dispatch-ready-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dispatch-ready-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef4f1;
    color: var(--mint);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.dispatch-ready-metrics strong {
    color: var(--brand-dark);
    font-size: 14px;
}

.dispatch-summary-actions {
    display: grid;
    grid-template-columns: auto 42px 20px;
    align-items: center;
    gap: 8px;
}

.dispatch-summary-actions .icon-only-btn {
    width: 42px;
    min-width: 42px;
    height: 40px;
    padding: 0;
}

.dispatch-collapse-icon {
    color: var(--muted);
    transition: transform .18s ease;
}

.dispatch-products-collapse[open] .dispatch-collapse-icon,
.dispatch-date-group[open] .dispatch-collapse-icon {
    transform: rotate(180deg);
}

.dispatch-products-collapse .dispatch-ready-grid {
    padding: 12px;
}

.dispatch-date-groups {
    display: grid;
    gap: 12px;
}

.dispatch-date-group > summary strong {
    display: block;
    color: var(--brand-dark);
    font-size: 18px;
    line-height: 1.2;
}

.dispatch-date-group > summary span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.dispatch-date-group > summary em {
    color: var(--mint);
    font-style: normal;
    font-weight: 950;
    white-space: nowrap;
}

.dispatch-date-group > summary::after {
    content: "\f078";
    color: var(--muted);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform .18s ease;
}

.dispatch-date-group[open] > summary::after {
    transform: rotate(180deg);
}

.dispatch-date-table {
    border: 0;
    border-top: 1px solid rgba(47, 102, 88, .14);
    border-radius: 0;
    box-shadow: none;
}

.dispatch-date-table table {
    table-layout: fixed;
}

.dispatch-date-table th,
.dispatch-date-table td {
    padding: 12px 12px;
    vertical-align: middle;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dispatch-date-table th {
    font-size: 12px;
}

.dispatch-date-table td {
    font-size: 14px;
}

.dispatch-date-table th:nth-child(1),
.dispatch-date-table td:nth-child(1) {
    width: 54px;
}

.dispatch-date-table th:nth-child(3),
.dispatch-date-table td:nth-child(3) {
    width: 150px;
}

.dispatch-date-table th:nth-child(4),
.dispatch-date-table td:nth-child(4) {
    width: 220px;
}

.dispatch-date-table th:nth-child(5),
.dispatch-date-table td:nth-child(5),
.dispatch-date-table th:nth-child(6),
.dispatch-date-table td:nth-child(6) {
    width: 105px;
}

.dispatch-date-table th:nth-child(7),
.dispatch-date-table td:nth-child(7),
.dispatch-date-table th:nth-child(8),
.dispatch-date-table td:nth-child(8) {
    width: 128px;
}

.dispatch-date-table th:nth-child(9),
.dispatch-date-table td:nth-child(9) {
    width: 92px;
}

.dispatch-date-table .dispatch-card-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow: visible;
}

.dispatch-date-table .dispatch-card-actions .ghost {
    width: 36px;
    min-width: 36px;
    height: 34px;
    min-height: 34px;
    padding: 0;
}

.dispatch-card-table {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(47, 102, 88, .14);
    background: #fff;
    max-width: 100%;
    overflow-x: visible;
    overflow-y: visible;
}

.dispatch-card-head,
.dispatch-invoice-row {
    display: grid;
    grid-template-columns: 42px 82px minmax(92px, 1fr) minmax(150px, 1.45fr) 74px 92px 108px 98px 72px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.dispatch-card-head {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(99, 79, 69, .12);
    background: #f8f5f1;
    color: #4a4d55;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.dispatch-card-body {
    display: grid;
    gap: 8px;
    padding: 10px;
    min-width: 0;
    width: 100%;
}

.dispatch-invoice-row {
    padding: 10px 12px;
    border: 1px solid rgba(47, 102, 88, .14);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #fbfdfc 100%);
    box-shadow: 0 8px 18px rgba(47, 102, 88, .06);
}

.dispatch-invoice-row > span {
    min-width: 0;
    overflow: visible;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

.dispatch-invoice-row > span:nth-child(3),
.dispatch-invoice-row > span:nth-child(4),
.dispatch-invoice-row > span:nth-child(5),
.dispatch-invoice-row > span:nth-child(6) {
    font-weight: 900;
}

.dispatch-invoice-row > span::before {
    display: none;
}

.dispatch-invoice-row .dispatch-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: visible;
}

.dispatch-invoice-row .status-chip {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
    white-space: normal;
}

.dispatch-invoice-row .dispatch-card-actions .ghost {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
}

.dispatch-product-card {
    grid-template-rows: auto auto;
    gap: 8px;
    min-height: 118px;
    padding: 10px;
    border-color: rgba(47, 102, 88, .24);
    background: linear-gradient(180deg, #fff 0%, #f7fbf9 100%);
    box-shadow: 0 10px 22px rgba(47, 102, 88, .08);
}

.dispatch-product-card .prep-item-head strong {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.22;
}

.dispatch-product-card .prep-item-head span {
    margin-top: 3px;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dispatch-product-card .prep-item-head {
    gap: 8px;
    padding-right: 0;
    padding-bottom: 7px;
}

.dispatch-product-card .prep-item-head em {
    position: static;
    background: #eef4f1;
    color: var(--mint);
    font-size: 10px;
}

.dispatch-ready-qty {
    display: grid;
    align-content: center;
    justify-items: center;
    min-height: 56px;
    padding: 8px;
    border: 1px solid rgba(47, 102, 88, .16);
    border-radius: 8px;
    background: linear-gradient(135deg, #eef7f3 0%, #fff 100%);
}

.dispatch-ready-qty span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.dispatch-ready-qty b {
    margin-top: 2px;
    color: #dc2626;
    font-size: 24px;
    line-height: 1;
}

.dispatch-ready-qty small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.dispatch-product-card:hover {
    border-color: rgba(47, 102, 88, .34);
    box-shadow: 0 14px 26px rgba(47, 102, 88, .11);
}

@media (max-width: 980px) {
    .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .brand,
    .session {
        min-width: 0;
    }

    .session {
        justify-content: flex-start;
    }

    .nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hero-band,
    .login-layout,
    .admin-layout,
    .auth-grid,
    .product-admin-grid {
        grid-template-columns: 1fr;
    }

    .hero-carousel {
        min-height: 260px;
    }

    .admin-sidebar,
    .sticky-editor {
        position: static;
    }

    .admin-sidebar {
        min-height: 0;
    }

    .admin-sidebar {
        display: flex;
        overflow-x: auto;
        padding: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .admin-sidebar-title {
        min-width: 190px;
        margin: 0 6px 0 0;
        padding: 0 10px 0 0;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    .admin-sidebar .nav-link {
        width: auto;
        min-width: max-content;
    }

    .login-copy {
        display: none;
    }

    .hero-visual {
        min-height: 180px;
    }

    .brand-showcase img {
        width: min(190px, 64%);
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .graph-month-grid {
        grid-template-columns: repeat(3, minmax(86px, 1fr));
    }

    .invoice-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .access-level-grid,
    .access-form-grid,
    .staff-summary-grid,
    .staff-form-grid,
    .staff-document-grid,
    .salary-summary-grid,
    .salary-month-generator,
    .salary-form-grid {
        grid-template-columns: 1fr;
    }

    .salary-month-generator .compact-action {
        width: 100%;
    }

    .salary-form-grid .span-2 {
        grid-column: span 1;
    }

    .staff-profile-panel {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .staff-profile-photo {
        width: 88px;
        height: 104px;
    }

    .staff-profile-copy h3 {
        font-size: 20px;
    }

    .staff-document-preview {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .staff-document-preview small {
        grid-column: 2;
        justify-self: start;
    }

    .access-user-card summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .salary-record-card summary {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
    }

    .salary-month-group > summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .salary-month-group > summary em,
    .salary-month-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .salary-month-actions .compact-action {
        flex: 1 1 150px;
    }

    .staff-record-card summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .salary-record-card summary .status-pill {
        grid-column: 2;
        justify-self: start;
        margin-top: 6px;
    }

    .staff-record-card summary .status-pill {
        grid-column: 2;
        justify-self: start;
        margin-top: 6px;
    }

    .staff-data-badge-slot {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .staff-record-card summary b {
        grid-column: 2;
        justify-self: start;
    }

    .staff-record-card summary .staff-record-chevron {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }

    .access-user-chevron {
        grid-column: 3;
    }

    .access-user-card summary .status-pill {
        grid-column: 2;
        justify-self: start;
        margin-top: 6px;
    }

    body[data-portal="partner-login"] .topbar {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 18px;
    }

    body[data-portal="partner-login"] .brand {
        min-width: 0;
    }

    body[data-portal="partner-login"] .nav {
        justify-self: stretch;
        justify-content: flex-start;
        overflow-x: auto;
    }

    body[data-portal="partner-login"] .auth-page {
        width: min(100% - 28px, 760px);
        margin-top: 28px;
    }

    body[data-portal="partner-login"] .login-layout {
        grid-template-columns: 1fr;
    }

    body[data-portal="partner-login"] .login-copy {
        display: grid;
        min-height: 420px;
    }
}

@media (max-width: 760px) {
    body {
        min-width: 0;
    }

    .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .brand {
        min-width: 0;
        width: 100%;
    }

    .brand strong {
        overflow-wrap: anywhere;
    }

    .nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .session {
        min-width: 0;
        width: 100%;
        justify-content: space-between;
    }

    .shell,
    .admin-shell,
    .auth-page,
    .wide-auth {
        width: min(100% - 20px, 1180px);
        margin-left: auto;
        margin-right: auto;
    }

    .hero-band,
    .login-layout,
    .admin-layout,
    .auth-grid,
    .product-admin-grid,
    .settings-grid,
    .invoice-detail-grid,
    .invoice-print-head,
    .dashboard-charts,
    .dashboard-kpi-grid,
    .kitchen-day-note,
    .donut-wrap {
        grid-template-columns: 1fr;
    }

    .dashboard-snapshot-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .hero-band {
        padding: 22px;
    }

    .hero-band h1,
    .section-title h1 {
        font-size: 34px;
        line-height: 1.08;
    }

    .section-title,
    .tools,
    .form-actions,
    .auth-links,
    .mini-actions,
    .checkout-date-panel,
    .invoice-total-panel,
    .finalise-invoice-bar,
    .kitchen-day-title,
    .prep-item-head {
        align-items: stretch;
        flex-direction: column;
    }

    .kitchen-day-actions {
        justify-content: flex-end;
        width: auto;
    }

    .kitchen-day-title {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .kitchen-day-note-actions {
        width: 100%;
        justify-content: stretch;
    }

    .kitchen-day-note-actions .primary,
    .kitchen-day-note-actions .ghost {
        flex: 1 1 180px;
    }

    .tools,
    .search,
    .date-field,
    .checkout-date-panel .date-field,
    .hero-actions .primary,
    .hero-actions .ghost,
    .form-actions .primary,
    .mini-actions .primary,
    .mini-actions .ghost,
    .full-button {
        width: 100%;
    }

    .form-grid,
    .report-filter,
    .stat-grid,
    .invoice-summary,
    .graph-year-form,
    .graph-month-grid,
    .partner-detail-card,
    .partner-password-reset-card,
    .partner-product-price-summary,
    .partner-status-cards,
    .prep-grid,
    .prep-actions,
    .prep-qty-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .partner-password-reset-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .prep-qty-tile {
        min-width: 0;
        padding: 8px 6px;
    }

    .prep-qty-tile span {
        font-size: 9px;
        line-height: 1.15;
    }

    .prep-qty-tile b {
        font-size: 24px;
    }

    .ready-qty-card-input {
        min-height: 34px;
        padding: 6px 4px;
        font-size: 17px;
    }

    .prep-actions {
        display: flex;
        justify-content: flex-end;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    }

    .product-card {
        min-height: 0;
        grid-template-rows: minmax(150px, auto) 1fr;
    }

    .panel,
    .registration-card,
    .login-card {
        padding: 18px;
    }

    .table-wrap,
    .partner-status-section,
    .admin-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 640px;
    }

    .partner-status-section table {
        min-width: 720px;
    }

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

    .price-input,
    .qty-input {
        width: 100%;
    }

    body[data-portal="partner-login"] .topbar {
        border-radius: 0 0 18px 18px;
        padding: 12px;
        gap: 10px;
    }

    body[data-portal="partner-login"] .brand {
        gap: 12px;
    }

    body[data-portal="partner-login"] .brand-logo {
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    body[data-portal="partner-login"] .brand strong {
        font-size: 16px;
    }

    body[data-portal="partner-login"] .brand small {
        font-size: 12px;
    }

    body[data-portal="partner-login"] .nav {
        justify-self: stretch;
        gap: 6px;
    }

    body[data-portal="partner-login"] .nav-link {
        min-width: max-content;
        min-height: 38px;
        padding: 8px 11px;
        font-size: 14px;
    }

    body[data-portal="partner-login"] .auth-page {
        width: min(100% - 20px, 760px);
        margin-top: 20px;
    }

    body[data-portal="partner-login"] .login-copy {
        display: grid;
        min-height: 330px;
        padding: 32px 24px;
    }

    body[data-portal="partner-login"] .login-copy h1 {
        max-width: 360px;
        font-size: 36px;
    }

    body[data-portal="partner-login"] .login-copy p {
        max-width: 330px;
        font-size: 15px;
    }

    body[data-portal="partner-login"] .login-card {
        padding: 28px 20px;
    }

    body[data-portal="partner"],
    body[data-portal="partner-login"],
    body[data-portal="partner-register"],
    body[data-portal="partner-reset"] {
        --partner-topbar-offset: 86px;
    }

    body[data-portal="partner"] .topbar,
    body[data-portal="partner-login"] .topbar,
    body[data-portal="partner-register"] .topbar,
    body[data-portal="partner-reset"] .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    body[data-portal="partner"] .mobile-menu-toggle,
    body[data-portal="partner-login"] .mobile-menu-toggle,
    body[data-portal="partner-register"] .mobile-menu-toggle,
    body[data-portal="partner-reset"] .mobile-menu-toggle {
        display: grid;
    }

    body[data-portal="partner"] .topbar > .nav,
    body[data-portal="partner-login"] .topbar > .nav,
    body[data-portal="partner-register"] .topbar > .nav,
    body[data-portal="partner-reset"] .topbar > .nav {
        grid-column: 1 / -1;
        display: none;
        width: 100%;
        margin: 0;
        padding: 8px;
        border: 1px solid rgba(221, 226, 232, .9);
        border-radius: 12px;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 14px 30px rgba(32, 34, 38, .08);
    }

    body[data-portal="partner"] .topbar.mobile-menu-open > .nav,
    body[data-portal="partner-login"] .topbar.mobile-menu-open > .nav,
    body[data-portal="partner-register"] .topbar.mobile-menu-open > .nav,
    body[data-portal="partner-reset"] .topbar.mobile-menu-open > .nav {
        display: none;
    }

    body[data-portal="partner"] .topbar > .nav .nav-link,
    body[data-portal="partner-login"] .topbar > .nav .nav-link,
    body[data-portal="partner-register"] .topbar > .nav .nav-link,
    body[data-portal="partner-reset"] .topbar > .nav .nav-link {
        width: 100%;
        min-height: 42px;
        justify-content: flex-start;
        padding: 9px 12px;
    }

    body[data-portal="partner"] .manager-link {
        display: none !important;
    }

    body[data-portal="partner"] .topbar > .session {
        grid-column: 1 / -1;
    }

    body[data-portal="partner"] .mobile-menu-toggle,
    body[data-portal="partner-login"] .mobile-menu-toggle,
    body[data-portal="partner-register"] .mobile-menu-toggle,
    body[data-portal="partner-reset"] .mobile-menu-toggle,
    body[data-portal="partner"] .topbar > .nav,
    body[data-portal="partner-login"] .topbar > .nav,
    body[data-portal="partner-register"] .topbar > .nav,
    body[data-portal="partner-reset"] .topbar > .nav {
        display: none !important;
    }

    body[data-portal="partner"]:not(.partner-logged-in) .topbar > .session {
        display: none;
    }

    body[data-portal="partner"].partner-logged-in .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body[data-portal="partner"].partner-logged-in .mobile-menu-toggle,
    body[data-portal="partner"].partner-logged-in .topbar > .nav {
        display: none !important;
    }

body[data-portal="partner"].partner-logged-in .topbar > .session {
    grid-column: auto;
    width: auto;
    min-width: min(260px, 48vw);
    justify-content: flex-end;
}

body[data-portal="partner"].partner-logged-in #welcomeText {
    display: inline-block !important;
    max-width: min(260px, 34vw);
    color: var(--brand-dark);
}

    body[data-portal="partner"] #partnerStatusBadge {
        display: none !important;
    }

    body[data-portal="partner"],
    body[data-portal="partner-login"],
    body[data-portal="partner-register"],
    body[data-portal="partner-reset"] {
        padding-bottom: 64px;
    }

    body[data-portal="partner"] .mobile-bottom-nav,
    body[data-portal="partner-login"] .mobile-bottom-nav,
    body[data-portal="partner-register"] .mobile-bottom-nav,
    body[data-portal="partner-reset"] .mobile-bottom-nav {
        position: fixed;
        left: var(--partner-mobile-gutter, 12px);
        right: var(--partner-mobile-gutter, 12px);
        bottom: 4px;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
        gap: 4px;
        padding: 6px;
        border: 1px solid rgba(169, 54, 49, .16);
        border-radius: 18px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 16px 38px rgba(32, 34, 38, .16);
        backdrop-filter: blur(18px);
    }

    body[data-portal="partner"] .bottom-nav-link,
    body[data-portal="partner-login"] .bottom-nav-link,
    body[data-portal="partner-register"] .bottom-nav-link,
    body[data-portal="partner-reset"] .bottom-nav-link {
        display: grid;
        place-items: center;
        min-width: 0;
        min-height: 48px;
        gap: 4px;
        padding: 5px 4px 4px;
        border-radius: 13px;
        font-size: 11px;
        font-weight: 850;
        line-height: 1.1;
        white-space: nowrap;
        transition: background .15s ease, color .15s ease, transform .15s ease;
    }

    body[data-portal="partner"] .bottom-nav-link i,
    body[data-portal="partner-login"] .bottom-nav-link i,
    body[data-portal="partner-register"] .bottom-nav-link i,
    body[data-portal="partner-reset"] .bottom-nav-link i {
        font-size: 18px;
        line-height: 1;
    }

    body[data-portal="partner"] .bottom-nav-link.active,
    body[data-portal="partner-login"] .bottom-nav-link.active,
    body[data-portal="partner-register"] .bottom-nav-link.active,
    body[data-portal="partner-reset"] .bottom-nav-link.active {
        background: #fff2eb;
        color: var(--brand-dark);
    }

    body[data-portal="partner"] .bottom-nav-link:active,
    body[data-portal="partner-login"] .bottom-nav-link:active,
    body[data-portal="partner-register"] .bottom-nav-link:active,
    body[data-portal="partner-reset"] .bottom-nav-link:active {
        transform: translateY(1px);
    }

    body[data-portal="partner"] .bottom-cart-count {
        position: absolute;
        top: 5px;
        right: 10px;
        display: inline-grid;
        place-items: center;
        min-width: 19px;
        height: 19px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--brand);
        color: #fff;
        font-size: 11px;
        font-weight: 950;
        line-height: 1;
        box-shadow: 0 4px 10px rgba(169, 54, 49, .24);
    }
}

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

    body[data-portal="partner"] {
        --partner-mobile-gutter: 12px;
        background: linear-gradient(180deg, #fff7ef 0, #f7f8f6 260px, #f3f5f4 100%);
    }

    .shell {
        width: min(100% - 20px, 1180px);
        margin-top: 12px;
    }

    body[data-portal="partner"] .shell {
        width: 100%;
        max-width: 100%;
        margin-top: 0;
        margin-bottom: 0;
        overflow-x: clip;
        padding: 10px var(--partner-mobile-gutter) 18px;
    }

    body[data-portal="partner"] .storefront-carousel {
        margin: 10px 0 16px;
        border-radius: 0;
    }

    body[data-portal="partner"] #cartView .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    body[data-portal="partner"] .cart-table {
        display: block;
        min-width: 0;
        table-layout: auto;
        border-collapse: separate;
    }

    body[data-portal="partner"] .cart-table colgroup,
    body[data-portal="partner"] .cart-table thead {
        display: none;
    }

    body[data-portal="partner"] .cart-table tbody,
    body[data-portal="partner"] .cart-table tfoot,
    body[data-portal="partner"] .cart-table tr,
    body[data-portal="partner"] .cart-table td,
    body[data-portal="partner"] .cart-table th {
        display: block;
        width: 100%;
    }

    body[data-portal="partner"] .cart-table tbody {
        display: grid;
        gap: 10px;
    }

    body[data-portal="partner"] .cart-table tbody tr {
        padding: 12px;
        border: 1px solid rgba(99, 79, 69, .12);
        border-radius: 14px;
        background: #fff;
        box-shadow: var(--shadow-soft);
    }

    body[data-portal="partner"] .cart-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(99, 79, 69, .1);
        text-align: right;
        white-space: normal;
    }

    body[data-portal="partner"] .cart-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    body[data-portal="partner"] .cart-table tbody td:nth-child(2) {
        align-items: flex-start;
        color: var(--ink);
        font-size: 15px;
        font-weight: 900;
        line-height: 1.25;
    }

    body[data-portal="partner"] .cart-table tbody td:last-child {
        border-bottom: 0;
    }

    body[data-portal="partner"] .cart-table [data-cart-qty] {
        width: 74px;
        min-height: 38px;
        text-align: center;
    }

    body[data-portal="partner"] .cart-table td:nth-child(7) .ghost {
        width: auto;
        min-width: 104px;
    }

    body[data-portal="partner"] .cart-table tfoot {
        display: grid;
        gap: 8px;
        margin-top: 12px;
        padding: 12px;
        border: 1px solid rgba(99, 79, 69, .12);
        border-radius: 14px;
        background: #fff7ec;
    }

    body[data-portal="partner"] .cart-table tfoot tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
        align-items: center;
    }

    body[data-portal="partner"] .cart-table tfoot th {
        padding: 0;
        border: 0;
        background: transparent;
        text-align: left;
    }

    body[data-portal="partner"] .cart-table tfoot th[colspan] {
        color: var(--muted);
    }

    body[data-portal="partner"] .cart-table tfoot th[id] {
        color: var(--brand);
        font-size: 17px;
        text-align: right;
    }

    body[data-portal="partner"] .cart-table tfoot th:last-child {
        display: none;
    }

    body[data-portal="partner"] #confirmOrderBtn {
        width: 100%;
        margin-top: 14px;
    }

    .auth-page {
        width: min(100% - 20px, 1080px);
        margin-top: 16px;
    }

    .topbar {
        padding: 12px;
        gap: 10px;
    }

    .brand {
        width: 100%;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
    }

    .nav {
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
        overflow-x: auto;
        padding: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-link {
        min-width: max-content;
        min-height: 38px;
        padding: 8px 11px;
    }

    .manager-link {
        margin-left: 0;
    }

    .session {
        width: 100%;
        justify-content: space-between;
    }

    .hero-band {
        padding: 22px;
        min-height: 0;
    }

    body[data-portal="partner"] .hero-band {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        margin: 10px 0 14px;
        padding: 0;
        width: 100%;
        max-width: 100%;
        border: 0;
        border-radius: 18px;
        background: #fff;
        overflow: hidden;
        box-shadow: 0 10px 22px rgba(45, 36, 29, .08);
    }

    body[data-portal="partner"] .hero-band > div:first-child {
        display: none;
    }

    body[data-portal="partner"] .hero-visual {
        min-height: 0;
    }

    body[data-portal="partner"] .brand-showcase {
        aspect-ratio: var(--hero-carousel-ratio, 16 / 9);
        min-height: 0;
        width: 100%;
        max-width: 100%;
        border: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
    }

    body[data-portal="partner"] .hero-carousel-slide {
        padding: 0;
        object-fit: cover;
        object-position: center center;
        background: #fff;
    }

    body[data-portal="partner"] .hero-logo {
        display: none;
    }

    body[data-portal="partner"] .hero-band .eyebrow {
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        margin-bottom: 7px;
        padding: 0 8px;
        border-radius: 999px;
        background: #fff2eb;
        color: var(--brand-dark);
        font-size: 9px;
        letter-spacing: .06em;
    }

    body[data-portal="partner"] .hero-band p {
        display: -webkit-box;
        margin: 7px 0 0;
        overflow: hidden;
        color: #626973;
        font-size: 12px;
        line-height: 1.35;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .hero-band h1,
    .login-copy h1 {
        font-size: 34px;
        line-height: 1.05;
    }

    body[data-portal="partner"] .hero-band h1 {
        max-width: 190px;
        font-size: 21px;
        line-height: 1.08;
    }

    body[data-portal="partner-login"] .nav-link {
        min-width: max-content;
        min-height: 38px;
        padding: 8px 11px;
        font-size: 14px;
    }

    body[data-portal="partner-login"] .login-copy {
        min-height: 320px;
        padding: 34px 24px;
    }

    body[data-portal="partner-login"] .login-copy h1 {
        max-width: 330px;
        font-size: 36px;
    }

    body[data-portal="partner-login"] .login-copy p {
        max-width: 310px;
        font-size: 15px;
    }

    body[data-portal="partner-login"] .login-copy::before {
        width: 300px;
        opacity: .42;
    }

    body[data-portal="partner-login"] .login-copy::after {
        right: -20px;
        bottom: 28px;
        width: 180px;
        height: 78px;
        opacity: .9;
    }

    body[data-portal="partner-login"] .login-card {
        padding: 30px 20px;
        border-radius: 18px;
    }

    .login-card-logo {
        width: 86px;
        height: 86px;
    }

    .login-card-head h2 {
        font-size: 28px;
    }

    .hero-actions,
    .form-actions,
    .auth-links,
    .mini-actions {
        align-items: stretch;
        flex-direction: column;
    }

    body[data-portal="partner"] .hero-actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 7px;
        margin-top: 10px;
        max-width: 100%;
        overflow: hidden;
    }

    body[data-portal="partner"] .hero-actions .primary,
    body[data-portal="partner"] .hero-actions .ghost {
        width: auto;
        min-height: 34px;
        padding: 8px 10px;
        border-radius: 11px;
        font-size: 11px;
        white-space: nowrap;
    }

    .hero-actions .primary,
    .hero-actions .ghost,
    .form-actions .primary,
    .mini-actions .primary,
    .mini-actions .ghost {
        width: 100%;
    }

    .form-grid,
    .stat-grid,
    .dashboard-charts,
    .graph-year-form,
    .graph-month-grid,
    .invoice-summary,
    .prep-grid {
        grid-template-columns: 1fr;
    }

    .section-title,
    .tools {
        align-items: stretch;
        flex-direction: column;
    }

    body[data-portal="partner"] #homeView .section-title {
        gap: 12px;
        margin: 0 0 12px;
        padding: 14px;
        width: 100%;
        max-width: 100%;
        border: 1px solid rgba(221, 226, 232, .78);
        border-radius: 20px;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 10px 24px rgba(32, 34, 38, .06);
    }

    body[data-portal="partner"] #homeView .section-title h2 {
        font-size: 22px;
        line-height: 1.1;
    }

    body[data-portal="partner"] #homeView .tools {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    body[data-portal="partner"] #homeView .search {
        min-height: 46px;
        border-radius: 14px;
        background: #f9faf9;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
    }

    .search {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body[data-portal="partner"] .product-grid {
        width: 100%;
        max-width: 100%;
        gap: 10px;
    }

    .product-card {
        grid-template-rows: 112px 1fr;
        min-height: 315px;
        border-radius: 10px;
    }

    body[data-portal="partner"] .product-card {
        min-width: 0;
        min-height: 272px;
        overflow: hidden;
        border: 0;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 10px 22px rgba(32, 34, 38, .07);
    }

    body[data-portal="partner"] .tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 10px 0;
        padding: 5px;
        border-radius: 16px;
    }

    body[data-portal="partner"] .tab {
        min-height: 40px;
        padding: 8px 7px;
        border-radius: 12px;
        font-size: 12px;
        line-height: 1.15;
    }

    body[data-portal="partner"] #profileContent.panel {
        padding: 12px;
        border-radius: 16px;
    }

    .profile-card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .profile-invoice-card,
    .profile-product-card,
    .profile-empty-card {
        padding: 12px;
        border-radius: 16px;
    }

    .profile-invoice-card {
        gap: 8px;
        padding: 10px;
    }

    .profile-card-meta,
    .product-price-meta {
        grid-template-columns: 1fr;
    }

    .profile-invoice-card .profile-card-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-card-actions .ghost,
    .profile-bulk-pay .primary {
        flex: 1 1 auto;
        min-width: min(130px, 100%);
    }

    .profile-invoice-card .profile-card-actions {
        grid-auto-columns: minmax(32px, 1fr);
        gap: 5px;
    }

    .profile-invoice-card .profile-card-actions .ghost.icon-only-btn {
        min-height: 30px;
        padding: 0;
    }

    .profile-pagination {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
        margin-bottom: 10px;
        padding: 8px;
    }

    .profile-pagination div {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
        width: 100%;
    }

    .profile-pagination .ghost {
        width: 100%;
        min-height: 30px;
    }

    .product-form-modal {
        width: min(100%, 94vw);
        max-height: 88vh;
        padding: 16px;
    }

    .product-modal-grid {
        grid-template-columns: 1fr;
    }

    .product-modal-actions {
        flex-direction: column-reverse;
    }

    .product-art {
        min-height: 112px;
    }

    body[data-portal="partner"] .product-art {
        min-height: 112px;
        border-radius: 0;
        background: linear-gradient(180deg, #fff8f2, #f7f9f8);
    }

    body[data-portal="partner"] .product-art-img {
        padding: 6px;
        object-fit: contain;
    }

    .product-body h3 {
        min-height: 38px;
        font-size: 13px;
        line-height: 1.28;
    }

    .product-body {
        gap: 8px;
        padding: 10px;
    }

    body[data-portal="partner"] .product-body {
        gap: 7px;
        padding: 10px;
    }

    body[data-portal="partner"] .product-body h3 {
        min-height: 34px;
        margin-bottom: 1px;
        color: #22252a;
        font-size: 12px;
        font-weight: 900;
        line-height: 1.25;
    }

    .price-row {
        align-items: flex-start;
        gap: 6px;
        font-size: 12px;
    }

    body[data-portal="partner"] .price-row {
        gap: 4px;
        font-size: 11px;
        line-height: 1.2;
    }

    body[data-portal="partner"] .price-row strong {
        color: var(--brand-dark);
        font-size: 12px;
    }

    .qty-row {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    body[data-portal="partner"] .qty-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        gap: 7px;
        margin-top: auto;
    }

    body[data-portal="partner"] .qty-row label {
        gap: 4px;
        font-size: 10px;
        font-weight: 850;
    }

    .qty-row input,
    .qty-row select,
    .price-input,
    .qty-input {
        width: 100%;
    }

    body[data-portal="partner"] .qty-row input,
    body[data-portal="partner"] .qty-row select {
        min-height: 38px;
        padding: 7px 6px;
        border-radius: 12px;
        text-align: center;
    }

    body[data-portal="partner"] .qty-row .primary {
        grid-column: 1 / -1;
        min-height: 38px;
        padding: 8px 9px;
        border-radius: 12px;
        font-size: 11px;
        white-space: nowrap;
    }

    body[data-portal="partner"] .hero-actions .primary,
    body[data-portal="partner"] .hero-actions .ghost {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }

    .invoice-total-panel {
        flex-direction: column;
    }

    .invoice-total-rows {
        margin-left: 0;
        width: 100%;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .partner-detail-card {
        grid-template-columns: 1fr;
    }

    .partner-status-cards {
        grid-template-columns: 1fr;
    }

    .invoice-detail-grid,
    .invoice-print-head {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .checkout-date-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .donut-wrap {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .checkout-date-panel .date-field,
    .date-field {
        min-width: 0;
        width: 100%;
    }

    .panel {
        padding: 14px;
    }

    .table-wrap {
        border-radius: 8px;
    }

    table {
        min-width: 680px;
    }

    th,
    td {
        padding: 10px 9px;
    }

    .stat strong {
        font-size: 28px;
    }

    .chart {
        height: 210px;
        overflow-x: auto;
    }

    .bar {
        min-width: 58px;
    }

    .product-admin-grid {
        gap: 12px;
    }

    .list-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .product-list-row {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .product-list-row .ghost {
        grid-column: 1 / -1;
    }

    .admin-sidebar {
        margin: 0 -2px;
    }

    .admin-sidebar-title {
        display: none;
    }

    .admin-content .section-title {
        margin-top: 16px;
    }
}

@media (max-width: 760px) {
    body[data-portal="partner"] .topbar > .nav,
    body[data-portal="partner-login"] .topbar > .nav,
    body[data-portal="partner-register"] .topbar > .nav,
    body[data-portal="partner-reset"] .topbar > .nav {
        display: none;
        overflow: visible;
    }

    body[data-portal="partner"] .topbar.mobile-menu-open > .nav,
    body[data-portal="partner-login"] .topbar.mobile-menu-open > .nav,
    body[data-portal="partner-register"] .topbar.mobile-menu-open > .nav,
    body[data-portal="partner-reset"] .topbar.mobile-menu-open > .nav {
        display: grid;
    }
}

@media (max-width: 420px) {
    .shell,
    .admin-shell,
    .auth-page,
    .wide-auth {
        width: min(100% - 14px, 1180px);
    }

    .topbar {
        padding: 10px;
    }

    .brand {
        gap: 8px;
    }

    .brand-logo,
    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand small {
        font-size: 10px;
    }

    .nav-link {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 13px;
    }

    .panel,
    .registration-card,
    .login-card {
        padding: 14px;
        border-radius: 10px;
    }

    .hero-band {
        padding: 18px;
        border-radius: 10px;
    }

    .hero-band h1,
    .section-title h1,
    body[data-portal="partner-login"] .login-copy h1 {
        font-size: 30px;
    }

    .login-card-logo {
        width: 76px;
        height: 76px;
    }

    .login-card-head h2 {
        font-size: 25px;
    }

    .secure-divider::before,
    .secure-divider::after {
        width: 34px;
    }

    body[data-portal="partner-login"] .login-copy {
        display: none !important;
    }

    body[data-portal="partner-login"] .login-copy::after {
        display: none;
    }

    body[data-portal="partner-login"] .login-layout {
        grid-template-columns: 1fr;
    }

    body[data-portal="partner-login"] .auth-page {
        padding-bottom: 72px;
    }

    table {
        min-width: 600px;
    }

    body[data-portal="partner"],
    body[data-portal="partner-login"],
    body[data-portal="partner-register"],
    body[data-portal="partner-reset"] {
        --partner-topbar-offset: 76px;
    }
}

@media (max-width: 820px) {
    body[data-portal="partner"] #cartView .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    body[data-portal="partner"] .cart-table {
        display: block;
        min-width: 0;
        table-layout: auto;
        border-collapse: separate;
    }

    body[data-portal="partner"] .cart-table colgroup,
    body[data-portal="partner"] .cart-table thead {
        display: none;
    }

    body[data-portal="partner"] .cart-table tbody,
    body[data-portal="partner"] .cart-table tfoot,
    body[data-portal="partner"] .cart-table tr,
    body[data-portal="partner"] .cart-table td,
    body[data-portal="partner"] .cart-table th {
        display: block;
        width: 100%;
        min-width: 0;
    }

    body[data-portal="partner"] .cart-table tbody {
        display: grid;
        gap: 10px;
    }

    body[data-portal="partner"] .cart-table tbody tr {
        padding: 12px;
        border: 1px solid rgba(99, 79, 69, .12);
        border-radius: 14px;
        background: #fff;
        box-shadow: var(--shadow-soft);
    }

    body[data-portal="partner"] .cart-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(99, 79, 69, .1);
        text-align: right;
        white-space: normal;
    }

    body[data-portal="partner"] .cart-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    body[data-portal="partner"] .cart-table tbody td:nth-child(2) {
        align-items: flex-start;
        color: var(--ink);
        font-size: 15px;
        font-weight: 900;
        line-height: 1.25;
    }

    body[data-portal="partner"] .cart-table tbody td:last-child {
        border-bottom: 0;
    }

    body[data-portal="partner"] .cart-table [data-cart-qty] {
        width: 74px;
        min-height: 38px;
        text-align: center;
    }

    body[data-portal="partner"] .cart-table td:nth-child(7) .ghost {
        width: auto;
        min-width: 104px;
    }

    body[data-portal="partner"] .cart-table tfoot {
        display: grid;
        gap: 8px;
        margin-top: 12px;
        padding: 12px;
        border: 1px solid rgba(99, 79, 69, .12);
        border-radius: 14px;
        background: #fff7ec;
    }

    body[data-portal="partner"] .cart-table tfoot tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
        align-items: center;
    }

    body[data-portal="partner"] .cart-table tfoot th {
        padding: 0;
        border: 0;
        background: transparent;
        text-align: left;
    }

    body[data-portal="partner"] .cart-table tfoot th[colspan] {
        color: var(--muted);
    }

    body[data-portal="partner"] .cart-table tfoot th[id] {
        color: var(--brand);
        font-size: 17px;
        text-align: right;
    }

    body[data-portal="partner"] .cart-table tfoot th:last-child {
        display: none;
    }

    body[data-portal="partner"] #confirmOrderBtn {
        width: 100%;
        margin-top: 14px;
    }
}

@media (max-width: 640px) {
    .kitchen-days {
        gap: 14px;
    }

    .kitchen-range-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 10px;
    }

    .kitchen-range-summary span {
        min-height: 58px;
        padding: 9px;
        font-size: 18px;
        text-align: center;
    }

    .kitchen-range-summary b {
        font-size: 10px;
    }

    .kitchen-pagination {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        padding: 8px;
    }

    .kitchen-pagination div {
        grid-column: 1 / -1;
        grid-row: 1;
        padding: 4px 0 8px;
    }

    .kitchen-pagination button {
        min-height: 38px;
        padding: 0 8px;
        font-size: 12px;
    }

    .kitchen-pagination button span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kitchen-day-card {
        gap: 10px;
        padding: 10px;
        box-shadow: 0 10px 22px rgba(61, 43, 31, .06);
    }

    .kitchen-day-title {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 8px 9px;
    }

    .kitchen-day-main {
        display: grid;
        grid-template-columns: minmax(78px, auto) repeat(3, minmax(0, auto));
        gap: 5px;
        align-items: center;
    }

    .kitchen-day-title strong {
        font-size: 16px;
    }

    .kitchen-day-title span {
        min-height: 24px;
        padding: 0 6px;
        font-size: 10px;
        white-space: nowrap;
    }

    .kitchen-day-actions {
        display: grid;
        grid-template-columns: auto auto 36px 14px;
        align-items: center;
        align-content: center;
        gap: 6px;
    }

    .kitchen-save-btn,
    .kitchen-edit-btn {
        height: 36px;
        min-height: 36px;
        padding: 0 9px;
        font-size: 12px;
    }

    .kitchen-day-actions .icon-only-btn {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .kitchen-day-chevron {
        font-size: 12px;
    }

    .kitchen-day-note-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .kitchen-day-note-actions .primary,
    .kitchen-day-note-actions .ghost {
        width: 100%;
    }

    .kitchen-day-note {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .dispatch-products-collapse > summary,
    .dispatch-date-group > summary {
        align-items: center;
        padding: 12px;
    }

    .dispatch-products-collapse > summary {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .dispatch-products-collapse > summary h2 {
        max-width: 100%;
        font-size: 20px;
        line-height: 1.12;
    }

    .dispatch-ready-heading {
        display: grid;
        gap: 8px;
    }

    .dispatch-ready-metrics {
        gap: 6px;
    }

    .dispatch-ready-metrics span {
        min-height: 26px;
        padding: 0 9px;
        font-size: 11px;
    }

    .dispatch-ready-metrics strong {
        font-size: 13px;
    }

    .dispatch-products-collapse > summary .eyebrow {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .dispatch-date-group > summary {
        grid-template-columns: minmax(0, 1fr) auto 18px;
    }

    .dispatch-summary-actions {
        grid-template-columns: auto 40px 18px;
        justify-content: end;
        gap: 7px;
    }

    .dispatch-summary-actions .pill {
        min-height: 30px;
        padding: 0 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .dispatch-summary-actions .icon-only-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .dispatch-products-collapse .dispatch-ready-grid {
        padding: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .dispatch-product-card {
        grid-template-columns: minmax(0, 1fr) 68px;
        grid-template-rows: auto;
        align-items: stretch;
        gap: 8px;
        min-height: 0;
        padding: 8px;
    }

    .dispatch-product-card .prep-item-head {
        min-width: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .dispatch-product-card .prep-item-head strong {
        font-size: 12px;
    }

    .dispatch-product-card .prep-item-head span {
        font-size: 9px;
    }

    .dispatch-product-card .prep-item-head em {
        display: none;
    }

    .dispatch-ready-qty {
        min-height: 62px;
        padding: 6px;
    }

    .dispatch-ready-qty b {
        font-size: 22px;
    }

    .dispatch-ready-qty small {
        font-size: 9px;
    }

    .dispatch-date-group > summary {
        position: static;
        padding-right: 12px;
    }

    .dispatch-date-group > summary::after {
        position: static;
        transform: none;
        align-self: center;
    }

    .dispatch-date-group[open] > summary::after {
        transform: rotate(180deg);
    }

    .dispatch-card-table {
        border-top: 0;
        background: transparent;
        overflow-x: visible;
    }

    .dispatch-card-head {
        display: none;
    }

    .dispatch-card-body {
        gap: 10px;
        padding: 10px;
        min-width: 0;
    }

    .dispatch-invoice-row {
        grid-template-columns: 1fr;
        min-width: 0;
        gap: 0;
        padding: 12px 14px;
        border-color: rgba(47, 102, 88, .16);
        box-shadow: 0 10px 20px rgba(47, 102, 88, .08);
    }

    .dispatch-invoice-row > span {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: 9px 0;
        border-bottom: 1px solid rgba(99, 79, 69, .1);
        overflow: visible;
        font-size: 14px;
        text-overflow: clip;
        white-space: normal;
    }

    .dispatch-invoice-row > span {
        overflow-wrap: anywhere;
    }

    .dispatch-invoice-row > span::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .dispatch-invoice-row > span:nth-child(4) {
        font-size: 13px;
    }

    .dispatch-invoice-row > span:nth-child(5),
    .dispatch-invoice-row > span:nth-child(6) {
        color: var(--brand-dark);
        font-weight: 900;
    }

    .dispatch-invoice-row > span:last-child {
        border-bottom: 0;
    }

    .dispatch-invoice-row .dispatch-card-actions {
        display: grid;
        grid-template-columns: 108px 36px 36px;
        justify-content: start;
    }

    .prep-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .prep-item {
        padding: 12px;
    }

    .prep-item-head {
        gap: 8px;
    }

    .prep-qty-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .prep-qty-tile {
        padding: 9px 8px;
    }

    .prep-qty-tile span {
        font-size: 10px;
    }

    .ready-qty-card-input {
        min-height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 420px) {
    .kitchen-day-title {
        grid-template-columns: 1fr;
    }

    .kitchen-day-main {
        grid-template-columns: minmax(74px, auto) repeat(3, minmax(0, auto));
        width: 100%;
    }

    .kitchen-day-actions {
        grid-template-columns: auto auto 36px 14px;
        justify-content: end;
    }

    .dispatch-products-collapse .dispatch-ready-grid {
        grid-template-columns: 1fr;
    }

    .dispatch-product-card {
        grid-template-columns: minmax(0, 1fr) 74px;
    }

    .dispatch-invoice-row > span {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 8px;
        font-size: 13px;
    }

    .dispatch-invoice-row .dispatch-card-actions {
        grid-template-columns: 92px 34px 34px;
    }

    .dispatch-invoice-row .dispatch-card-actions .ghost {
        width: 34px;
        min-width: 34px;
    }

    .prep-qty-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .prep-qty-tile {
        min-width: 0;
        padding: 8px 6px;
    }

    .prep-qty-tile span {
        font-size: 9px;
        line-height: 1.15;
    }

    .prep-qty-tile b {
        font-size: 24px;
    }

    .ready-qty-card-input {
        min-height: 34px;
        padding: 6px 4px;
        font-size: 17px;
    }

    .prep-actions {
        justify-content: stretch;
    }

    .prep-actions .icon-only-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .dispatch-detail-doc {
        padding: 12px;
        border-radius: 10px;
        overflow: hidden;
    }

    .dispatch-detail-doc .section-title {
        gap: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(99, 79, 69, .12);
    }

    .dispatch-detail-doc .section-title h2 {
        max-width: 100%;
        overflow-wrap: anywhere;
        font-size: 20px;
        line-height: 1.2;
    }

    .dispatch-detail-doc .detail-subtitle {
        margin-top: 6px;
        color: var(--muted);
        font-size: 13px;
        line-height: 1.45;
    }

    .dispatch-detail-doc .mini-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .dispatch-detail-doc .mini-actions button {
        width: 100%;
        justify-content: center;
    }

    .dispatch-detail-doc .invoice-print-head {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .dispatch-detail-doc .invoice-company {
        align-items: center;
        min-width: 0;
    }

    .dispatch-detail-doc .invoice-company h1 {
        font-size: 18px;
        line-height: 1.2;
    }

    .dispatch-detail-doc .invoice-company p,
    .dispatch-detail-doc .invoice-title-block span {
        overflow-wrap: anywhere;
        font-size: 12px;
        line-height: 1.35;
    }

    .dispatch-detail-doc .invoice-title-block {
        justify-items: start;
        text-align: left;
    }

    .dispatch-detail-doc .invoice-title-block strong {
        font-size: 20px;
    }

    .dispatch-detail-doc .invoice-detail-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dispatch-detail-doc .invoice-detail-grid section {
        padding: 12px;
    }

    .dispatch-detail-doc .invoice-detail-grid p {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 8px;
        margin: 8px 0;
    }

    .dispatch-detail-doc .invoice-detail-grid strong {
        overflow-wrap: anywhere;
    }

    .dispatch-detail-doc table.invoice-item-table {
        display: block;
        min-width: 0;
        border: 0;
        background: transparent;
    }

    .dispatch-detail-doc .invoice-item-table thead {
        display: none;
    }

    .dispatch-detail-doc .invoice-item-table tbody {
        display: grid;
        gap: 10px;
    }

    .dispatch-detail-doc .invoice-item-table tr {
        display: grid;
        gap: 0;
        padding: 12px;
        border: 1px solid rgba(99, 79, 69, .14);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 10px 20px rgba(61, 43, 31, .06);
    }

    .dispatch-detail-doc .invoice-item-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 38px;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid rgba(99, 79, 69, .09);
        text-align: left;
        white-space: normal;
    }

    .dispatch-detail-doc .invoice-item-table td:last-child {
        border-bottom: 0;
    }

    .dispatch-detail-doc .invoice-item-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .dispatch-detail-doc .invoice-item-table .money-cell {
        text-align: left;
    }

    .dispatch-detail-doc .invoice-item-table [data-label="Product Name"] {
        align-items: start;
        color: var(--ink);
        font-weight: 900;
        line-height: 1.3;
    }

    .dispatch-detail-doc .invoice-item-table [data-label="GST"] {
        align-items: start;
    }

    .dispatch-detail-doc .invoice-item-table [data-label="GST"] strong {
        display: block;
        margin-top: 2px;
    }

    .dispatch-detail-doc .qty-input {
        width: 76px;
        min-height: 36px;
    }

    .dispatch-detail-doc .invoice-remarks-panel {
        margin-top: 12px;
    }

    .dispatch-detail-doc .invoice-remarks-panel textarea {
        min-height: 82px;
    }

    .dispatch-detail-doc .invoice-total-panel {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding-top: 12px;
    }

    .dispatch-detail-doc .invoice-qty-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .dispatch-detail-doc .invoice-qty-summary span {
        padding: 10px;
    }

    .dispatch-detail-doc .invoice-total-rows {
        width: 100%;
        margin-left: 0;
    }

    .dispatch-detail-doc .invoice-print-footer {
        display: grid;
        gap: 8px;
        font-size: 12px;
    }

    .dispatch-detail-doc .invoice-footer-contact {
        text-align: left;
    }

    .dispatch-detail-doc + .finalise-invoice-bar.split-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .dispatch-detail-doc + .finalise-invoice-bar .left-actions,
    .dispatch-detail-doc + .finalise-invoice-bar .right-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .dispatch-detail-doc + .finalise-invoice-bar button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .dispatch-detail-doc {
        padding: 10px;
    }

    .dispatch-detail-doc .invoice-item-table td,
    .dispatch-detail-doc .invoice-detail-grid p {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .dispatch-detail-doc .invoice-qty-summary {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body.printing-payslip,
    body.printing-payslip html {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        background: #fff !important;
    }

    body.printing-payslip * {
        visibility: hidden !important;
    }

    body.printing-payslip > *:not(#payslipPreviewModal) {
        display: none !important;
    }

    body.printing-payslip #payslipPreviewModal {
        position: static !important;
        display: block !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
        visibility: visible !important;
    }

    body.printing-payslip #payslipPreviewModal *,
    body.printing-payslip #payslipPreviewContent,
    body.printing-payslip #payslipPreviewContent * {
        visibility: visible !important;
    }

    body.printing-payslip .payslip-preview-modal {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    body.printing-payslip .payslip-preview-modal > .section-title,
    body.printing-payslip .payslip-preview-actions {
        display: none !important;
        visibility: hidden !important;
    }

    body.printing-payslip .payslip-preview-content {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    body.printing-payslip .payslip-doc {
        width: 100% !important;
        min-height: auto !important;
        padding: 12mm !important;
        border: 0 !important;
        box-shadow: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    * {
        box-shadow: none !important;
    }

    body {
        background: #fff;
        color: #111;
        font-size: 11px;
    }

    body > .topbar,
    .admin-sidebar,
    #managerLoginPanel,
    #toast,
    #adminDashboard,
    #productEditorView,
    #adminTableView > .section-title,
    #adminSummary,
    .screen-only,
    .finalise-invoice-bar,
    .mini-actions,
    .tools {
        display: none !important;
    }

    .shell,
    .admin-shell,
    .admin-layout,
    .admin-content,
    #adminApp,
    #adminTableView,
    #adminTable,
    .table-wrap {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        background: #fff !important;
    }

    .invoice-print-doc {
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        color: #111;
        font-family: Arial, sans-serif;
    }

    .invoice-print-head {
        margin: 0 0 14px;
        padding: 0 0 12px;
        border: 0;
        border-bottom: 2px solid #111;
        border-radius: 0;
    }

    .brand-mark {
        background: #111 !important;
        color: #fff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .invoice-logo {
        width: 86px;
        height: 58px;
    }

    .invoice-company h1 {
        font-size: 22px;
    }

    .invoice-title-block strong {
        color: #111;
        font-size: 28px;
    }

    .invoice-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .invoice-detail-grid section {
        padding: 10px;
        border: 1px solid #333;
        border-radius: 0;
    }

    .invoice-detail-grid h3 {
        color: #111;
        font-size: 12px;
    }

    .invoice-detail-grid p {
        grid-template-columns: 94px 1fr;
        gap: 8px;
        margin: 4px 0;
    }

    table.invoice-item-table {
        width: 100%;
        min-width: 0;
        border: 1px solid #333;
        font-size: 10.5px;
        page-break-inside: auto;
    }

    .invoice-item-table th,
    .invoice-item-table td {
        padding: 7px 6px;
        border: 1px solid #333;
        background: #fff !important;
        color: #111 !important;
    }

    .invoice-item-table th {
        font-weight: 900;
        text-transform: uppercase;
    }

    .invoice-item-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .qty-input {
        display: none !important;
    }

    .print-only {
        display: inline !important;
    }

    .invoice-remarks-panel {
        margin-top: 12px;
    }

    .invoice-remarks-print {
        display: block !important;
        padding: 8px 10px;
        border: 1px solid #333;
        border-radius: 0;
        background: #fff;
    }

    .invoice-remarks-print span,
    .invoice-remarks-print strong {
        color: #111;
    }

    .invoice-total-panel {
        align-items: flex-start;
        margin-top: 12px;
        padding: 0;
        page-break-inside: avoid;
    }

    .invoice-qty-summary span {
        padding: 8px 10px;
        border: 1px solid #333;
        border-radius: 0;
    }

    .invoice-total-rows {
        width: 260px;
        padding: 0;
        border: 1px solid #333;
        border-radius: 0;
    }

    .invoice-total-rows div {
        padding: 8px 10px;
        border-bottom: 1px solid #333;
    }

    .invoice-total-rows .grand-total {
        border-bottom: 0;
        font-size: 13px;
    }

    .invoice-total-rows .grand-total span,
    .invoice-total-rows .grand-total strong,
    .invoice-total-rows [data-gst-total] {
        color: #111;
    }

    .invoice-print-footer {
        margin-top: 18px;
        color: #111;
        page-break-inside: avoid;
    }

    .invoice-footer-contact {
        color: #111;
    }

    body[data-portal="partner"] * {
        visibility: hidden !important;
    }

    body[data-portal="partner"] .invoice-print-doc,
    body[data-portal="partner"] .invoice-print-doc * {
        visibility: visible !important;
    }

body[data-portal="partner"] .invoice-print-doc {
        position: absolute;
        inset: 0 auto auto 0;
        width: 100% !important;
        margin: 0 !important;
    }
}

body[data-portal="management"] .staff-form-actions,
body[data-portal="management"] .salary-form-actions,
body[data-portal="management"] .salary-month-actions {
    align-items: center;
    gap: 8px;
}

body[data-portal="management"] .staff-form-actions {
    display: flex;
    align-items: center;
}

body[data-portal="management"] .salary-form-actions {
    display: flex;
    align-items: center;
}

body[data-portal="management"] .staff-form-actions .primary,
body[data-portal="management"] .staff-form-actions .ghost,
body[data-portal="management"] .salary-form-actions .primary,
body[data-portal="management"] .salary-form-actions .ghost {
    align-self: center;
    height: 38px;
    margin-top: 0;
    vertical-align: middle;
}

body[data-portal="management"] .staff-form-actions .compact-action,
body[data-portal="management"] .salary-form-actions .compact-action,
body[data-portal="management"] .salary-month-actions .compact-action,
body[data-portal="management"] .salary-item-head .compact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 92px;
    min-height: 38px;
    height: 38px;
    padding: 0 12px;
    line-height: 1;
    white-space: nowrap;
}

body[data-portal="management"] .salary-item-head .compact-action {
    min-width: 74px;
}

body[data-portal="management"] .salary-item-row .icon-only-btn {
    width: 42px;
    min-width: 42px;
    height: 40px;
    min-height: 40px;
    padding: 0;
}

body[data-portal="management"] .staff-record-card summary .staff-missing-badge b {
    color: #ffffff;
}

body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month] {
    border-color: #7b2523;
    background: #a93631;
    color: #fff;
}

body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month]:disabled {
    border-color: rgba(47, 102, 88, .42);
    background: #2f6658;
    color: #fff;
    opacity: 1;
    filter: none;
}

body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month],
body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month] i,
body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month] span,
body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month]:disabled,
body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month]:disabled i,
body[data-portal="management"] .salary-month-actions [data-finalise-payroll-month]:disabled span {
    color: #ffffff !important;
}

@media (max-width: 760px) {
    body[data-portal="management"] .staff-form-actions,
    body[data-portal="management"] .salary-form-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }

    body[data-portal="management"] .staff-form-actions .compact-action,
    body[data-portal="management"] .salary-form-actions .compact-action,
    body[data-portal="management"] .salary-month-actions .compact-action,
    body[data-portal="management"] .salary-item-head .compact-action {
        width: auto;
        flex: 0 1 auto;
    }

    body[data-portal="management"] .salary-month-actions {
        align-items: center;
        justify-content: flex-start;
    }
}
