/* Filled warning surfaces: Radzen humanistic-dark uses --rz-on-warning: #fff on #fac152.
   Dark navy on yellow meets WCAG-ish contrast. Outlined/text warning variants still use
   --rz-warning (yellow-on-dark) and are left alone. Success/danger tokens are untouched. */
:root {
    --mmz-on-warning: #1a2332;
    --rz-on-warning: var(--mmz-on-warning);
    --rz-on-warning-light: var(--mmz-on-warning);
    --rz-on-warning-dark: var(--mmz-on-warning);
    --rz-on-warning-darker: var(--mmz-on-warning);
}

.rz-badge-warning,
.rz-badge.rz-warning,
.rz-button.rz-warning:not(.rz-variant-outlined):not(.rz-variant-text),
.rz-chip-warning:not(.rz-variant-outlined):not(.rz-variant-text) {
    color: var(--mmz-on-warning);
}

.rz-button.rz-warning:not(.rz-variant-outlined):not(.rz-variant-text) .rzi,
.rz-button.rz-warning:not(.rz-variant-outlined):not(.rz-variant-text) .rz-button-icon-left,
.rz-button.rz-warning:not(.rz-variant-outlined):not(.rz-variant-text) .rz-button-icon-right,
.rz-button.rz-warning:not(.rz-variant-outlined):not(.rz-variant-text) .material-icons,
.rz-button.rz-warning:not(.rz-variant-outlined):not(.rz-variant-text) .material-symbols-outlined {
    color: var(--mmz-on-warning);
}

/* Override browser autofill yellow background for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active,
.rz-inputtext:-webkit-autofill,
.rz-textbox:-webkit-autofill,
.rz-password:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #1e293b inset !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    caret-color: #e2e8f0 !important;
    transition: background-color 5000s ease-in-out 0s;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

/* Blazor SSR wrapper elements must not break flex height chain */
blazor-ssr {
    display: contents;
}

/* Radzen layout fills full viewport */
.rz-layout {
    min-height: 100vh !important;
    height: 100vh !important;
}

/* Sidebar always visible at full height */
.rz-sidebar {
    height: 100% !important;
    min-height: 100vh !important;
}

/* Hide sidebar scrollbar; keep touch/wheel scrolling */
.admin-sidebar,
.admin-sidebar .rz-sidebar-content,
.admin-layout .rz-sidebar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* legacy Edge */
}

.admin-sidebar::-webkit-scrollbar,
.admin-sidebar .rz-sidebar-content::-webkit-scrollbar,
.admin-layout .rz-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none; /* Chrome, Safari, mobile WebKit */
}

/* ==================== ADMIN LAYOUT — MOBILE RESPONSIVE ==================== */

.admin-layout {
    position: relative;
    max-width: 100vw;
    overflow-x: hidden;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.admin-header-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 0.25rem;
    min-height: 44px;
    height: auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.admin-sidebar-toggle {
    appearance: none;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: var(--rz-border-radius, 4px);
    background: transparent;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1;
    overflow: visible;
    position: relative;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}

.admin-sidebar-toggle .material-icons {
    font-size: 24px;
}

.admin-sidebar-toggle:hover,
.admin-sidebar-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.admin-sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: var(--rz-border-radius, 4px);
    background: transparent;
    color: var(--rz-text-color, inherit);
    cursor: pointer;
}

.admin-sidebar-close-btn .material-icons {
    font-size: 22px;
}

.admin-header-title {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0.25rem;
}

.admin-nav-search {
    padding: 0 0.75rem 0.75rem;
}

.admin-nav-search .rz-textbox,
.admin-nav-search input {
    width: 100%;
    min-height: 40px;
}

.admin-nav-empty {
    margin: 0;
    padding: 0.5rem 1rem 1rem;
    font-size: 0.8125rem;
    color: var(--rz-text-disabled-color, #94a3b8);
}

.admin-nav-menu {
    padding-bottom: 0.75rem;
}

.admin-nav-menu .rz-navigation-item-wrapper-active > .rz-navigation-item-link,
.admin-nav-menu .rz-navigation-item-link:hover {
    border-radius: 0.4rem;
}

.admin-header-actions {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-logout-form {
    display: inline-flex;
    margin: 0;
}

.admin-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.35rem 0.65rem;
    border: none;
    border-radius: var(--rz-border-radius, 4px);
    background: transparent;
    color: var(--rz-text-color, inherit);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: background-color 0.15s ease;
    text-decoration: none;
}

.admin-logout-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.admin-logout-btn .material-icons {
    font-size: 22px;
}

.admin-logout-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.admin-body {
    overflow-x: hidden;
    min-width: 0;
}

.admin-content {
    padding: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
}

.admin-sidebar-close {
    display: none;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 2.75rem;
    z-index: 1001;
    cursor: pointer;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.55);
}

body.admin-sidebar-open .admin-sidebar-overlay {
    display: block;
    pointer-events: auto;
}

body.admin-sidebar-open {
    overflow: hidden;
}

/* Horizontal scroll wrapper for data tables */
.mmz-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mmz-hide-desktop {
    display: none !important;
}

.mmz-page-actions > .mmz-hide-phone {
    display: contents;
}

.mmz-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mmz-order-list-empty {
    margin: 0;
    padding: 1rem 0.25rem;
    color: var(--rz-base-400);
}

.mmz-order-card,
.mmz-entity-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--rz-base-700);
    border-radius: 10px;
    background: var(--rz-base-800);
    color: inherit;
    cursor: pointer;
    min-height: 44px;
}

.mmz-order-card:hover,
.mmz-order-card:focus-visible,
.mmz-entity-card:hover,
.mmz-entity-card:focus-visible {
    border-color: var(--rz-primary);
    outline: none;
}

.mmz-order-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mmz-order-card-id {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 0;
    word-break: break-all;
}

