:root {
    --bg: #f4f8fb;
    --surface: #ffffff;
    --surface-soft: #f8fbfd;
    --sidebar: #073f4d;
    --sidebar-2: #042f3b;
    --primary: #087987;
    --primary-dark: #05606b;
    --primary-soft: #e6f7f8;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #d97706;
    --warning-soft: #fff7ed;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --info: #2563eb;
    --info-soft: #eff6ff;
    --text: #0f2433;
    --muted: #667789;
    --border: #d9e6ee;
    --border-soft: #edf3f7;
    --shadow: 0 18px 45px rgba(15, 36, 51, .08);
    --shadow-soft: 0 8px 24px rgba(15, 36, 51, .06);
    --radius: 10px;
    --sidebar-width: 252px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    padding: 16px 12px;
    overflow: auto;
    color: #eaf7f8;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    border-right: 1px solid rgba(255, 255, 255, .08);
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 70px;
    padding: 10px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
}

.brand-clover {
    width: 30px;
    height: 30px;
    display: block;
}

.brand-text {
    min-width: 0;
}

.brand-text strong {
    display: block;
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.05;
}

.brand-text small {
    display: block;
    margin-top: 4px;
    color: #c7e4e8;
    font-size: 12px;
    font-weight: 500;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: calc(100vh - 116px);
}

.nav-link,
.nav summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 10px 11px;
    border-radius: 7px;
    color: #dceff2;
    cursor: pointer;
    font-weight: 700;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-link span,
.nav summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link:hover,
.nav summary:hover,
.nav-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.nav-link.is-active {
    box-shadow: inset 3px 0 0 #7be3c9;
}

.nav details {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    padding: 4px;
}

.nav details[open] {
    background: rgba(0, 0, 0, .08);
}

.nav summary {
    list-style: none;
}

.nav summary::-webkit-details-marker {
    display: none;
}

.nav details .nav-link {
    margin-top: 4px;
    padding-left: 34px;
    min-height: 36px;
    font-size: 13px;
}

.nav-chevron {
    margin-left: auto;
    width: 15px;
    height: 15px;
    opacity: .8;
}

.nav details[open] .nav-chevron {
    transform: rotate(180deg);
}

.nav-spacer {
    flex: 1 1 auto;
    min-height: 12px;
}

.logout {
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, .28);
    background: rgba(127, 29, 29, .14);
}

.seller-header-status {
    margin: -4px 0 14px;
}

.seller-header-status .status-chip {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
}

.seller-topbar-status {
    display: none;
    margin-left: auto;
}

.main-content {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 18px 16px 32px;
}

.content-wrap {
    width: min(100%, 1500px);
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 14px 16px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.topbar-menu-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    background: #fff;
    cursor: pointer;
}

.topbar-title {
    min-width: 0;
}

.topbar-title p {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.topbar-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-icon-btn,
.topbar-pill,
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: #fff;
}

.topbar-icon-btn {
    position: relative;
    justify-content: center;
    width: 38px;
    padding: 0;
    cursor: pointer;
}

.notify-dot {
    position: absolute;
    top: -4px;
    right: -2px;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    font-size: 10px;
    font-weight: 600;
}

.topbar-pill {
    padding: 0 12px;
    color: #314556;
    font-size: 12px;
    font-weight: 600;
}

.topbar-user {
    padding: 4px 10px 4px 5px;
}

.topbar-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    font-weight: 600;
}

.topbar-user strong,
.topbar-user small {
    display: block;
    line-height: 1.1;
}

.topbar-user strong {
    font-size: 13px;
}

.topbar-user small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.page-title h1 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
}

.page-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

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

.card {
    margin-bottom: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.stat {
    position: relative;
    min-height: 112px;
    overflow: hidden;
}

.stat h3 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    color: var(--text);
    font-size: 26px;
    line-height: 1.05;
}

.stat p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-soft);
}

.stat-icon.success {
    color: var(--success);
    background: var(--success-soft);
}

.stat-icon.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.stat-icon.info {
    color: var(--info);
    background: var(--info-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

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

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

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

.btn-blue {
    color: #fff;
    background: #0f4c81;
}

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

.btn-warning {
    color: #111827;
    background: #fbbf24;
}

.btn-light {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: #bde7eb;
}

.btn-sm {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 12px;
}

.actions,
.modal-actions,
.finance-actions,
.winner-actions,
.seller-form-actions,
.seller-form-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.finance-filter-form,
.reports-filter-form,
.logs-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
    max-width: 1000px;
}

.finance-filter-form .finance-actions,
.reports-filter-form .finance-actions,
.logs-filter-form .form-actions-end {
    align-self: end;
    padding-bottom: 0;
}

.winner-number-check {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 1000px;
}

.winner-number-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
    flex: 1 1 auto;
}

