/* ========================================
   1. BASE Y ENCABEZADO
======================================== */

.merchant-body {
    min-height: 100vh;
    background: #0b0d18;
}

.merchant-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    height: 70px;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 11, 22, 0.92);
    backdrop-filter: blur(16px);
}

.merchant-account {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c8c6d3;
    font-size: 11px;
}

.merchant-home-link {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    color: #d8d5e2;
    text-decoration: none;
    white-space: nowrap;
}

.merchant-home-link:hover {
    border-color: #9b70ff;
    color: #ffffff;
}

.merchant-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(174, 145, 255, 0.35);
    border-radius: 50%;
    background: rgba(132, 85, 245, 0.17);
    color: #c3adff;
    font-weight: 700;
}

.merchant-main {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 30px 0 70px;
}

.hidden {
    display: none !important;
}


/* ========================================
   2. ACCESO DEL NEGOCIO
======================================== */

.business-picker {
    max-width: 520px;
    margin: 35px auto;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    background: #111321;
}

.business-picker h1 {
    margin: 10px 0;
    font: 700 22px Manrope, sans-serif;
}

.business-picker p {
    color: #a5a6b5;
    font-size: 11px;
    line-height: 1.6;
}

.business-picker label {
    display: block;
    margin: 17px 0 7px;
    color: #dedce8;
    font-size: 10px;
}

.business-picker select {
    width: 100%;
    height: 42px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: #0b0d18;
    color: #ffffff;
}

.business-picker .button {
    margin-top: 13px;
    border: 0;
    cursor: pointer;
}

#businessLoginForm input,
#businessRecoveryForm input {
    width: 100%;
    height: 42px;
    margin-bottom: 6px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    outline: none;
    background: #0b0d18;
    color: #ffffff;
    font: inherit;
}

#businessLoginForm input:focus,
#businessRecoveryForm input:focus {
    border-color: #9b70ff;
    box-shadow: 0 0 0 3px rgba(132, 85, 245, 0.16);
}

#businessLoginForm .button,
#businessRecoveryForm .button {
    margin-top: 14px;
}

.business-recovery-link,
.business-recovery-back {
    display: block;
    margin: 5px 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b9a2ff;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.business-recovery-link:hover,
.business-recovery-back:hover {
    color: #ffffff;
    text-decoration: underline;
}

#businessRecoveryForm p {
    color: #a5a6b5;
    font-size: 11px;
    line-height: 1.6;
}

.business-recovery-back {
    margin: 14px auto 0;
}

.business-recovery-message {
    min-height: 18px;
    margin: 10px 0 0;
    color: #b9a2ff !important;
}

.login-back-link {
    margin: 18px 0 0;
    text-align: center;
}

.login-back-link a {
    color: #b9a2ff;
    text-decoration: none;
}

.login-back-link a:hover {
    text-decoration: underline;
}

.merchant-logout {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: transparent;
    color: #d8d5e2;
    cursor: pointer;
    font: inherit;
}

.merchant-logout:hover {
    border-color: #9b70ff;
    color: #ffffff;
}


/* ========================================
   3. NAVEGACIÓN Y TÍTULOS
======================================== */

.merchant-tabs {
    display: flex;
    gap: 7px;
    margin-bottom: 24px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: #0e101c;
}

.merchant-tab {
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #a5a6b5;
    font: 500 11px 'DM Sans', sans-serif;
    cursor: pointer;
}

.merchant-tab:hover {
    color: #ffffff;
}

.merchant-tab.active {
    border-color: rgba(174, 145, 255, 0.2);
    background: rgba(132, 85, 245, 0.12);
    color: #c4afff;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-heading h1 {
    margin: 9px 0 6px;
    font: 700 27px Manrope, sans-serif;
    letter-spacing: -0.8px;
}

.page-heading p {
    margin: 0;
    color: #a5a6b5;
    font-size: 11px;
    line-height: 1.6;
}

.merchant-notice {
    display: none;
    margin-bottom: 18px;
    padding: 12px 15px;
    border: 1px solid rgba(235, 164, 78, 0.25);
    border-radius: 10px;
    background: rgba(235, 164, 78, 0.08);
    color: #efbd79;
    font-size: 10px;
    line-height: 1.5;
}