.mmz-order-card-who {
    font-size: 0.9rem;
    color: var(--rz-base-100);
}

.mmz-order-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--rz-base-400);
}

.mmz-entity-card-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.mmz-entity-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--rz-base-700);
}

.mmz-image-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.mmz-image-toolbar-urls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.mmz-image-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.mmz-image-upload {
    cursor: pointer;
    display: inline-flex;
    margin: 0;
    line-height: 0;
}

.mmz-image-upload .rz-button {
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.mmz-line-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
    background: var(--rz-base-900);
    border: 1px solid var(--rz-base-700);
    border-radius: 8px;
}

.mmz-line-item-copy {
    min-width: 0;
}

.mmz-line-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--rz-base-0);
}

.mmz-line-item-variant,
.mmz-line-item-qty {
    font-size: 0.78rem;
    color: var(--rz-base-400);
    margin-top: 0.1rem;
}

.mmz-line-item-total {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--rz-base-0);
}

.mmz-contact-link {
    color: var(--rz-primary-lighter, #93c5fd);
    text-decoration: none;
    word-break: break-word;
}

.mmz-contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.7rem;
}

.mmz-wa-btn {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #128c7e;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.order-row-number {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.order-row-obs-flag {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}

.order-row-obs-flag .material-icons {
    font-size: 1.05rem;
    color: var(--rz-danger);
}

.order-row-obs-flag--error .material-icons,
.order-row-obs-flag--warning .material-icons {
    color: var(--rz-danger);
}

@media (max-width: 767px) {
    .admin-sidebar-toggle {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .admin-content {
        padding: 0.75rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
    }

    .admin-content > .rz-stack.rz-orientation-horizontal,
    .admin-content > .rz-stack > .rz-stack:first-child,
    .admin-content > div > .rz-stack.rz-orientation-horizontal:first-child {
        flex-wrap: wrap !important;
        row-gap: 0.75rem;
    }

    .mmz-card-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .mmz-card-toolbar > .rz-stack.rz-orientation-horizontal {
        flex-wrap: wrap !important;
        width: 100%;
    }

    /* Mobile off-canvas sidebar (JS: body.admin-sidebar-open) */
    .admin-sidebar-close {
        display: flex;
    }

    .admin-sidebar-overlay {
        top: calc(2.75rem + env(safe-area-inset-top, 0));
    }

    .admin-sidebar {
        position: fixed !important;
        left: 0 !important;
        top: calc(2.75rem + env(safe-area-inset-top, 0)) !important;
        height: calc(100dvh - 2.75rem - env(safe-area-inset-top, 0)) !important;
        width: min(280px, 88vw) !important;
        max-width: 88vw !important;
        transform: translateX(-105%) !important;
        transition: transform 0.2s ease !important;
        z-index: 1002 !important;
        opacity: 1 !important;
        box-shadow: none;
    }

    body.admin-sidebar-open .admin-sidebar {
        transform: translateX(0) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    }

    /* Touch-friendly tap targets (exclude header toggle — sized above) */
    .admin-layout .rz-button,
    .admin-layout .rz-panel-menu-item,
    .admin-layout .rz-panel-menu-item-content {
        min-height: 44px;
    }

    .admin-layout .admin-notif-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .admin-logout-label {
        display: none;
    }

    .mmz-table-scroll .rz-data-grid,
    .mmz-table-scroll .rz-datatable {
        min-width: 640px;
    }

    /* Data grids: keep table layout, scroll sideways instead of stretching */
    .admin-content .rz-data-grid,
    .admin-content .rz-datatable {
        max-width: 100%;
    }

    .admin-content .rz-data-grid-data,
    .admin-content .rz-datatable-data {
        min-width: 0;
    }

    .mmz-hide-phone {
        display: none !important;
    }

    .mmz-hide-desktop {
        display: block !important;
    }

    .mmz-hide-desktop.mmz-order-list {
        display: flex !important;
    }

    .rz-expanded-row-template {
        max-width: 100%;
        box-sizing: border-box;
        padding: 0.5rem !important;
    }

    /* Forms: full-width inputs */
    .admin-content .rz-textbox,
    .admin-content .rz-textarea,
    .admin-content .rz-dropdown,
    .admin-content .rz-numeric,
    .admin-content .rz-datepicker,
    .admin-content .rz-colorpicker,
    .admin-content .rz-html-editor {
        width: 100% !important;
        max-width: 100% !important;
    }

    .admin-content .rz-form-field {
        width: 100%;
    }

    /* Charts stay within viewport */
    .admin-content .rz-chart {
        max-width: 100%;
        overflow: hidden;
    }

    .admin-content .rz-chart svg {
        max-width: 100%;
        height: auto;
    }

    /* Dialogs nearly full-width on phones */
    .rz-dialog {
        max-width: calc(100vw - 1.5rem) !important;
        margin: 0.75rem !important;
    }

    .admin-not-found,
    .admin-access-denied {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .admin-header-title {
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    .admin-sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        height: auto !important;
        transform: none !important;
        transition: none !important;
        width: var(--rz-sidebar-width) !important;
        max-width: none !important;
        box-shadow: none !important;
    }

    .admin-sidebar.rz-sidebar-collapsed {
        transform: none !important;
        width: var(--rz-sidebar-width) !important;
        opacity: 1 !important;
    }

    .admin-sidebar-toggle {
        display: none !important;
    }

    body.admin-sidebar-open .admin-sidebar-overlay,
    .admin-sidebar-overlay {
        display: none !important;
    }

    .admin-sidebar-close {
        display: none !important;
    }

    .admin-nav-search,
    .admin-nav-empty {
        display: none;
    }

    .mmz-page-header,
    .mmz-card-toolbar {
        flex-wrap: nowrap !important;
    }
}

.admin-not-found, .admin-access-denied {
    padding: 60px;
    text-align: center;
}

/* ==================== LOGIN PAGE ==================== */

.login-layout {
    height: 100%;
}

.login-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
    align-items: stretch;
}

/* Left Column — 66.67% light */
.login-left-col {
    flex: 0 0 66.67%;
    max-width: 66.67%;
    background: #f8fafc;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    box-sizing: border-box;
}

.login-left-content {
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-brand {
    color: #1e293b;
    font-weight: 700;
    margin: 0;
}

.login-tagline {
    color: #64748b;
    font-weight: 400;
    margin-top: 0.25rem;
}

/* Info Cards */
.info-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.info-icon {
    color: #3b82f6 !important;
    font-size: 1.5rem;
}

.info-title {
    color: #1e293b !important;
    font-weight: 600;
}

.info-text {
    color: #64748b !important;
    line-height: 1.6;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

/* Dark Login Card */
.login-card-dark {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.login-card-dark .login-title {
    color: #f1f5f9;
    font-weight: 700;
    margin: 0;
}

.login-card-dark .login-subtitle {
    color: #94a3b8;
    margin: 0;
}

.login-card-dark .login-footer {
    color: #64748b;
    text-align: center;
}

/* Simple Form Fields - Dark Theme */
.login-card-dark .field-label {
    color: #94a3b8 !important;
    font-weight: 500;
}

.login-card-dark .login-input {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    border-radius: 8px !important;
    color: #f1f5f9 !important;
    width: 100%;
    padding: 12px 16px !important;
}

.login-card-dark .login-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    outline: none !important;
}

.login-card-dark .login-input::placeholder {
    color: #64748b !important;
}

.login-card-dark .login-btn {
    margin-top: 0.5rem;
}

.login-card-dark .rz-button {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    width: 100%;
}

.login-card-dark .rz-button:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

/* Right column — 33.33% dark */
.login-right-col {
    flex: 0 0 33.33%;
    max-width: 33.33%;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Native form elements */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.login-card-dark form .login-input {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.login-card-dark form .login-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    outline: none;
}

.login-card-dark form .login-input::placeholder {
    color: #64748b;
}

.login-card-dark .login-btn {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

.login-card-dark .login-btn:hover {
    background: #2563eb;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    border-radius: 8px;
    color: #fca5a5;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.recent-users {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-users-label {
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0;
}

.recent-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.recent-user-chip:hover {
    border-color: #3b82f6;
    background: #111c33;
}

.recent-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: #334155;
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.recent-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.recent-user-name {
    color: #f1f5f9;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-user-email {
    color: #94a3b8;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-users-alt {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    text-align: center;
}

.recent-users-alt:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.recent-users-alt-inline {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
}

.selected-user-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
}

.selected-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.login-card-dark .login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Info cards as block elements */
.info-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.info-card .info-title {
    color: #1e293b;
    font-weight: 600;
}

.info-card .info-text {
    margin: 0;
}

/* Responsive */
@media (max-width: 991px) {
    .login-left-col {
        display: none;
    }

    .login-right-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Hero designer preview — storefront-matching stage + caption layout */
.hero-designer-preview {
    --hero-carousel-navy: #0f2a44;
    position: relative;
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 1280 / 600;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--rz-base-600);
    cursor: crosshair;
    user-select: none;
    container-type: inline-size;
    container-name: hero;
}

.hero-designer-preview__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.hero-designer-preview__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.hero-designer-preview__guides {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.hero-designer-preview__guide-v,
.hero-designer-preview__guide-h {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
}

.hero-designer-preview__guide-v {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

.hero-designer-preview__guide-h {
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

.hero-designer-preview .hero-caption-stage--preview,
.hero-designer-preview .hero-caption-stage {
    position: absolute;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    color: white;
    pointer-events: none;
    opacity: 1;
}

.hero-designer-preview .hero-caption-stage .slide-eyebrow,
.hero-designer-preview .hero-caption-stage .slide-title,
.hero-designer-preview .hero-caption-stage .slide-subtitle {
    margin: 0;
    padding: 0;
}

.hero-designer-preview .hero-caption-stage .slide-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    width: fit-content;
    margin-bottom: 7px;
}

.hero-designer-preview .hero-caption-stage .slide-eyebrow::before {
    content: '';
    width: 32px;
    height: 2px;
    background: currentColor;
    flex-shrink: 0;
}

.hero-designer-preview .hero-caption-stage .slide-title {
    font-size: clamp(var(--slide-title-size-min, 24px), 4.8cqi, var(--slide-title-size, 48px));
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -1.5px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
    margin-bottom: 9px;
}

.hero-designer-preview .hero-caption-stage .slide-title em {
    color: var(--slide-title-accent, #ffd966);
    font-style: italic;
}

.hero-designer-preview .hero-caption-stage .slide-subtitle {
    font-size: clamp(var(--slide-subtitle-size-min, 12px), 1.15cqi, var(--slide-subtitle-size, 17px));
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    opacity: var(--slide-subtitle-opacity, 1);
    margin-bottom: 0;
}

.hero-designer-preview .hero-caption-stage .hero-slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-top: 17px;
    padding: 15px 32px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(43, 184, 200, 0.4);
    text-decoration: none;
    pointer-events: auto;
}

.hero-designer-preview .slide-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    width: fit-content;
}

.hero-designer-preview .slide-eyebrow::before {
    content: '';
    width: 32px;
    height: 2px;
    background: currentColor;
    flex-shrink: 0;
}

.hero-designer-preview .slide-title {
    font-weight: 800;
    letter-spacing: -1.5px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.hero-designer-preview .slide-title em {
    color: var(--slide-title-accent, #ffd966);
    font-style: italic;
}

.hero-designer-preview .slide-subtitle {
    font-weight: 500;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.hero-designer-preview .hero-slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 15px 32px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(43, 184, 200, 0.4);
    text-decoration: none;
    pointer-events: auto;
}

.hero-designer-preview .carousel-arrow {
    position: absolute;
    top: 50%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: var(--hero-carousel-navy);
    z-index: 6;
    transform: translateY(-50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
    pointer-events: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-designer-preview .carousel-arrow:hover {
    transform: translateY(-50%) scale(1.08);
    background: white;
}

.hero-designer-preview .carousel-arrow.prev {
    left: 14px;
}

.hero-designer-preview .carousel-arrow.next {
    right: 14px;
}

.hero-designer-preview .carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 6;
    pointer-events: auto;
}

.hero-designer-preview .carousel-indicators .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: default;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: none;
    padding: 0;
}

.hero-designer-preview .carousel-indicators .dot.active {
    background: white;
    width: 24px;
    border-radius: 999px;
}

.hero-designer-preview .carousel-indicators .dot--clickable {
    cursor: pointer;
}

/* ── Hero Slide Studio (full-page editor) ───────────────── */
.hero-studio {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100vh - 4.5rem);
    min-height: 560px;
    margin: -0.5rem -0.75rem 0;
    background: var(--rz-base-900);
    border: 1px solid var(--rz-base-700);
    border-radius: 10px;
    overflow: hidden;
}

.hero-studio__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--rz-base-700);
    background: var(--rz-base-850, var(--rz-base-800));
    z-index: 2;
}

.hero-studio__toolbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hero-studio__toolbar-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-studio__dirty {
    font-size: 0.7rem;
    color: #f0c14b;
    white-space: nowrap;
}

.hero-studio__body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.hero-studio__canvas {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0);
    background-size: 18px 18px;
    background-color: #12151c;
}

.hero-studio__canvas-tools {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
}

.hero-studio__zoom-label {
    min-width: 3.2rem;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.75;
}

.hero-studio__viewport {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    cursor: default;
    touch-action: none;
}

.hero-studio__viewport--pan-tool,
.hero-studio__viewport--pan-ready {
    cursor: grab;
}

.hero-studio__viewport--panning {
    cursor: grabbing !important;
}

.hero-studio__world {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}

/* Storefront browser frame — realistic WYSIWYG of live storefront.
   Desktop simulates a common 1920×1080 content viewport so hero matches
   storefront edge-to-edge: width 100%, height clamp(420px, 60vh, 600px) → 600px.
   (Same object-fit:cover crop as a full-HD storefront window.) */
.hero-studio__sf-frame {
    --sf-viewport-w: 1920px;
    --sf-viewport-h: 1080px;
    --sf-hero-h: clamp(420px, calc(var(--sf-viewport-h) * 0.6), 600px);
    --sf-hero-pad-x: 0px;
    width: var(--sf-viewport-w);
    background: #f7f3ea;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-studio__sf-frame--mobile {
    --sf-viewport-w: 390px;
    --sf-viewport-h: 844px;
    --sf-hero-h: min(52vw, 360px);
    --sf-hero-pad-x: 0px;
    width: var(--sf-viewport-w);
}

.hero-studio__sf-chrome {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: #1e2430;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-studio__sf-dots {
    display: inline-flex;
    gap: 5px;
}

.hero-studio__sf-dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4b5563;
    display: block;
}

.hero-studio__sf-dots i:first-child { background: #ff5f57; }
.hero-studio__sf-dots i:nth-child(2) { background: #febc2e; }
.hero-studio__sf-dots i:nth-child(3) { background: #28c840; }

.hero-studio__sf-url {
    flex: 1;
    background: #111827;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.72rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    text-align: center;
    letter-spacing: 0.01em;
}

.hero-studio__sf-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2bb8c8;
    white-space: nowrap;
}

.hero-studio__sf-page {
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 217, 102, 0.18), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(43, 184, 200, 0.1), transparent 24%),
        linear-gradient(180deg, #fff8ef 0%, #f7f3ea 45%, #f4efe6 100%);
    font-family: 'Inter', system-ui, sans-serif;
}

.hero-studio__sf-promo {
    background: #2bb8c8;
    color: white;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
}

.hero-studio__sf-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(15, 42, 68, 0.08);
    color: #0f2a44;
}

.hero-studio__sf-nav strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-studio__sf-search {
    flex: 1;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    color: rgba(15, 42, 68, 0.45);
}

.hero-studio__sf-nav-icons {
    font-size: 0.78rem;
    opacity: 0.7;
    white-space: nowrap;
}

.hero-studio__sf-hero {
    background: transparent;
    padding: 0 0 12px;
}

.hero-studio .hero-designer-preview--storefront {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: crosshair;
    font-family: 'Inter', system-ui, sans-serif;
    overflow: hidden;
}

/* Match storefront edge-to-edge .hero-stage */
.hero-studio .hero-designer-preview--desktop {
    width: 100%;
    max-width: none;
    height: var(--sf-hero-h); /* 540px at 900px simulated viewport */
    aspect-ratio: auto;
}

.hero-studio .hero-designer-preview--mobile {
    width: 100%;
    max-width: none;
    height: min(320px, var(--sf-hero-h));
    min-height: 260px;
    border-radius: 0;
    box-shadow: none;
    aspect-ratio: auto;
}

.hero-studio .hero-designer-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e0f0;
}

.hero-studio__coords {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 6;
}

/* Match storefront dots under the stage (not overlaid) */
.hero-studio__sf-dots-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 8px;
}

.hero-studio__sf-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: rgba(15, 42, 68, 0.28);
    cursor: pointer;
    transition: 0.25s;
}