.winner-number-search .field,
.winner-confirm-inline {
    margin: 0;
}

.winner-confirm-inline {
    display: flex;
    align-items: flex-end;
    flex: 0 0 auto;
}

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

.field label {
    display: block;
    margin: 0 0 5px;
    color: #24384a;
    font-size: 13px;
    font-weight: 600;
}

.field input,
.field select,
.field textarea,
.actions input {
    width: 100%;
    min-height: 39px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
    outline: none;
}

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

.btn-whatsapp {
    width: 38px;
    min-width: 38px;
    padding: 0;
    color: #fff;
    background: #16a34a;
}

.btn-whatsapp .app-icon {
    width: 20px;
    height: 20px;
    stroke-width: 1.7;
}

.btn-whatsapp:hover {
    background: #15803d;
}

.seller-edit-modal {
    width: min(740px, 96vw);
}

.seller-edit-form {
    gap: 9px 12px;
}

.seller-edit-form .field label {
    margin-bottom: 3px;
}

.seller-edit-actions {
    grid-column: 1 / -1;
    margin-top: 14px;
    padding-top: 4px;
}

.game-edit-modal {
    width: min(760px, 96vw);
}

.game-edit-form {
    gap: 9px 12px;
}

.game-edit-form .field {
    grid-column: 1 / -1;
}

.game-edit-form .field label {
    margin-bottom: 3px;
}

.game-edit-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 14px;
    padding-top: 4px;
}

.generate-tickets-form {
    align-items: end;
}

.generate-ticket-actions {
    align-self: end;
    padding-bottom: 17px;
}

.field textarea {
    min-height: 90px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.actions input:focus {
    border-color: #77cbd3;
    box-shadow: 0 0 0 3px rgba(8, 121, 135, .12);
}

.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 700 !important;
}

.checkbox-line input {
    width: auto;
}

.table-wrap {
    overflow: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.table th,
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: #40566a;
    background: #f3f8fb;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.table tr:hover td {
    background: #fbfdfe;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-open,
.badge-active,
.badge-sold {
    color: #166534;
    background: var(--success-soft);
}

.badge-waiting {
    color: #92400e;
    background: #fef3c7;
}

.badge-closed,
.badge-suspended,
.badge-cancelled {
    color: #991b1b;
    background: var(--danger-soft);
}

.badge-available {
    color: #1e40af;
    background: #dbeafe;
}

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

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 700;
}

.alert-success {
    color: #166534;
    background: var(--success-soft);
    border-color: #bbf7d0;
}

.alert-error {
    color: #991b1b;
    background: var(--danger-soft);
    border-color: #fecaca;
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    font-weight: 600;
}

