:root {
    --bg: #eef3f9;
    --surface: #ffffff;
    --surface-soft: #f5f8fd;
    --border: #d8e1ec;
    --text: #132033;
    --muted: #617083;
    --primary: #234fbd;
    --primary-strong: #173c96;
    --primary-soft: #e9effd;
    --header-bg: #10213a;
    --header-bg-2: #172745;
    --header-text: #f6f8fc;
    --header-muted: rgba(246, 248, 252, .72);
    --header-border: rgba(255, 255, 255, .09);
    --danger: #c81e4a;
    --danger-soft: #ffe4ec;
    --success: #166534;
    --success-soft: #e6f7eb;
    --shadow: 0 14px 36px rgba(15, 23, 42, .08);
    --shadow-soft: 0 8px 18px rgba(15, 23, 42, .05);
    --radius: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box
}

html,
body {
    min-height: 100%;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: linear-gradient(0deg, #f8fbff 0%, var(--bg) 100%) fixed;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit
}

h1, h2, h3, p {
    margin: 0
}

p {
    color: var(--muted)
}

label {
    color: var(--text)
}

code {
    background: #edf3ff;
    padding: .1rem .35rem;
    border-radius: 6px
}

.app-shell {
    width: min(1560px, calc(100% - 20px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px 0 28px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 14px;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--header-border);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(16, 33, 58, .98), rgba(23, 39, 69, .94));
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(10, 18, 33, .14);
    min-width: 0;
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
    position: relative;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
}

.header-actions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-left: auto;
    flex: 0 0 auto;
}

.alerts-shell {
    position: relative;
    flex: 0 0 auto;
}

.alerts-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: var(--header-text);
    box-shadow: none;
}

.alerts-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.alerts-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 8px 18px rgba(225, 29, 72, .28);
}

.alerts-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(100vw - 24px, 380px);
    max-height: 420px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--header-border);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(16, 33, 58, .99), rgba(23, 39, 69, .99));
    box-shadow: 0 18px 40px rgba(10, 18, 33, .22);
    z-index: 50;
}

.alerts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--header-text);
}

.alerts-head strong {
    color: var(--header-text);
}

.alerts-mark-all {
    min-height: 34px;
    padding: 0 10px;
}

.alerts-summary-list {
    display: grid;
    gap: 8px;
}

.alerts-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    text-decoration: none;
    color: var(--header-text);
}

.alerts-summary-row span {
    color: var(--header-muted);
}

.alerts-summary-row strong {
    color: var(--header-text);
    font-size: .98rem;
}

.alerts-view-all {
    width: 100%;
    margin-top: 10px;
    justify-content: center;
}

.alerts-feed {
    display: grid;
    gap: 14px;
}

.alert-card-stock {
    margin-bottom: 14px;
}

.alert-card {
    display: grid;
    gap: 12px;
}

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

.alert-card-foot {
    align-items: center;
}

.alert-modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
    z-index: 90;
    overflow: auto;
}

.alert-modal-backdrop[hidden] {
    display: none !important;
}

.alert-modal {
    width: min(100%, 920px);
    margin: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.purchase-items-modal {
    width: min(100%, 680px);
}

.purchase-items-modal .table-list {
    max-height: 56vh;
    overflow: auto;
    padding-right: 2px;
}

.exchange-modal {
    width: min(100%, 1100px);
}

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

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

.exchange-detail-columns h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.exchange-detail-columns .table-list {
    max-height: 38vh;
    overflow: auto;
    padding-right: 2px;
}

.exchange-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.exchange-modal-actions form,
.row-meta form {
    display: inline-flex;
    margin: 0;
}

.exchange-modal-actions button,
.row-meta button {
    width: auto;
}

.row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (min-width: 781px) {
    .exchange-modal-actions,
    .row-meta {
        flex-wrap: nowrap;
    }
}

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

.alert-modal .data-table {
    margin-top: 12px;
}

body.modal-open {
    overflow: hidden;
}

.alerts-shell.is-open .alerts-panel {
    display: block;
}

.alerts-panel[hidden] {
    display: none;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--header-text);
}

.brand-block {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 14px;
    width: auto;
    min-width: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.site-header h1 {
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.1;
    color: var(--header-text);
    letter-spacing: 0;
}

.site-header h1 .header-subline {
    display: block;
    margin-top: 4px;
    font-size: .95rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--header-muted);
}

.site-header p {
    margin-top: 4px;
    color: var(--header-muted);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(255, 255, 255, .06);
    min-width: 0;
}

.nav-group {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

.nav-group-toggle {
    cursor: pointer;
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(16, 33, 58, .98);
    box-shadow: 0 18px 40px rgba(10, 18, 33, .22);
    z-index: 30;
}

.nav-group.is-open .nav-submenu {
    display: flex;
}

.nav-group.active > .nav-group-toggle {
    background: #ffffff;
    border-color: #d4def1;
    color: #173c96;
    box-shadow: 0 10px 22px rgba(10, 18, 33, .18);
}

.nav-group > .nav-group-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: none;
}

.nav-link,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.nav-link:hover,
.button:hover,
button:hover {
    border-color: #b8c6db;
    transform: translateY(-1px);
}

.button:disabled,
button:disabled {
    background: #e5eaf2;
    color: #8d97a8;
    border-color: #d4dbe6;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
    opacity: 1;
}

.button:disabled:hover,
button:disabled:hover {
    background: #e5eaf2;
    color: #8d97a8;
    border-color: #d4dbe6;
    transform: none;
}

.raffle-locked {
    opacity: .96;
}

.raffle-locked .split-box,
.raffle-locked .panel-sub,
.raffle-locked .table-row,
.raffle-locked .recent-raffle-row {
    background: var(--surface-soft);
}

.raffle-locked input:disabled,
.raffle-locked select:disabled,
.raffle-locked textarea:disabled,
.raffle-locked button:disabled {
    cursor: not-allowed;
    background: #edf1f7 !important;
    color: #8a96a8 !important;
    border-color: #d5dde8 !important;
    box-shadow: none !important;
    opacity: 1;
}

.raffle-locked input[readonly] {
    background: #edf1f7 !important;
    color: #8a96a8 !important;
}

.nav-link.active {
    background: linear-gradient(180deg, #ffffff, #dfe8ff);
    border-color: rgba(255, 255, 255, .2);
    color: var(--primary-strong);
    box-shadow: 0 10px 22px rgba(10, 18, 33, .14);
}

.site-nav .nav-link {
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .08);
    color: var(--header-text);
    box-shadow: none;
    flex: 0 0 auto;
    white-space: nowrap;
}

.site-nav .nav-link.active {
    background: linear-gradient(180deg, #ffffff, #dfe8ff);
    border-color: rgba(255, 255, 255, .2);
    color: var(--primary-strong);
    box-shadow: 0 10px 22px rgba(10, 18, 33, .14);
}

.site-nav .nav-link:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .14);
    transform: translateY(0);
}

.site-nav .nav-link.active:hover {
    background: linear-gradient(180deg, #ffffff, #dfe8ff);
}

.nav-logout-form {
    margin: 0;
    flex: 0 0 auto;
    min-width: 0;
}

.nav-link.logout {
    cursor: pointer;
}

.nav-submenu .nav-link {
    width: 100%;
    justify-content: flex-start;
}

.page {
    display: flex;
    gap: 14px;
    flex-direction: column;
}

.login-wrap {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 260px);
}

.login-panel {
    width: min(100%, 430px);
    padding: 22px;
}

.login-panel button {
    width: 100%;
    justify-content: center;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.flash.ok {
    background: var(--success-soft);
    border-color: #c7ead0;
    color: var(--success);
}

.flash.error {
    background: var(--danger-soft);
    border-color: #f2bfd0;
    color: var(--danger);
}

.toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
}

.toast-item.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}

.store-toast {
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 10px 28px rgba(16, 33, 58, .16);
    font-size: .95rem;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.store-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.store-toast.is-ok {
    background: var(--success-soft);
    border-color: #c7ead0;
    color: var(--success);
}

.store-toast.is-error {
    background: var(--danger-soft);
    border-color: #f2bfd0;
    color: var(--danger);
}

@media (max-width: 720px) {
    .toast-stack {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .store-toast {
        min-width: 0;
        max-width: 100%;
    }
}

.metric-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.metric-grid.compact {
    grid-template-columns:repeat(auto-fit, minmax(170px, 1fr));
}

.finance-subnav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 6px;
    width: max-content;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.finance-subnav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}

.finance-subnav-link:hover {
    color: var(--text);
    background: var(--surface-soft);
}

.finance-subnav-link.active {
    color: #fff;
    background: var(--primary);
}

.header-subnav {
    margin: 0;
}

.legend-tabs-shell {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    margin: 0 0 16px;
}

.legend-tabs-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
    flex: 0 0 auto;
}

.legend-tabs-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.legend-tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px;
    width: max-content;
    max-width: 100%;
}

.legends-stock-grid .stack-form label {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.legends-stock-grid .stack-form select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-rarity-field {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.legend-rarity-field select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) center / 8px 8px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) center / 8px 8px no-repeat,
    var(--surface);
}

.metric-card,
.panel,
.card,
.shortcut {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 14px;
}