.merchant-notice.visible {
    display: block;
}


/* ========================================
   4. FORMULARIO DE PERSONALIZACIÓN
======================================== */

.design-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
    align-items: start;
    gap: 20px;
}

.settings-panel,
.preview-column,
.scanner-panel,
.scanner-info {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: #111321;
}

.settings-panel {
    overflow: hidden;
}

.settings-section {
    padding: 21px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.settings-section:last-of-type {
    border-bottom: 0;
}

.settings-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 17px;
}

.settings-number {
    display: grid;
    width: 27px;
    height: 27px;
    flex: none;
    place-items: center;
    border-radius: 8px;
    background: rgba(132, 85, 245, 0.14);
    color: #b69bff;
    font-size: 9px;
    font-weight: 700;
}

.settings-section-heading h2 {
    margin: 1px 0 4px;
    font: 700 13px Manrope, sans-serif;
}

.settings-section-heading p {
    margin: 0;
    color: #9294a5;
    font-size: 9px;
    line-height: 1.5;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
}

.field label {
    color: #e4e2ed;
    font-size: 10px;
    font-weight: 600;
}

.field input:not([type="file"]):not([type="color"]),
.field select {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    outline: none;
    background: #0b0d18;
    color: #f7f6fb;
    font: 10px 'DM Sans', sans-serif;
}

.field input::placeholder {
    color: #737588;
}

.field input:focus,
.field select:focus {
    border-color: #9d79ff;
    box-shadow: 0 0 0 3px rgba(132, 85, 245, 0.12);
}

.field input[type="file"] {
    width: 100%;
    color: #aaa9bd;
    font-size: 10px;
}

.field input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    background: #1a1c2d;
    color: #d8d6e2;
    font: 10px 'DM Sans', sans-serif;
    cursor: pointer;
}

.field > small {
    color: #85879a;
    font-size: 9px;
    line-height: 1.5;
}

.background-design-group {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.02);
}

.background-design-group h3 {
    margin: 0;
    color: #e4e2ed;
    font: 700 11px Manrope, sans-serif;
}


/* Selectores de color */

.color-picker-row {
    display: flex;
    height: 42px;
    align-items: center;
    gap: 10px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #0b0d18;
}