.hero-studio__sf-dot.active {
    background: #0f2a44;
    width: 28px;
    border-radius: 999px;
}

.hero-studio__sf-dot:disabled {
    cursor: default;
}

.hero-studio__sf-below {
    padding: 28px 24px 36px;
    text-align: center;
}

.hero-studio__sf-below h2 {
    margin: 0 0 18px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f2a44;
}

.hero-studio__sf-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.hero-studio__sf-pills span {
    background: white;
    color: #0f2a44;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(15, 42, 68, 0.08);
}

/* Storefront-accurate caption / CTA in studio */
.hero-studio .hero-designer-preview--storefront .hero-caption-stage .slide-eyebrow {
    font-size: inherit; /* driven by design inline styles */
}

.hero-studio .hero-designer-preview--storefront .hero-caption-stage .hero-slide-cta {
    margin: 17px 0 0;
    padding: 15px 32px;
    background: #1a8f9c;
    color: white;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 10px 24px rgba(26, 143, 156, 0.4);
}

.hero-studio .hero-designer-preview--storefront .carousel-arrow {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f2a44;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hero-studio .hero-designer-preview--storefront .carousel-arrow.prev { left: 20px; }
.hero-studio .hero-designer-preview--storefront .carousel-arrow.next { right: 20px; }

.hero-studio__hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 5;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}

