/* --- Modal Create Staff (Manage Accounts) --- */
#createStaffModalContent > form#signup-form {
    background: #fff;
    border-radius: var(--heigen-radius-lg);
    box-shadow: 0 4px 32px 0 rgba(22,81,102,0.10);
    padding: 2.5rem 2rem 2rem 2rem;
    margin: 2rem auto;
    max-width: 600px;
    min-width: 320px;
    width: 100%;
    display: block;
    position: relative;
}
#createStaffModalContent h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: #165167;
    margin-bottom: 1.5rem;
}
#createStaffModalContent .btn-primary {
    margin-top: 1.5rem;
    width: 100%;
    font-size: 1.125rem;
    padding: 0.75rem 0;
}
#createStaffModalContent label {
    color: #165167 !important;
    font-weight: 600;
}
#createStaffModalContent input,
#createStaffModalContent select {
    font-size: 1rem;
    padding: 0.7rem 1rem;
    border-radius: var(--heigen-radius-sm);
    border: 1px solid #b4ccd4;
    margin-bottom: 0.5rem;
    background: #fafdff;
}
#createStaffModalContent input:focus,
#createStaffModalContent select:focus {
    border-color: #165167;
    outline: none;
}
/* main.css — shared staff shell + auth */

:root {
    --heigen-teal: var(--heigen-brand, #165166);
    --heigen-teal-dark: #134152;
    --heigen-slate: #5f6e79;
    --heigen-slate-deep: var(--heigen-brand-muted, #4f6e79);
    --heigen-cream: #f6efe3;
    --heigen-header-bg: #f4f0e4;
    --heigen-page-bg: #9bb5bc;
    --heigen-page-bg-top: #b4ccd4;
    --heigen-page-bg-mid: #9bb5bc;
    --heigen-page-bg-bottom: #89a8b4;
    --heigen-radius: 12px;
    --heigen-radius-sm: 8px;
    --heigen-radius-pill: 999px;
    --heigen-radius-xs: 4px;
    --heigen-radius-lg: 16px;
    --heigen-shadow-sm: 0 1px 3px rgba(22, 81, 102, 0.08);
    --heigen-shadow-md: 0 4px 24px rgba(0, 0, 0, 0.12);
    --heigen-shadow-sidebar: 4px 0 32px rgba(0, 0, 0, 0.14);
    --heigen-shadow-surface: 0 8px 32px rgba(22, 81, 102, 0.09);
    --heigen-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    /* Shared staff UI — surfaces, tables, chips (overridden in theme-dark.css) */
    --heigen-border-ui: #e3eaed;
    --heigen-table-stripe-a: rgba(249, 252, 253, 0.97);
    --heigen-table-stripe-b: rgba(255, 255, 255, 0.98);
    /* Thead — fixed brand teal (not --heigen-teal in dark, which is sky accent) */
    --heigen-table-header-bg: var(--heigen-brand, #165166);
    --heigen-table-hover: #eef5f7;
    --heigen-table-text-strong: #153947;
    --heigen-table-text-accent: var(--heigen-brand, #165166);
    --heigen-table-text-muted: #445b66;
    --heigen-chip-bg: rgba(22, 81, 102, 0.075);
    --heigen-chip-border: rgba(22, 81, 102, 0.18);
    --heigen-chip-fg: #134e60;
    /* Buttons — primary gradient, outline, neutral (aligned across staff + customer toolbar) */
    --heigen-btn-primary-grad-top: #1e6f86;
    --heigen-btn-primary-grad-bottom: var(--heigen-teal);
    --heigen-btn-primary-fg: #fff;
    --heigen-btn-primary-shadow: 0 2px 10px rgba(22, 81, 102, 0.28);
    --heigen-btn-primary-shadow-hover: 0 4px 16px rgba(22, 81, 102, 0.34);
    --heigen-btn-outline-border: rgba(22, 81, 102, 0.42);
    --heigen-btn-outline-border-hover: rgba(22, 81, 102, 0.55);
    --heigen-btn-secondary-hover-bg: var(--heigen-table-hover);
    --heigen-btn-solid-bg: var(--heigen-teal);
    --heigen-btn-solid-bg-hover: var(--heigen-teal-dark);
    --heigen-btn-neutral-border: #d4dee3;
    --heigen-btn-neutral-hover-bg: #f8fafb;
    --heigen-btn-danger-fg: #b91c1c;
    --heigen-btn-danger-border: #fca5a5;
    --heigen-btn-danger-hover-bg: #fef2f2;
    /* Text fields, selects, date inputs, search wells, filter strips */
    --heigen-field-border: rgba(22, 81, 102, 0.2);
    --heigen-field-border-hover: rgba(22, 81, 102, 0.32);
    --heigen-field-border-focus: rgba(22, 81, 102, 0.45);
    --heigen-field-ring: 0 0 0 3px rgba(22, 81, 102, 0.12);
    --heigen-field-ring-tight: 0 0 0 2px rgba(22, 81, 102, 0.15);
    --heigen-field-bg: #ffffff;
    --heigen-field-fg: #2a2a2a;
    --heigen-field-placeholder: #9aa8af;
    --heigen-field-muted-well-bg: #f6f8fa;
    --heigen-field-shadow-inset: 0 1px 2px rgba(31, 35, 40, 0.04);
    --heigen-filter-label-color: var(--heigen-slate);
    --heigen-toolbar-surface-bg: rgba(255, 255, 255, 0.92);
    --heigen-sort-menu-bg: #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
    /* Avoid shell host (iframe parent): outer document does not scroll */
    html:not(.shell-root) {
        scroll-behavior: smooth;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Text font is inherited from body (Inter); headings use --font-display (see ui.css). */
body {
    font-family: var(--font-body, "Segoe UI", sans-serif);
}

.font-segoe {
    font-family: var(--font-body);
}

body {
    background-color: var(--heigen-page-bg);
    color: var(--heigen-field-fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Staff shell + embedded tabs: one gradient instead of flat fill per page */
body.staff-body {
    background: linear-gradient(
        165deg,
        var(--heigen-page-bg-top) 0%,
        var(--heigen-page-bg-mid) 48%,
        var(--heigen-page-bg-bottom) 100%
    );
    /* fixed attachment breaks wheel / compositor scrolling in Electron (Chromium) */
}

/* Dashboard + Customer Data: flat canvas like Coupons (no page gradient) */
body.staff-body.staff-body--flat-page {
    background-color: var(--heigen-page-bg);
}

/* Auth-style staff pages (reset password, create staff) */
body.auth-body {
    background: linear-gradient(155deg, #a3b9c2 0%, #7d96a3 55%, #6d8795 100%);
}

body.auth-body--login {
    background: linear-gradient(160deg, #567584 0%, #3d5560 100%);
}

::selection {
    background: rgba(22, 81, 102, 0.18);
    color: #1a1a1a;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Staff shell: alternate mark only when desktop sidebar is collapsed */
.sidebar-logo-collapsed {
    display: none;
}

/* ── Sidebar ── */
.sidebar {
    width: 279px;
    background: linear-gradient(180deg, #677986 0%, var(--heigen-slate) 48%, #55636d 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--heigen-shadow-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 51;
}

/*
 * Narrow windows: keep the sidebar visible as a 72px icon rail (same look as the
 * desktop "collapsed" mode). Nav items get hover titles from staff-guard.js.
 * Nothing opened the old off-canvas sidebar, so it used to disappear entirely.
 */
@media (max-width: 1025px) {
    .sidebar {
        width: 72px;
    }

    #sidebar .sidebar-brand-wrap {
        padding: 0.45rem 0.35rem;
    }

    #sidebar .sidebar-brand-wrap .sidebar-logo-expanded {
        display: none;
    }

    #sidebar .sidebar-brand-wrap .sidebar-logo-collapsed {
        display: block;
        width: 44px;
        height: auto;
        max-height: 58px;
    }

    #sidebar nav {
        padding-left: 8px;
        padding-right: 8px;
    }

    #sidebar .sidebar-nav-item {
        justify-content: center;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 0;
        line-height: 0;
        gap: 0;
    }

    #sidebar .sidebar-nav-item svg {
        flex-shrink: 0;
    }
}

.sidebar.mobile-open {
    transform: translateX(0) !important;
}

/* Theme toggle + collapse dock (shell): below scrollable nav */
.sidebar-bottom-stack {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 0 1.25rem;
}

.sidebar-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: var(--heigen-radius-sm);
    border: none;
    background: #fffbf4;
    color: var(--heigen-slate-deep);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color var(--heigen-transition);
    position: relative;
}

.sidebar-theme-toggle:hover {
    background: #f3f0e4;
}

.sidebar-theme-toggle:focus-visible {
    outline: 2px solid rgba(246, 239, 227, 0.95);
    outline-offset: 3px;
}

.sidebar-theme-toggle .theme-toggle-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

/* Icon shows the theme you switch TO: moon in light mode, sun in dark mode */
.sidebar-theme-toggle .theme-toggle-icon--moon {
    display: block !important;
}
.sidebar-theme-toggle .theme-toggle-icon--sun {
    display: none !important;
}

[data-theme="dark"] .sidebar-theme-toggle .theme-toggle-icon--moon {
    display: none !important;
}
[data-theme="dark"] .sidebar-theme-toggle .theme-toggle-icon--sun {
    display: block !important;
}

/* Login page: same icon visibility (class lives in index.html; base position stays fixed in theme-dark). */
.heigen-theme-toggle-login .theme-toggle-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
}
/* Icon shows the theme you switch TO: moon in light mode, sun in dark mode */
.heigen-theme-toggle-login .theme-toggle-icon--moon {
    display: block !important;
}
.heigen-theme-toggle-login .theme-toggle-icon--sun {
    display: none !important;
}
[data-theme="dark"] .heigen-theme-toggle-login .theme-toggle-icon--moon {
    display: none !important;
}
[data-theme="dark"] .heigen-theme-toggle-login .theme-toggle-icon--sun {
    display: block !important;
}

@media (min-width: 1026px) {
    .sidebar-bottom-stack {
        padding-bottom: 2rem;
    }
}

/* ── Main content area (offset by sidebar width) ── */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/*
 * Staff sidebar pages: viewport-locked column — header stays put; .staff-main or main.page-content scrolls.
 */
body.staff-body:has(> .main-content) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.staff-body:has(> .main-content) > .main-content {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* Only offset content when a real sidebar exists in DOM flow. */
.sidebar ~ .main-content {
    margin-left: 279px;
}

@media (max-width: 1025px) {
    .main-content {
        margin-left: 0;
    }

    /* Room for the 72px icon rail. */
    .sidebar ~ .main-content {
        margin-left: 72px;
    }
}

/* ── Top header bar ── */
.header {
    min-height: 103px;
    height: auto;
    background: linear-gradient(180deg, #fdfcfa 0%, #f3efe6 100%);
    border-bottom: 1px solid rgba(22, 81, 102, 0.07);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 4px 22px rgba(22, 81, 102, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    gap: 16px;
}

/*
 * styles.css defines .header { position: fixed } for legacy app-container layouts.
 * Staff main column (.main-content) uses an in-flow header; reset fixed positioning.
 *
 * Customer pages load styles.css after main.css — its generic .header (column layout,
 * different padding) must not alter the staff bar. This block fully defines the bar.
 */
.main-content > .header {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: auto;
    max-width: none;
    z-index: 41;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 clamp(1rem, 3.5vw, 1.75rem);
    min-height: 103px;
    height: auto;
    background: linear-gradient(180deg, #fdfcfa 0%, #f3efe6 100%);
    border-bottom: 1px solid rgba(22, 81, 102, 0.07);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 4px 22px rgba(22, 81, 102, 0.06);
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .main-content > .header {
        min-height: 88px;
    }
}

/* Left column: page title (+ optional controls); grows, truncates title */
.staff-header-start {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Flex child scroll: main.page-content (customer list / details) */
.main-content > main.page-content {
    min-height: 0;
}

/* Shared page title + user strip (staff tabs) */
.staff-page-title,
.header .header-title {
    margin: 0;
    font-weight: 800;
    font-size: clamp(1.125rem, 2.2vw, 1.75rem);
    color: var(--heigen-slate-deep);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.staff-header-user,
.header .header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.staff-header-user-meta,
.header .header-user-info {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    text-align: right;
}

@media (min-width: 640px) {
    .staff-header-user-meta,
    .header .header-user-info {
        display: flex;
    }
}

.staff-header-user-name,
.header .header-user-name {
    font-weight: 700;
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    color: var(--heigen-slate-deep);
    line-height: 1.2;
}

.staff-header-user-role,
.header .header-user-role {
    font-weight: 600;
    font-size: clamp(0.6875rem, 1.2vw, 0.875rem);
    color: var(--heigen-slate);
    line-height: 1.2;
}

.staff-header-avatar,
.header .header-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 14px rgba(22, 81, 102, 0.14);
    border: 2px solid rgba(255, 255, 255, 0.85);
}

@media (min-width: 1024px) {
    .staff-header-avatar,
    .header .header-user-avatar {
        width: 61px;
        height: 61px;
    }
}

/* Main scroll region for full-height staff tabs */
.staff-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: clamp(1.25rem, 3.5vw, 1.75rem);
}

.staff-main--padded {
    padding: clamp(1.25rem, 3.5vw, 1.75rem);
}

/* White panels: one definition for tables/cards */
.heigen-surface {
    background: #fff;
    border-radius: var(--heigen-radius);
    border: 1px solid var(--heigen-border-ui);
    box-shadow: var(--heigen-shadow-surface);
}

/* Package List: Packages / Add-ons segmented control (staff catalog) */
.catalog-segment {
    display: inline-flex;
    align-items: stretch;
    padding: 3px;
    gap: 2px;
    border-radius: var(--heigen-radius-pill);
    background: rgba(22, 81, 102, 0.14);
    box-shadow: inset 0 1px 4px rgba(22, 81, 102, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.catalog-segment__btn {
    position: relative;
    z-index: 1;
    min-width: 92px;
    padding: 0 16px;
    height: 32px;
    border: none;
    border-radius: var(--heigen-radius-pill);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    color: rgba(79, 110, 121, 0.92);
    background: transparent;
    transition:
        color var(--heigen-transition),
        background var(--heigen-transition),
        box-shadow var(--heigen-transition),
        transform 0.15s ease;
}

.catalog-segment__btn:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.4);
    color: var(--heigen-teal-dark);
}

.catalog-segment__btn:active:not(:disabled) {
    transform: scale(0.98);
}

.catalog-segment__btn.is-active {
    background: linear-gradient(180deg, #fffefb 0%, var(--heigen-cream) 100%);
    color: var(--heigen-teal);
    box-shadow:
        0 2px 10px rgba(22, 81, 102, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.catalog-segment__btn:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .catalog-segment__btn {
        transition: none;
    }

    .catalog-segment__btn:active:not(:disabled) {
        transform: none;
    }
}

/* ── Staff sidebar links (icons + text; active = cream pill like Coupons) ── */
.sidebar nav a.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--heigen-radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--heigen-cream);
    text-decoration: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    transition: background-color var(--heigen-transition), color var(--heigen-transition),
        text-shadow var(--heigen-transition), box-shadow var(--heigen-transition);
    width: 100%;
    box-sizing: border-box;
}

.sidebar nav a.sidebar-nav-item:focus-visible {
    outline: 2px solid var(--heigen-cream);
    outline-offset: 2px;
}

.sidebar nav a.sidebar-nav-item svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.sidebar nav a.sidebar-nav-item:hover {
    background-color: rgba(246, 239, 227, 0.95);
    color: var(--heigen-teal);
    text-shadow: none;
}

.sidebar nav a.sidebar-nav-item.is-active {
    background-color: var(--heigen-cream);
    color: var(--heigen-teal);
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sidebar nav a.sidebar-nav-item.is-active:hover {
    background-color: var(--heigen-cream);
    color: var(--heigen-teal);
}

/* Embedded staff page (inside shell iframe): one column, no duplicate sidebar */
html.staff-embed .sidebar {
    display: none !important;
}

html.staff-embed .main-content {
    margin-left: 0 !important;
    min-height: 100vh;
}

/* Legacy layouts that still use .main-container */
html.staff-embed .main-container {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100%;
}

html.staff-embed .header {
    left: 0 !important;
    right: 0;
}

html.staff-embed .mobile-overlay.show {
    display: none !important;
}

html.staff-embed .floating-notification-btn,
html.staff-embed .global-refresh-btn,
html.staff-embed .global-kiosk-btn,
html.staff-embed .kiosk-launch-btn,
html.staff-embed .booking-status-panel,
html.staff-embed .booking-status-panel-overlay,
html.staff-embed .page-loading-overlay {
    display: none !important;
}

/* Shell host: main area beside fixed sidebar */
.shell-frame-wrap {
    margin-left: 279px;
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.staff-app-iframe {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100vh;
    border: 0;
    display: block;
}

/*
 * Admin shell (sidebar + iframe): lock host to the viewport so the iframe gets a
 * bounded height. Otherwise the iframe grows with embedded content and the
 * mouse wheel targets a non-scrolling shell document (common Electron issue).
 */
html.shell-root,
html.shell-root body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

html.shell-root .shell-frame-wrap {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
}

html.shell-root .staff-app-iframe {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100%;
    max-height: 100%;
}

@media (max-width: 1025px) {
    /* Room for the 72px icon rail. */
    .shell-frame-wrap {
        margin-left: 72px;
    }
}

/* ── Sidebar nav items (legacy; prefer sidebar-nav-item in staff_admin) ── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    height: 51px;
    padding: 0 24px;
    font-weight: 700;
    font-size: 0.875rem;
    color: #f7efe3;
    text-shadow: 2px 1px 1px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    border-radius: var(--heigen-radius-sm);
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-item.active {
    background: #ffffff;
    color: #165167;
    text-shadow: none;
}

/* ── Mobile overlay ── */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 41;
}

.mobile-overlay.show {
    display: block;
}

/* ── Section visibility (legacy single-page mode) ── */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* ── Responsive helpers ── */
@media (max-width: 641px) {
    .logo-text {
        display: none;
    }
}

/* ── Chart container ── */
.chart-container {
    position: relative;
    height: 300px;
    max-height: 400px;
}

@media (max-width: 1025px) {
    .chart-container {
        height: 250px;
    }
}

/* ── Hamburger menu icon ── */
.menu-icon {
    width: 24px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.menu-icon span {
    width: 100%;
    height: 3px;
    background: #5f6e79;
    transition: all 0.2s ease;
    border-radius: var(--heigen-radius-xs);
}

/* ── Sidebar close button (mobile only) ── */
.close-btn {
    position: absolute;
    right: 16px;
    top: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: var(--heigen-radius-sm);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
    line-height: 1;
    width: 40px;
    height: 40px;
    transition: background var(--heigen-transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.close-btn:focus-visible {
    outline: 2px solid var(--heigen-cream);
    outline-offset: 2px;
}


/* ── Collapsible sidebar (desktop only) ── */
@media (min-width: 1026px) {
    .sidebar {
        transition: width 0.2s ease;
    }

    .main-content {
        transition: margin-left 0.2s ease;
    }

    .shell-frame-wrap {
        transition: margin-left 0.2s ease;
    }

    /* Match guest booking sidebar `.sidebar-toggle` (double chevron, bottom of column) */
    .sidebar-collapse-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
        margin-top: auto;
        margin-bottom: 2rem;
        width: 46px;
        height: 46px;
        padding: 0;
        border-radius: var(--heigen-radius-sm);
        border: none;
        background: #fffbf4;
        color: var(--heigen-slate-deep);
        cursor: pointer;
        flex-shrink: 0;
        transition: background-color var(--heigen-transition);
    }

    .sidebar-collapse-toggle:hover {
        background: #f3f0e4;
    }

    .sidebar-collapse-toggle:focus-visible {
        outline: 2px solid #fffbf4;
        outline-offset: 3px;
    }

    .sidebar-collapse-toggle svg {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
        transition: transform 0.3s ease;
    }

    html.sidebar-collapsed .sidebar-collapse-toggle svg {
        transform: scaleX(-1);
    }

    html.sidebar-collapsed #sidebar {
        width: 72px;
    }

    /* Wide wordmark when expanded; portrait mark when collapsed (narrow rail) */
    html.sidebar-collapsed .sidebar-brand-wrap {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    html.sidebar-collapsed .sidebar-brand-wrap .sidebar-logo-expanded {
        display: none;
    }

    html.sidebar-collapsed .sidebar-brand-wrap .sidebar-logo-collapsed {
        display: block;
        width: 44px;
        height: auto;
        max-height: 58px;
    }

    html.sidebar-collapsed #sidebar nav {
        padding-left: 8px;
        padding-right: 8px;
    }

    html.sidebar-collapsed #sidebar .sidebar-nav-item {
        justify-content: center;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 0;
        line-height: 0;
        gap: 0;
    }

    html.sidebar-collapsed #sidebar .sidebar-nav-item svg {
        flex-shrink: 0;
    }

    html.sidebar-collapsed .main-content {
        margin-left: 72px;
    }

    html.sidebar-collapsed .shell-frame-wrap {
        margin-left: 72px;
    }

    html.sidebar-collapsed .main-container {
        margin-left: 72px !important;
    }

    .sidebar-bottom-stack .sidebar-collapse-toggle {
        margin-top: 0;
        margin-bottom: 0;
        align-self: center;
    }
}

@media (max-width: 1025px) {
    .sidebar-collapse-toggle {
        display: none !important;
    }
}

/* ── Sidebar nav: thin scrollbar (WebKit) ── */
.sidebar nav {
    scrollbar-width: auto; /* thin thumbs are too small to grab */
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: var(--heigen-radius-pill);
}

/* ── Login / auth (index + staff auth pages use these class names) ── */
.heigen-gradient {
    background: linear-gradient(145deg, #1a6578 0%, var(--heigen-teal) 45%, #0f3d4d 100%);
    box-shadow: var(--heigen-shadow-md);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    border: none;
    cursor: pointer;
    background: linear-gradient(
        180deg,
        var(--heigen-btn-primary-grad-top) 0%,
        var(--heigen-btn-primary-grad-bottom) 100%
    );
    color: var(--heigen-btn-primary-fg);
    box-shadow: var(--heigen-btn-primary-shadow);
    transition: filter var(--heigen-transition), box-shadow var(--heigen-transition),
        transform var(--heigen-transition);
}

.btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: var(--heigen-btn-primary-shadow-hover);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.link-button {
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity var(--heigen-transition);
}

.link-button:hover {
    opacity: 0.9;
}

.link-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
    border-radius: var(--heigen-radius-xs);
}

/* index.html login card inputs */
#login-email,
#login-password,
#reset-email,
#signup-name,
#signup-email,
#signup-password,
#signup-confirm,
#reset-new-password,
#reset-confirm-password {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.98);
    transition: border-color var(--heigen-transition), box-shadow var(--heigen-transition);
}

#login-email:focus,
#login-password:focus,
#reset-email:focus,
#signup-name:focus,
#signup-email:focus,
#signup-password:focus,
#signup-confirm:focus,
#reset-new-password:focus,
#reset-confirm-password:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Login card (solid teal) */
.heigen-login-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

/* Onboarding wizard card */
.heigen-onboarding-card {
    border: 1px solid rgba(22, 81, 102, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

/* Staff data tables (Coupons, etc.) */
.heigen-table-wrap {
    border: 1px solid var(--heigen-border-ui);
    box-shadow: var(--heigen-shadow-sm);
}

.heigen-table {
    border-collapse: collapse;
}

.heigen-table thead {
    background: var(--heigen-table-header-bg);
    color: #fff;
}

.heigen-table thead th {
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.75rem;
    background: transparent;
    color: inherit;
}

/* Body cell copy — strong / accent / muted (overridden per-column where needed).
 * Staff tables: default td = muted; `.heigen-td-strong` / `.heigen-td-accent` for hierarchy. */
.heigen-table tbody td {
    color: var(--heigen-table-text-muted);
    font-size: 0.8125rem;
}

.heigen-td-strong {
    font-weight: 600;
    color: var(--heigen-table-text-strong);
}

.heigen-td-accent {
    font-weight: 600;
    color: var(--heigen-table-text-accent);
}

a.heigen-table-link {
    color: var(--heigen-table-text-accent);
    font-weight: 600;
    text-decoration: none;
}

a.heigen-table-link:hover {
    text-decoration: underline;
}

button.heigen-table-action {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--heigen-table-text-accent);
    background: none;
    border: none;
    padding: 0;
    margin-right: 0.5rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

button.heigen-table-action:hover {
    color: var(--heigen-teal-dark);
}

button.heigen-table-action--danger {
    color: var(--heigen-btn-danger-fg);
    margin-right: 0;
}

button.heigen-table-action--danger:hover {
    color: #991b1b;
}

/* Nested staff tables (modal histories — not .heigen-table) */
.staff-nested-table tbody td {
    color: var(--heigen-table-text-muted);
    font-size: 0.75rem;
}

a.staff-nested-table-link {
    color: var(--heigen-table-text-accent);
    font-weight: 600;
    text-decoration: none;
}

a.staff-nested-table-link:hover {
    text-decoration: underline;
}

/* Staff tables without .heigen-table wrapper (e.g. coupon history modals) */
thead.staff-thead-brand {
    background: var(--heigen-table-header-bg);
    color: #fff;
}

thead.staff-thead-brand th {
    color: inherit;
}

/* Manage accounts table — layout/spacing aligned with customer data table */
.manage-accounts-table {
    border-collapse: collapse;
    table-layout: fixed;
}

.manage-accounts-table thead th {
    font-family: var(--font-display);
    vertical-align: bottom;
}

.manage-accounts-table .ma-th--name,
.manage-accounts-table .ma-td--name {
    width: 19%;
    min-width: 11rem;
}

.manage-accounts-table .ma-th--username,
.manage-accounts-table .ma-td--username {
    width: 11%;
    min-width: 5.5rem;
}

.manage-accounts-table .ma-th--email,
.manage-accounts-table .ma-td--email {
    width: 18%;
    min-width: 8rem;
}

.manage-accounts-table .ma-th--role,
.manage-accounts-table .ma-td--role {
    width: 7rem;
}

.manage-accounts-table .ma-th--status,
.manage-accounts-table .ma-td--status {
    width: 6.5rem;
}

.manage-accounts-table .ma-th--phone,
.manage-accounts-table .ma-td--phone {
    width: 11%;
    min-width: 6rem;
}

.manage-accounts-table .ma-th--nickname,
.manage-accounts-table .ma-td--nickname {
    width: 12%;
    min-width: 6rem;
}

.manage-accounts-table .ma-th--actions,
.manage-accounts-table .ma-td--actions {
    width: 7rem;
    min-width: 7rem;
}

.manage-accounts-table .ma-th--role .accounts-sort-btn,
.manage-accounts-table .ma-th--status .accounts-sort-btn {
    justify-content: center;
    width: 100%;
}

.manage-accounts-table thead .accounts-sort-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 1px;
}

.manage-account-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.manage-account-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--heigen-radius-pill);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(22, 81, 102, 0.12);
    background: #e8f0f2;
}

.manage-account-name-text {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--heigen-table-text-strong);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-accounts-table .ma-td--username {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--heigen-table-text-accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-accounts-table .ma-td--email,
.manage-accounts-table .ma-td--phone,
.manage-accounts-table .ma-td--nickname {
    font-size: 0.8125rem;
    color: var(--heigen-table-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-account-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Text-only row actions (no pill / no extra horizontal space) */
.manage-account-action-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    color: var(--heigen-table-text-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.manage-account-action-link:hover {
    color: var(--heigen-teal-dark);
}

.manage-account-action-link--danger {
    color: var(--heigen-btn-danger-fg);
}

.manage-account-action-link--danger:hover {
    color: #991b1b;
}

/* Zebra + hover — staff data tables (same tokens everywhere) */
#couponsTable .heigen-table tbody tr:nth-child(even),
#recycleSections .heigen-table tbody tr:nth-child(even),
#accountsTableWrap .manage-accounts-table tbody tr.manage-account-row:nth-child(even),
#logsTableWrap .action-logs-table tbody tr.action-log-row:nth-child(even),
.customer-data-heigen-table tbody tr.customer-table-row:nth-child(even) {
    background: var(--heigen-table-stripe-a);
}

#couponsTable .heigen-table tbody tr:nth-child(odd),
#recycleSections .heigen-table tbody tr:nth-child(odd),
#accountsTableWrap .manage-accounts-table tbody tr.manage-account-row:nth-child(odd),
#logsTableWrap .action-logs-table tbody tr.action-log-row:nth-child(odd),
.customer-data-heigen-table tbody tr.customer-table-row:nth-child(odd) {
    background: var(--heigen-table-stripe-b);
}

#couponsTable .heigen-table tbody tr:hover,
#recycleSections .heigen-table tbody tr:hover,
#accountsTableWrap .manage-accounts-table tbody tr.manage-account-row:hover,
#logsTableWrap .action-logs-table tbody tr.action-log-row:hover,
.customer-data-heigen-table tbody tr.customer-table-row:hover {
    background: var(--heigen-table-hover) !important;
}

.account-role-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border-radius: var(--heigen-radius-pill);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: 1px solid;
    white-space: nowrap;
}

.account-role-pill--owner {
    background: #fce7d6;
    color: #9a3412;
    border-color: #f7c9a6;
}

.account-role-pill--admin {
    background: #dff3fa;
    color: #0f4c5f;
    border-color: #bde7f6;
}

.account-role-pill--staff {
    background: #eef1f4;
    color: #4b5563;
    border-color: #d7dde3;
}

.account-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border-radius: var(--heigen-radius-pill);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.account-status-pill--active {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

.account-status-pill--inactive {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.accounts-sort-menu {
    background: var(--heigen-sort-menu-bg);
    border: 1px solid var(--heigen-border-ui);
}

.accounts-sort-option--active {
    background: #e8f0f2;
}

.accounts-sort-option {
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--heigen-radius-sm);
    color: var(--heigen-teal);
}

.accounts-sort-option:hover {
    background: var(--heigen-table-hover);
}

/* Staff filter/toolbar — shared borders + search wells */
.staff-filter-row-divider {
    border-top: 1px solid var(--heigen-border-ui);
}

.staff-muted-text {
    color: var(--heigen-slate);
}

.staff-toolbar-count-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: var(--heigen-radius-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--heigen-field-bg);
    color: var(--heigen-teal);
    border: 1px solid var(--heigen-field-border);
}

.staff-search-well {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    border-radius: var(--heigen-radius);
    border: 1px solid var(--heigen-field-border);
    background: var(--heigen-field-muted-well-bg);
    padding: 0.5rem 0.75rem;
    box-shadow: var(--heigen-field-shadow-inset);
    transition:
        border-color var(--heigen-transition),
        box-shadow var(--heigen-transition),
        background var(--heigen-transition);
}

.staff-search-well:focus-within {
    border-color: var(--heigen-field-border-focus);
    background: var(--heigen-field-bg);
    box-shadow: var(--heigen-field-ring), var(--heigen-field-shadow-inset);
}

.staff-search-well svg {
    flex-shrink: 0;
    color: var(--heigen-field-placeholder);
}

.staff-search-well input {
    min-width: 0;
    flex: 1 1 0%;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--heigen-field-fg);
    outline: none;
    box-shadow: none;
}

/* Coupons list: expired row emphasis */
.coupon-expired-text {
    color: #dc2626;
    font-weight: 600;
}

.staff-search-well input::placeholder {
    color: var(--heigen-field-placeholder);
}

.staff-archived-section-head {
    border-top: 1px solid var(--heigen-border-ui);
}

.staff-checkbox-teal {
    accent-color: var(--heigen-teal);
}

/* Action logs — palette aligned with staff surfaces / teal accents */
.action-logs-filter-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--heigen-filter-label-color);
}

.action-logs-table thead th {
    font-family: var(--font-display);
    vertical-align: bottom;
}

.action-log-type-pill {
    display: inline-flex;
    align-items: center;
    max-width: min(100%, 260px);
    padding: 0.22rem 0.55rem;
    border-radius: var(--heigen-radius-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--heigen-chip-border);
    background: var(--heigen-chip-bg);
    color: var(--heigen-chip-fg);
}

.action-log-td--time {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--heigen-table-text-strong);
}

.action-log-td--actor {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--heigen-table-text-accent);
}

.action-log-td--text {
    font-size: 0.8125rem;
    color: var(--heigen-table-text-muted);
    word-break: break-word;
}

.action-log-td--type {
    font-size: 0.8125rem;
    color: var(--heigen-table-text-muted);
    vertical-align: middle;
}

.heigen-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background var(--heigen-transition);
}

.heigen-table tbody tr:hover {
    background: rgba(22, 81, 102, 0.045);
}

.heigen-table tbody tr:last-child {
    border-bottom: none;
}

/* Header bar: mobile menu & icon buttons */
.header button:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 3px;
    border-radius: var(--heigen-radius-sm);
}

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

.heigen-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e0e8eb;
    border-top-color: var(--heigen-teal);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.heigen-spinner--sm {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ── Toast (heigen-app.js) ── */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    min-width: 220px;
    max-width: min(92vw, 420px);
    padding: 14px 18px;
    border-radius: var(--heigen-radius-sm);
    box-shadow: var(--heigen-shadow-md);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-success {
    background: #e8f5f0;
    color: #0d4a38;
    border: 1px solid rgba(45, 138, 110, 0.35);
}

.toast-error {
    background: #fff0f0;
    color: #991b1b;
    border: 1px solid rgba(255, 90, 90, 0.35);
}

.toast-info {
    background: #eef5f7;
    color: var(--heigen-teal);
    border: 1px solid rgba(22, 81, 102, 0.25);
}

/* ── Global alert modal (heigen-api.js) ── */
.heigen-alert-host {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    background: rgba(15, 40, 48, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.heigen-alert-card {
    width: min(92vw, 420px);
    background: #fff;
    border-radius: var(--heigen-radius);
    border: 1px solid rgba(22, 81, 102, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 20px 20px 16px;
}

.loyalty-claim-label {
    display: block;
    margin: 12px 0 4px;
    font: 600 0.75rem "Segoe UI", sans-serif;
    color: var(--heigen-teal);
}

.loyalty-claim-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(22, 81, 102, 0.25);
    border-radius: var(--heigen-radius-sm);
    font: 500 0.8125rem "Segoe UI", sans-serif;
    background: inherit;
    color: inherit;
}

.loyalty-claim-error {
    min-height: 18px;
    margin-top: 6px;
    font: 500 0.75rem "Segoe UI", sans-serif;
    color: #b91c1c;
}

.heigen-alert-title {
    font: 700 1rem "Segoe UI", sans-serif;
    color: var(--heigen-teal);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

#heigenAlertMsg {
    font: 500 0.8125rem/1.45 "Segoe UI", sans-serif;
    color: #424242;
    max-height: 46vh;
    overflow: auto;
    white-space: pre-wrap;
}

.heigen-alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Confirm dialog (heigenConfirm): two distinct buttons, no overlap */
.heigen-confirm-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.heigen-confirm-msg {
    font: 500 0.8125rem/1.45 "Segoe UI", sans-serif;
    color: #424242;
    max-height: 46vh;
    overflow: auto;
    white-space: pre-wrap;
}

.heigen-confirm-btn {
    flex: 0 0 auto;
    min-width: 88px;
    height: 36px;
    padding: 0 18px;
    border-radius: var(--heigen-radius-pill);
    font: 600 0.75rem "Segoe UI", sans-serif;
    cursor: pointer;
    transition: filter var(--heigen-transition), transform var(--heigen-transition),
        background 0.15s ease, border-color 0.15s ease;
}

.heigen-confirm-btn:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 2px;
}

.heigen-confirm-cancel {
    border: 1px solid rgba(22, 81, 102, 0.35);
    background: #f4f8f9;
    color: #2d4a52;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.heigen-confirm-cancel:hover {
    background: #e8f0f2;
    border-color: rgba(22, 81, 102, 0.5);
}

.heigen-confirm-ok.heigen-confirm-safe {
    border: none;
    background: linear-gradient(180deg, #1e6f86 0%, var(--heigen-teal) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(22, 81, 102, 0.28);
}

.heigen-confirm-ok.heigen-confirm-safe:hover {
    filter: brightness(1.06);
}

.heigen-confirm-ok.heigen-confirm-danger {
    border: none;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35);
}

.heigen-confirm-ok.heigen-confirm-danger:hover {
    filter: brightness(1.05);
}

.heigen-confirm-ok:active {
    transform: translateY(1px);
}

#heigenAlertOk {
    height: 36px;
    padding: 0 20px;
    border: none;
    border-radius: var(--heigen-radius-pill);
    background: linear-gradient(180deg, #1e6f86 0%, var(--heigen-teal) 100%);
    color: #fff;
    font: 700 0.75rem "Segoe UI", sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(22, 81, 102, 0.3);
    transition: filter var(--heigen-transition), transform var(--heigen-transition);
}

#heigenAlertOk:hover {
    filter: brightness(1.06);
}

#heigenAlertOk:active {
    transform: translateY(1px);
}

#heigenAlertOk:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 3px;
}

/* ── Staff UI kit (shared across staff_admin pages) ── */

.staff-eyebrow {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(61, 90, 99, 0.78);
}

.staff-page-lead {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--heigen-slate);
    max-width: 42rem;
}