.color-picker-row input[type="color"] {
    width: 32px;
    height: 30px;
    padding: 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.color-picker-row span {
    color: #c5c3d0;
    font: 10px monospace;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 3px;
}

.color-palette button {
    width: 23px;
    height: 23px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    outline: 1px solid transparent;
    background: var(--swatch);
    cursor: pointer;
}

.color-palette button:hover,
.color-palette button:focus-visible {
    outline-color: #c3adff;
    outline-offset: 2px;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 16px;
    color: #aaa9bd;
    font-size: 9px;
    line-height: 1.5;
}

.check-field input {
    flex: none;
    margin: 1px 0 0;
    accent-color: #8455f5;
}

.save-button {
    min-height: 40px;
    padding-inline: 15px;
    border: 0;
    font-size: 10px;
    cursor: pointer;
}

.mobile-save {
    display: none;
    margin: 18px 21px;
}

.save-message {
    display: none;
    margin: 12px 21px 18px;
    color: #9de4bb;
    font-size: 10px;
    line-height: 1.5;
}

.save-message.visible {
    display: block;
}


/* ========================================
   5. AFICHE DEL QR
======================================== */

.preview-column {
    position: sticky;
    top: 95px;
    padding: 18px;
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.preview-heading h2 {
    margin: 6px 0 0;
    font: 700 14px Manrope, sans-serif;
}

.preview-badge {
    padding: 6px 9px;
    border-radius: 20px;
    background: rgba(132, 85, 245, 0.13);
    color: #c3adff;
    font-size: 8px;
}

.qr-poster {
    --poster-bg: #f6f2fb;
    --poster-text: #17131f;

    position: relative;
    min-height: 610px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background-color: var(--poster-bg);
    background-position: center;
    background-size: cover;
    color: var(--poster-text);
    font-family: Manrope, sans-serif;
    text-align: center;
}

.qr-poster.has-background-image::before {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.24);
    content: "";
}

.poster-content {
    position: relative;
    z-index: 1;
    padding: 27px 23px 100px;
}

.poster-decoration {
    position: absolute;
    z-index: 1;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    opacity: 0.35;
    pointer-events: none;
}

.poster-decoration-one {
    top: -70px;
    left: -68px;
    background: #a787e8;
}

.poster-decoration-two {
    right: -82px;
    bottom: 140px;
    background: #f078ad;
}

.poster-logo {
    display: grid;
    width: 94px;
    height: 94px;
    place-items: center;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 3px solid rgba(177, 110, 211, 0.58);
    border-radius: 50%;
    background: #17131f;
    color: #d4bbff;
    font-size: 10px;
}

.poster-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-content h3 {
    max-width: 100%;
    margin: 8px 0 5px;
    overflow-wrap: anywhere;
    font-size: 22px;
    line-height: 1.2;
}

.poster-tagline {
    min-height: 17px;
    margin: 0 0 17px;
    font-size: 9px;
    letter-spacing: 1.2px;
}

.qr-code-box {
    display: flex;
    width: 230px;
    min-height: 275px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 18px;
    padding: 12px;
    border: 1px solid rgba(80, 60, 100, 0.2);
    border-radius: 17px;
    background: #ffffff;
    color: #473d55;
}

.qr-code-box canvas {
    display: block;
    width: 190px;
    height: 190px;
}

.qr-code-box p {
    margin: 0;
    font-size: 9px;
    text-align: center;
}

.qr-download-button {
    padding: 7px 11px;
    border: 1px solid #d9d1e5;
    border-radius: 7px;
    background: #ffffff;
    color: #473d55;
    font: 10px 'DM Sans', sans-serif;
    cursor: pointer;
}

.qr-download-action {
    display: flex;
    justify-content: center;
    margin: 14px 0;
}

.qr-download-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.poster-instruction {
    display: flex;
    max-width: 260px;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    text-align: left;
}

.phone-scan-icon {
    flex: none;
    font-size: 32px;
}

.poster-instruction p {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
}

.poster-footer {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    min-height: 83px;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 14px;
    border-radius: 50% 50% 0 0 / 16% 16% 0 0;
    background: #17132a;
    color: #ffffff;
}

.poster-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font: 700 12px Manrope, sans-serif;
    text-align: left;
}

.poster-brand small {
    display: block;
    margin-top: 2px;
    color: #bca4ff;
    font-size: 7px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.poster-brand-mark {
    color: #9b75ff;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -3px;
}

.poster-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.45);
}

.poster-footer p {
    margin: 0;
    color: #e4dff4;
    font-size: 8px;
    line-height: 1.5;
    text-align: left;
}

.preview-note {
    margin: 12px 2px 0;
    color: #9294a5;
    font-size: 9px;
    line-height: 1.6;
}

.maps-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: #bca4ff;
    font-size: 10px;
}


/* ========================================
   6. TARJETA VISTA POR EL CLIENTE
======================================== */

.customer-card-preview {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: #0d0f1b;
}

.customer-card-preview .preview-heading {
    margin-bottom: 14px;
}

.customer-card-preview .preview-heading h2 {
    margin: 6px 0 0;
    font: 700 14px Manrope, sans-serif;
}

.customer-phone {
    width: min(100%, 300px);
    margin: 0 auto;
    padding: 15px;
    border: 1px solid #555467;
    border-radius: 25px;
    background: linear-gradient(145deg, #191a2b, #0c0e19);
    box-shadow: 0 15px 35px #0005;
}

.customer-phone-heading {
    display: flex;
    justify-content: space-between;
    margin-bottom: 13px;
    color: #c9c7d4;
    font-size: 9px;
}

.customer-loyalty-card {
    --customer-card-color: #29213f;
    --customer-card-text: #ffffff;

    position: relative;
    display: flex;
    width: 100%;
    min-height: 154px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background-color: var(--customer-card-color);
    background-position: center;
    background-size: cover;
    color: var(--customer-card-text);
    font-family: Manrope, sans-serif;
    text-align: left;
    cursor: pointer;
}

.customer-loyalty-card::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 35%, #ffffff18);
    content: "";
    pointer-events: none;
}