.hero-studio__inspector {
    width: 360px;
    max-width: 42vw;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--rz-base-700);
    background: var(--rz-base-800);
    min-height: 0;
}

.hero-studio__inspector-head {
    padding: 0.65rem 0.85rem 0.4rem;
    border-bottom: 1px solid var(--rz-base-700);
}

.hero-studio__inspector-head h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.85;
}

.hero-studio__inspector-scroll {
    flex: 1;
    overflow: auto;
    padding: 0.35rem 0.65rem 1rem;
}

.hero-studio__section {
    border: 1px solid var(--rz-base-700);
    border-radius: 8px;
    margin-top: 0.5rem;
    background: var(--rz-base-850, rgba(0, 0, 0, 0.15));
    overflow: hidden;
}

.hero-studio__section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
}

.hero-studio__section-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.hero-studio__section-body {
    padding: 0 0.7rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.hero-studio__section-body.collapsed {
    display: none;
}

.hero-studio__color-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hero-studio__color-row input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.hero-studio__field-label {
    font-size: 0.72rem;
    opacity: 0.7;
    margin: 0;
}

.hero-designer-caption-block {
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.hero-designer-caption-block:active,
.hero-designer-caption-block.hero-designer-caption-block--dragging {
    cursor: grabbing;
}

.hero-designer-caption-block:hover {
    outline: 1px dashed rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
}

.hero-designer-caption-block.hero-designer-caption-block--active,
.hero-designer-caption-block.hero-designer-caption-block--dragging {
    outline: 2px solid rgba(43, 184, 200, 0.95);
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(43, 184, 200, 0.2);
}

@media (max-width: 960px) {
    .hero-studio {
        height: auto;
        min-height: 0;
        margin: 0;
    }

    .hero-studio__body {
        flex-direction: column;
    }

    .hero-studio__canvas {
        min-height: 420px;
    }

    .hero-studio__inspector {
        width: 100%;
        max-width: none;
        border-left: 0;
        border-top: 1px solid var(--rz-base-700);
        max-height: 50vh;
    }
}

/* Return request — admin notes preview & editor (BackOffice dark theme) */
.return-admin-notes {
    padding: 0.75rem 1rem;
    border: 1px solid var(--rz-base-600);
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-900);
    color: var(--rz-text-color);
    font-size: 0.875rem;
    line-height: 1.6;
}

.return-admin-notes p {
    margin: 0 0 0.75em;
    color: inherit;
    background: transparent !important;
}

.return-admin-notes p:last-child {
    margin-bottom: 0;
}

.return-admin-notes ul,
.return-admin-notes ol {
    margin: 0.5em 0 0.75em 1.25em;
    padding: 0;
}

.return-admin-notes li {
    margin-bottom: 0.25em;
}

.return-admin-notes a {
    color: var(--rz-info);
    text-decoration: underline;
}

.return-admin-notes a:hover {
    color: var(--rz-info-lighter);
}

.return-admin-notes strong,
.return-admin-notes b {
    color: var(--rz-base-0);
    font-weight: 600;
}

.return-admin-notes-helper {
    color: var(--rz-base-400) !important;
    line-height: 1.5;
}

.return-admin-notes-dialog .return-admin-notes-editor {
    min-height: 320px;
}

.return-admin-notes-dialog .return-admin-notes-editor .rz-html-editor-content {
    min-height: 260px;
}

/* ==================== ORDER DETAIL PANEL ==================== */

.order-detail-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-detail-section {
    background: var(--rz-base-800);
    border: 1px solid var(--rz-base-700);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.order-detail-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--rz-base-0);
    margin: 0 0 0.75rem;
}