.staff-toolbar-surface {
    border-radius: var(--heigen-radius-lg);
    background: var(--heigen-toolbar-surface-bg);
    border: 1px solid var(--heigen-border-ui);
    box-shadow: var(--heigen-shadow-surface);
    padding: 0.875rem 1rem;
}

@media (min-width: 640px) {
    .staff-toolbar-surface {
        padding: 1rem 1.25rem;
    }
}

.staff-card {
    background: #fff;
    border-radius: var(--heigen-radius);
    border: 1px solid var(--heigen-border-ui);
    box-shadow: var(--heigen-shadow-surface);
}

.staff-create-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 224px;
    border-radius: var(--heigen-radius);
    border: 2px dashed rgba(22, 81, 102, 0.2);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-family: inherit;
    transition:
        border-color var(--heigen-transition),
        background var(--heigen-transition),
        box-shadow var(--heigen-transition),
        transform 0.15s ease;
}

.staff-create-tile:hover {
    border-color: rgba(22, 81, 102, 0.38);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 24px rgba(22, 81, 102, 0.08);
}

.staff-create-tile:active {
    transform: scale(0.992);
}

/* Shorter dashed tile (e.g. package-list “New add-on”) */
.staff-create-tile--compact {
    min-height: 160px;
}

.staff-create-tile__label {
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--heigen-teal);
}

