/* Perfect Consign Web - minimal styles */

:root {
    --color-bg: #f5f5f5;
    --color-surface: #fff;
    --color-border: #ddd;
    --color-text: #222;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-error: #b91c1c;
    /* Dashboard card accents (charts and borders) */
    --dashboard-sales-today: #2563eb;
    --dashboard-sales-week: #0d9488;
    --dashboard-sales-month: #0369a1;
    --dashboard-inventory: #d97706;
    --dashboard-consignors: #7c3aed;
    --dashboard-booth: #059669;
    /* Header strip: onboarding, clock, change password, logout (overridden in theme-retail + palettes) */
    --header-strip-link: var(--color-primary);
    --header-strip-link-hover: var(--color-primary-hover);
    /* Registers hub: fixed tile column width (flex row grows with register count) */
    --register-tile-column-width: 9.5rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > .app-shell-wrap {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    max-width: none;
    margin: 0;
    padding: 0.5rem clamp(0.35rem, 1.25vw, 0.65rem) 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
}

.header-top {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    width: 100%;
}

.header-top.header-top--authed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.header-top__left {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    min-width: 0;
}

.header-top__left .header-brand-group {
    margin-right: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.header-top__center {
    justify-self: center;
    text-align: center;
    min-width: 0;
}

.header-store-clock {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--header-strip-link);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(22rem, 88vw);
}

.header-top__right.user-menu {
    margin-left: 0;
    justify-self: end;
    justify-content: flex-end;
}

.header-brand-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    min-width: 0;
    flex: 0 1 auto;
    margin-right: auto;
}

.brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text);
    line-height: 1.25;
}

.header-onboarding {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--header-strip-link);
    white-space: nowrap;
}

.header-onboarding:hover {
    color: var(--header-strip-link-hover);
    text-decoration: underline;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    padding-top: 0.15rem;
    border-top: 1px solid var(--color-border);
}

.main-nav a {
    color: var(--color-primary);
    text-decoration: none;
}

.main-nav a:hover {
    text-decoration: underline;
}

.user-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem 0.75rem;
    justify-content: flex-end;
    text-align: right;
    min-width: 0;
    flex: 0 0 auto;
    margin-left: 0.75rem;
}

