: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);
    }
}

.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"] #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-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-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 {
    margin: 0 0 14px;
    font-size: 18px;
}

.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);
}

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

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

.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);
}

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;
}

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

.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 {
    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-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-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-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;
}

.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-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;
}

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

.editable-detail-card input:disabled,
.editable-detail-card select:disabled {
    border-color: transparent;
    background: transparent;
    color: var(--ink);
    opacity: 1;
    padding-left: 0;
}

.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;
}

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;
}

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-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 .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);
}

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

.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);
}

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

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

.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;
    grid-template-columns: repeat(3, minmax(120px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin: -4px 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
}

.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 legend {
    padding: 0 6px;
    color: var(--brand-dark);
    font-weight: 900;
}

.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;
}

.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 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;
}

.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;
}

.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;
}

.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);
}

.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: 14px;
}

.kitchen-days {
    display: grid;
    gap: 18px;
}

.kitchen-day-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(99, 79, 69, .34);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(61, 43, 31, .06);
}

.kitchen-day-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff7ec;
    border: 1px solid rgba(169, 54, 49, .14);
}

.kitchen-day-title strong {
    display: block;
    color: var(--brand-dark);
}

.kitchen-day-title small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 800;
}

.kitchen-day-title span {
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}

.kitchen-day-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.prep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.prep-item {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(99, 79, 69, .18);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #f9fbfa 100%);
    box-shadow: 0 10px 22px rgba(61, 43, 31, .05);
}

.prep-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 79, 69, .12);
}

.prep-item-head strong {
    display: block;
    color: var(--ink);
    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 {
    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(2, minmax(0, 1fr));
    gap: 10px;
}

.prep-qty-tile {
    display: grid;
    gap: 4px;
    padding: 11px;
    border-radius: 8px;
    background: #fff7ec;
    border: 1px solid rgba(169, 54, 49, .14);
}

.prep-qty-tile span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.prep-qty-tile b {
    color: #dc2626;
    font-size: 28px;
    line-height: 1;
}

.muted-tile {
    background: #eef4f1;
    border-color: rgba(47, 102, 88, .16);
}

.muted-tile b {
    color: var(--mint);
}

.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: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 8px;
}

.dispatch-ready-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.dispatch-product-card {
    gap: 7px;
    padding: 9px;
    border-color: rgba(47, 102, 88, .22);
    background: linear-gradient(180deg, #fff 0%, #f5faf8 100%);
}

.dispatch-product-card .prep-item-head strong {
    font-size: 13px;
}

.dispatch-product-card .prep-item-head span {
    font-size: 11px;
}

.dispatch-product-card .prep-item-head em {
    background: #eef4f1;
    color: var(--mint);
    font-size: 10px;
}

.dispatch-ready-qty {
    display: grid;
    place-items: center;
    min-height: 68px;
    padding: 9px;
    border: 1px solid rgba(220, 38, 38, .14);
    border-radius: 8px;
    background: #fff7f7;
}

.dispatch-ready-qty span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.dispatch-ready-qty b {
    color: #dc2626;
    font-size: 28px;
    line-height: 1;
}

@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;
    }

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

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

    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,
    .donut-wrap {
        grid-template-columns: 1fr;
    }

    .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: space-between;
        width: 100%;
    }

    .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-product-price-summary,
    .partner-status-cards,
    .prep-grid,
    .prep-actions,
    .prep-qty-row {
        grid-template-columns: 1fr;
    }

    .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: 0;
        justify-content: flex-end;
    }

    body[data-portal="partner"] #welcomeText,
    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;
    }

    .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: 54px 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,
    .price-input,
    .qty-input {
        width: 100%;
    }

    body[data-portal="partner"] .qty-row input {
        min-height: 38px;
        padding: 7px 6px;
        border-radius: 12px;
        text-align: center;
    }

    body[data-portal="partner"] .qty-row .primary {
        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 print {
    @page {
        size: A4;
        margin: 12mm;
    }

    * {
        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-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;
    }

    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;
    }
}