.staff-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0 1.35rem;
    border: none;
    border-radius: var(--heigen-radius-pill);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(
        180deg,
        var(--heigen-btn-primary-grad-top) 0%,
        var(--heigen-btn-primary-grad-bottom) 100%
    );
    color: var(--heigen-btn-primary-fg);
    box-shadow: var(--heigen-btn-primary-shadow);
    transition: filter var(--heigen-transition), box-shadow var(--heigen-transition), transform 0.15s ease;
}

.staff-btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: var(--heigen-btn-primary-shadow-hover);
}

.staff-btn-primary:active {
    transform: translateY(1px);
}

.staff-btn-primary:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 3px;
}

.staff-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 1.25rem;
    border-radius: var(--heigen-radius-pill);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--heigen-teal);
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--heigen-btn-outline-border);
    box-shadow: 0 1px 3px rgba(22, 81, 102, 0.08);
    transition:
        background var(--heigen-transition),
        border-color var(--heigen-transition),
        transform 0.15s ease;
}

.staff-btn-secondary:hover {
    background: var(--heigen-btn-secondary-hover-bg);
    border-color: var(--heigen-btn-outline-border-hover);
}

.staff-btn-secondary:active {
    transform: translateY(1px);
}

.staff-btn-secondary:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 2px;
}