.customer-card-top,
.customer-card-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
}

.customer-card-top {
    align-items: flex-start;
    gap: 9px;
}

.customer-card-logo {
    display: grid;
    width: 38px;
    height: 38px;
    flex: none;
    place-items: center;
    overflow: hidden;
    border: 1px solid #ffffff55;
    border-radius: 50%;
    background: #17131f88;
    color: #ffffff;
    font-size: 8px;
}

.customer-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.customer-card-name {
    min-width: 0;
    flex: 1;
}

.customer-card-name strong,
.customer-card-name small {
    display: block;
}

.customer-card-name strong {
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.3;
    font-size: 11px;
}

.customer-card-name small {
    overflow: hidden;
    margin-top: 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.72;
    font-size: 8px;
}

.customer-card-dots {
    flex: none;
    align-self: flex-start;
    opacity: 0.8;
    letter-spacing: 2px;
}

.customer-card-bottom {
    justify-content: space-between;
    opacity: 0.75;
}

.customer-card-bottom small {
    font-size: 8px;
}

.customer-card-hint {
    margin: 10px 0 0;
    color: #9294a5;
    font-size: 8px;
    text-align: center;
}

.customer-card-details {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: #17192a;
    color: #f7f6fb;
}

.customer-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 8px;
}

.customer-progress {
    height: 5px;
    overflow: hidden;
    margin-top: 9px;
    border-radius: 8px;
    background: #ffffff1c;
}

.customer-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #a989ff;
}

.customer-map-link,
.customer-whatsapp-link,
.customer-instagram-link {
    display: block;
    margin-top: 10px;
    color: #c3adff;
    font-size: 8px;
}

/* Sellos de la tarjeta del cliente */

.customer-stamps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.stamp-circle {
    position: relative;
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(195, 173, 255, 0.55);
    border-radius: 50%;
    background: rgba(132, 85, 245, 0.12);
    color: #e4d9ff;
    font-size: 10px;
}

.stamp-circle.completed {
    border-color: #a989ff;
    background: rgba(132, 85, 245, 0.32);
}

.stamp-circle.completed::after {
    position: absolute;
    width: 70%;
    height: 2px;
    border-radius: 2px;
    background: #e4d9ff;
    content: "";
    transform: rotate(-45deg);
}

/* Control para probar la tarjeta en esta vista previa */

.preview-progress-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    color: #a5a6b5;
    font-size: 9px;
}

.preview-progress-control strong {
    color: #d8caff;
    font-size: 11px;
}

.preview-progress-control input {
    width: 100%;
    accent-color: #9b75ff;
}


/* ========================================
   7. CLIENTES
======================================== */

.search-field {
    display: flex;
    width: min(280px, 100%);
    align-items: center;
    gap: 8px;
    margin: 0 0 17px auto;
    padding-left: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: #111321;
    color: #b69bff;
}

.search-field input {
    width: 100%;
    height: 38px;
    border: 0;
    outline: none;
    background: transparent;
    color: #ffffff;
    font: 10px 'DM Sans', sans-serif;
}

.frequent-clients-panel {
    margin: 18px 0;
    padding: 20px;
    border: 1px solid rgba(174, 145, 255, 0.18);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(132, 85, 245, 0.08), #111321 70%);
}

.frequent-clients-panel[hidden] {
    display: none;
}

.frequent-clients-heading h2 {
    margin: 6px 0;
    font: 700 16px Manrope, sans-serif;
}

.frequent-clients-heading p {
    margin: 0;
    color: #9294a5;
    font-size: 10px;
    line-height: 1.5;
}

.frequent-client-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 16px 0 0;
    padding-left: 26px;
}

.frequent-client-list li {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    background: rgba(8, 10, 20, 0.55);
    color: #bda7ff;
    font-size: 11px;
}

.frequent-client-list li strong,
.frequent-client-list li span {
    display: block;
    overflow-wrap: anywhere;
}

.frequent-client-list li strong {
    color: #f7f6fb;
    font-size: 11px;
}

.frequent-client-list li span {
    margin-top: 4px;
    color: #9294a5;
    font-size: 9px;
}