.order-detail-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.order-detail-header-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.order-detail-header-meta .order-detail-header-id {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--rz-base-0);
    margin: 0;
}

.order-detail-header-who,
.order-detail-header-email,
.order-detail-header-when,
.order-detail-header-total {
    margin: 0;
    font-size: 0.875rem;
    color: var(--rz-base-300);
}

.order-detail-header-who {
    color: var(--rz-base-100);
    font-weight: 500;
}

.order-detail-header-total {
    color: var(--rz-base-0);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.order-detail-header-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.order-detail-header-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    min-width: min(100%, 22rem);
}

.order-detail-docs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    max-width: 20rem;
}

.order-detail-docs--compact {
    max-width: none;
    margin-top: 0.25rem;
}

.order-detail-docs__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.order-detail-docs__label-btn,
.order-detail-docs__receipt-btn {
    flex: 0 1 auto;
}

.order-detail-docs__hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--rz-text-secondary-color, rgba(255, 255, 255, 0.55));
}

.order-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.9fr);
    gap: 0.75rem;
    align-items: start;
}

.order-detail-body-main,
.order-detail-body-rail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.order-detail-body-rail {
    position: sticky;
    top: 0.5rem;
}

.order-detail-contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 0.4rem 1.25rem;
    align-items: start;
}