.metric-sub {
    margin-top: 6px;
    font-size: .86rem;
    color: var(--muted);
}

.manage-metrics .metric-card {
    padding: 12px 14px;
}

.metric-card-sm span {
    font-size: .8rem;
}

.metric-card-sm strong {
    margin-top: 4px;
    font-size: 1.8rem;
}

.manage-head {
    margin-bottom: 12px;
}

.manage-panel .manage-filters {
    display: grid;
    grid-template-columns:minmax(0, 1.2fr) minmax(180px, .92fr) auto auto;
    gap: 10px;
    align-items: center;
}

.manage-panel .field-icon,
.manage-panel .field-select {
    display: flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.manage-panel .field-icon {
    gap: 8px;
    padding: 0 12px;
}

.manage-panel .field-icon input {
    border: 0;
    padding: 0;
    min-height: 0;
    background: transparent;
}

.manage-panel .field-icon:focus-within,
.manage-panel .field-select:focus-within,
.manage-panel .availability-toggle:focus-within {
    border-color: rgba(29, 78, 216, .45);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .08);
}

.manage-panel .field-icon-mark {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    color: var(--muted);
    flex-shrink: 0;
}

.manage-panel .field-select select {
    border: 0;
    min-height: 40px;
    padding: 0 2px;
    background: transparent;
}

.manage-panel .availability-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    white-space: nowrap;
    font-weight: 700;
    color: var(--text);
}

.manage-panel .availability-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.manage-panel .toggle-ui {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #d7e0ef;
    flex: 0 0 auto;
    transition: background .15s ease;
}

.manage-panel .toggle-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .18);
    transition: transform .15s ease;
}

.manage-panel .availability-toggle input:checked + .toggle-ui {
    background: var(--primary);
}

.manage-panel .availability-toggle input:checked + .toggle-ui::after {
    transform: translateX(14px);
}

.manage-panel .filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.manage-panel .filter-primary,
.manage-panel .filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.manage-panel .filter-primary {
    min-height: 40px;
}

.manage-panel .filter-reset {
    min-height: 40px;
    text-decoration: none;
}

.ui-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.metric-card span {
    display: block;
    font-size: .67rem;
}

.metric-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:4px 10px;
    border-radius:10px;
    font-size:.67rem;
    font-weight:800;
    letter-spacing:0;
    text-transform:uppercase;
    color:#234fbd;
    background:rgba(35,79,189,.10);
    border:1px solid rgba(35,79,189,.16);
}

.metric-badge-blue{
    color:#234fbd;
    background:rgba(35,79,189,.10);
    border-color:rgba(35,79,189,.16);
}

.metric-badge-violet{
    color:#6b4cd6;
    background:rgba(107,76,214,.10);
    border-color:rgba(107,76,214,.16);
}

.metric-badge-green{
    color:#1f7a4f;
    background:rgba(31,122,79,.10);
    border-color:rgba(31,122,79,.16);
}

.metric-card strong {
    display: block;
    margin-top: 4px;
    font-size: 1.10rem;
    line-height: 1;
}

.dashboard-hero-stats .metric-card strong{
    text-align:center;
}

.dashboard-hero-stats .metric-card{
    text-align:center;
}

.dashboard-hero-stats .metric-card span{
    margin-inline:auto;
}

