:root {
    --vp-bg: #eef3fb;
    --vp-surface: #ffffff;
    --vp-surface-soft: #f8fafd;
    --vp-border: #dfe7f2;
    --vp-text: #101b33;
    --vp-muted: #71809a;
    --vp-primary: #2f5fb8;
    --vp-primary-dark: #244f9e;
    --vp-danger: #ef4444;
    --vp-success: #18a957;
    --vp-warning: #f59e0b;
    --vp-radius: 14px;
    --vp-shadow: 0 10px 28px rgba(25, 55, 109, 0.08);
}

html, body {
    background: var(--vp-bg);
    color: var(--vp-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a, .btn-link {
    color: var(--vp-primary);
}

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

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.4rem;
}

h1 {
    color: var(--vp-text);
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0;
}

p.text-body-secondary,
.text-body-secondary {
    color: var(--vp-muted) !important;
    font-size: 0.82rem;
    font-weight: 600;
}

.alert {
    border: 0;
    border-radius: 12px;
    box-shadow: var(--vp-shadow);
    font-weight: 700;
}

.login-page {
    align-items: center;
    background: #eef3fb;
    display: flex;
    min-height: 100vh;
    justify-content: center;
    padding: 1.5rem;
}

.login-panel {
    background: #ffffff;
    border: 1px solid var(--vp-border);
    border-radius: 16px;
    box-shadow: var(--vp-shadow);
    display: grid;
    gap: 1.4rem;
    max-width: 26rem;
    padding: 2rem;
    width: 100%;
}

.login-brand {
    align-items: center;
    background: var(--vp-primary);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(47, 95, 184, 0.28);
    color: #ffffff;
    display: flex;
    font-size: 0.95rem;
    font-weight: 900;
    height: 3rem;
    justify-content: center;
    margin-bottom: 1rem;
    width: 3rem;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.form-label {
    color: var(--vp-muted);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border: 1px solid var(--vp-border);
    border-radius: 12px;
    color: var(--vp-text);
    min-height: 2.8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #9db6e4;
    box-shadow: 0 0 0 0.18rem rgba(47, 95, 184, 0.12);
}

.table-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.search-input {
    max-width: 280px;
}

.edit-panel {
    background: var(--vp-surface);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    box-shadow: var(--vp-shadow);
    padding: 1.25rem;
}

.empty-state {
    border: 1px dashed #ced4da;
    border-radius: 8px;
    color: #6c757d;
    padding: 2rem;
    text-align: center;
}

.grid-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
}

.dialog-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.pos-shell {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) 320px;
}

.pos-panel {
    background: var(--vp-surface);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    box-shadow: var(--vp-shadow);
    padding: 1.1rem;
}

.pos-total {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.autocomplete-box {
    position: relative;
}

.autocomplete-menu {
    background: white;
    border: 1px solid var(--vp-border);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.35rem;
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
}

.autocomplete-menu button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    display: grid;
    gap: 0.1rem;
    padding: 0.65rem 0.8rem;
    text-align: left;
    width: 100%;
}

.autocomplete-menu button:hover,
.autocomplete-menu button:focus {
    background: #edf4ff;
}

.autocomplete-menu span {
    color: #0f172a;
    font-weight: 700;
}

.autocomplete-menu small {
    color: #64748b;
}

.autocomplete-empty {
    color: var(--vp-muted);
    font-size: 0.85rem;
    padding: 0.7rem 0.8rem;
}

.payment-dialog .e-dlg-content {
    padding: 0;
}

.payment-head {
    background: var(--vp-primary);
    color: white;
    padding: 1.25rem 1.5rem;
}

.payment-head div {
    font-size: 1rem;
    opacity: 0.9;
}

.payment-head strong {
    display: block;
    font-size: 2.4rem;
    line-height: 1.05;
}

.payment-body {
    padding: 1.5rem;
}

.payment-tabs {
    background: #edf1f6;
    border-radius: 14px;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(4, 1fr);
    padding: 0.35rem;
}

.payment-tabs button,
.payment-quick button {
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--vp-primary);
    font-weight: 700;
    min-height: 2.8rem;
}