.staff-btn-muted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 1rem;
    border-radius: var(--heigen-radius-pill);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--heigen-slate);
    cursor: pointer;
    background: var(--heigen-field-bg);
    border: 1px solid var(--heigen-btn-neutral-border);
    box-shadow: 0 1px 2px rgba(31, 35, 40, 0.05);
    transition:
        background var(--heigen-transition),
        border-color var(--heigen-transition);
}

.staff-btn-muted:hover {
    background: var(--heigen-btn-neutral-hover-bg);
}

.staff-btn-muted:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 2px;
}

.staff-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: var(--heigen-radius-sm);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--heigen-teal);
    background: transparent;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--heigen-transition), background var(--heigen-transition);
}

.staff-btn-ghost:hover {
    color: var(--heigen-teal-dark);
    background: rgba(22, 81, 102, 0.06);
}

.staff-btn-ghost:focus-visible {
    outline: 2px solid var(--heigen-teal);
    outline-offset: 2px;
}

.staff-input,
input.heigen-field,
select.heigen-field,
textarea.heigen-field {
    width: 100%;
    border: 1px solid var(--heigen-field-border);
    border-radius: var(--heigen-radius-sm);
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--heigen-field-fg);
    background: var(--heigen-field-bg);
    box-shadow: var(--heigen-field-shadow-inset);
    transition: border-color var(--heigen-transition), box-shadow var(--heigen-transition);
}