.tenant-name {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.user-email {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(14rem, 28vw);
}

.user-role {
    font-size: 0.85rem;
    color: #5a5a5a;
    white-space: nowrap;
    max-width: min(10rem, 22vw);
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu a {
    color: var(--header-strip-link);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-menu a:hover {
    color: var(--header-strip-link-hover);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .header-top:not(.header-top--authed) {
        flex-wrap: wrap;
    }

    .header-top.header-top--authed {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .header-top--authed .header-top__left {
        flex-wrap: wrap;
        width: 100%;
        order: 1;
    }

    .header-top--authed .header-top__center {
        order: 2;
        text-align: center;
        width: 100%;
    }

    .header-top--authed .header-store-clock {
        max-width: 100%;
    }

    .header-top--authed .header-top__right.user-menu {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        row-gap: 0.5rem;
        text-align: left;
    }

    .header-brand-group {
        margin-right: 0;
        flex: 1 1 auto;
    }

    .user-menu {
        flex-basis: 100%;
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
        row-gap: 0.5rem;
        text-align: left;
    }

    .user-menu .tenant-name,
    .user-menu .user-email,
    .user-menu .user-role {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }

    .user-menu a,
    .user-menu .logout {
        min-height: 2.75rem;
        padding: 0.35rem 0.5rem;
        display: inline-flex;
        align-items: center;
        box-sizing: border-box;
    }

    form.logout-form button.logout {
        padding: 0.35rem 0.5rem;
    }
}

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

form.logout-form button.logout {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.logout {
    color: var(--header-strip-link);
    text-decoration: none;
}

.logout:hover {
    color: var(--header-strip-link-hover);
    text-decoration: underline;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #666;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.login-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 360px;
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Deprecated: use .storefront-alert--danger (kept for rare legacy markup) */
.login-error {
    color: var(--color-error);
    margin-bottom: 1rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
}

/* Password field + show/hide toggle (signup, change password, etc.) */
.password-field {
    position: relative;
    width: 100%;
}

.login-form .password-field {
    max-width: none;
}

.item-form .password-field {
    max-width: 24rem;
}

.password-field > input {
    padding-right: 2.75rem;
}

.password-field__toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #555;
    cursor: pointer;
    line-height: 0;
}

.password-field__toggle:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.06);
}

.password-field__toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.password-field__icon--hide {
    display: none;
}

.password-field--visible .password-field__icon--show {
    display: none;
}

.password-field--visible .password-field__icon--hide {
    display: block;
}

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

/* Buttons — primary filled; secondary outlined (theme primary) for visibility on pale backgrounds */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: color-mix(in srgb, var(--color-primary) 14%, var(--color-surface));
    color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: var(--color-error);
    color: #fff;
    border: 2px solid var(--color-error);
}

.btn-danger:hover {
    background: #991b1b;
    border-color: #991b1b;
    color: #fff;
}

.btn-danger:focus-visible {
    outline-color: var(--color-error);
}

/* Reference data list rows: Edit + Delete on one line */
.table-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.table-row-actions .inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-icon {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.btn-icon svg {
    display: block;
}

/* Dashboard */
.dashboard {
    max-width: 1000px;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

.dashboard-date {
    margin: 0;
    font-size: 0.9375rem;
    color: #666;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.onboarding-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.onboarding-step.card summary {
    cursor: pointer;
    list-style-position: outside;
    padding: 0;
    user-select: none;
}

.onboarding-step.card summary h2 {
    margin: 0;
    display: inline;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

.onboarding-step.card > summary + * {
    margin-top: 0.75rem;
}

.onboarding-step.card[open] {
    border-color: var(--color-primary, #2563eb);
}

.onboarding-step__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: var(--color-border);
}

.dashboard-card--sales-today {
    border-left-color: var(--dashboard-sales-today);
}

.dashboard-card--sales-week {
    border-left-color: var(--dashboard-sales-week);
}

.dashboard-card--sales-month {
    border-left-color: var(--dashboard-sales-month);
}

.dashboard-card--inventory {
    border-left-color: var(--dashboard-inventory);
}

.dashboard-card--consignors {
    border-left-color: var(--dashboard-consignors);
}

.dashboard-card--booth {
    border-left-color: var(--dashboard-booth);
}

.dashboard-card--full {
    grid-column: 1 / -1;
}

.dashboard-card-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.dashboard-card-row .dashboard-card {
    margin: 0;
}

.dashboard-card-row--metrics-secondary .dashboard-card {
    flex: 1 1 0;
    min-width: 0;
}

.dashboard-card--owed {
    border-left-color: var(--color-primary);
    flex: 1 1 auto;
}

.dashboard-card-row .dashboard-card--booth {
    flex: 0 0 240px;
}

.dashboard-card h2 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dashboard-card h2 a {
    color: #555;
    text-decoration: none;
}

.dashboard-card h2 a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.dashboard-card-chart {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.dashboard-card--sales-today .dashboard-card-bar {
    background: var(--dashboard-sales-today);
}

.dashboard-card--sales-week .dashboard-card-bar {
    background: var(--dashboard-sales-week);
}

.dashboard-card--sales-month .dashboard-card-bar {
    background: var(--dashboard-sales-month);
}

.dashboard-card--inventory .dashboard-card-bar {
    background: var(--dashboard-inventory);
}

.dashboard-card--consignors .dashboard-card-bar {
    background: var(--dashboard-consignors);
}

.dashboard-card-bar {
    height: 100%;
    border-radius: 3px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.dashboard-metric-value {
    margin: 0;
    font-size: 0.9375rem;
    color: #555;
}

.dashboard-metric-sales-link,
.dashboard-metric-value-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.dashboard-metric-sales-link:hover,
.dashboard-metric-value-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.dashboard-metric-sales-link:focus-visible,
.dashboard-metric-value-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.dashboard-metric-amount {
    margin: 0.35rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

/* People hub (touch-friendly tiles) */
.people-hub {
    max-width: 720px;
}

.people-hub__header {
    margin-bottom: 1.5rem;
}

.people-hub__header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

.people-hub__intro {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    color: #555;
    max-width: 40rem;
}

.people-hub__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 520px) {
    .people-hub__grid {
        grid-template-columns: 1fr;
    }
}

.people-hub__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 9.5rem;
    padding: 1.35rem 1.25rem;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.people-hub__tile:hover {
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
}

.people-hub__tile:active {
    transform: scale(0.98);
}

.people-hub__tile:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
    outline-offset: 3px;
}

.people-hub__tile--consignors {
    border-left: 5px solid var(--dashboard-consignors, #7c3aed);
}

.people-hub__tile--customers {
    border-left: 5px solid var(--dashboard-sales-today, #2563eb);
}

.people-hub__tile--booths {
    border-left: 5px solid var(--dashboard-inventory, #d97706);
}

.people-hub__tile--booth-rent {
    border-left: 5px solid var(--dashboard-booth, #059669);
}

.people-hub__tile--booth-map {
    border-left: 5px solid var(--dashboard-booth, #059669);
}

.people-hub__tile--booth-map-edit {
    border-left: 5px solid #0d9488;
}

.people-hub__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    color: var(--color-primary);
}

.people-hub__tile--consignors .people-hub__icon {
    color: var(--dashboard-consignors, #7c3aed);
}

.people-hub__tile--customers .people-hub__icon {
    color: var(--dashboard-sales-today, #2563eb);
}

.people-hub__tile--booths .people-hub__icon {
    color: var(--dashboard-inventory, #d97706);
}

.people-hub__tile--booth-rent .people-hub__icon {
    color: var(--dashboard-booth, #059669);
}

.people-hub__tile--booth-map .people-hub__icon {
    color: var(--dashboard-booth, #059669);
}

.people-hub__tile--booth-map-edit .people-hub__icon {
    color: #0d9488;
}

.people-hub__label {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.people-hub__hint {
    font-size: 0.9rem;
    line-height: 1.35;
    color: #64748b;
    max-width: 14rem;
}

.dashboard-quicklinks {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-quicklinks h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.dashboard-quicklinks-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.75rem;
}

.dashboard-quicklinks-list li {
    margin: 0;
}

/* Keep tile size consistent when the grid has few items (e.g. analytics hub). */
.dashboard-quicklinks-list--fixed-tiles {
    grid-template-columns: repeat(auto-fill, minmax(145px, 11rem));
}

.dashboard-quicklink {
    --tile-border: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 110px;
    aspect-ratio: 4 / 3;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--tile-border);
    background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface));
    color: var(--color-primary);
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dashboard-quicklink:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.dashboard-quicklink:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.dashboard-quicklink-icon {
    display: inline-flex;
    width: 1.8rem;
    height: 1.8rem;
    align-items: center;
    justify-content: center;
}

.dashboard-quicklink-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-quicklink-label {
    font-size: 0.93rem;
}

@media (max-width: 700px) {
    .dashboard-quicklinks-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-quicklinks-list--fixed-tiles {
        grid-template-columns: repeat(auto-fill, minmax(145px, 11rem));
    }

    .dashboard-quicklink {
        aspect-ratio: auto;
        min-height: 94px;
    }
}

@media (max-width: 900px) {
    .dashboard-card-row {
        flex-direction: column;
    }

    .dashboard-card--owed {
        flex: 1 1 auto;
    }
}

/* Legacy .card and .metric-* for other pages (e.g. onboarding) */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.card h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

.metric-value {
    margin: 0;
    font-size: 1.25rem;
}

.metric-amount {
    margin: 0.25rem 0 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tables */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    max-width: 100%;
}

.search-form__label {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.search-form__clear {
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 1rem;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
    align-self: center;
}

.search-form__clear:hover {
    color: var(--color-primary-hover);
}

.search-form input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    min-width: 0;
}

@media (max-width: 520px) {
    .search-form input[type='text'],
    .search-form input[type='search'],
    .search-form input:not([type]) {
        flex: 1 1 100%;
        width: 100%;
    }
}

.table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-bg);
    font-weight: 600;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--color-border);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    padding-right: 1.5rem;
}

.data-table th.sortable:hover {
    background: #e8e8e8;
}

.data-table th.sortable::after {
    content: '\2195';
    opacity: 0.4;
    margin-left: 0.25rem;
    font-size: 0.85em;
}

.data-table th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.data-table th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

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

.data-table tbody tr:hover {
    background: #fafafa;
}

/* Inline POST actions in row (e.g. Reactivate) — match plain <a> Edit/Delete */
.data-table .table-action-link {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.data-table .table-action-link:hover {
    color: var(--color-primary-hover);
}

.pill {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 9999px;
    font-size: 0.875em;
    font-weight: 500;
}

.pill-available {
    background: #dcfce7;
    color: #166534;
}

.pill-rented,
a.pill-rented {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: underline;
}

a.pill-rented:hover {
    background: #fecaca;
    color: #7f1d1d;
    text-decoration: underline;
}

.pill-move-out,
a.pill-move-out {
    background: #fef3c7;
    color: #b45309;
    text-decoration: underline;
}

a.pill-move-out:hover {
    background: #fde68a;
    color: #92400e;
}

.pill-incoming,
a.pill-incoming {
    background: #dbeafe;
    color: #1d4ed8;
    text-decoration: underline;
}

a.pill-incoming:hover {
    background: #bfdbfe;
    color: #1e40af;
}

/* Table-scoped pills so status colors win over link/cell overrides */
.data-table .pill {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 9999px;
    font-size: 0.875em;
    font-weight: 500;
}

.data-table .pill-available {
    background: #dcfce7;
    color: #166534;
}

.data-table .pill-rented,
.data-table a.pill-rented {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: underline;
}

.data-table a.pill-rented:hover {
    background: #fecaca;
    color: #7f1d1d;
    text-decoration: underline;
}

.data-table .pill-move-out,
.data-table a.pill-move-out {
    background: #fef3c7;
    color: #b45309;
    text-decoration: underline;
}

.data-table a.pill-move-out:hover {
    background: #fde68a;
    color: #92400e;
}

.data-table .pill-incoming,
.data-table a.pill-incoming {
    background: #dbeafe;
    color: #1d4ed8;
    text-decoration: underline;
}

.data-table a.pill-incoming:hover {
    background: #bfdbfe;
    color: #1e40af;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-error {
    color: var(--color-error);
    margin-bottom: 1rem;
}

.system-alerts {
    margin-bottom: 1rem;
}

.system-alerts .storefront-alert:last-child {
    margin-bottom: 0;
}

.storefront-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    line-height: 1.45;
}

.storefront-alert__icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.1rem;
    line-height: 0;
}

.storefront-alert__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.storefront-alert__icon--success {
    color: #16a34a;
}

.storefront-alert__icon--danger {
    color: #dc2626;
}

.storefront-alert__icon--warning {
    color: #ca8a04;
}

.storefront-alert__body {
    flex: 1;
    min-width: 0;
}

.storefront-alert--success {
    color: #14532d;
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left: 4px solid #16a34a;
}

.storefront-alert--danger {
    color: #7f1d1d;
    background: #fef2f2;
    border-color: #fecaca;
    border-left: 4px solid var(--color-error, #b91c1c);
}

.storefront-alert--warning {
    color: #713f12;
    background: #fffbeb;
    border-color: #fde68a;
    border-left: 4px solid #ca8a04;
}

.payouts-statement-dirty-hint[hidden] {
    display: none !important;
}

.payouts-active-filters {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.payouts-active-filters__text {
    margin: 0;
}

.form-success {
    color: #0d9488;
    margin-bottom: 1rem;
}

.form-hint {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.required {
    color: var(--color-error);
}

.item-form .form-group {
    margin-bottom: 1rem;
}

/* Settings: slider-style toggle (checkbox) */
.form-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 24rem;
}

.form-switch-label {
    font-weight: 500;
}

.form-switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.form-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.form-switch__track {
    display: block;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.15s ease;
    position: relative;
}

.form-switch__track::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

.form-switch input:checked + .form-switch__track {
    background: var(--color-primary);
}

.form-switch input:checked + .form-switch__track::after {
    transform: translateX(1.2rem);
}

.form-switch input:focus-visible + .form-switch__track {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.form-switch input:disabled + .form-switch__track {
    opacity: 0.45;
    cursor: not-allowed;
}

.form-switch--compact .form-switch__track {
    width: 2.5rem;
    height: 1.35rem;
}

.form-switch--compact .form-switch__track::after {
    width: 1.05rem;
    height: 1.05rem;
}

.form-switch--compact input:checked + .form-switch__track::after {
    transform: translateX(1.1rem);
}

.item-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.item-form input,
.item-form select,
.item-form textarea {
    width: 100%;
    max-width: 24rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
}

.item-form input[type="checkbox"] {
    width: auto;
    max-width: none;
    margin: 0;
}

.item-form input[type="radio"] {
    width: auto;
    max-width: none;
    margin: 0;
    flex-shrink: 0;
}

/* Checkbox rows: keep checkbox and label text on one line, left-aligned */
.item-form .form-group:has(input[type="checkbox"]) label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
    font-weight: 500;
    cursor: pointer;
}

/* Radio rows: same as checkbox — input default width:100% would push label text */
.item-form .form-group:has(input[type="radio"]) label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
    font-weight: 500;
    cursor: pointer;
}

.item-form .form-group:has(input[type="checkbox"]) .form-hint {
    margin-top: 0.25rem;
    margin-left: 0;
}

.item-form textarea {
    min-height: 4rem;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 8rem;
}

/* Payouts: statement filter grid — dates | dates, scope | minimum, Apply under scope */
.payouts-statement-card {
    max-width: 40rem;
}

/* Payouts two-column layout: let statement block use full left column (see consignor-booth-split) */
.consignor-booth-split .payouts-statement-card {
    max-width: none;
}

.payouts-statement-blank-dates-hint {
    margin-top: 0.35rem;
}

.payouts-statement-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    align-items: end;
    margin-bottom: 0.75rem;
}

.payouts-statement-form .form-group {
    min-width: 0;
}

.payouts-statement-form .form-group label {
    display: block;
}

.payouts-statement-apply {
    grid-column: 1;
    align-self: start;
    margin-top: 0.15rem;
}

.payouts-statement-apply .btn {
    width: 100%;
}

/* Booth rent due from consignor's pocket (separate collection, or not covered by commission balance) */
.payouts-page .amount-owing-store {
    color: #b91c1c;
    font-weight: 600;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Consignor / customer add/edit: two columns on wide screens, full-width fields in column, tighter hints */
.item-form--consignor .form-group,
.item-form--customer .form-group {
    margin-bottom: 0.5rem;
}

.item-form--consignor .form-hint,
.item-form--customer .form-hint {
    margin-bottom: 0.35rem;
}

.item-form--consignor input,
.item-form--consignor select,
.item-form--consignor textarea,
.item-form--customer input,
.item-form--customer select,
.item-form--customer textarea {
    max-width: none;
}

.item-form--consignor .form-actions,
.item-form--customer .form-actions {
    margin-top: 1rem;
}

/* Wide storefront forms: header + body share one column (aligns page-header with cards) */
.storefront-form-page {
    width: 100%;
    max-width: 72rem;
    margin-inline: auto;
}

.item-form--consignor.consignor-form {
    width: 100%;
}

input[type="number"].input-no-spinners {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"].input-no-spinners::-webkit-outer-spin-button,
input[type="number"].input-no-spinners::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.consignor-form__pre-cards-hint {
    margin-bottom: 0.75rem;
}

.consignor-form-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.consignor-form-layout__main,
.consignor-form-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.consignor-form-layout__actions {
    min-width: 0;
}

.consignor-form-layout__actions .form-actions {
    margin-top: 0;
}

.item-form--consignor.consignor-form .consignor-form__card .form-group:last-child {
    margin-bottom: 0;
}

@media (min-width: 52rem) {
    .consignor-form-layout {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 1rem 1.25rem;
        align-items: start;
    }

    .consignor-form-layout__main,
    .consignor-form-layout__aside {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .consignor-form-layout__actions {
        grid-column: 1 / -1;
    }
}

/* Intake add/edit item: inner cards on page bg, 2:1 columns at wide widths (mobile-first) */
.intake-consignor-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.intake-consignor-banner__text {
    margin: 0;
}

.intake-consignor-banner__change {
    flex-shrink: 0;
}

.item-form.intake-item-form {
    width: 100%;
}

.intake-item-form-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.intake-item-form-layout__main,
.intake-item-form-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.intake-item-form-layout__actions {
    min-width: 0;
}

.intake-item-form-layout__actions .form-actions {
    margin-top: 0;
}

.intake-item-form__autocomplete-wrap {
    position: relative;
    max-width: 100%;
}

.item-form.intake-item-form input,
.item-form.intake-item-form select,
.item-form.intake-item-form textarea {
    max-width: none;
}

.item-form.intake-item-form .intake-item-form__card .form-group:last-child {
    margin-bottom: 0;
}

@media (min-width: 52rem) {
    .intake-item-form-layout {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 1rem 1.25rem;
        align-items: start;
    }

    .intake-item-form-layout__main,
    .intake-item-form-layout__aside {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .intake-item-form-layout__actions {
        grid-column: 1 / -1;
    }
}

/* Storefront settings-style forms: stacked cards; optional 2-col at wide widths */
.storefront-form__back {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.item-form.storefront-settings-form {
    width: 100%;
}

.storefront-form-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.storefront-form-layout__main,
.storefront-form-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.storefront-form-layout__actions {
    min-width: 0;
}

.storefront-form-layout__actions .form-actions {
    margin-top: 0;
}

.item-form.storefront-settings-form .storefront-form__card .form-group:last-child {
    margin-bottom: 0;
}

.item-form.storefront-settings-form input,
.item-form.storefront-settings-form select,
.item-form.storefront-settings-form textarea {
    max-width: none;
}

.preferences-subsection-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.35rem;
}

.preferences-subsection-heading:first-of-type {
    margin-top: 0.75rem;
}

.preferences-subsection-hint {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.preferences-items-list-cols {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.preferences-items-list-col {
    margin-bottom: 0;
}

.preferences-items-list-col__label--blocked {
    color: var(--color-muted, #6b7280);
}

.preferences-items-list-col__hint {
    margin: 0.15rem 0 0 1.5rem;
}

@media (min-width: 52rem) {
    .storefront-form-layout--two-col {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 1rem 1.25rem;
        align-items: start;
    }

    .storefront-form-layout--two-col > .storefront-form-layout__main,
    .storefront-form-layout--two-col > .storefront-form-layout__aside {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .storefront-form-layout--two-col > .storefront-form-layout__actions {
        grid-column: 1 / -1;
    }
}

.automarkdown-tier-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.automarkdown-tier-row .form-group {
    margin-bottom: 0;
}

.automarkdown-tier-row .automarkdown-remove {
    margin-bottom: 0.35rem;
}

.automarkdown-tier-row__input-narrow {
    width: 6rem;
    max-width: 100%;
}

/* Add customer: keep type selector compact (two short options) */
.item-form--customer select#kind {
    max-width: min(100%, 14rem);
    width: 100%;
}

.item-form--customer.customer-form {
    width: 100%;
}

.customer-form-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.customer-form-layout__main,
.customer-form-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.customer-form-layout__actions {
    min-width: 0;
}

.customer-form-layout__actions .form-actions {
    margin-top: 0;
}

.item-form--customer.customer-form .customer-form__card .form-group:last-child {
    margin-bottom: 0;
}

@media (min-width: 52rem) {
    .customer-form-layout {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 1rem 1.25rem;
        align-items: start;
    }

    .customer-form-layout__main,
    .customer-form-layout__aside {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .customer-form-layout__actions {
        grid-column: 1 / -1;
    }
}

.autocomplete-suggestions {
    position: absolute;
    z-index: 100;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    max-height: 12rem;
    overflow-y: auto;
    margin-top: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background: var(--color-bg);
}

#items-consignor-suggestions li.is-active {
    background: #f0f0f0;
}

#brand-autocomplete-wrap,
#color-autocomplete-wrap,
#department-autocomplete-wrap,
#category-autocomplete-wrap {
    position: relative;
}

.form-hint--ref-field {
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
    color: #555;
    line-height: 1.35;
}

.ref-data-create-panel {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #f8fafc;
    max-width: 24rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ref-data-create-panel__title {
    margin: 0 0 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

.ref-data-create-panel__desc {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.4;
}

.ref-data-create-panel__btn {
    width: 100%;
    max-width: 18rem;
    justify-content: center;
}

#ii-cat-wrap,
#ii-brand-wrap,
#ii-color-wrap,
#ii-dept-wrap {
    position: relative;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* POS */
.pos-page h1 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.pos-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .pos-grid {
        grid-template-columns: 1fr;
    }
}

/* Consignor detail: booth rental — forced 50/50 split + obvious vertical bar */
.consignor-detail-page {
    width: 100%;
    max-width: 100%;
}

/* Fixed-width cards (28rem) in one or two columns — tracks cap width so cards are not stretched */
.consignor-detail-page__cards {
    display: grid;
    grid-template-columns: minmax(0, 28rem);
    gap: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    justify-content: start;
    align-items: start;
}

@media (min-width: 52rem) {
    .consignor-detail-page__cards {
        grid-template-columns: repeat(2, minmax(0, 28rem));
    }
}

.consignor-detail-page__cards > .consignor-detail-page__card {
    margin-bottom: 0;
    max-width: 28rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.consignor-detail-page__card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.consignor-detail-dl {
    margin: 0;
}

.consignor-detail-dl__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem 0;
    margin-bottom: 0.65rem;
}

.consignor-detail-dl__row:last-child {
    margin-bottom: 0;
}

.consignor-detail-dl dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted, #555);
    margin: 0;
}

.consignor-detail-dl dd {
    margin: 0;
    font-size: 0.9375rem;
}

@media (min-width: 30rem) {
    .consignor-detail-dl__row {
        grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
        gap: 0.35rem 1rem;
        align-items: baseline;
    }
}

.consignor-detail-page__notes {
    margin-bottom: 1.5rem;
    max-width: 56rem;
}

.consignor-detail-page__notes h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.consignor-detail-notes__body {
    font-size: 0.9375rem;
    line-height: 1.45;
}

.consignor-booth-rent-alert {
    max-width: none;
    width: 100%;
}

.consignor-booth-split {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin-top: 0.75rem;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface);
}

.consignor-booth-split .card {
    max-width: none;
}

.consignor-booth-split__col--left {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 1rem 0.75rem 1rem 1rem;
    background: var(--color-bg);
}

.consignor-booth-split__col--right {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 1rem 1rem 1rem 0.75rem;
    background: var(--color-bg);
}

.consignor-booth-split__divider {
    flex: 0 0 6px;
    width: 6px;
    min-width: 6px;
    align-self: stretch;
    box-sizing: border-box;
    background: #4b5563;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.consignor-booth-split__heading {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
}

@media (max-width: 768px) {
    .consignor-booth-split {
        flex-direction: column;
        flex-wrap: wrap;
    }

    .consignor-booth-split__col--left {
        flex: none;
        width: 100%;
        padding: 1rem;
    }

    .consignor-booth-split__divider {
        flex: none;
        width: 100%;
        min-width: 0;
        height: 6px;
    }

    .consignor-booth-split__col--right {
        flex: none;
        width: 100%;
        padding: 1rem;
    }
}

.pos-left h2,
.pos-right h2 {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.pos-left h2:first-of-type,
.pos-right h2:first-of-type {
    margin-top: 0;
}

.pos-add-form {
    margin-bottom: 0.35rem;
}

.pos-cart-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0.35rem 0 0.75rem;
    max-width: 100%;
    overflow-x: auto;
}

.pos-cart-toolbar__form {
    display: flex;
    flex: 0 0 auto;
    margin: 0;
    align-items: center;
}

.pos-cart-toolbar .btn {
    flex: 0 0 auto;
}

.pos-checkout-form .form-group {
    margin-bottom: 0.75rem;
}

/* Register cash denomination grid (open/close) — Cash (bills) + Coins cards, steppers */
:root {
    --cash-denom-header-bg: #2e7d32;
    --cash-denom-plus-bg: #43a047;
    --cash-denom-plus-hover: #388e3c;
    --cash-denom-minus-bg: #ffebee;
    --cash-denom-minus-border: #e57373;
    --cash-denom-minus-hover: #ffcdd2;
    --cash-denom-subtotal: #2e7d32;
    --cash-denom-label-bg: #eceff1;
    --register-close-stack-max-width: 52rem;
}

/* Align retail sales hero with left column width (cash/coin + expected stacks) above the two-column block */
.register-close-preview-layout {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .register-close-preview-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1rem;
        align-items: start;
    }

    .register-close-preview-layout__sales {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .register-close-preview-layout .register-close-main-columns {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

.register-close-preview-layout__sales {
    min-width: 0;
    width: 100%;
}

/* Close register: denomination + expected reference (left/first) vs worksheet + submit (right/second); stack on narrow */
.register-close-main-columns {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
}

.register-close-main-columns__expected,
.register-close-main-columns__workflow {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .register-close-main-columns {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* Shared max width: close-register preview card, worksheet (matches cash/coin grid cap) */
.register-close-stack {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--register-close-stack-max-width);
}

.register-close-main-columns__expected > .register-close-denom-anchor .cash-denom-grid {
    margin-top: 0;
}

.cash-denom-grid {
    margin-top: 0.75rem;
    padding: 1rem;
    max-width: var(--register-close-stack-max-width, 52rem);
}

.cash-denom-grid__hint {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.cash-denom-grid__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

.cash-denom-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface);
    min-width: 0;
}

.cash-denom-card__header {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: var(--cash-denom-header-bg);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

.cash-denom-card__body {
    padding: 0.5rem 0.65rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cash-denom-row {
    display: grid;
    grid-template-columns: minmax(3.25rem, auto) auto 1fr auto minmax(4.5rem, 1fr);
    align-items: center;
    gap: 0.35rem 0.4rem;
}

.cash-denom-row__label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0 0.35rem;
    background: var(--cash-denom-label-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text);
}

.cash-denom-row__btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 4px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.cash-denom-row__btn--minus {
    background: var(--cash-denom-minus-bg);
    border: 1px solid var(--cash-denom-minus-border);
    color: #b71c1c;
}

.cash-denom-row__btn--minus:hover {
    background: var(--cash-denom-minus-hover);
}

.cash-denom-row__btn--plus {
    background: var(--cash-denom-plus-bg);
    border: 1px solid var(--cash-denom-plus-hover);
    color: #fff;
}

.cash-denom-row__btn--plus:hover {
    background: var(--cash-denom-plus-hover);
}

.cash-denom-row__input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0.4rem 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.95rem;
    text-align: center;
}

.cash-denom-row__subtotal {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cash-denom-subtotal);
    text-align: right;
    white-space: nowrap;
}

.cash-denom-grid__total-line {
    margin: 0.85rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
}

.cash-denom-grid__total-with-actions {
    margin: 0.85rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
}

.cash-denom-grid__total-with-actions .cash-denom-grid__total-line {
    margin: 0;
    padding-top: 0;
    border-top: 0;
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
}

.cash-denom-grid__total-actions {
    flex: 0 0 auto;
}

.cash-denom-grid--no-steppers .cash-denom-row__btn {
    display: none !important;
}

.cash-denom-grid--no-steppers .cash-denom-row {
    grid-template-columns: minmax(3.25rem, auto) minmax(3rem, 1fr) minmax(4.5rem, 1fr);
}

@media (max-width: 768px) {
    .cash-denom-grid--no-steppers .cash-denom-row {
        grid-template-columns: minmax(3rem, auto) minmax(3rem, 1fr) minmax(4rem, 1fr);
    }

    .cash-denom-grid__cards {
        grid-template-columns: 1fr;
    }

    .cash-denom-row {
        grid-template-columns: minmax(3rem, auto) auto minmax(3rem, 1fr) auto minmax(4rem, 1fr);
    }
}

/* Close register — POS tally (worksheet preview above counted vs POS) */
.register-close-tally {
    box-sizing: border-box;
    margin: 0.35rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-card, 8px);
    border: 1px solid var(--color-border, #ddd);
    background: var(--color-surface, #fff);
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    line-height: 1.55;
}

.register-close-tally__title {
    margin: 0 0 0.5rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-muted, #616161);
}

.register-close-tally__row {
    display: grid;
    grid-template-columns: minmax(7.25rem, max-content) auto minmax(0, 1fr);
    gap: 0 0.35rem;
    align-items: baseline;
}

.register-close-tally__amt {
    text-align: right;
    white-space: nowrap;
}

.register-close-tally__sep {
    color: var(--color-text-muted, #616161);
}

.register-close-tally__label {
    word-break: break-word;
}

.register-close-tally__rule {
    margin: 0.55rem 0;
    border: none;
    border-top: 1px solid var(--color-border, #ddd);
}

.register-close-tally__row--emphasis .register-close-tally__amt,
.register-close-tally__row--emphasis .register-close-tally__label {
    font-weight: 700;
}

.register-close-tally__row--hero .register-close-tally__amt {
    font-size: 1.12rem;
    font-weight: 700;
}

.register-close-tally__row--alloc .register-close-tally__amt,
.register-close-tally__row--alloc .register-close-tally__label {
    color: var(--color-text-muted, #616161);
    font-weight: 500;
}

.register-close-tally__note {
    margin: 0.45rem 0 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.82rem;
    color: var(--color-text-muted, #616161);
}

.register-close-preview-layout__sales .register-close-sales-strip {
    margin-bottom: 0;
}

.register-close-sales-strip {
    margin-bottom: 1rem;
}

.register-close-sales-strip .register-close-tally {
    margin-top: 0;
}

.register-close-tally--shift-sales .register-close-tally__row--shift-sales-hero .register-close-tally__amt {
    font-size: 1.5rem;
    font-weight: 700;
}

.register-close-tally--shift-sales .register-close-tally__row--shift-sales-hero .register-close-tally__label {
    font-weight: 700;
}

.register-close-tally__footnote {
    margin: 0.45rem 0 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.78rem;
    color: var(--color-text-muted, #616161);
    line-height: 1.4;
}

.register-close-cash-drops--in-tally {
    margin: 0.45rem 0 0;
}

.register-close-denom-anchor .cash-denom-grid {
    margin-top: 0.5rem;
}

.register-close-section__title {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-text-muted, #616161);
}

.register-close-cash-drops {
    margin: 0.35rem 0 0.5rem;
    padding-left: 1.15rem;
    font-size: 0.9rem;
}

.register-close-cash-drops__row {
    margin: 0.25rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: baseline;
}

.register-close-cash-drops__amt {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.register-close-cash-drops__when {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted, #616161);
}

.register-close-cash-drops__id {
    font-size: 0.78rem;
    color: var(--color-text-muted, #616161);
    font-family: ui-monospace, monospace;
}

.register-close-worksheet {
    box-sizing: border-box;
    margin: 0 0 0.5rem;
    padding: 1rem;
    border-radius: var(--radius-card, 8px);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.register-close-worksheet__heading {
    margin: 0 0 0.35rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--color-text);
}

.register-close-worksheet__intro {
    margin: 0 0 0.75rem;
}

.register-close-worksheet__scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.register-close-worksheet__table {
    width: max-content;
    max-width: 100%;
    min-width: min(18rem, 100%);
    border-collapse: collapse;
    font-size: 0.89rem;
}

.register-close-worksheet__table th,
.register-close-worksheet__table td {
    padding: 0.42rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.register-close-worksheet__table thead th:first-child,
.register-close-worksheet__table tbody th[scope='row'] {
    text-align: left;
}

.register-close-worksheet__table thead th:nth-child(2),
.register-close-worksheet__table tbody td:nth-child(2) {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.register-close-worksheet__table thead th:nth-child(3),
.register-close-worksheet__table tbody td:nth-child(3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.register-close-worksheet__table thead th:nth-child(4) {
    text-align: right;
}

.register-close-worksheet__table tbody th {
    font-weight: 600;
}

.register-close-worksheet__match {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.register-close-worksheet__match--ok {
    color: var(--cash-denom-subtotal, #2e7d32);
}

.register-close-worksheet__match--bad {
    color: #c62828;
}

.register-close-worksheet__money {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0;
    font-variant-numeric: tabular-nums;
}

.register-close-worksheet__table tbody td:nth-child(3) .register-close-worksheet__money {
    justify-content: flex-end;
}

.register-close-worksheet__sym {
    flex: none;
}

.register-close-worksheet__val {
    flex: none;
    text-align: left;
}

.register-close-worksheet__table tbody td:nth-child(3) .register-close-worksheet__val {
    text-align: right;
}

.register-close-worksheet__val output {
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.register-close-worksheet__count-cell {
    white-space: nowrap;
}

.register-close-worksheet__table .register-close-tender-counted-input {
    width: 100%;
    max-width: 7.75rem;
    box-sizing: border-box;
    margin-left: auto;
    display: block;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.register-close-worksheet__muted {
    color: var(--color-text-muted, #616161);
}

/* Register close — cash variance confirmation lightbox */
.register-variance-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.register-variance-lightbox[hidden] {
    display: none !important;
}

.register-variance-lightbox__backdrop {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    margin: 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: default;
}

.register-variance-lightbox__panel {
    grid-area: 1 / 1;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: min(38rem, 100vw - 2rem);
    max-height: min(92vh, 36rem);
    margin: 0;
    padding: 1rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    outline: none;
    min-height: 0;
}

.register-variance-lightbox__title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}

.register-variance-lightbox__lead {
    margin: 0 0 0.65rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--color-text);
}

.register-variance-lightbox__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
    margin: 0 0 0.5rem;
}

.register-variance-lightbox__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.register-variance-lightbox__table th,
.register-variance-lightbox__table td {
    padding: 0.35rem 0.35rem;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}

.register-variance-lightbox__table thead th {
    text-align: left;
    font-weight: 700;
}

.register-variance-lightbox__table tbody th[scope='row'] {
    text-align: left;
}

.register-variance-lightbox__table td {
    font-weight: 600;
}

.register-variance-lightbox__table tbody td:nth-child(4) {
    font-weight: 700;
}

.register-variance-lightbox__var--ok {
    color: var(--cash-denom-subtotal, #2e7d32);
}

.register-variance-lightbox__var--bad {
    color: var(--color-error, #b91c1c);
}

.register-variance-lightbox__combined {
    margin: 0.65rem 0 0;
    font-size: 1.875rem;
    line-height: 1.3;
}

.register-variance-lightbox__combined-lead {
    font-weight: 500;
    color: var(--color-text, #222);
}

.register-variance-lightbox__combined #register-variance-combined-display {
    font-weight: 700;
}

.register-variance-lightbox__recap-mini {
    margin: 0.5rem 0 0;
}

.register-variance-lightbox__footnote {
    flex-shrink: 0;
    margin: 0 0 0.75rem;
}

.register-variance-lightbox__actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 480px) {
    .register-variance-lightbox__actions {
        flex-direction: column-reverse;
    }

    .register-variance-lightbox__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Registers hub: primary actions + setup disclosure */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.registers-hub-actions__title {
    margin-top: 0;
}

.registers-hub-actions__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.registers-setup-details__summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0;
}

.registers-setup-details__body {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.75rem;
}

/* Payout history: collapsible Payout detail */
.payout-history-detail__summary {
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.25rem 0;
}

.payout-history-detail__body {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.75rem;
}

.registers-active-section {
    --register-tile-column-width: 15rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.registers-active-section .register-tiles {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    align-content: center;
}

.registers-active-section__lead {
    margin-top: 0;
    margin-bottom: 0;
}

.registers-active-section h2 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Open / Close register: prominent register name */
.register-flow-current-register {
    margin: 0.75rem 0 1.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

/* App shell: primary rail + section subnav */
.app-shell-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 0.35rem;
    background: var(--color-surface);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text);
}

.app-shell-menu-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.app-nav-primary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 5.5rem;
    flex-shrink: 0;
    min-height: 0;
    padding: 0.5rem 0.35rem;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.app-nav-primary__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 3.25rem;
    padding: 0.35rem 0.2rem;
    border-radius: 0.4rem;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.15;
}

.app-nav-primary__link:hover {
    background: var(--color-bg);
}

.app-nav-primary__link--active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--color-primary);
}

.app-nav-primary__glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.app-nav-primary__glyph svg {
    display: block;
}

.app-nav-primary__text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-shell__column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-nav-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.app-nav-secondary__link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    padding: 0.25rem 0.15rem;
    border-radius: 0.25rem;
}

@media (max-width: 899px) {
    .app-nav-secondary {
        gap: 0.35rem 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .app-nav-secondary__link {
        display: inline-flex;
        align-items: center;
        min-height: 2.75rem;
        padding: 0.35rem 0.5rem;
    }
}

.app-nav-secondary__link:hover {
    text-decoration: underline;
}

.app-nav-secondary__link--current {
    font-weight: 700;
    text-decoration: underline;
}

.app-shell__column .main-content {
    margin: 0;
    max-width: none;
}

@media (max-width: 899px) {
    .app-shell-menu-toggle {
        display: inline-flex;
    }

    .app-shell {
        position: relative;
    }

    .app-nav-primary {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        height: 100dvh;
        width: 11rem;
        z-index: 400;
        padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        padding-left: max(0.35rem, env(safe-area-inset-left, 0px));
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .app-shell-wrap--open .app-nav-primary {
        transform: translateX(0);
    }

    .app-shell-wrap--open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 350;
    }
}

@media (min-width: 900px) {
    .app-shell-menu-toggle {
        display: none !important;
    }
}

/* Register hub tiles (Lightspeed-style, touch-friendly) */
.register-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-start;
    align-content: flex-start;
    align-items: stretch;
    min-width: 0;
}

.register-tiles .register-tile-wrap--closed {
    flex: 0 1 var(--register-tile-column-width);
    width: min(var(--register-tile-column-width), 100%);
    max-width: 100%;
    box-sizing: border-box;
}

.register-tiles .register-tile {
    flex: 0 1 var(--register-tile-column-width);
    width: min(var(--register-tile-column-width), 100%);
    max-width: 100%;
    box-sizing: border-box;
}

.register-tile-wrap--closed > .register-tile {
    flex: 1 1 auto;
    min-height: 0;
}

.register-tile-form {
    display: contents;
}

.register-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    min-height: 8.75rem;
    padding: 1.1rem 0.65rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.register-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.register-tile:has(.register-tile__icon img) {
    min-height: auto;
    padding: 0.55rem 0.65rem 0.65rem;
}

.register-tile:has(.register-tile__icon img) .register-tile__icon {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.register-tile:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.register-tile--closed {
    background: #fff5f5;
    opacity: 1;
    border-color: var(--color-danger, #b00020);
    color: var(--color-danger, #b00020);
}

.register-tile--closed .register-tile__icon {
    color: inherit;
}

.register-tile--active {
    border-color: #15803d;
    box-shadow: 0 0 0 2px #15803d;
}

.register-tile--open {
    border-color: #15803d;
    color: #14532d;
}

.register-tile--open .register-tile__icon {
    color: #15803d;
}

.register-tile:not(a):not(button).register-tile--open {
    cursor: default;
}

.register-tile--unknown {
    cursor: default;
    opacity: 0.9;
}

.register-tile__badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.06rem;
    margin: 0 0 0.2rem;
    flex-shrink: 0;
    pointer-events: none;
}

.register-tile__badge {
    display: block;
    text-align: center;
}

.register-tile__badge--open,
.register-tile__badge--closed {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
}

.register-tile__badge--open {
    color: #15803d;
}

.register-tile__badge--closed {
    color: var(--color-danger, #b00020);
}

.register-tile__badge--active {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    color: #15803d;
}

.register-tile__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.35rem 0 0.5rem;
    color: #1e3a5f;
}

.register-tile__icon svg,
.register-tile__icon img {
    display: block;
    width: 192px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.register-tile__icon img {
    object-fit: contain;
    mix-blend-mode: multiply;
}

.register-tile__name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    word-break: break-word;
}

.register-tile--open .register-tile__name {
    color: #14532d;
}

.register-tile--closed .register-tile__name {
    color: inherit;
}

.register-tile__action,
.register-tile__action--close-register {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #166534;
    text-align: center;
}

.register-tile--closed .register-tile__action {
    color: inherit;
}

.register-tile__action--muted {
    color: #64748b;
    font-weight: 500;
}

.register-tile--active .register-tile__action--close-register {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.register-tile--active .register-tile__action--close-register:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 0.15rem;
}

.register-tile__meta {
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
}

.register-tile-wrap--closed {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: stretch;
}

.register-tiles__kick-row {
    flex-basis: 100%;
    width: 100%;
    box-sizing: border-box;
}

.register-tiles__kick {
    width: 100%;
    box-sizing: border-box;
}

.stale-register-shift-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4000;
    padding: 0.55rem 1rem;
    background: #fef3c7;
    border-bottom: 1px solid #f59e0b;
    font-size: 0.9rem;
}

.stale-register-shift-dialog {
    max-width: 30rem;
    width: calc(100% - 2rem);
    border: none;
    border-radius: 0.5rem;
    padding: 0;
}

.stale-register-shift-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.stale-register-shift-dialog__panel {
    padding: 1.25rem 1.5rem;
}

.stale-register-shift-dialog__title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.stale-register-shift-dialog__list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}

.stale-register-shift-dialog__hint {
    margin-top: 0.85rem;
}

/* Page help (Need help?) */
.page-help {
    margin-bottom: 1.25rem;
}

.page-help__summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.35rem 0;
}

.page-help__body {
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}

.page-help__body p {
    margin: 0 0 0.75rem;
}

.page-help__body p:last-child {
    margin-bottom: 0;
}

.page-help__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

/* Booth floor map (Konva) */
.booth-map-page__header {
    margin-bottom: 1rem;
}

.booth-map-page__header h1 {
    margin-bottom: 0.35rem;
}

.booth-map-page__intro {
    color: var(--color-text-muted, #555);
    margin: 0 0 0.75rem;
    max-width: 42rem;
}

.booth-map-page__actions {
    margin: 0 0 1rem;
}

.booth-map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.booth-map-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.booth-map-toolbar__field--switch {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.booth-map-toolbar__field--switch .booth-map-toolbar__label {
    margin: 0;
    white-space: nowrap;
}

/* Checkbox styled as toggle switch (lock layout / show grid) */
.booth-map-toolbar__switch {
    appearance: none;
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
    border-radius: 9999px;
    background: var(--color-border, #ccc);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s ease;
}

.booth-map-toolbar__switch::after {
    content: '';
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.booth-map-toolbar__switch:checked {
    background: var(--color-primary, #2563eb);
}

.booth-map-toolbar__switch:checked::after {
    transform: translateX(1.2rem);
}

.booth-map-toolbar__switch:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

.booth-map-toolbar__label {
    font-size: 0.85rem;
    font-weight: 600;
}

.booth-map-toolbar__select {
    min-width: 14rem;
    padding: 0.4rem 0.5rem;
    font-size: 1rem;
}

.booth-map-page__alerts {
    min-height: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.booth-map-page__alerts--error {
    color: var(--color-danger, #a40000);
}

.booth-map-page__tooltip {
    position: fixed;
    z-index: 10050;
    max-width: 18rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--color-text, #111);
    background: #fff;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

.booth-map-page__tooltip[hidden] {
    display: none !important;
}

.booth-map-page__tooltip strong {
    font-weight: 600;
}

.booth-map-page__stage-wrap {
    overflow: auto;
    max-width: 100%;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 6px;
    background: #fafafa;
}

.booth-map-page__stage {
    margin: 0 auto;
}

/* Print: hide nav, footer, and no-print elements; show only receipt content */
@media print {
    .site-header,
    .site-footer,
    .app-nav-primary,
    .app-nav-secondary,
    .app-shell-menu-toggle,
    .main-content .no-print {
        display: none !important;
    }
    .main-content {
        padding: 0;
    }
    .pos-receipt-page .receipt-print-content {
        border: none;
        box-shadow: none;
    }
    .pos-receipt-page .storefront-alert {
        display: none !important;
    }
}

/* Sales analytics report */
.sales-patterns-report .sales-patterns-view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
}

.sales-patterns-report .sales-patterns-view-toggle .btn.is-active {
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-color: var(--color-primary, #2563eb);
}

.sales-patterns-report .sales-patterns-filters {
    max-width: 42rem;
    margin-bottom: 1.25rem;
}

.report-chart-wrap {
    margin-bottom: 1.5rem;
}

.report-chart-canvas-holder {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: clamp(260px, 35vh, 360px);
    min-height: 240px;
}

.sales-heatmap-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

.sales-heatmap {
    display: grid;
    grid-template-columns: 5.5rem repeat(24, minmax(1.35rem, 1fr));
    gap: 2px;
    min-width: 42rem;
}

.sales-heatmap-header,
.sales-heatmap-row {
    display: contents;
}

.sales-heatmap-corner {
    grid-column: 1;
}

.sales-heatmap-hour-label {
    font-size: 0.65rem;
    text-align: center;
    color: #64748b;
    padding: 0.15rem 0;
}

.sales-heatmap-day-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.35rem 0.25rem;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.sales-heatmap-day-label.is-selected {
    color: var(--color-primary, #2563eb);
}

.sales-heatmap-cell {
    min-height: 1.5rem;
    border-radius: 3px;
    background: rgba(37, 99, 235, calc(0.08 + (var(--heat-intensity, 0) * 0.0072)));
    border: 1px solid rgba(148, 163, 184, 0.35);
    cursor: pointer;
}

.sales-heatmap-cell:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 1px;
}

.sales-heatmap-summary {
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .sales-patterns-report .report-chart-wrap + .report-chart-wrap {
        margin-top: 0.5rem;
    }
}