.empty-clients {
    padding: 55px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: #111321;
    text-align: center;
}

.empty-clients-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: rgba(132, 85, 245, 0.13);
    color: #b69bff;
    font-size: 21px;
}

.empty-clients h2 {
    margin: 0 0 7px;
    font: 700 14px Manrope, sans-serif;
}

.empty-clients p {
    max-width: 380px;
    margin: 0 auto;
    color: #9294a5;
    font-size: 10px;
    line-height: 1.6;
}

.client-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.business-client-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: #111321;
}

.business-client-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.business-client-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: none;
    place-items: center;
    border: 1px solid rgba(174, 145, 255, 0.3);
    border-radius: 50%;
    background: rgba(132, 85, 245, 0.16);
    color: #c3adff;
    font-size: 13px;
    font-weight: 700;
}

.business-client-details {
    min-width: 0;
}

.business-client-details strong,
.business-client-details small {
    display: block;
    overflow-wrap: anywhere;
}

.business-client-details strong {
    color: #f7f6fb;
    font-size: 12px;
}

.business-client-details small {
    margin-top: 4px;
    color: #9294a5;
    font-size: 10px;
    line-height: 1.5;
}

.business-client-whatsapp {
    flex: none;
    padding: 8px 11px;
    border: 1px solid rgba(89, 210, 145, 0.28);
    border-radius: 8px;
    color: #8be0ae;
    font-size: 10px;
    text-decoration: none;
}

.business-client-whatsapp:hover {
    background: rgba(89, 210, 145, 0.1);
}


/* ========================================
   8. ESCÁNER DEL QR DEL CLIENTE
======================================== */

.scanner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 18px;
}

.scanner-panel {
    padding: 20px;
}

.camera-frame {
    position: relative;
    display: grid;
    min-height: 320px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(174, 145, 255, 0.2);
    border-radius: 13px;
    background: #080a13;
}

.camera-frame video {
    display: none;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.camera-frame.camera-active video {
    display: block;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999bad;
    pointer-events: none;
}

.camera-active .camera-placeholder-icon,
.camera-active .camera-overlay p {
    display: none;
}

.camera-placeholder-icon {
    color: #b69bff;
    font-size: 42px;
}

.camera-overlay p {
    margin: 8px 0 0;
    font-size: 10px;
}

.scan-corner {
    position: absolute;
    width: 35px;
    height: 35px;
    border-color: #a987ff;
    border-style: solid;
}

.scan-top-left {
    top: 22%;
    left: 22%;
    border-width: 3px 0 0 3px;
}

.scan-top-right {
    top: 22%;
    right: 22%;
    border-width: 3px 3px 0 0;
}

.scan-bottom-left {
    bottom: 22%;
    left: 22%;
    border-width: 0 0 3px 3px;
}

.scan-bottom-right {
    right: 22%;
    bottom: 22%;
    border-width: 0 3px 3px 0;
}

.scanner-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.scanner-controls .button {
    min-height: 38px;
    font-size: 10px;
}

.scanner-message {
    margin: 12px 0 0;
    color: #a5a6b5;
    font-size: 10px;
    line-height: 1.6;
}

.scanned-customer {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid rgba(174, 145, 255, 0.22);
    border-radius: 13px;
    background: linear-gradient(145deg, #17192a, #101220);
}

.scanned-customer h2 {
    margin: 7px 0 3px;
    color: #f7f6fb;
    font: 700 16px Manrope, sans-serif;
    overflow-wrap: anywhere;
}

.scanned-customer-phone {
    margin: 0;
    color: #9294a5;
    font-size: 10px;
}

.scanned-progress-card {
    margin-top: 15px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: #0b0d18;
}

.scanned-progress-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #e4e2ed;
    font-size: 10px;
}

.scanned-progress-heading span:last-child {
    color: #b9a2ff;
    text-align: right;
}

.scanned-progress-bar {
    height: 7px;
    overflow: hidden;
    margin-top: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

.scanned-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8151ed, #c096ff);
    transition: width 0.2s ease;
}

.scanned-stamps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-top: 11px;
}

.scanned-stamp {
    position: relative;
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(195, 173, 255, 0.5);
    border-radius: 50%;
    color: #ded5f7;
    font-size: 9px;
}