.panel {
    padding: 14px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.dashboard-hero-copy {
    display: grid;
    gap: 8px;
    align-content: start;
}

.dashboard-hero-copy h2 {
    font-size: 1.2rem;
}

.dashboard-hero-copy p {
    max-width: 60ch;
    font-size: .92rem;
}

.dashboard-hero-stats {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 8px;
}

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

.realtime-charts {
    grid-template-columns:repeat(4, minmax(0, 1fr));
}

.realtime-summary-card {
    padding: 10px 12px;
    min-width: 0;
}

.realtime-label {
    display: block;
    font-size: .68rem;
    letter-spacing: .02em;
}

.realtime-title {
    display: block;
    margin-top: 4px;
    font-size: .78rem;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.realtime-meta {
    margin-top: 3px;
    font-size: .7rem;
    line-height: 1.2;
}

.realtime-stats {
    margin-top: 6px;
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.realtime-stat {
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f7fbff;
    min-width: 0;
}

.realtime-stat-label {
    font-size: .58rem;
    color: var(--muted);
    line-height: 1;
}

.realtime-stat-value {
    display: block;
    margin-top: 2px;
    font-size: .72rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-layout {
    display: block;
    gap: 10px;
    align-items: start;
    margin-top: 8px;
}

.stock-charts {
    margin-top: 0;
}

.stock-legend-list {
    display: grid;
    gap: 4px;
    max-height: calc(6 * 32px + 5 * 4px);
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(97, 112, 131, .55) transparent;
}

.stock-legend-list::-webkit-scrollbar {
    width: 8px;
}

.stock-legend-list::-webkit-scrollbar-track {
    background: transparent;
}

.stock-legend-list::-webkit-scrollbar-thumb {
    background: rgba(97, 112, 131, .45);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.stock-legend-list::-webkit-scrollbar-thumb:hover {
    background: rgba(97, 112, 131, .65);
    background-clip: padding-box;
}

.stock-legend-row {
    display: grid;
    grid-template-columns:auto 1fr;
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.stock-legend-row .flag {
    font-size: 1.4rem;
}

.stock-legend-row .country-flag {
    width: 24px;
    height: 24px;
}

.stock-legend-code {
    min-width: 0;
    font-size: .74rem;
    line-height: 1.1;
    justify-self: end;
    text-align: left;
}

.stock-legend-main span {
    font-size: .78rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-composition-grid {
    display: grid;
    grid-template-columns:minmax(0, 1.7fr) minmax(110px, .3fr);
    gap: 4px;
    align-items: start;
}

.stock-composition-card .chart-head {
    margin-bottom: 4px;
}

.stock-composition-card .chart-head h3 {
    font-size: .9rem;
}

.stock-composition-card .chart-head p {
    font-size: .74rem;
}

.stock-composition-card .chart-xs {
    min-height: 150px;
}

.chart-card {
    padding: 10px 10px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-soft);
}

.chart-card-tight {
    padding: 15px 15px 10px;
}

.chart-card-wide {
    grid-column: span 2;
}

.chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.chart-head h3 {
    font-size: .92rem;
}

.chart-head p {
    margin-top: 4px;
    font-size: .76rem;
}

.chart-wrap {
    position: relative;
    width: 100%;
}

.chart-sm {
    aspect-ratio: 1.35 / 1;
    min-height: 150px;
}

.chart-xs {
    aspect-ratio: 1.9 / 1;
    min-height: 110px;
}

.chart-finance {
    aspect-ratio: auto;
    min-height: 240px;
    height: 240px;
    max-height: 240px;
    overflow: hidden;
}

.chart-sales {
    aspect-ratio: auto;
    min-height: 0;
    height: 100%;
    max-height: 340px;
    overflow: hidden;
}

.finance-charts .chart-card {
    padding: 10px 10px 8px;
}

.finance-charts .chart-head {
    margin-bottom: 6px;
}

.finance-charts .chart-head h3 {
    font-size: .92rem;
}

.finance-charts .chart-head p {
    font-size: .76rem;
}

.finance-charts .chart-wrap {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    overflow: hidden;
}

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

.sales-chart {
    grid-template-columns:1fr;
}

.sales-grid {
    display: grid;
    grid-template-columns:minmax(240px, .85fr) minmax(0, 1.08fr) minmax(0, 1.08fr);
    gap: 10px;
    align-items: start;
    min-height: 410px;
}

.sales-stats {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 0;
    grid-template-rows:repeat(4, minmax(52px, 1fr));
    height: 410px;
}

.sales-stats .metric-card {
    padding: 12px 12px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sales-chart-panel {
    min-height: 0;
    height: 410px;
    overflow: hidden;
}

.sales-chart-panel .chart-wrap {
    width: 100%;
    height: 340px;
    min-height: 0;
    max-height: 340px;
    overflow: hidden;
}

.sales-chart-panel .chart-head {
    margin-bottom: 8px;
}

.sales-chart-panel .chart-head p {
    max-width: 100%;
}

.sales-chart-panel .chart-head h3 {
    font-size: .92rem;
}

.sales-chart-panel .chart-head p {
    font-size: .78rem;
}

.manage-panel {
    padding: 16px;
    position: sticky;
    top: 92px;
    z-index: 15;
}

.narrow {
    max-width: 720px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.section-meta {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.section-meta .min-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

.section-meta .min-qty span {
    white-space: nowrap;
}

.section-meta .min-qty input {
    width: 110px;
    min-width: 110px;
    padding: 10px 14px !important;
}

.section-head h2 {
    font-size: 1rem;
}

.section-head p {
    margin-top: 4px;
}

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

.shortcut {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    text-decoration: none;
}

.shortcut strong {
    font-size: 1rem;
}

.shortcut span {
    line-height: 1.5;
}

.scanner-layout {
    align-items: start;
}

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

.split-50 {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.split-50 > * {
    min-width: 0;
}

.split-box {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.box-frame {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.split-box .section-head {
    margin: 0;
    padding: 0;
    border: 0;
    min-height: auto;
}

.reserve-form {
    margin-top: 0;
}

.split-box label {
    border: 0;
    padding: 0;
}

.split-box input[readonly] {
    background-color: var(--muted-bg) !important;
    background: var(--muted-bg) !important;
    color: var(--muted-text) !important;
    -webkit-text-fill-color: var(--muted-text) !important;
    box-shadow: inset 0 0 0 9999px var(--muted-bg) !important;
    opacity: 1;
    cursor: not-allowed;
    appearance: none;
    -webkit-appearance: none;
}

.split-box input[readonly]::placeholder {
    color: var(--muted-text) !important;
    opacity: .8;
}

.add-layout {
    align-items: start;
}

.add-panel {
    min-width: 0;
}

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

.recent-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.recent-item-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.recent-item-main strong {
    font-size: 1rem;
    line-height: 1.2;
}

.recent-item-main span {
    color: var(--muted);
    font-size: .92rem;
    word-break: break-word;
}

.recent-item-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    text-align: right;
    flex: 0 0 auto;
}

.recent-raffle-row {
    display: grid;
    gap: 10px;
    padding: 14px 14px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.recent-raffle-row:first-child {
    padding-top: 14px;
}

.recent-raffle-head {
    display: grid;
    gap: 4px;
}

.recent-raffle-head strong {
    font-size: 1rem;
    line-height: 1.2;
}

.recent-raffle-head span {
    color: var(--muted);
    font-size: .88rem;
}

.recent-stats {
    display: grid;
    grid-template-columns:repeat(6, minmax(0, 1fr));
    gap: 8px;
    min-width: min(100%, 100%);
}

.recent-stat {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    min-width: 0;
}

.recent-stat strong {
    font-size: .98rem;
    line-height: 1.15;
    white-space: nowrap;
}

.recent-stat span {
    font-size: .78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.recent-raffle-draw {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: .88rem;
    color: var(--muted);
    padding-top: 4px;
}

.recent-raffle-draw strong {
    color: var(--text);
}

@media (max-width: 1180px) {
    .recent-stats {
        min-width: 0;
        grid-template-columns:repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .recent-stats {
        min-width: 0;
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

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

.recent-item-meta form {
    margin: 0;
}

.recent-item-meta .button.ghost {
    min-height: 32px;
    padding: 0 10px;
}

.recent-item-meta strong {
    font-size: 1rem;
}

.recent-item-meta span {
    color: var(--muted);
    font-size: .82rem;
}

.refresh-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}

.refresh-pill[data-state="error"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.split-grid.triple {
    grid-template-columns:repeat(3, minmax(0, 1fr));
}

.table-list,
.grid {
    display: grid;
}

.check-results-scroll {
    max-height: calc(5 * 78px + 4 * 12px);
    overflow-y: auto;
    padding-right: 8px;
    background: var(--surface);
    scrollbar-gutter: stable;
    scrollbar-color: var(--muted) var(--surface);
    scrollbar-width: thin;
}

.check-results-scroll::-webkit-scrollbar {
    width: 10px;
}

.check-results-scroll::-webkit-scrollbar-track {
    background: var(--surface);
}

.check-results-scroll::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 999px;
    border: 2px solid var(--surface);
}

.table-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.table-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.client-activity-row {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    font: inherit;
    padding-left: 0;
    padding-right: 0;
}

.client-activity-row:hover {
    background: var(--surface-soft);
}

.table-row-link {
    text-decoration: none;
    color: inherit;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.table-row-link:hover {
    background: var(--surface-soft);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
    z-index: 90;
    overflow: auto;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-panel {
    width: min(100%, 920px);
    margin: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    max-height: calc(100vh - 40px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(97, 112, 131, .65) rgba(15, 23, 42, .06);
}

.modal-panel::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-panel::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, .06);
    border-radius: 999px;
}

.modal-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(97, 112, 131, .55), rgba(59, 130, 246, .45));
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .92);
}

.modal-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(97, 112, 131, .72), rgba(59, 130, 246, .62));
}

.row-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.row-title strong {
    display: block;
    font-size: 1rem;
}

.row-title p {
    font-size: .92rem;
}

.row-sub {
    margin-top: 6px;
    font-size: .86rem;
    color: var(--muted);
}

.pager-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    margin-bottom: 12px;
}

.pager-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pager-label strong {
    font-size: 1rem;
    line-height: 1;
}

.pager-text {
    color: var(--muted);
    font-size: .92rem;
    white-space: nowrap;
}

.row-meta {
    text-align: right;
    flex-shrink: 0;
}

.row-meta strong {
    display: block;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
}

.data-table thead th {
    text-align: left;
    font-size: .9rem;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.data-table .num {
    text-align: right;
    white-space: nowrap;
}

.data-table .actions {
    text-align: right;
    white-space: nowrap;
}

.table-primary {
    display: block;
    font-weight: 600;
}

.table-sub {
    display: block;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.2;
}

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

.table-actions form {
    margin: 0;
}

.legend-search-wrap {
    display: grid;
    grid-template-columns:minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    margin: 0 0 16px 0;
    width: 100%;
}

.legend-search-field {
    min-width: 0;
    width: 100%;
    display: grid;
    gap: 6px;
}

.legend-search-field span {
    display: block;
    margin-bottom: 6px;
}

.legend-search-field input {
    width: 100%;
}

.legends-search-button {
    display: none;
}

.legends-order-main {
    display: grid;
    gap: 16px;
}

.legend-search-results,
.legend-cart-panel,
.legend-order-side {
    display: grid;
    gap: 12px;
}

.legend-search-results {
    min-height: 0;
}

.legend-search-results .table-list {
    max-height: 210px;
    overflow: auto;
    padding-right: 6px;
    gap: 10px;
}

.legend-results-head {
    margin-bottom: 0;
}

.legends-result-row {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 12px;
    background: #fff;
    padding: 11px 14px;
    cursor: pointer;
    text-align: left;
    align-items: center;
    box-shadow: none;
}

.legends-result-row:hover {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, .16);
}

.legends-result-title,
.legends-result-meta {
    min-width: 0;
}

.legends-result-nameblock {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}

.legends-result-row .row-title strong {
    font-size: 1rem;
    line-height: 1.15;
    color: var(--text);
}

.legends-result-row .row-title {
    overflow: hidden;
}

.legends-result-row .row-title strong,
.legends-result-row .row-title p,
.legends-result-meta strong,
.legends-result-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legends-result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: var(--muted);
}

.legends-result-meta strong {
    color: var(--text);
}

.legends-result-meta span {
    font-size: .84rem;
}

.legends-combo-pill {
    background: rgba(34, 197, 94, .12) !important;
    border-color: rgba(34, 197, 94, .22) !important;
    color: rgb(22, 101, 52) !important;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .86rem;
    line-height: 1;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-size: .86rem;
    line-height: 1;
    white-space: nowrap;
}

.status-pill.sale {
    border-color: rgba(22, 163, 74, .35);
    background: rgba(22, 163, 74, .10);
    color: rgb(22, 101, 52);
}

.status-pill.quote {
    border-color: rgba(59, 130, 246, .35);
    background: rgba(59, 130, 246, .10);
    color: rgb(30, 64, 175);
}

.status-pill.info {
    border-color: rgba(59, 130, 246, .35);
    background: rgba(59, 130, 246, .12);
    color: rgb(30, 64, 175);
}

.status-pill.rarity {
    border-radius: 999px;
    font-weight: 600;
}

.status-pill.rarity-bordo {
    border-color: rgba(109, 40, 217, .32);
    background: rgba(109, 40, 217, .12);
    color: rgb(91, 33, 182);
}

.status-pill.rarity-bronze {
    border-color: rgba(180, 83, 9, .35);
    background: rgba(180, 83, 9, .12);
    color: rgb(154, 52, 18);
}

.status-pill.rarity-prata {
    border-color: rgba(107, 114, 128, .35);
    background: rgba(107, 114, 128, .14);
    color: rgb(55, 65, 81);
}

.status-pill.rarity-ouro {
    border-color: rgba(161, 98, 7, .45);
    background: linear-gradient(180deg, #ffd94d, #f5b400);
    color: #3f2d00;
}

.status-pill.rarity-outro {
    border-color: rgba(15, 118, 110, .30);
    background: rgba(15, 118, 110, .12);
    color: rgb(13, 148, 136);
}

.status-pill.void {
    border-color: rgba(220, 38, 38, .35);
    background: rgba(220, 38, 38, .08);
    color: rgb(153, 27, 27);
}

.order-confirm-form {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: end;
    width: min(100%, 640px);
    min-width: 0;
}

.order-confirm-form label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.order-confirm-form label span {
    font-size: .86rem;
    color: var(--muted);
}

.order-confirm-form select,
.order-confirm-form button {
    width: 100%;
}

.check-text-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.flag {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.grid {
    grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
}

.sticker-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(156px, 1fr));
    gap: 8px;
}

.team-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f2f7ff);
    box-shadow: var(--shadow-soft);
}

.team-divider-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.team-divider-name {
    font-size: .95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-divider-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.team-divider-center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.team-divider-progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    font-size: .9rem;
    line-height: 1;
}

.team-divider-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 900;
    font-size: .95rem;
    line-height: 1;
}

.card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sticker-card {
    padding: 10px;
    display: grid;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: linear-gradient(180deg, #ffffff, #f7faff);
    box-shadow: var(--shadow);
}

.sticker-card-head {
    display: grid;
    grid-template-columns:auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.sticker-mark {
    width: auto;
    min-width: 0;
}

.sticker-code {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    letter-spacing: 0;
}

.sticker-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.sticker-body-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sticker-meta {
    display: grid;
    gap: 2px;
}

.sticker-meta strong {
    font-size: .86rem;
    line-height: 1.2;
    color: var(--text);
}

.sticker-meta span {
    font-size: .76rem;
}

.sticker-player {
    color: var(--muted);
    line-height: 1.2;
    word-break: break-word;
}

.sticker-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.sticker-actions-left {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.sticker-mark,
.qty-pill.compact,
.sticker-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 28px;
    padding: 2px 7px;
    border: 1px solid #d7e5f7;
    border-radius: 7px;
    background: #f5f9ff;
    color: var(--primary-strong);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.sticker-actions form,
.sticker-set,
.sticker-delete {
    display: flex;
    min-width: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}

.icon-btn.subtle {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.icon-btn.danger {
    background: var(--danger-soft);
    border-color: #f2bfd0;
    color: var(--danger);
}

.icon-btn:hover {
    border-color: #b8c6db;
}

.icon-btn svg {
    width: 14px;
    height: 14px;
}

.legends-cart-title {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    overflow: hidden;
}

.legends-cart-name-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.legends-cart-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.legends-cart-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.legends-cart-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.legends-cart-rarity {
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
    white-space: nowrap;
    display: inline-flex;
}

.legends-cart-price {
    min-width: 72px;
    text-align: right;
}

.legends-cart-qty input {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    padding: 6px 8px;
}

.legends-cart-remove-text {
    font-size: .85rem;
    font-weight: 700;
    color: var(--danger);
    white-space: nowrap;
}

.legends-add-btn {
    background: #1f8f4a;
    border-color: #1f8f4a;
    color: #fff;
}

.legends-add-btn:hover {
    background: #18763d;
    border-color: #18763d;
    color: #fff;
}

.legends-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.legends-cart-row .row-title {
    flex: 1 1 auto;
    min-width: 0;
}

.legends-cart-row .row-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.legends-cart-name-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.legends-cart-rarity {
    flex: 0 0 auto;
}

.legends-cart-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.legends-cart-qty {
    display: grid;
    gap: 4px;
    min-width: 72px;
}

.legends-cart-qty span {
    font-size: .82rem;
    color: var(--muted);
}

.legends-cart-qty input {
    width: 72px;
    text-align: center;
}

.combo-item-row {
    display: grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.combo-item-title {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.combo-item-name-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.combo-item-rarity {
    width: max-content;
}

.combo-item-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.combo-item-meta span {
    color: var(--muted);
    font-size: .86rem;
}

.legends-stock-grid .table-list {
    gap: 0;
}

.legends-stock-grid .table-row {
    display: grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
}

.legends-stock-grid .row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.legends-stock-grid {
    grid-template-columns:minmax(280px, .38fr) minmax(0, .62fr);
}

.legends-orders-grid {
    grid-template-columns:minmax(0, .58fr) minmax(0, .42fr);
}

.legends-combos-grid {
    grid-template-columns:minmax(0, .4fr) minmax(0, .6fr);
}

.country-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-size: 1.2rem;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-variant-emoji: emoji;
    box-shadow: none;
    flex: 0 0 auto;
}

.country-flag img.emoji {
    width: 18px;
    height: 18px;
    display: block;
}

.sticker-set {
    display: grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap: 6px;
    min-width: 0;
}

.qty-pill.compact {
    min-width: 28px;
}

.sticker-set input {
    min-width: 0;
    min-height: 32px;
    padding: 7px 8px;
    border-radius: 10px;
}

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

.qty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    background: #edf4ff;
    color: var(--primary-strong);
    font-size: 1.05rem;
    font-weight: 800;
}

.qty-pill.qty-pill-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.qty-pill.qty-pill-success {
    background: var(--success-soft);
    color: var(--success);
}

.pill-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.pill-stack-left {
    justify-content: flex-start;
    margin-right: auto;
}

.price-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .9rem;
    font-weight: 800;
    white-space: nowrap;
}

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

.card-actions form {
    width: 100%;
}

.card-actions form,
.inline-form {
    display: flex;
}

button {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button.secondary,
.button.ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.raffle-card-footer .button.secondary {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.raffle-card-footer .button.secondary:hover {
    background: #1e40af;
    border-color: #1e40af;
}

.raffle-card-footer .button.ghost:disabled {
    background: #eef2f7;
    color: #90a0b5;
    border-color: #d8e0eb;
}

button.success,
.button.success {
    background: #16a34a;
    border-color: #15803d;
    color: #fff;
}

button.success:hover,
.button.success:hover {
    background: #15803d;
    border-color: #166534;
}

button.danger {
    background: var(--danger-soft);
    border-color: #f2bfd0;
    color: var(--danger);
}

.inline-form {
    gap: 8px;
    width: 100%;
}

.inline-form input {
    flex: 1 1 auto;
    min-width: 0;
}

.inline-form button,
.card-actions button {
    width: 100%;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 12px;
}

.panel-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-toolbar-actions form,
.panel-toolbar-actions > a {
    display: inline-flex;
}

.panel-toolbar-actions button,
.panel-toolbar-actions .button {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}

.panel-toolbar-actions button:hover,
.panel-toolbar-actions .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.panel-toolbar-actions button:focus-visible,
.panel-toolbar-actions .button:focus-visible {
    outline: 2px solid rgba(29, 78, 216, .28);
    outline-offset: 2px;
}

.table-row .panel-toolbar-actions {
    justify-content: flex-end;
}

.table-row .panel-toolbar-actions form {
    margin: 0;
}

.panel-toolbar form {
    margin: 0;
}

.panel-toolbar button {
    width: auto;
}

.panel-toolbar + .pager-row {
    margin-top: 12px;
}

.pager-row + .table-list {
    margin-top: 12px;
}

.table-list + .pager-row {
    margin-top: 12px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.password-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.password-field input {
    flex: 1 1 auto;
    min-width: 0;
}

.password-toggle {
    flex: 0 0 44px;
    width: 44px;
    height: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
    box-shadow: none;
}

.password-toggle:hover {
    color: var(--text);
    border-color: #b8c4d5;
}

.password-toggle .ui-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stack-form .toggle-row-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
    order: -1;
}

.stack-form .toggle-row-top input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(0.9);
    transform-origin: left center;
}

.checkbox-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 6px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    min-height: auto;
    cursor: pointer;
}

.checkbox-row input {
    width: auto;
    margin: 0;
    transform: scale(0.8);
    transform-origin: left center;
}

.rule-details {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 10px 12px;
}

.rule-details summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--text);
}

.rule-details .details-body {
    margin-top: 12px;
}

.rule-card-list {
    display: grid;
    grid-template-columns:1fr;
    gap: 12px;
}

.check-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.check-actions label {
    display: grid;
    gap: 4px;
}

.check-actions label > span {
    font-size: .86rem;
    color: var(--muted);
}

.check-actions .file-compact {
    flex: 1 1 360px;
    min-width: 260px;
}

.check-actions .min-qty {
    flex: 0 0 160px;
}

.check-actions .min-qty input {
    max-width: 160px;
}

.result-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.settings-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.settings-toolbar-left,
.settings-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-panel.is-hidden {
    display: none;
}

.checkout-list {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.checkout-item {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.checkout-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.checkout-main input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 4px;
    flex: 0 0 auto;
}

.checkout-note {
    margin: 0;
    font-size: .92rem;
    color: var(--muted);
}

.checkout-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkout-actions button {
    flex: 1 1 180px;
}

.checkout-actions > button {
    flex: 0 0 auto;
}

.checkout-form {
    flex: 1 1 520px;
    min-width: 320px;
}

.checkout-fields {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 10px;
}

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

.checkout-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkout-buttons button {
    flex: 0 0 auto;
}

.checkout-buttons-left,
.checkout-buttons-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-buttons-left {
    flex: 1 1 auto;
}

.checkout-buttons-right {
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.stack-form label,
.filter-form label {
    display: grid;
    gap: 3px;
    color: var(--text);
}

.field-locked {
    background: #eef2f7;
    color: #64748b;
    border-color: #d8e0ea;
    cursor: not-allowed;
}

.field-locked:disabled {
    background: #eef2f7;
    color: #64748b;
    opacity: 1;
}

.tab-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.tab-btn.active {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary-strong);
}

.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-sub {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.filter-form input,
.filter-form select {
    flex: 1 1 0;
    min-width: 0;
}

.order-filter-meta {
    display: flex;
    justify-content: flex-end;
    width: min(100%, 980px);
    min-width: 0;
}

.order-filter-form {
    display: grid;
    grid-template-columns:minmax(260px, 1.4fr) minmax(150px, .75fr) auto auto auto;
    gap: 10px;
    align-items: end;
    justify-content: end;
    width: 100%;
    min-width: 0;
}

.order-filter-field {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.order-filter-field input,
.order-filter-field select {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 10px;
}

.order-filter-search {
    min-width: 0;
}

.order-filter-status {
    min-width: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.filter-chip input {
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
}

.addresses-layout {
    display: grid;
    grid-template-columns:minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 16px;
    align-items: start;
}

.panel-surface {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 16px;
}

.address-form {
    display: grid;
    gap: 16px;
    max-width: none;
}

.address-section {
    display: grid;
    gap: 10px;
}

.address-section-head h3 {
    margin: 0;
    font-size: .92rem;
    line-height: 1.2;
    color: var(--text);
}

.address-grid {
    display: grid;
    gap: 10px;
}

.address-grid label {
    display: grid;
    gap: 6px;
}

.address-grid label span {
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
}

.address-grid input {
    min-width: 0;
}

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

.address-grid-address {
    grid-template-columns:minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr);
}

.address-grid-location {
    grid-template-columns:minmax(0, 4fr) minmax(0, 6fr) minmax(0, 2fr);
}

.address-grid-footer {
    grid-template-columns:minmax(0, 8fr) minmax(0, 4fr);
    align-items: end;
}

.address-switch-field {
    display: grid;
    gap: 6px;
}

.address-switch-field > span {
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
}

.address-default-toggle {
    position: relative;
    display: block;
    width: 56px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.address-default-toggle input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.address-default-toggle .toggle-track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #d9e0e8;
    border: 1px solid #bcc7d6;
    transition: background .15s ease, border-color .15s ease;
}

.address-default-toggle .toggle-track::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 1px 3px rgba(16, 33, 58, .22);
    transition: left .15s ease;
}

.address-default-toggle input:checked + .toggle-track {
    background: var(--primary);
    border-color: var(--primary);
}

.address-default-toggle input:checked + .toggle-track::after {
    left: 31px;
}

.address-list {
    display: grid;
    gap: 12px;
}

.address-card {
    position: relative;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 14px 14px 14px 16px;
    display: grid;
    gap: 10px;
}

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

.address-card-body {
    display: grid;
    gap: 4px;
}

.address-card-body p {
    margin: 0;
    color: var(--text);
    font-size: .9rem;
    line-height: 1.35;
}

.address-card-body p:last-child {
    color: var(--muted);
}

.address-card-actions {
    display: flex;
    justify-content: flex-end;
}

.address-card-actions form {
    margin: 0;
}

.address-card-actions button {
    min-height: 36px;
}

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

@media (max-width: 780px) {
    .addresses-layout {
        grid-template-columns:1fr;
    }

    .address-grid-2,
    .address-grid-address,
    .address-grid-location,
    .address-grid-footer {
        grid-template-columns:1fr;
    }

    .address-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .address-card-actions {
        justify-content: stretch;
    }

    .address-card-actions button {
        width: 100%;
    }
}

.order-filter-form button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    white-space: nowrap;
}

.check-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.disponible {
    background: #1f8f4a;
    color: #fff;
    font-weight: bold;
}

.reserved {
    background: #f59e0b;
    color: #fff;
    font-weight: bold;
}

.sold {
    background: #205cdc;
    color: #fff;
    font-weight: bold;
}

.badge-info {
    background: #eef4ff;
    border-color: #bfd0ff;
    color: #1e40af;
}

.badge-success {
    background: #ecfdf3;
    border-color: #b7ebc8;
    color: #166534;
}

.address-preview {
    display: grid;
    gap: 4px;
    margin: 12px 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.address-preview strong {
    font-size: .95rem;
}

.address-preview p {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.35;
}

.filter-form select {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.badge-primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.badge-warm {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.history-number-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.history-number-badge {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 6px;
}

.payment-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
}

.payment-card-list {
    display: grid;
    gap: 10px;
}

.payment-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 12px;
    display: grid;
    gap: 10px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

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

.payment-card-head strong {
    display: block;
    font-size: .96rem;
}

.payment-card-head span,
.payment-card-numbers span {
    color: var(--muted);
    font-size: .84rem;
}

.payment-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.payment-card-numbers {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.payment-card-numbers strong {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--muted);
}

.payment-badge {
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
}

.payment-badge.status.paid {
    background: rgba(22, 163, 74, .10);
    border-color: rgba(22, 163, 74, .28);
    color: rgb(22, 101, 52);
}

.payment-badge.status.pending {
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .30);
    color: rgb(146, 64, 14);
}

.payment-badge.status.cancelled {
    background: rgba(220, 38, 38, .10);
    border-color: rgba(220, 38, 38, .28);
    color: rgb(153, 27, 27);
}

.payment-badge.method,
.payment-badge.state {
    color: var(--text);
}

.payment-badge.state[data-status="pending"],
.payment-badge.state[data-status="payment_pending"],
.payment-badge.state[data-status="in_process"] {
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .32);
    color: rgb(146, 64, 14);
}

.payment-badge.state[data-status="approved"],
.payment-badge.state[data-status="paid"],
.payment-badge.state[data-status="received"] {
    background: rgba(22, 163, 74, .10);
    border-color: rgba(22, 163, 74, .28);
    color: rgb(22, 101, 52);
}

.payment-badge.state[data-status="numbers"] {
    background: rgba(59, 130, 246, .12);
    border-color: rgba(59, 130, 246, .28);
    color: rgb(30, 64, 175);
}

.payment-badge.state[data-status="rejected"],
.payment-badge.state[data-status="cancelled"],
.payment-badge.state[data-status="canceled"] {
    background: rgba(220, 38, 38, .10);
    border-color: rgba(220, 38, 38, .28);
    color: rgb(153, 27, 27);
}

.payment-confirm-grid {
    display: grid;
    grid-template-columns:minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: end;
    max-width: none;
    justify-content: space-between;
}

.payment-confirm-grid label {
    display: grid;
    gap: 4px;
}

.payment-paid-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-height: 49px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    cursor: pointer;
    user-select: none;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.payment-paid-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-paid-mark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #94a3b8;
    background: #fff;
    position: relative;
    flex: 0 0 auto;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.payment-paid-mark::after {
    content: "";
    position: absolute;
    inset: 3px 4px 4px 3px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg) scale(.6);
    opacity: 0;
    transition: opacity .16s ease, border-color .16s ease, transform .16s ease;
}

.payment-paid-toggle:has(input:checked) {
    border-color: rgba(22, 163, 74, .35);
    background: rgba(22, 163, 74, .08);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .08);
}

.payment-paid-toggle:has(input:checked) .payment-paid-mark {
    border-color: #16a34a;
    background: #16a34a;
}

.payment-paid-toggle:has(input:checked) .payment-paid-mark::after {
    border-color: #fff;
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.payment-paid-toggle:hover .payment-paid-mark {
    border-color: #64748b;
}

.payment-paid-toggle:focus-within {
    border-color: rgba(37, 99, 235, .35);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.payment-confirm-grid button {
    min-height: 36px;
    padding: 0 12px;
    width: auto;
}

.payment-card-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: -2px;
}

.payment-card-foot form {
    margin: 0;
}

.payment-confirm-button,
.payment-remove-button {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: .74rem;
    width: auto;
    white-space: nowrap;
}

.payment-card-foot .payment-confirm-button {
    min-width: 84px;
}

.payment-card-foot .payment-remove-button {
    min-width: 122px;
}

.payment-confirm-button {
    background: #2563eb;
    border-color: #2563eb;
}

.payment-confirm-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.payment-remove-button {
    background: #dc2626;
    border-color: #dc2626;
}

.payment-remove-button:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

@media (max-width: 1100px) {
    .payment-card-head {
        flex-direction: column;
    }
}

@media (min-width: 1101px) {
    .payment-card-list {
        grid-template-columns:repeat(3, minmax(0, 1fr));
        align-items: start;
    }

    .payment-card {
        min-width: 0;
    }
}

@media (max-width: 700px) {
    .payment-confirm-grid {
        grid-template-columns:1fr;
        max-width: none;
    }

    .payment-confirm-grid button {
        width: 100%;
    }

    .payment-card-foot {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .payment-card-foot > * {
        width: 100%;
    }

    .payment-remove-button {
        width: 100%;
    }

    .payment-confirm-button {
        width: 100%;
    }
}

.payment-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(215, 226, 244, 0.28);
    border-top-color: #d7e2f4;
    animation: payment-spin 0.85s linear infinite;
}

.payment-state:not(.is-loading) .payment-spinner {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.numbers-filter-row {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: nowrap;
}

.numbers-filter-field {
    margin: 0;
    flex: 1 1 auto;
}

.numbers-filter-field input {
    min-height: 42px;
}

.numbers-filter-button {
    min-height: 42px;
    padding: 0 14px;
    width: auto;
    flex: 0 0 auto;
}

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

.raffle-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(16, 33, 58, .03);
}

.raffle-cover {
    aspect-ratio: 8 / 10;
    background: #dfe6f2;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.raffle-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.02) contrast(1.02);
}

.raffle-cover-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #10213a, #1d3d6e);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 12px;
}

.raffle-card-body {
    padding: 10px 10px 12px;
    display: grid;
    gap: 8px;
}

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

.raffle-card-head h3 {
    margin: 0;
    font-size: .9rem;
    line-height: 1.2;
}

.raffle-card-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.3;
}

.raffle-card-meta,
.raffle-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.raffle-card-meta .check-chip {
    min-height: 30px;
    padding: 0 9px;
    font-size: .74rem;
}

.raffle-chip.total {
    background: rgba(37, 99, 235, .10);
    border-color: rgba(37, 99, 235, .22);
    color: rgb(30, 64, 175);
}

.raffle-chip.remaining {
    background: rgba(22, 163, 74, .10);
    border-color: rgba(22, 163, 74, .22);
    color: rgb(22, 101, 52);
}

.raffle-chip.value {
    background: rgba(245, 158, 11, .10);
    border-color: rgba(245, 158, 11, .22);
    color: rgb(146, 64, 14);
}

.selected-numbers-box {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--muted);
    line-height: 1.4;
    margin-top: 10px;
}

#manualModeBlock {
    display: grid;
    gap: 10px;
}

.selectable-number-grid {
    grid-template-columns:repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
}

.number-select-chip {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.number-select-chip:hover {
    border-color: rgba(37, 99, 235, .28);
    transform: translateY(-1px);
}

.number-select-chip.selected {
    border-color: rgba(37, 99, 235, .45);
    background: rgba(37, 99, 235, .10);
    color: rgb(29, 78, 216);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.number-select-chip.available {
    background: rgba(37, 99, 235, .06);
}

.number-select-chip.reserved {
    background: rgba(245, 158, 11, .10);
    border-color: rgba(245, 158, 11, .28);
    color: rgb(146, 64, 14);
}

.number-select-chip.sold {
    background: rgba(220, 38, 38, .10);
    border-color: rgba(220, 38, 38, .28);
    color: rgb(153, 27, 27);
}

.number-select-chip:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.raffle-card-meta .check-chip small {
    font-size: .68rem;
}

.raffle-card-footer {
    justify-content: flex-end;
}

@media (max-width: 700px) {
    .raffles-catalog {
        grid-template-columns:1fr;
        gap: 10px;
    }

    .raffle-card {
        border-radius: 10px;
    }

    .raffle-cover {
        aspect-ratio: 8 / 10;
    }

    .raffle-card-body {
        padding: 9px;
        gap: 7px;
    }

    .raffle-card-head {
        gap: 8px;
        align-items: flex-start;
    }

    .raffle-card-head h3 {
        font-size: .88rem;
        line-height: 1.15;
    }

    .raffle-card-head p {
        font-size: .74rem;
    }

    .raffle-card-meta .check-chip,
    .raffle-card-footer .button {
        min-height: 28px;
        padding: 0 9px;
        font-size: .74rem;
    }

    .raffle-card-footer {
        justify-content: stretch;
    }

    .raffle-card-footer .button {
        width: 100%;
    }
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.stack-form button,
.stack-form .button,
.filter-form button,
.filter-form .button {
    width: auto;
}

.button.block {
    width: 100%;
}

.copybox {
    width: 100%;
    min-height: 150px;
    background: #f8fbff;
}

.order-detail-panel .panel-toolbar-actions button,
.order-detail-panel .panel-toolbar-actions .button {
    padding: 8px 12px;
    min-height: 34px;
    border-radius: 10px;
}

.order-detail-panel .panel-toolbar-actions form:last-child button.danger {
    padding-inline: 10px;
    min-width: 0;
    width: auto;
}

.order-detail-panel .panel-toolbar-actions button:hover,
.order-detail-panel .panel-toolbar-actions .button:hover {
    transform: none;
    box-shadow: none;
}

.order-detail-panel .order-message-box {
    min-height: 120px;
    max-height: 180px;
    padding: 10px 12px;
    font-size: .92rem;
    line-height: 1.35;
}

.order-detail-panel .order-confirm-form {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    display: flex;
    align-items: end;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.order-detail-panel .order-confirm-inline {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}

.order-detail-panel .panel-toolbar-actions {
    gap: 12px 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.order-detail-panel .panel-toolbar-actions > form {
    margin-top: 0;
}

.order-detail-panel .order-confirm-form select,
.order-detail-panel .order-confirm-form button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: .92rem;
}

.order-detail-panel .order-confirm-form label:first-child {
    min-width: 180px;
}

.order-detail-panel .order-confirm-form label:nth-child(2) {
    min-width: 180px;
}

.order-detail-panel .order-confirm-form select {
    min-width: 180px;
}

@media (max-width: 980px) {
    .order-detail-panel .panel-toolbar-actions {
        width: 100%;
    }

    .order-detail-panel .order-confirm-form,
    .order-detail-panel .order-confirm-inline {
        width: 100%;
        flex-wrap: wrap;
    }

    .order-detail-panel .order-confirm-form label,
    .order-detail-panel .order-confirm-form button,
    .order-detail-panel .panel-toolbar-actions > form {
        width: 100%;
    }

    .order-detail-panel .panel-toolbar-actions form:last-child button.danger {
        width: 100%;
    }
}

.camera-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid var(--border);
}

.camera-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-overlay {
    position: absolute;
    inset: 12%;
    border: 2px solid rgba(255, 255, 255, .78);
    border-radius: 18px;
    box-shadow: 0 0 0 9999px rgba(2, 6, 23, .18);
    pointer-events: none;
}

.scanner-actions {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.scanner-actions form {
    display: flex;
}

.scanner-actions button,
.scanner-actions .button {
    width: 100%;
}

.stack-label {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.scanner-result,
.scanner-result-list,
.scanner-tip {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.scanner-result {
    display: grid;
    gap: 8px;
}

.scanner-result strong {
    font-size: 1.45rem;
    color: var(--text);
    word-break: break-word;
}

.scanner-result-list {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.scanner-result-list strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
}

.check-chip.order-status.paid {
    border-color: rgba(22, 163, 74, .35);
    background: rgba(22, 163, 74, .12);
    color: rgb(22, 101, 52);
}

.compact-card .check-chip.order-status {
    min-height: 24px;
    padding: 0 8px;
    font-size: .72rem;
    line-height: 1;
    border-radius: 999px;
}

.check-chip.order-status.pending {
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .12);
    color: rgb(146, 64, 14);
}

.check-chip.order-status.cancelled {
    border-color: rgba(220, 38, 38, .35);
    background: rgba(220, 38, 38, .10);
    color: rgb(153, 27, 27);
}

.compact-grid {
    display: grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.compact-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 12px;
    display: grid;
    gap: 10px;
    width: 100%;
    text-align: left;
}

.compact-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.compact-number {
    font-size: 1.1rem;
    letter-spacing: 0;
}

.compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compact-card.client-activity-row {
    cursor: pointer;
    font: inherit;
    color: inherit;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .99)),
    var(--surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
    border-radius: 12px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.compact-card.client-store-row {
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
}

.compact-card.client-activity-row:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 250, 252, .98)),
    var(--surface-soft);
    border-color: rgba(37, 99, 235, .25);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
    transform: translateY(-1px);
}

.compact-ribbon {
    position: absolute;
    inset: 0 auto auto 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #2563eb, #14b8a6);
}

.compact-arrow {
    color: var(--muted);
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.compact-card .compact-top {
    align-items: flex-start;
    padding-left: 4px;
    min-width: 0;
}

.compact-card .compact-top strong {
    font-size: .9rem;
    line-height: 1.2;
}

.compact-card .compact-top > div {
    min-width: 0;
}

.compact-card .compact-meta {
    padding-left: 4px;
    margin-top: 4px;
    row-gap: 6px;
}

.compact-card .compact-meta .check-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-card .compact-submeta {
    margin-top: 2px;
    font-size: .78rem;
    color: var(--muted);
}

.pix-qr-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    margin-bottom: 14px;
}

.pix-qr-image {
    width: min(280px, 100%);
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
}

.detail-summary-grid {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 16px;
}

.detail-summary-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--surface-soft);
    display: grid;
    gap: 4px;
}

.detail-summary-item strong {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--muted);
}

.detail-summary-item span {
    font-weight: 800;
    color: var(--text);
}

.modal-section {
    margin-top: 10px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 14px 8px;
    box-shadow: none;
}

.history-row {
    padding: 12px 0;
}

.history-row .row-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.history-row .payment-link {
    color: #1f8f4a;
}

.history-title {
    display: grid;
    gap: 4px;
}

.compact-submeta {
    margin-top: 4px;
    font-size: .85rem;
    color: var(--muted);
}

.modal-panel .section-head h2 {
    font-size: 1rem;
}

.modal-panel .section-head p {
    font-size: .9rem;
}

@media (max-width: 700px) {
    .detail-summary-grid {
        grid-template-columns:1fr;
    }

    .compact-card.client-activity-row {
        padding: 9px;
    }

    .compact-card .compact-top {
        padding-left: 4px;
    }

    .compact-card .compact-meta {
        padding-left: 4px;
    }
}

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

.number-badge {
    justify-content: center;
    min-height: 24px;
    padding: 0 7px;
    font-size: .72rem;
}

@media (min-width: 1180px) {
    .compact-grid {
        gap: 6px;
    }
}

@media (min-width: 1080px) {
    .compact-number-grid {
        grid-template-columns:repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .compact-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

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

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

    .compact-number-grid {
        grid-template-columns:repeat(4, minmax(0, 1fr));
    }

    .raffles-catalog {
        grid-template-columns:1fr;
    }
}

.scanner-tip {
    margin-top: 12px;
}

.code-list,
.empty-state {
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.empty-state {
    color: var(--muted);
}

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

    .dashboard-hero,
    .dashboard-charts {
        grid-template-columns:1fr;
    }

    .stock-layout {
        display: block;
    }

    .stock-composition-grid {
        grid-template-columns:1fr;
    }

    .sales-grid {
        grid-template-columns:1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .split-grid.triple {
        grid-template-columns:1fr;
    }

    .scanner-actions,
    .scanner-result-list {
        grid-template-columns:1fr;
    }

    .legends-stock-grid,
    .legends-orders-grid,
    .legends-combos-grid {
        grid-template-columns:1fr;
    }

    .legend-search-wrap {
        grid-template-columns:1fr;
        align-items: stretch;
    }

    .legend-search-field {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }

    .legend-search-field input {
        width: 100%;
    }

    .legends-cart-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .legends-cart-row .row-meta {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .combo-item-row {
        grid-template-columns:1fr;
        align-items: flex-start;
    }

    .combo-item-meta {
        justify-content: flex-start;
    }

    .legends-cart-qty input {
        width: 100%;
    }
}

@media (max-width: 780px) {
    .app-shell {
        width: min(calc(100% - 16px), 1560px);
        padding-top: 12px;
    }

    .site-header {
        position: sticky;
        top: 0;
        padding: 14px 14px 12px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px 14px;
    }

    .header-top {
        align-items: flex-start;
    }

    .alerts-panel {
        right: 0;
        width: min(100vw - 24px, 360px);
    }

    .manage-panel {
        top: 0;
    }

    .legend-tabs-shell {
        display: flex;
        align-items: start;
        gap: 10px;
        width: 100%;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }

    .legend-tabs-toggle {
        display: inline-flex;
    }

    .legend-tabs-nav {
        position: absolute;
        left: 0;
        top: calc(100% + 10px);
        width: min(calc(100vw - 24px), 320px);
        max-width: calc(100vw - 24px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
        border: 1px solid var(--header-border);
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(16, 33, 58, .98), rgba(23, 39, 69, .98));
        box-shadow: 0 18px 40px rgba(10, 18, 33, .22);
        z-index: 40;
    }

    .legend-tabs-nav.is-open {
        display: flex;
    }

    .legend-tabs-nav .finance-subnav-link {
        width: 100%;
        justify-content: flex-start;
        white-space: normal;
    }

    .legend-tabs-shell > .legend-tabs-toggle {
        flex: 0 0 auto;
    }

    .legend-tabs-shell > .legend-tabs-nav {
        flex: 1 1 100%;
    }

    .raffles-detail-shell {
        margin-top: 16px;
    }

    .numbers-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .numbers-filter-field,
    .numbers-filter-button {
        width: 100%;
        flex: 1 1 auto;
    }

    .numbers-filter-field input {
        width: 100%;
    }

    .brand-block {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .brand-block > div {
        min-width: 0;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: 0;
        flex: 0 0 auto;
    }

    .site-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 10px);
        width: auto;
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
        padding: 12px;
        gap: 10px;
        border: 1px solid var(--header-border);
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(16, 33, 58, .98), rgba(23, 39, 69, .98));
        box-shadow: 0 18px 40px rgba(10, 18, 33, .22);
        z-index: 40;
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-link {
        flex: 1 1 auto;
        width: 100%;
    }

    .nav-logout-form {
        flex: 1 1 auto;
        width: 100%;
    }

    .nav-group {
        flex-direction: column;
        width: 100%;
    }

    .nav-submenu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 0;
    }

    .nav-group.is-open .nav-submenu {
        display: flex;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-toolbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .panel-toolbar-actions button {
        width: 100%;
    }

    .panel-toolbar-actions form {
        width: 100%;
    }

    .panel-toolbar-actions form button {
        width: 100%;
    }

    .order-confirm-form {
        grid-template-columns:1fr;
        width: 100%;
    }

    .manage-panel .manage-filters {
        grid-template-columns:1fr;
    }

    .manage-panel .filter-actions {
        justify-content: stretch;
    }

    .manage-panel .filter-actions .button,
    .manage-panel .filter-actions button {
        width: 100%;
        justify-content: center;
    }

    .checkout-fields {
        grid-template-columns:1fr;
    }

    .exchange-fields {
        grid-template-columns:1fr;
    }

    .checkout-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-buttons-left,
    .checkout-buttons-right {
        width: 100%;
    }

    .checkout-buttons-right {
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-buttons-left button,
    .checkout-buttons-right button {
        width: 100%;
        justify-content: center;
    }

    .apply {
        color: white !important;
    }

    .filter-form,
    .inline-form,
    .card-actions {
        grid-template-columns:1fr;
    }

    .filter-form {
        display: grid;
    }

    .order-filter-meta {
        width: 100%;
    }

    .order-filter-form {
        grid-template-columns:1fr;
        justify-content: stretch;
    }

    .order-filter-search,
    .order-filter-status {
        min-width: 0;
        width: 100%;
    }

    .filter-chip {
        justify-content: flex-start;
    }

    .order-filter-form button {
        width: 100%;
        justify-content: center;
    }

    .filter-form button,
    .filter-form .button,
    .stack-form button,
    .stack-form .button,
    .button.block,
    .scanner-actions button,
    .scanner-actions .button,
    .checkout-actions form button {
        width: 100%;
    }

    .inline-form,
    .card-actions {
        flex-direction: column;
    }

    .sticker-grid {
        grid-template-columns:repeat(auto-fill, minmax(148px, 1fr));
    }

    .table-row {
        align-items: flex-start;
    }

    .client-dashboard-store .table-row {
        flex-direction: row;
        align-items: center;
    }

    .client-dashboard-store .row-title {
        align-items: center;
    }

    .client-dashboard-store .row-meta {
        text-align: right;
    }
}

@media (max-width: 560px) {
    .metric-grid,
    .grid,
    .split-50,
    .dashboard-hero-stats,
    .dashboard-charts,
    .shortcut-grid {
        grid-template-columns:1fr;
    }

    .realtime-charts {
        grid-template-columns:1fr !important;
    }

    .realtime-summary-card {
        padding: 12px 14px;
    }

    .realtime-label {
        font-size: .72rem;
    }

    .realtime-title {
        margin-top: 6px;
        font-size: .84rem;
        line-height: 1.15;
    }

    .realtime-meta {
        margin-top: 4px;
        font-size: .76rem;
        line-height: 1.25;
    }

    .realtime-stats {
        grid-template-columns:repeat(2, minmax(0, 1fr));
        margin-top: 8px;
    }

    .realtime-title {
        white-space: normal;
    }

    .dashboard-hero-copy h2 {
        font-size: 1.08rem;
    }

    .sticker-grid {
        grid-template-columns:repeat(auto-fill, minmax(138px, 1fr));
    }

    .card-head,
    .table-row {
        flex-direction: column;
    }

    .result-actions {
        justify-content: stretch;
    }

    .result-actions button,
    .result-actions .button {
        width: 100%;
    }

    .settings-toolbar {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .settings-toolbar-left,
    .settings-toolbar-right {
        width: 100%;
    }

    .settings-toolbar button,
    .settings-toolbar .button {
        width: 100%;
    }

    .row-meta {
        text-align: left;
    }

    .row-title {
        align-items: flex-start;
    }

    .legends-cart-row {
        flex-direction: column;
    }

    .legends-cart-row .row-meta {
        margin-left: 0;
        width: 100%;
    }

    .legends-cart-meta {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        white-space: normal;
    }

    .legends-cart-qty {
        width: 100%;
    }

    .legends-cart-qty input {
        max-width: 72px;
    }

    .legends-cart-price {
        min-width: 0;
        text-align: left;
    }

    .camera-overlay {
        inset: 14%;
    }
}

.card-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    border: 1px solid rgba(16, 33, 58, .12);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.product-image-wrap {
    aspect-ratio: 1 / 1;
    background: #eef3f8;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-body {
    padding: 12px;
}

.product-meta,
.product-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.product-meta {
    font-size: .84rem;
    color: #475569;
}

.product-body h3 {
    margin: 8px 0 10px;
    font-size: 1rem;
}

.product-footer {
    align-items: flex-end;
}

.product-footer span {
    display: block;
    color: #667085;
    font-size: .8rem;
}

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

.store-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.store-topbar-title h2 {
    font-size: 1.15rem;
}

.store-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1 1 auto;
}

.store-batch-modal {
    width: min(1100px, calc(100vw - 24px));
}

.store-batch-layout {
    display: grid;
    grid-template-columns:340px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.store-batch-input,
.store-batch-results {
    min-width: 0;
}

.store-batch-input textarea {
    width: 100%;
    min-height: 220px;
    resize: vertical;
}

.store-batch-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.store-batch-results-list {
    max-height: 58vh;
    overflow: auto;
}

.store-batch-row .row-title {
    min-width: 0;
}

.store-batch-row .row-title strong,
.store-batch-row .row-title p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-cart-button {
    margin-left: auto;
}

.store-sidebar {
    position: sticky;
    top: 96px;
    padding: 14px;
    max-height: calc(100vh - 112px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.store-sidebar-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 12px;
}

.store-sidebar-head span {
    color: var(--muted);
    font-size: .85rem;
}

.store-sidebar-list {
    display: grid;
    gap: 8px;
}

.store-sidebar-list-historical {
    margin-bottom: 8px;
    flex: 0 0 auto;
}

.store-sidebar-list-scroll {
    flex: 1 1 auto;
    overflow: auto;
    padding-right: 4px;
    min-height: 0;
}

.store-team-link {
    display: grid;
    gap: 2px;
    padding: 12px 12px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    text-decoration: none;
    color: var(--text);
}

.store-team-prefix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 800;
    color: var(--muted);
}

.store-team-flag {
    font-size: .82rem;
    line-height: 1;
}

.store-team-flag.country-flag {
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    font-size: .82rem;
}

.store-team-flag.country-flag img.emoji {
    width: 16px;
    height: 16px;
}

.store-team-link strong {
    font-size: .92rem;
}

.store-team-link.active {
    border-color: rgba(35, 79, 189, .28);
    background: linear-gradient(180deg, #ffffff, #eef3ff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.client-showcase-list {
    display: grid;
    gap: 10px;
}

.client-showcase-list-main {
    padding: 2px 0 0;
}

.client-showcase-list-scroll{
    max-height: calc((5 * 72px) + (4 * 10px));
    overflow:auto;
    padding-right:4px;
}

.client-showcase-row {
    display: grid;
    grid-template-columns:auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(35, 79, 189, .08), rgba(255, 255, 255, 0)),
    var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.client-showcase-list-main .client-showcase-row {
    padding: 12px 14px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(35, 79, 189, .06), rgba(255, 255, 255, 0)),
        var(--surface-soft);
}

.client-showcase-row:hover {
    border-color: rgba(35, 79, 189, .25);
    box-shadow: 0 14px 24px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.client-showcase-list-main .client-showcase-row:hover {
    transform: none;
}

.client-showcase-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #234fbd;
    background: rgba(35, 79, 189, .10);
    border: 1px solid rgba(35, 79, 189, .18);
}

.client-showcase-list-main .client-showcase-badge {
    min-width: 80px;
    padding: 6px 9px;
    font-size: .66rem;
}

.client-showcase-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.client-showcase-copy strong {
    font-size: .98rem;
    line-height: 1.15;
}

.client-showcase-copy span {
    color: var(--muted);
    font-size: .86rem;
}

.client-showcase-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.client-showcase-list-main .client-showcase-action {
    font-size: .78rem;
}

.client-showcase-action .ui-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.client-dashboard-row {
    align-items: stretch;
    grid-auto-rows: auto;
}

.client-dashboard-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.client-dashboard-card .table-list {
    flex: 1 1 auto;
    min-height: 0;
}

.client-dashboard-feature {
    min-height: 0;
    max-height: none;
    align-self: stretch;
    height: 100%;
}

.client-dashboard-feature .client-showcase-list-main{
    display:grid;
    grid-auto-rows:min-content;
}

.client-dashboard-row-top .client-dashboard-account {
    min-height: 260px;
}

.client-dashboard-row-top .client-dashboard-feature {
    min-height: 260px;
}

.client-dashboard-row-bottom .client-dashboard-card {
    min-height: 260px;
}

.client-dashboard-row-top .client-dashboard-feature .client-showcase-list {
    max-height: 75px;
}

.client-dashboard-row-bottom .client-dashboard-store .table-list,
.client-dashboard-row-bottom .client-dashboard-wins .table-list {
    max-height: 100%;
}

.client-dashboard-row-top .client-dashboard-account .client-account-grid {
    min-height: 0;
}

.client-dashboard-account {
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(244, 247, 252, .98));
}

.client-account-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(35, 79, 189, .06), rgba(255, 255, 255, 0));
}

.client-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(180deg, #234fbd, #5d7eea);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(35, 79, 189, .18);
    flex: 0 0 auto;
}

.client-account-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.client-account-copy strong {
    font-size: 1.05rem;
    line-height: 1.1;
}

.client-account-copy span {
    color: var(--muted);
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-account-grid {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
}

.client-account-stat {
    display: grid;
    gap: 6px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.client-account-stat span {
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 700;
}

.client-account-stat strong {
    font-size: 1.15rem;
    line-height: 1.1;
}

.client-dashboard-store .table-list,
.client-dashboard-wins .table-list {
    gap: 10px;
}

.wins-count-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.win-item {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, var(--surface-soft));
    box-shadow: var(--shadow-soft);
}

.win-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.win-item-title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.win-item-title strong {
    font-size: .96rem;
    line-height: 1.2;
}

.win-item-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(22, 101, 52, .12);
    color: var(--success);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.win-item-number {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 800;
    letter-spacing: 0;
}

.win-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: .84rem;
    color: var(--muted);
}

.win-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.client-dashboard-store .table-list {
    padding-top: 2px;
}

.client-dashboard-wins .table-list .table-row,
.client-dashboard-store .table-list .table-row {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--surface-soft);
}

.client-dashboard-store .table-list .table-row:hover,
.client-dashboard-wins .table-list .table-row:hover {
    border-color: rgba(35, 79, 189, .2);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .06);
}

.win-item:hover {
    border-color: rgba(35, 79, 189, .2);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.client-dashboard-store .store-feature-row {
    align-items: center;
}

.client-dashboard-store .store-feature-title {
    gap: 12px;
}

.client-dashboard-store .store-feature-title > div {
    display: grid;
    gap: 4px;
}

.client-dashboard-store .store-feature-title strong {
    font-size: .98rem;
}

.client-dashboard-store .store-feature-title span {
    font-size: .86rem;
}

.client-dashboard-store .row-meta {
    align-items: flex-end;
    text-align: right;
}

.client-dashboard-store .row-meta strong {
    font-size: .85rem;
}

.client-dashboard-store .row-meta span {
    font-size: .8rem;
}

@media (max-width: 960px) {
    .client-dashboard-card {
        min-height: 0;
    }

    .client-dashboard-feature {
        min-height: 0;
        max-height: none;
    }

    .client-dashboard-feature .client-showcase-list {
        max-height: 100px !important;
    }

    .client-account-grid {
        grid-template-columns:1fr;
    }
}

.legend-rarity-pill,
.legend-rarity-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.legend-rarity-dot {
    width: 10px;
    height: 10px;
    padding: 0;
}

.legend-rarity-star {
    width: auto;
    height: auto;
    padding: 0;
    font-size: 17px;
    line-height: 1;
    background: transparent;
    border: none;
    box-shadow: none;
}

.legend-rarity-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .80rem;
    font-weight: 800;
    line-height: 1;
    background: transparent;
}

.legend-rarity-label.rarity-ouro {
    background: transparent;
    color: #3f2d00 !important;
}

.legend-rarity-label.rarity-ouro .legend-rarity-star {
    background: linear-gradient(180deg, #ffd94d, #f5b400);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent !important;
}

.legend-rarity-label.rarity-prata,
.legend-rarity-label.rarity-prata .legend-rarity-star {
    color: rgb(55, 65, 81) !important;
}

.legend-rarity-label.rarity-bronze,
.legend-rarity-label.rarity-bronze .legend-rarity-star {
    color: rgb(154, 52, 18) !important;
}

.legend-rarity-label.rarity-bordo,
.legend-rarity-label.rarity-bordo .legend-rarity-star {
    color: rgb(91, 33, 182) !important;
}

.store-main {
    min-width: 0;
}

.store-team-section {
    margin-bottom: 16px;
}

.store-team-grid {
    margin-top: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 980px) {
    .store-layout {
        grid-template-columns:1fr;
    }

    .store-sidebar {
        position: static;
    }

    .store-topbar {
        align-items: flex-start;
    }

    .store-topbar-actions {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .store-team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    .store-team-grid .product-card {
        min-width: 0;
    }

    .store-team-grid .product-body {
        padding: 10px;
    }
}

@media (max-width: 720px) {
    .store-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .store-topbar-title {
        min-width: 0;
    }

    .store-topbar-title h2 {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .store-topbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .store-topbar-actions > * {
        width: 100%;
    }

    .store-cart-button {
        margin-left: 0;
    }

    .store-topbar + .filter-form,
    .store-topbar ~ .filter-form {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        grid-template-columns:1fr !important;
    }

    .store-topbar + .filter-form label,
    .store-topbar ~ .filter-form label {
        width: 100%;
    }

    .store-topbar + .filter-form > label,
    .store-topbar ~ .filter-form > label {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .store-topbar + .filter-form select,
    .store-topbar + .filter-form input,
    .store-topbar ~ .filter-form select,
    .store-topbar ~ .filter-form input {
        width: 100%;
        min-width: 0;
    }

    .store-topbar + .filter-form > div,
    .store-topbar ~ .filter-form > div {
        width: 100%;
    }

    .store-batch-layout {
        grid-template-columns:1fr;
    }

    .store-batch-results-list {
        max-height: 42vh;
    }
}