.active-game-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.active-game-label {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.active-game-name {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

.active-game-name span,
.active-game-name time {
    display: inline-block;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.status-chip-dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.status-chip-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 999px;
    opacity: .35;
    animation: statusPulse 1.6s ease-out infinite;
}

.status-chip-open {
    color: #166534;
    background: var(--success-soft);
    border-color: #bbf7d0;
}

.status-chip-open .status-chip-dot,
.status-chip-open .status-chip-dot::after {
    background: var(--success);
}

.status-chip-waiting {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.status-chip-waiting .status-chip-dot,
.status-chip-waiting .status-chip-dot::after {
    background: #f59e0b;
}

.status-chip-closed,
.status-chip-finished {
    color: #991b1b;
    background: var(--danger-soft);
    border-color: #fecaca;
}

.status-chip-closed .status-chip-dot,
.status-chip-closed .status-chip-dot::after,
.status-chip-finished .status-chip-dot,
.status-chip-finished .status-chip-dot::after {
    background: var(--danger);
}

.status-chip-neutral {
    color: #334155;
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.status-chip-neutral .status-chip-dot,
.status-chip-neutral .status-chip-dot::after {
    background: #64748b;
}

@keyframes statusPulse {
    0% { transform: scale(.6); opacity: .45; }
    70% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    padding: 18px;
    overflow: auto;
    background: rgba(15, 23, 42, .55);
}

.modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    width: min(760px, 96vw);
    max-height: 92vh;
    overflow: auto;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .24);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-head h2 {
    margin: 0;
    font-size: 20px;
}

.modal-head button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.qr-reader video {
    display: none;
    width: min(420px, 100%);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.qr-reader video.is-active {
    display: block;
}

.qr-reader [data-qr-html5-reader] {
    width: 100%;
    max-width: 560px;
    margin: 10px auto;
}

.qr-reader [data-qr-html5-reader] video {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    background: #111827;
}

.qr-manual-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 12px;
}

.qr-manual-entry input {
    min-height: 38px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}

.qr-scan-result-card {
    margin-top: 12px;
    padding: 14px;
    color: #0f172a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    text-align: center;
}

.qr-scan-result-card[hidden] {
    display: none;
}

.qr-scan-result-card span {
    display: block;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.qr-scan-result-card strong {
    display: block;
    margin-top: 4px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: .08em;
}

.qr-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 520px) {
    .qr-result-actions {
        grid-template-columns: 1fr;
    }
}

.qr-scan-modal {
    width: min(640px, 96vw);
}

.qr-result-modal {
    width: min(640px, 96vw);
}

.qr-result-status {
    margin-bottom: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

.qr-result-sold {
    color: #166534;
    background: var(--success-soft);
}

.qr-result-open {
    color: #92400e;
    background: #fef3c7;
}

.qr-result-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.qr-result-list div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.qr-result-list span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.qr-result-list b {
    display: block;
    color: var(--text);
    word-break: break-word;
}

.seller-mobile-list {
    display: none;
}

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

.seller-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.seller-card-title-row span {
    min-width: 28px;
    padding: 4px 8px;
    color: var(--primary);
    background: #e8f8f0;
    border: 1px solid #cfe8da;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.seller-available-list {
    display: grid;
    gap: 8px;
}

.seller-ticket-available .seller-ticket-head {
    margin-bottom: 4px;
}

.seller-ticket-available {
    padding: 10px;
}

.seller-ticket-available .seller-ticket-head strong {
    font-size: 15px;
}

.seller-ticket-available .seller-ticket-numbers {
    margin: 0;
    padding: 7px 8px;
    font-size: 16px;
    line-height: 1.2;
}

.seller-empty-text {
    margin: 0;
    padding: 10px 0 2px;
}

.seller-sales-closed-alert {
    margin-bottom: 10px;
}

.seller-current-game-card {
    display: none;
}

.seller-summary-strip {
    display: none;
}

.role-seller.page-tickets .seller-current-game-card,
.role-seller.page-dashboard .seller-current-game-card {
    display: flex;
    align-items: center;
    gap: 0;
}

.role-seller.page-tickets .seller-current-game-card .active-game-name,
.role-seller.page-dashboard .seller-current-game-card .active-game-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.role-seller.page-tickets .seller-current-game-card .active-game-name span,
.role-seller.page-dashboard .seller-current-game-card .active-game-name span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-seller.page-tickets .seller-current-game-card .active-game-name time,
.role-seller.page-dashboard .seller-current-game-card .active-game-name time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.role-seller.page-tickets .seller-summary-strip,
.role-seller.page-dashboard .seller-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 10px;
    padding: 10px 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.role-seller.page-tickets .seller-summary-strip div,
.role-seller.page-dashboard .seller-summary-strip div {
    min-width: 0;
    padding: 0 8px;
    text-align: center;
    border-right: 1px solid var(--border-soft);
}

.role-seller.page-tickets .seller-summary-strip div:last-child,
.role-seller.page-dashboard .seller-summary-strip div:last-child {
    border-right: 0;
}

.role-seller.page-tickets .seller-summary-strip span,
.role-seller.page-dashboard .seller-summary-strip span {
    display: block;
    margin-bottom: 2px;
    color: #0f2433;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
}

.role-seller.page-tickets .seller-summary-strip strong,
.role-seller.page-dashboard .seller-summary-strip strong {
    display: block;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
}

.role-seller.page-tickets .seller-summary-strip div:last-child strong,
.role-seller.page-dashboard .seller-summary-strip div:last-child strong {
    color: var(--primary);
}

.seller-ticket-card {
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.seller-ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.seller-ticket-head strong {
    font-size: 16px;
}

.seller-ticket-head span {
    color: var(--success);
    font-weight: 600;
}

.seller-ticket-game {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.seller-ticket-numbers {
    margin: 8px 0;
    padding: 8px;
    border-radius: 8px;
    color: var(--text);
    background: #f3f8fb;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.seller-sale-form {
    display: grid;
    gap: 8px;
}

.seller-sale-form input {
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.seller-ticket-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.seller-ticket-meta div {
    padding: 8px;
    border-radius: 8px;
    background: #f8fafc;
}

.seller-ticket-meta span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.seller-ticket-meta b {
    display: block;
    margin-top: 3px;
}

.bulk-ticket-lines {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.bulk-ticket-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.bulk-ticket-add {
    margin-top: 10px;
}

.seller-qr-btn,
.seller-remove-btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
}

.seller-form-hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.seller-form-hint-error {
    color: var(--danger);
    font-weight: 700;
}

.role-seller.page-tickets .field input.is-duplicate {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.seller-recent-table small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.login-page {
    min-height: 100vh;
    background: #eef5f8;
    overflow: hidden;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(320px, 1.1fr);
    padding: 0;
}

.login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 42px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(160deg, #06414e, #032c36);
    border-radius: 0;
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: 0 -18% 0 auto;
    width: 44%;
    background: rgba(255, 255, 255, .08);
    transform: skewX(-10deg);
}

.login-hero-content,
.login-hero-foot,
.login-ticket-demo {
    position: relative;
    z-index: 1;
}

.login-hero-logo {
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
}

.login-hero h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.05;
}

.login-hero p {
    max-width: 300px;
    margin: 12px 0 0;
    color: #c7e4e8;
    font-weight: 700;
}

.login-ticket-demo {
    width: min(310px, 88%);
    margin: 42px auto;
    padding: 20px;
    color: #412d04;
    background: #ffd064;
    border: 2px solid #e5a928;
    border-radius: 10px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .24);
    transform: rotate(-5deg);
}

.login-ticket-demo strong {
    display: block;
    margin-bottom: 10px;
    font-size: 20px;
}

.login-ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    max-width: 168px;
}

.login-ticket-grid span {
    padding: 5px 8px;
    border: 1px solid rgba(65, 45, 4, .5);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.login-ticket-qr-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    color: #412d04;
}

.login-hero-foot {
    color: #b7d5da;
    font-size: 12px;
}

.login-panel {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px;
    background: #fff;
    border-radius: 0;
}

.login-card {
    width: min(430px, 100%);
    padding: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.login-brand {
    margin-bottom: 24px;
}

.login-brand h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
}

.login-brand p {
    margin: 6px 0 0;
    color: var(--muted);
}

.login-card .field {
    margin-bottom: 14px;
}

.login-password-wrap {
    position: relative;
}

.login-password-wrap input {
    padding-right: 44px;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 2px 0 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.login-options a {
    color: var(--primary);
    white-space: nowrap;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.login-remember input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.login-submit {
    width: 100%;
    margin-top: 6px;
}

.login-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.blocked-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.blocked-card {
    width: min(440px, 92vw);
}

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

@media (max-width: 900px) {
    .app-shell {
        min-height: 100vh;
    }

    .sidebar {
        transform: translateX(-104%);
        transition: transform .18s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, .22);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0 12px 12px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        min-height: 64px;
        margin: 0 -12px 12px;
        border-radius: 0 0 10px 10px;
        border-top: 0;
        border-left: 0;
        border-right: 0;
    }

    .topbar-menu-button {
        display: inline-flex;
    }

    .topbar-title p {
        display: none;
    }

    .topbar-title h2 {
        font-size: 17px;
    }

    .topbar-pill {
        display: none;
    }

    .topbar-user {
        padding-right: 6px;
    }

    .topbar-user div,
    .topbar-user > .app-icon {
        display: none;
    }

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

    .finance-filter-form,
    .reports-filter-form,
    .logs-filter-form {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .finance-filter-form .finance-actions,
    .finance-filter-form .finance-actions .btn,
    .reports-filter-form .finance-actions,
    .reports-filter-form .finance-actions .btn,
    .logs-filter-form .form-actions-end,
    .logs-filter-form .form-actions-end .btn {
        width: 100%;
    }

    .generate-ticket-actions {
        padding-bottom: 0;
    }

    .generate-ticket-actions .btn {
        width: 100%;
    }

    .winner-number-check,
    .winner-number-search {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: none;
    }

    .winner-number-search .winner-actions,
    .winner-confirm-inline,
    .winner-number-search .btn,
    .winner-confirm-inline .btn {
        width: 100%;
    }

    .role-seller .main-content {
        padding: 0 8px 8px;
    }

    .role-seller .topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 -8px 10px;
        min-height: 58px;
        padding: 9px 10px;
        border-top: 0;
        border-left: 0;
        border-right: 0;
        border-radius: 0 0 10px 10px;
    }

    .role-seller .topbar-meta {
        display: none;
    }

    .role-seller .topbar-title h2 {
        margin: 0;
        max-width: none;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.1;
        text-align: left;
        white-space: nowrap;
    }

    .role-seller .topbar-menu-button {
        width: 39px;
        height: 39px;
        border-radius: 10px;
        color: var(--primary);
        background: #fff;
        border-color: var(--border);
    }

    .role-seller .topbar-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .role-seller .seller-topbar-status {
        display: flex;
        flex: 0 0 auto;
    }

    .role-seller .seller-topbar-status .status-chip {
        padding: 7px 9px;
        font-size: 11px;
        white-space: nowrap;
    }

    .role-seller .seller-topbar-status .status-chip-dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 700px) {
    body {
        background: #eef4f7;
    }

    .login-page {
        overflow: auto;
    }

    .main-content {
        padding: 0 8px 8px;
    }

    .topbar {
        margin: 0 -8px 10px;
    }

    .page-title {
        margin-bottom: 10px;
    }

    .page-title h1 {
        font-size: 21px;
    }

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

    .card {
        margin-bottom: 10px;
        padding: 11px;
        border-radius: 9px;
        box-shadow: none;
    }

    .stat {
        min-height: 96px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        margin-bottom: 10px;
    }

    .stat strong {
        font-size: 22px;
    }

    .btn {
        min-height: 38px;
        padding: 8px 10px;
    }

    .actions .btn,
    .seller-form-actions .btn,
    .seller-form-submit .btn {
        width: auto;
    }

    .table th,
    .table td {
        padding: 8px;
        font-size: 12px;
    }

    .seller-mobile-list {
        display: block;
    }

    .seller-desktop-table {
        display: none;
    }

    .qr-result-list,
    .seller-ticket-meta {
        grid-template-columns: 1fr;
    }

    .role-seller.page-tickets .page-title,
    .role-seller.page-dashboard .page-title {
        display: none;
    }

    .role-seller.page-tickets .seller-current-game-card,
    .role-seller.page-dashboard .seller-current-game-card {
        display: flex;
        align-items: center;
        gap: 0;
        margin-top: 2px;
    }

    .role-seller.page-tickets .seller-current-game-card .active-game-name,
    .role-seller.page-dashboard .seller-current-game-card .active-game-name {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.25;
    }

    .role-seller.page-tickets .seller-current-game-card .active-game-name span,
    .role-seller.page-dashboard .seller-current-game-card .active-game-name span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .role-seller.page-tickets .seller-current-game-card .active-game-name time,
    .role-seller.page-dashboard .seller-current-game-card .active-game-name time {
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
    }

    .role-seller.page-tickets .seller-current-game-card [data-seller-status-card-badge],
    .role-seller.page-dashboard .seller-current-game-card [data-seller-status-card-badge] {
        display: none;
    }

    .role-seller.page-tickets .seller-summary-strip,
    .role-seller.page-dashboard .seller-summary-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        margin: 0 0 10px;
        padding: 10px 8px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow-soft);
    }

    .role-seller.page-tickets .seller-summary-strip div,
    .role-seller.page-dashboard .seller-summary-strip div {
        min-width: 0;
        padding: 0 8px;
        text-align: center;
        border-right: 1px solid var(--border-soft);
    }

    .role-seller.page-tickets .seller-summary-strip div:last-child,
    .role-seller.page-dashboard .seller-summary-strip div:last-child {
        border-right: 0;
    }

    .role-seller.page-tickets .seller-summary-strip span,
    .role-seller.page-dashboard .seller-summary-strip span {
        display: block;
        margin-bottom: 2px;
        color: #0f2433;
        font-size: 10px;
        font-weight: 600;
        line-height: 1.1;
    }

    .role-seller.page-tickets .seller-summary-strip strong,
    .role-seller.page-dashboard .seller-summary-strip strong {
        display: block;
        color: var(--text);
        font-size: 18px;
        font-weight: 700;
        line-height: 1.05;
        white-space: nowrap;
    }

    .role-seller.page-tickets .seller-summary-strip div:last-child strong,
    .role-seller.page-dashboard .seller-summary-strip div:last-child strong {
        color: var(--primary);
    }

    .role-seller.page-tickets .seller-bulk-card {
        border-radius: 14px;
        padding: 13px;
    }

    .role-seller.page-tickets .seller-bulk-card h2,
    .role-seller.page-tickets .seller-available-card h2,
    .role-seller.page-tickets .seller-recent-sales-card h2 {
        margin-bottom: 12px;
        color: #020617;
        font-size: 19px;
        font-weight: 600;
        line-height: 1.15;
    }

    .role-seller.page-tickets .seller-bulk-card .field label {
        display: none;
    }

    .role-seller.page-tickets .seller-bulk-card .form-grid,
    .role-seller.page-tickets .bulk-ticket-lines {
        gap: 8px;
    }

    .role-seller.page-tickets .bulk-ticket-lines {
        margin-bottom: 14px;
    }

    .role-seller.page-tickets .seller-note-field {
        display: none;
    }

    .role-seller.page-tickets .field input,
    .role-seller.page-tickets .seller-sale-form input {
        min-height: 42px;
        border-color: #cfe8da;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 500;
    }

    .role-seller.page-tickets .field input::placeholder {
        color: #94a3b8;
        font-weight: 500;
    }

    .bulk-ticket-row {
        grid-template-columns: minmax(0, 1fr) 46px 46px;
        gap: 7px;
        align-items: end;
    }

    .role-seller.page-tickets .seller-qr-btn,
    .role-seller.page-tickets .seller-remove-btn {
        width: 46px;
        min-width: 46px;
        height: 42px;
        border-radius: 10px;
    }

    .role-seller.page-tickets .seller-remove-btn {
        font-size: 18px;
        font-weight: 700;
    }

    .role-seller.page-tickets .seller-form-submit .btn,
    .role-seller.page-tickets .bulk-ticket-add .btn {
        width: 100%;
        min-height: 42px;
        border-radius: 10px;
        font-weight: 700;
    }

    .role-seller.page-tickets .bulk-ticket-add .btn {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

    .role-seller.page-tickets .seller-form-hint {
        font-size: 11px;
    }

    .role-seller.page-tickets .seller-search-card {
        display: none;
    }

    .role-seller.page-tickets .seller-recent-sales-card {
        border-radius: 14px;
        padding: 13px;
    }

    .role-seller.page-tickets .seller-recent-table-wrap {
        overflow: auto;
        border: 1px solid #d9efe3;
        border-radius: 12px;
    }

    .role-seller.page-tickets .seller-recent-table th,
    .role-seller.page-tickets .seller-recent-table td {
        padding: 9px 8px;
        white-space: nowrap;
        font-size: 12px;
        font-weight: 500;
    }

    .role-seller.page-tickets .seller-recent-table th {
        color: #052e20;
        background: #e9f8ef;
        font-weight: 700;
    }

    .role-seller.page-tickets .seller-recent-table td:first-child {
        color: #020617;
        font-weight: 600;
    }

    .login-shell {
        display: grid;
        min-height: 100vh;
        grid-template-columns: 1fr;
        padding: 0;
        background: #fff;
    }

    .login-hero {
        display: none;
    }

    .login-ticket-demo {
        display: none;
    }

    .login-panel {
        display: grid;
        place-items: center;
        min-height: 100vh;
        padding: 24px 20px;
        border-radius: 0;
    }

    .login-card {
        width: min(100%, 390px);
        margin: 0 auto;
        padding: 0;
    }

    .login-brand {
        margin-bottom: 22px;
    }

    .login-brand h1 {
        font-size: 22px;
        font-weight: 700;
    }

    .login-brand p {
        margin-top: 5px;
        font-size: 12px;
    }

    .login-card .field {
        margin-bottom: 16px;
    }

    .login-card .field label {
        margin-bottom: 7px;
        color: #334155;
        font-size: 12px;
        font-weight: 600;
    }

    .login-card .field input {
        min-height: 45px;
        padding: 10px 13px;
        border-color: #dbe5ec;
        border-radius: 7px;
        font-size: 13px;
    }

    .login-card .field input::placeholder {
        color: #9aa8b5;
    }

    .login-password-toggle {
        right: 7px;
        width: 34px;
        height: 34px;
    }

    .login-options {
        margin: 1px 0 17px;
        font-size: 11px;
    }

    .login-submit {
        min-height: 45px;
        margin-top: 0;
        border-radius: 7px;
        background: linear-gradient(90deg, var(--primary), #056f86);
        font-size: 12px;
        font-weight: 600;
    }

    .login-note {
        display: none;
    }
}

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

    .topbar {
        gap: 8px;
        padding: 10px;
    }

    .topbar-title h2 {
        max-width: 175px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