.scanned-stamp.is-complete {
    border-color: #a989ff;
    background: rgba(132, 85, 245, 0.28);
}

.scanned-stamp.is-complete::after {
    position: absolute;
    width: 70%;
    height: 2px;
    border-radius: 2px;
    background: #ffffff;
    content: "";
    transform: rotate(-45deg);
}

.scanned-action-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
}

.scanned-action-field label {
    color: #e4e2ed;
    font-size: 10px;
    font-weight: 600;
}

.scanned-action-field input {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    outline: none;
    background: #0b0d18;
    color: #f7f6fb;
    font: 11px 'DM Sans', sans-serif;
}

.scanned-action-field input:focus {
    border-color: #9d79ff;
    box-shadow: 0 0 0 3px rgba(132, 85, 245, 0.12);
}

.scanned-action-field small {
    color: #9294a5;
    font-size: 9px;
    line-height: 1.5;
}

.scanned-confirm-button,
.scanned-redeem-button {
    width: 100%;
    margin-top: 13px;
    border: 0;
    cursor: pointer;
}

.scanned-action-message {
    min-height: 16px;
    margin: 10px 0 0;
    color: #9de4bb;
    font-size: 10px;
    line-height: 1.5;
}

.scanner-info {
    padding: 21px;
}

.scanner-info-icon {
    color: #b69bff;
    font-size: 22px;
}

.scanner-info h2 {
    margin: 12px 0;
    font: 700 14px Manrope, sans-serif;
}

.scanner-info ol {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding-left: 18px;
    color: #c2c0ce;
    font-size: 10px;
    line-height: 1.6;
}

.scanner-info > p {
    margin: 17px 0 0;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #9294a5;
    font-size: 9px;
    line-height: 1.6;
}


/* ========================================
   9. TABLETS Y CELULARES
======================================== */

@media (max-width: 850px) {
    .design-layout,
    .scanner-layout {
        grid-template-columns: 1fr;
    }

    .preview-column {
        position: static;
    }

    .qr-poster {
        width: min(100%, 420px);
        margin: 0 auto;
    }
}

@media (max-width: 620px) {
    .merchant-account {
        gap: 7px;
        font-size: 10px;
    }

    .merchant-home-link {
        padding: 7px 8px;
        font-size: 9px;
    }

    .merchant-logout {
        padding: 7px 8px;
        font-size: 9px;
    }
}

@media (max-width: 600px) {
    .merchant-header {
        height: 64px;
        padding-inline: 15px;
    }

    .merchant-account {
        gap: 7px;
        font-size: 9px;
    }

    #merchantHeaderName {
        display: none;
    }

    .merchant-avatar {
        width: 30px;
        height: 30px;
    }

    .merchant-main {
        width: calc(100% - 26px);
        padding-top: 22px;
    }

    .merchant-tabs {
        overflow-x: auto;
        gap: 2px;
        padding: 8px;
    }

    .merchant-tab {
        flex: none;
        padding: 9px 10px;
        font-size: 9px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .page-heading h1 {
        font-size: 23px;
    }

    .save-button:not(.mobile-save) {
        display: none;
    }

    .mobile-save {
        display: inline-flex;
    }

    .settings-section {
        padding: 17px 15px;
    }

    .qr-poster {
        min-height: 590px;
    }

    .poster-content {
        padding-inline: 15px;
    }

    .qr-code-box {
        width: 215px;
    }

    .qr-code-box canvas {
        width: 175px;
        height: 175px;
    }

    .qr-download-action {
        width: min(100%, 420px);
        margin: 14px auto;
    }

    .qr-download-button {
        width: 100%;
        min-height: 42px;
        font-size: 12px;
    }

    .frequent-clients-panel {
        padding: 16px 13px;
    }

    .frequent-client-list {
        grid-template-columns: 1fr;
        gap: 7px;
        padding-left: 23px;
    }

    .customer-card-preview {
        padding: 14px;
    }

    .camera-frame {
        min-height: 260px;
    }

    .scanner-panel,
    .scanner-info {
        padding: 15px;
    }
}

@media print {
    .qr-download-action {
        display: none;
    }
}