.order-detail-contact-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.order-detail-contact-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
}

.order-detail-contact-inline > span {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.order-detail-contact-inline .order-detail-field-label {
    margin: 0;
}

.order-detail-contact-inline .order-detail-field-value {
    word-break: break-word;
}

@media (min-width: 768px) {
    .order-detail-contact-grid > div + div {
        border-left: 1px solid var(--rz-base-700);
        padding-left: 1.25rem;
    }
}

.order-detail-grid {
    display: grid;
    gap: 0.75rem;
}

.order-detail-grid--2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-detail-grid > .order-detail-section {
    height: 100%;
    box-sizing: border-box;
}

.order-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-detail-field-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rz-base-400);
    margin: 0 0 0.15rem;
}

.order-detail-field-value {
    font-size: 0.875rem;
    color: var(--rz-base-100);
    margin: 0;
    line-height: 1.45;
}

.order-detail-address {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.order-detail-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--rz-base-300);
    padding: 0.45rem 0.65rem;
    background: var(--rz-base-900);
    border-radius: 6px;
    border-left: 3px solid var(--rz-base-600);
    margin: 0;
}

.order-detail-hint .material-icons {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.85;
}

.order-detail-hint--info {
    border-left-color: var(--rz-info);
}

.order-detail-hint--warning {
    border-left-color: var(--rz-warning);
}

.order-detail-hint--success {
    border-left-color: var(--rz-success);
}

.order-detail-hint--danger {
    border-left-color: var(--rz-danger);
}

.order-detail-hint--muted {
    border-left: none;
    background: transparent;
    padding: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--rz-base-400);
}

.order-detail-subsection {
    background: var(--rz-base-900);
    border: 1px solid var(--rz-base-700);
    border-radius: 6px;
    padding: 0.875rem 1rem;
}

.order-detail-subsection + .order-detail-subsection {
    margin-top: 0.75rem;
}

.order-detail-subsection-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rz-base-0);
    margin: 0;
}

.order-detail-subsection-desc {
    font-size: 0.75rem;
    color: var(--rz-base-400);
    margin: 0.15rem 0 0;
    line-height: 1.4;
}

.order-items-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--rz-base-700);
    border-radius: 6px;
    background: var(--rz-base-900);
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.order-items-table th {
    text-align: left;
    padding: 0.4rem 0.6rem;
    font-weight: 600;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rz-base-400);
    border-bottom: 1px solid var(--rz-base-700);
    background: rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.order-items-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--rz-base-700);
    color: var(--rz-base-100);
    vertical-align: top;
}

.order-items-table tbody tr:last-child td {
    border-bottom: none;
}

.order-items-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.order-items-table .col-qty,
.order-items-table .col-price,
.order-items-table .col-total {
    text-align: right;
    white-space: nowrap;
}

.order-items-table .col-variant {
    color: var(--rz-base-300);
    font-size: 0.8125rem;
}

.order-totals-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rz-base-700);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.order-totals-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    max-width: 300px;
    font-size: 0.8125rem;
    color: var(--rz-base-300);
}

.order-totals-row span:last-child {
    color: var(--rz-base-100);
    font-variant-numeric: tabular-nums;
}

.order-totals-row--grand {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rz-base-600);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--rz-base-0);
}

.order-totals-row--grand span:last-child {
    color: var(--rz-success-lighter, #86efac);
}

.order-detail-shipment-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--rz-base-200);
}

/* ==================== ORDER WORKFLOW STEPPER ==================== */

.order-detail-workflow {
    padding: 0.5rem 0.75rem 0.4rem;
}

.order-workflow-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.2rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
}

.workflow-step {
    flex: 1;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
    text-align: center;
}

.workflow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: var(--rz-base-600);
    z-index: 0;
}

.workflow-step.completed:not(:last-child)::after {
    background: var(--rz-success);
}

.workflow-step.active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--rz-success) 50%, var(--rz-base-600) 50%);
}

.workflow-step-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-base-700);
    border: 2px solid var(--rz-base-600);
    z-index: 1;
    flex-shrink: 0;
}

.workflow-step-icon {
    font-size: 14px;
    color: var(--rz-base-300);
}

.workflow-step.completed .workflow-step-indicator {
    background: var(--rz-success);
    border-color: var(--rz-success);
}

.workflow-step.completed .workflow-step-icon {
    color: #fff;
}

.workflow-step.active .workflow-step-indicator {
    background: var(--rz-primary);
    border-color: var(--rz-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.workflow-step.active .workflow-step-icon {
    color: #fff;
}

.workflow-step-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--rz-base-400);
    line-height: 1.2;
    max-width: 72px;
}

.workflow-step.active .workflow-step-label {
    color: var(--rz-base-0);
    font-weight: 600;
}

.workflow-step.completed .workflow-step-label {
    color: var(--rz-success-lighter, #86efac);
}

.workflow-action-panel {
    padding: 0;
}

.workflow-step-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.order-detail-obs-banner {
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--rz-base-700);
}

.order-detail-obs-banner .order-detail-section-title {
    margin-bottom: 0.5rem;
}

.order-detail-obs-banner--error {
    background: color-mix(in srgb, var(--rz-danger) 14%, var(--rz-base-800));
    border-color: color-mix(in srgb, var(--rz-danger) 48%, var(--rz-base-700));
}

.order-detail-obs-banner--warning {
    background: color-mix(in srgb, var(--rz-warning) 12%, var(--rz-base-800));
    border-color: color-mix(in srgb, var(--rz-warning) 42%, var(--rz-base-700));
}

.order-detail-obs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-detail-obs-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
}