.staff-input::placeholder,
.heigen-field::placeholder {
    color: var(--heigen-field-placeholder);
}

.staff-input:hover,
.heigen-field:hover {
    border-color: var(--heigen-field-border-hover);
}

.staff-input:focus,
.heigen-field:focus {
    outline: none;
    border-color: var(--heigen-field-border-focus);
    box-shadow: var(--heigen-field-ring), var(--heigen-field-shadow-inset);
}

.staff-section-title {
    margin: 0 0 1rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--heigen-slate-deep);
}

.staff-loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4.5rem 1.5rem;
    border-radius: var(--heigen-radius-lg);
    border: 1px dashed var(--heigen-field-border);
    background: var(--heigen-toolbar-surface-bg);
}

.staff-modal-overlay {
    background: rgba(15, 40, 48, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (prefers-reduced-motion: reduce) {
    .staff-create-tile,
    .staff-btn-primary,
    .staff-btn-secondary,
    .staff-btn-muted,
    .staff-btn-ghost {
        transition: none;
    }

    .staff-create-tile:active,
    .staff-btn-primary:active,
    .staff-btn-secondary:active {
        transform: none;
    }
}

/* ── Send Coupon to Customers modal ── */
.send-step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--heigen-brand, #165166);
}
.send-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--heigen-radius-pill);
    background: var(--heigen-brand, #165166);
    color: #fff;
    font-size: 0.6875rem;
}
.send-field-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--heigen-slate);
}
.send-link-btn {
    padding: 3px 10px;
    border-radius: var(--heigen-radius-pill);
    border: 1px solid #c9d7dc;
    color: var(--heigen-brand, #165166);
    font-weight: 700;
    font-size: 0.6875rem;
    background: #fff;
}
.send-link-btn:hover {
    background: #f0f6f8;
}
.send-coupon-code-chip {
    padding: 4px 10px;
    border-radius: var(--heigen-radius-sm);
    border: 1px dashed var(--heigen-brand, #165166);
    background: #f0f6f8;
    color: var(--heigen-brand, #165166);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.send-customer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eef2f4;
}
.send-customer-row:last-child {
    border-bottom: 0;
}
.send-customer-row:hover {
    background: #f7fafb;
}
.send-customer-row.is-selected {
    background: #eaf3f6;
}
.send-customer-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #424242;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.send-customer-email {
    display: block;
    font-size: 0.6875rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.send-pill {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: var(--heigen-radius-pill);
    background: #eef2f4;
    color: #5f6e79;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.send-pill--likely {
    background: #dcfce7;
    color: #166534;
}
.send-pill--risk {
    background: #fef3c7;
    color: #92400e;
}