.payment-tabs button.active {
    background: white;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.payment-tabs button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.payment-input {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    font-size: 1.45rem;
    font-weight: 700;
    min-height: 3.8rem;
    padding: 0 1rem;
    width: 100%;
}

.payment-quick {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 0.85rem;
}

.payment-quick button {
    border: 1px solid #cbd5e1;
    min-height: 3rem;
}

.payment-balance {
    align-items: center;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 1rem;
}

.payment-balance.is-missing {
    background: #fde8e8;
    color: #dc2626;
}

.payment-balance.is-ok {
    background: #e8f8ef;
    color: #16803a;
}

.payment-balance span {
    color: #52627a;
    font-size: 1rem;
}

.payment-balance strong {
    font-size: 1.55rem;
}

.payment-confirm {
    background: var(--vp-primary);
    border: 0;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.25rem;
    min-height: 3.7rem;
    width: 100%;
}

.payment-confirm:disabled {
    background: #cbd5e1;
}

.ticket-dialog .e-dlg-content {
    background: #f8fafd;
}

.ticket-preview {
    background: white;
    border: 1px solid var(--vp-border);
    color: #111827;
    font-family: "Consolas", "Courier New", monospace;
    margin: 0 auto;
    max-width: 360px;
    padding: 1rem;
}

.ticket-preview header,
.ticket-preview footer {
    text-align: center;
}

.ticket-preview h2 {
    font-size: 1rem;
    font-weight: 900;
    margin: 0 0 0.25rem;
}

.ticket-preview p {
    font-size: 0.78rem;
    margin: 0;
}

.ticket-meta,
.ticket-totals {
    border-top: 1px dashed #94a3b8;
    display: grid;
    gap: 0.25rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.ticket-meta div,
.ticket-totals div {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.ticket-preview span {
    color: #475569;
}

.ticket-preview strong {
    color: #111827;
}

.ticket-preview table {
    border-top: 1px dashed #94a3b8;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    width: 100%;
}

.ticket-preview th,
.ticket-preview td {
    font-size: 0.76rem;
    padding: 0.25rem 0;
    vertical-align: top;
}

.ticket-preview th {
    color: #475569;
    font-weight: 900;
}

.ticket-total {
    border-top: 1px dashed #94a3b8;
    font-size: 1rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
}

.ticket-preview footer {
    border-top: 1px dashed #94a3b8;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.lote-distribuidor {
    background: var(--vp-surface-soft);
    border: 1px solid var(--vp-border);
    border-radius: 12px;
    margin-top: 0.75rem;
    padding: 0.75rem;
}

@media (max-width: 640px) {
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-input {
        max-width: none;
    }

    .pos-shell {
        grid-template-columns: 1fr;
    }

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

h1:focus {
    outline: none;
}

.e-btn,
button.e-btn {
    border-radius: 12px;
    font-weight: 800;
    min-height: 2.55rem;
}

.e-btn.e-primary,
.e-primary {
    background: var(--vp-primary) !important;
    border-color: var(--vp-primary) !important;
    box-shadow: 0 10px 20px rgba(47, 95, 184, 0.18);
}

.e-btn.e-success,
.e-success {
    background: var(--vp-primary) !important;
    border-color: var(--vp-primary) !important;
}

.badge {
    border-radius: 999px;
    font-weight: 800;
    padding: 0.4rem 0.65rem;
}

.summary-tile {
    background: var(--vp-surface);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    box-shadow: var(--vp-shadow);
    min-height: 6.2rem;
    padding: 1.1rem;
}

.summary-tile span {
    color: var(--vp-muted);
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.summary-tile strong {
    color: var(--vp-text);
    font-size: 1.6rem;
    font-weight: 900;
}

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

.dashboard-panel {
    background: var(--vp-surface);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    box-shadow: var(--vp-shadow);
    padding: 1.1rem;
}

.dashboard-panel-head {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dashboard-panel-head h2 {
    color: var(--vp-text);
    font-size: 1rem;
    font-weight: 900;
    margin: 0;
}

.dashboard-panel-head span,
.dashboard-panel-head a {
    color: var(--vp-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.dashboard-panel-head a {
    color: var(--vp-primary);
    text-decoration: none;
}

.dashboard-bars,
.dashboard-list {
    display: grid;
    gap: 0.75rem;
}

.dashboard-bar-row {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 3rem minmax(0, 1fr) 5rem;
}

.dashboard-bar-row span {
    color: var(--vp-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: capitalize;
}

.dashboard-bar-row strong {
    color: var(--vp-text);
    font-size: 0.82rem;
    font-weight: 900;
    text-align: right;
}

.dashboard-bar-track {
    background: #edf2f8;
    border-radius: 999px;
    height: 0.75rem;
    overflow: hidden;
}

.dashboard-bar-fill {
    background: var(--vp-primary);
    border-radius: inherit;
    height: 100%;
    min-width: 0.2rem;
}

.dashboard-rank-item {
    align-items: center;
    background: var(--vp-surface-soft);
    border: 1px solid var(--vp-border);
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.8rem 0.9rem;
}

.dashboard-rank-item strong {
    color: var(--vp-text);
    display: block;
    font-size: 0.9rem;
    font-weight: 900;
}

.dashboard-rank-item span {
    color: var(--vp-muted);
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.dashboard-rank-item b {
    color: var(--vp-primary);
    font-size: 0.92rem;
    font-weight: 900;
    white-space: nowrap;
}

.dashboard-rank-item.is-warning b {
    color: var(--vp-warning);
}

.dashboard-rank-item.is-danger b {
    color: var(--vp-danger);
}

.dashboard-empty {
    background: var(--vp-surface-soft);
    border: 1px dashed var(--vp-border);
    border-radius: 12px;
    color: var(--vp-muted);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 1rem;
    text-align: center;
}

.e-grid {
    border: 1px solid var(--vp-border) !important;
    border-radius: var(--vp-radius) !important;
    box-shadow: var(--vp-shadow);
    overflow: hidden;
}

.e-grid .e-gridheader,
.e-grid .e-headercell {
    background: var(--vp-surface-soft) !important;
}

.e-grid .e-headertext {
    color: var(--vp-muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.e-grid .e-rowcell {
    color: var(--vp-text);
    font-weight: 600;
}

.e-grid .grid-actions .e-btn,
.e-grid .e-rowcell .e-btn.e-small {
    background: #f5f8fd !important;
    border: 1px solid #dce5f2 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    color: var(--vp-primary) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    height: 2.15rem !important;
    line-height: 1 !important;
    min-height: 2.15rem !important;
    padding: 0 0.75rem !important;
    width: auto !important;
}

.e-grid .grid-actions .e-btn:hover,
.e-grid .e-rowcell .e-btn.e-small:hover {
    background: #e8eef8 !important;
    border-color: #b8cae8 !important;
}

.e-grid .e-rowcell .e-btn.e-danger {
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #dc2626 !important;
}

.e-grid .e-rowcell .e-btn.e-primary,
.e-grid .e-rowcell .e-btn.e-success {
    background: var(--vp-primary) !important;
    border-color: var(--vp-primary) !important;
    color: white !important;
}

.e-dialog {
    border-radius: 18px !important;
    overflow: hidden;
}

.e-dialog .e-dlg-header-content {
    border-bottom: 1px solid var(--vp-border);
}

.e-dialog .e-dlg-header {
    color: var(--vp-text);
    font-weight: 900;
}

@media print {
    @page {
        margin: 4mm;
        size: 80mm auto;
    }

    html,
    body {
        background: white !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        width: 80mm !important;
    }

    body * {
        visibility: hidden !important;
    }

    .e-dialog,
    .e-dlg-content,
    .e-dlg-template,
    .e-dlg-container,
    .e-dlg-content > div {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: static !important;
        transform: none !important;
    }

    .ticket-preview,
    .ticket-preview * {
        visibility: visible !important;
    }

    .ticket-preview {
        border: 0;
        box-shadow: none;
        display: block !important;
        font-size: 11px;
        left: 0 !important;
        margin: 0;
        max-width: 80mm;
        padding: 0;
        position: fixed !important;
        top: 0 !important;
        width: 80mm;
    }

    .ticket-preview table {
        break-inside: auto;
    }

    .ticket-preview tr {
        break-inside: avoid;
    }

    .no-print {
        display: none !important;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3L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jM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Ocurrió un error inesperado."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