.order-detail-obs-item .material-icons {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.order-detail-obs-item--error .material-icons,
.order-detail-obs-item--error .order-detail-obs-code {
    color: var(--rz-danger);
}

.order-detail-obs-item--warning .material-icons,
.order-detail-obs-item--warning .order-detail-obs-code {
    color: var(--rz-warning);
}

.order-detail-obs-body {
    min-width: 0;
    flex: 1;
}

.order-detail-obs-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.25rem;
}

.order-detail-obs-code {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.order-detail-obs-item--error .order-detail-obs-code {
    background: color-mix(in srgb, var(--rz-danger) 22%, transparent);
}

.order-detail-obs-item--warning .order-detail-obs-code {
    background: color-mix(in srgb, var(--rz-warning) 20%, transparent);
}

.order-detail-obs-source,
.order-detail-obs-when {
    font-size: 0.6875rem;
    color: var(--rz-base-400);
}

.order-detail-obs-message {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--rz-base-50, var(--rz-base-100));
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
}

.order-detail-notify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.order-detail-outbox-empty {
    font-size: 0.75rem;
    color: var(--rz-base-400);
    margin: 0;
}

.order-detail-outbox-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.order-detail-outbox-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--rz-base-700);
    font-size: 0.75rem;
}

.order-detail-outbox-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.order-detail-outbox-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.45rem;
    color: var(--rz-base-300);
    min-width: 0;
}

.order-detail-outbox-when {
    color: var(--rz-base-400);
    white-space: nowrap;
}

.order-detail-outbox-kind {
    color: var(--rz-base-100);
}

.order-detail-outbox-recipient {
    color: var(--rz-base-400);
    word-break: break-word;
}

.order-detail-outbox-error {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.6875rem;
    color: var(--rz-danger);
    line-height: 1.35;
}

.order-detail-outbox-status {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--rz-base-700);
    color: var(--rz-base-200);
}

.order-detail-outbox-status--sent,
.order-detail-outbox-status--delivered {
    background: color-mix(in srgb, var(--rz-success) 18%, transparent);
    color: var(--rz-success-lighter, #86efac);
}

.order-detail-outbox-status--failed {
    background: color-mix(in srgb, var(--rz-danger) 18%, transparent);
    color: var(--rz-danger);
}

.order-detail-outbox-status--pending,
.order-detail-outbox-status--processing {
    background: color-mix(in srgb, var(--rz-warning) 18%, transparent);
    color: var(--rz-warning);
}

.order-detail-outbox-more {
    font-size: 0.6875rem;
    color: var(--rz-base-400);
    margin: 0.35rem 0 0;
}

@media (max-width: 991px) {
    .order-detail-body {
        grid-template-columns: 1fr;
    }

    .order-detail-body-rail {
        position: static;
        order: 2;
    }

    .order-detail-body-main {
        order: 1;
    }
}

@media (max-width: 767px) {
    .order-detail-section {
        padding: 0.65rem 0.75rem;
    }

    .order-detail-grid--2col,
    .order-detail-contact-grid {
        grid-template-columns: 1fr;
    }

    .order-totals-row {
        max-width: 100%;
    }

    .workflow-step {
        min-width: 52px;
    }

    .workflow-step-label {
        font-size: 0.5625rem;
        max-width: 52px;
    }

    .workflow-step-indicator {
        width: 26px;
        height: 26px;
    }

    .workflow-step-icon {
        font-size: 13px;
    }

    .workflow-step:not(:last-child)::after {
        top: 13px;
        left: calc(50% + 14px);
        right: calc(-50% + 14px);
    }
}

@media (max-width: 767px) {
    html, body {
        touch-action: manipulation;
    }

    .admin-header-bar {
        min-height: 48px;
        padding: 0 0.35rem 0 0.15rem;
    }

    .admin-content .rz-text-h4,
    .admin-content h3,
    .admin-content h4 {
        font-size: 1.2rem !important;
        line-height: 1.3;
        word-break: break-word;
    }

    .mmz-page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        width: 100%;
    }

    .mmz-page-actions,
    .mmz-page-header > .rz-stack {
        width: 100%;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mmz-page-actions .rz-button,
    .mmz-page-header > .rz-button,
    .mmz-page-header > .rz-stack > .rz-button {
        min-height: 40px;
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .mmz-page-actions .rz-button:only-child {
        flex: 1 1 auto !important;
        width: 100% !important;
    }

    .mmz-sticky-actions {
        position: sticky;
        top: calc(2.75rem + env(safe-area-inset-top, 0));
        z-index: 40;
        background: var(--rz-base-800, #1e293b);
        margin: -0.75rem -0.75rem 0.75rem;
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .mmz-editor-page {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0));
    }

    .mmz-editor-page .rz-text-h4 {
        font-size: 1.05rem !important;
        padding-right: 0.25rem;
    }

    .mmz-editor-actions {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100vw;
        margin: 0 !important;
        transform: none !important;
        z-index: 1100;
        display: flex !important;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0));
        background: var(--rz-base-800, #1e293b);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
        box-sizing: border-box;
    }

    .mmz-editor-actions .rz-button {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        width: auto !important;
    }

    .mmz-editor-page .rz-tabview-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .mmz-editor-page .rz-tabview-nav li,
    .mmz-editor-page .rz-tabview-selected {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
    }

    .mmz-editor-page .rz-tabview-nav .rz-tabview-selected,
    .mmz-editor-page .rz-tabview-nav a,
    .mmz-editor-page .rz-tabview-nav span {
        padding: 0.55rem 0.7rem !important;
        font-size: 0.86rem !important;
        white-space: nowrap;
    }

    .mmz-editor-page .rz-html-editor {
        height: 180px !important;
    }

    .mmz-image-toolbar-main {
        flex-direction: column;
        align-items: stretch;
    }

    .mmz-image-toolbar-main .rz-button,
    .mmz-image-upload,
    .mmz-image-upload .rz-button {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .admin-content .rz-numeric-button,
    .admin-content .rz-numeric-up,
    .admin-content .rz-numeric-down {
        display: none !important;
    }

    .admin-content .rz-numeric-wrap input,
    .admin-content .rz-numeric-input {
        width: 100% !important;
        padding-right: 0.75rem !important;
    }

    .mmz-editor-page .rz-tabview-nav .rzi,
    .mmz-editor-page .rz-tabview-nav .material-icons {
        display: none;
    }

    .mmz-editor-page .rz-p-4 {
        padding: 0.7rem 0 !important;
    }

    /* Keep typing comfortable and stop iOS zooming inputs */
    .admin-content input,
    .admin-content select,
    .admin-content textarea,
    .admin-content .rz-textbox,
    .admin-content .rz-textarea,
    .admin-content .rz-dropdown-label,
    .admin-content .rz-numeric-wrap input,
    .login-card-dark input,
    .admin-nav-search input {
        font-size: 16px !important;
    }

    .admin-content .rz-numeric,
    .admin-content .rz-numeric-wrap,
    .admin-content .rz-dropdown,
    .admin-content .rz-datepicker {
        min-height: 44px;
    }

    .admin-content .rz-data-grid .rz-numeric,
    .admin-content .rz-data-grid .rz-numeric-wrap,
    .admin-content .rz-data-grid .rz-switch {
        min-height: 40px;
    }

    .admin-content .rz-pager,
    .admin-content .rz-paginator {
        flex-wrap: wrap !important;
        gap: 0.4rem;
        justify-content: center;
        padding: 0.5rem 0;
    }

    .admin-content .rz-tabview-nav,
    .admin-content .rz-tabs-navigation,
    .admin-content ul[role="tablist"] {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.15rem;
        max-width: 100%;
    }

    .admin-content .rz-tabview-nav li,
    .admin-content [role="tab"] {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .admin-content .rz-data-grid-filter,
    .admin-content .rz-grid-filter,
    .admin-content .rz-cell-filter {
        min-width: 0;
    }

    .rz-dialog-wrapper {
        padding: 0.5rem !important;
        align-items: flex-start !important;
    }

    .rz-dialog {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100dvh - 1rem - env(safe-area-inset-bottom, 0)) !important;
        margin: 0 !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .rz-dialog-content {
        max-height: none;
        overflow: visible;
    }

    .rz-notification {
        left: 0.5rem !important;
        right: 0.5rem !important;
        width: auto !important;
        max-width: none !important;
    }

    .notif-panel {
        position: fixed !important;
        right: 0.5rem !important;
        left: 0.5rem !important;
        top: calc(3.25rem + env(safe-area-inset-top, 0)) !important;
        width: auto !important;
        max-height: calc(100dvh - 5rem - env(safe-area-inset-bottom, 0)) !important;
    }

    .ml-layout {
        flex-direction: column;
    }

    .ml-layout-page {
        height: auto;
        min-height: calc(100dvh - 8rem);
    }

    .ml-layout-picker {
        height: auto;
        min-height: 360px;
        max-height: none;
    }

    .ml-sidebar {
        width: 100%;
        min-width: 0;
        max-height: 11rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        flex-direction: row;
        flex-wrap: wrap;
        overflow: auto;
    }

    .ml-img-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }

    .ml-img-thumb,
    .ml-img-overlay {
        height: 120px;
    }

    .ml-toolbar {
        padding: 0.5rem;
    }

    .ml-icon-btn {
        width: 40px;
        height: 40px;
    }

    .order-detail-header {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.45rem;
        min-height: 0;
        height: auto;
        position: sticky;
        top: calc(2.75rem + env(safe-area-inset-top, 0));
        z-index: 20;
        background: var(--rz-base-800);
    }

    .order-detail-header-email,
    .order-detail-header-when,
    .order-detail-workflow {
        display: none;
    }

    .order-detail-header-meta {
        flex: 0 1 auto;
        display: grid;
        gap: 0.1rem 0.75rem;
    }

    .order-detail-header-side {
        align-items: stretch;
        min-width: 0;
        width: 100%;
    }

    .order-detail-header-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        justify-content: flex-start;
    }

    .order-detail-docs {
        max-width: none;
    }

    .order-detail-panel:has(.order-detail-rail-actions) {
        padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0));
    }

    .order-detail-rail-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 45;
        border-radius: 12px 12px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
        padding: 0.75rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom, 0));
        background: var(--rz-base-800);
    }

    .order-detail-rail-actions .rz-text-body2,
    .order-detail-rail-actions .rz-color-secondary {
        display: none !important;
    }

    .order-detail-rail-actions .rz-button,
    .workflow-action-panel .rz-button {
        min-height: 44px;
        width: 100%;
    }

    .dash-card .dash-visibility-btn,
    .dash-visibility-toolbar {
        display: none !important;
    }

    .admin-content .rz-chart {
        height: 220px !important;
    }
}

@media (max-width: 991px) {
    .login-page {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: stretch;
    }

    .login-right-col {
        padding: 1.25rem 1rem;
        padding-top: calc(1.25rem + env(safe-area-inset-top, 0));
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
        min-height: 100dvh;
        align-items: flex-start;
    }

    .login-card-dark {
        padding: 1.25rem;
        max-width: 28rem;
        margin: 0 auto;
    }

    .login-card-dark form .login-input,
    .login-card-dark .login-input {
        font-size: 16px !important;
        min-height: 48px;
    }

    .login-card-dark .login-btn,
    .login-card-dark form button[type="submit"] {
        min-height: 48px;
        font-size: 1rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-header-title {
        font-size: 0.95rem;
    }
}

