/* ══════════════════════════════════════════════════════════
   Design Tokens — Variables globales de la tienda
   Cambiar estos valores afecta toda la UI de forma homogénea.
   ══════════════════════════════════════════════════════════ */
:root {
    --color-primary: #3C76F2;
    --color-primary-hover: #2b63d9;
    --color-primary-light: #dbeafe;
}

/* ══════════════════════════════════════════════════════════
   Table Header — Componente reutilizable (.tbl-thead)
   Estilo estandarizado para encabezados de tablas.
   Se usa automáticamente via <x-table-header :columns="[...]" />
   ══════════════════════════════════════════════════════════ */
.tbl-thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 10px 12px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    background: #f9fafb;
}
.tbl-thead .th-sortable {
    cursor: pointer;
    user-select: none;
}
.tbl-thead .th-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}
.tbl-thead .th-sort-link:hover {
    color: #111827;
}
.tbl-thead .th-sort-icon {
    display: inline-flex;
    align-items: center;
}
.tbl-thead .th-sort-icon svg {
    stroke: currentColor;
    fill: none;
    opacity: 0.35;
}
.tbl-thead .th-sorted .th-sort-icon svg {
    opacity: 1;
    stroke: #111827;
}
.tbl-thead .th-sorted .th-sort-link {
    color: inherit;
}

/* ══════════════════════════════════════════════════════════
   Section Header — Componente reutilizable (.section-header)
   Uso:
     <div class="section-header">
         <div>
             <h1 class="section-title">Título</h1>
             <p class="section-subtitle">Subtítulo opcional</p>
         </div>
         <a class="section-action" href="#">+ Acción</a>
     </div>
   Variantes del botón:
     .section-action             → primario (azul)
     .section-action.is-secondary → terciario (outline)
   ══════════════════════════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.section-header .section-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}
.section-header .section-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 2px 0 0;
}
.section-header .section-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50rem;
    padding: 9px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}
.section-header .section-action:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 2px 8px rgba(60,118,242,0.25);
    color: #fff;
}
.section-header .section-action i {
    font-size: 0.8rem;
}
/* ══════════════════════════════════════════════════════════
   Export button — Componente reutilizable (.btn-export)
   Uso:  <a class="btn-export" href="...">
             <i class="bi bi-file-earmark-excel"></i> Exportar a Excel
         </a>
   ══════════════════════════════════════════════════════════ */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 50rem;
    padding: 7px 18px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-export:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.btn-export i {
    font-size: 0.85rem;
    color: #16a34a;
}

input[type="file"] {
    font-size: 11px;
}

.attribute-item {
    margin-bottom: 5px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
}

.attribute-item button {
    margin-left: 0px;
}

.app-btn-danger {
    color: #FFFFFF;
}

/**********File Inputs**********/
.inputfile {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.inputfile + label {
    max-width: 80%;
    font-size: 1.25rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    display: inline-block;
    overflow: hidden;
    padding: 0.625rem 1.25rem;
}

.inputfile + label svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
}

.iborrainputfile {
    font-size:10px !important;
    font-weight:normal;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    margin-left: 0;
}

/* style 7 */

.inputfile-7 + label {
    color: #ec9b1b;
}

.inputfile-7 + label {
    border: 1px solid #ec9b1b;
    background-color: #fff;
    padding: 0;
}

.inputfile-7:focus + label,
.inputfile-7.has-focus + label,
.inputfile-7 + label:hover {
    border-color: #d47e03;
}

.inputfile-7 + label span,
.inputfile-7 + label strong {
    padding: 0.625rem 1.25rem;
}

.inputfile-7 + label span {
    width: 50% !important;
    height: 42px !important;
    min-height: 2em;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: top;
    position: absolute;
    background-color: #edfdf6;
    display: flex;
    align-items: center;
    text-align: center;
    color: #0a5936;
    font-weight: 600;
    border: 1px solid #0a5936;
    border-top-left-radius:5px;
    border-bottom-left-radius: 5px;
}

.inputfile-7 + label strong {
    color: #8C8C8C;
    background-color: white;
    font-weight: 100;
    font-size: 14px;
    position: absolute;
    right: 0;
    height: 42px;
    display: flex;
    align-items: center;
    width: 50%;
    border: 1px solid #0a5936;
    border-top-right-radius:5px;
    border-bottom-right-radius: 5px;
    margin-right: 2px;
    overflow: hidden;
}

.inputfile-7:focus + label strong,
.inputfile-7.has-focus + label strong,
.inputfile-7 + label:ahover strong {
    background-color: #39b5b5;
    color: #15a362;
    transition: 1s background-color;
    font-weight: 500;
    transition: 1s font-weight;
}
.file-container  {
    position: relative;
}

.file-container label  {
    margin-bottom: 30px;
}

.file-upload {
    height:35px; 
    max-width: 100px;
    margin:0 auto;
}

.file-error {
    font-weight: bold; color: #FF0000;
}

.file-delete {
    margin-left: 20%;
}
.input-group .input-group-addon {
    border-radius: 0.375rem;
    border: 1px solid #e7e9ed;
    background-color: #fff;
    width: 15%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.input-group-addon:first-child {
    border-right: 0;
}
.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:first-child>.btn-group:not(:first-child)>.btn, .input-group-btn:first-child>.btn:not(:first-child), .input-group-btn:last-child>.btn, .input-group-btn:last-child>.btn-group>.btn, .input-group-btn:last-child>.dropdown-toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.input-group .form-control, .input-group-addon, .input-group-btn {
    display: table-cell;
}
.input-group .form-control {
    position: relative;
    z-index: 2;
    float: left;
    width: 85%;
    margin-bottom: 0;
}
        /* Estilos personalizados para el Wizard */
        .wizard-steps {
            display: flex;
            justify-content: space-between; /* Distribuye el espacio equitativamente entre los ítems */
            margin-bottom: 1rem;
            position: relative;
            padding: 0 0px; /* Añadimos un padding para que los círculos no toquen el borde */
        }

        .wizard-step-item {
            display: flex;
            flex-direction: column;
            align-items: center; /* Centra el círculo y la etiqueta dentro de su espacio */
            position: relative;
            z-index: 2; /* Para que los círculos estén por encima de las líneas */
            /* Eliminamos flex: 1; para que justify-content: space-between haga su trabajo */
        }

        .wizard-step-circle {
            width: 27px;
            height:27px;
            border-radius: 50%;
            background-color: #e9ecef; /* Color por defecto */
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: #fff;
            z-index: 0;
            border: 0px solid #adb5bd;
            transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
        }

        .wizard-step-label {
            margin-top: 0.5rem;
            font-size: 0.9em;
            color: #6c757d;
            text-align: center;
        }

        /* Línea de conexión base (gris) */
        .wizard-steps::before {
            content: '';
            position: absolute;
            top: 13px; /* Ajusta para centrar verticalmente con el círculo (40px/2 - 2px/2) */
            left: 20px; /* Coincide con el padding del contenedor wizard-steps */
            right: 20px; /* Coincide con el padding del contenedor wizard-steps */
            height: 2px;
            background-color: #dee2e6;
            z-index: 0; /* Asegura que esté detrás de los círculos */
        }

        /* Estilos para el paso activo */
        .wizard-step-item.active .wizard-step-circle {
            background-color: #0d6efd; /* Color primario de Bootstrap */
            border-color: #0d6efd;
            color: #fff;
            z-index: 2;
        }

        /* Estilos para el paso completado */
        .wizard-step-item.completed .wizard-step-circle {
            background-color: #0d6efd; /* Color success de Bootstrap */
            border-color: #0d6efd;
            color: #fff;
        }

        .wizard-step-item.completed .wizard-step-circle i {
            font-size: 1.2em; /* Tamaño del icono de check */
        }

        /* Línea de progreso (azul) */
        .wizard-progress-line {
            position: absolute;
            top: 13px; /* Igual que la línea base para superponerse */
            left: 20px; /* Coincide con el padding del contenedor wizard-steps */
            height: 2px;
            background-color: #0d6efd; /* Color primario de Bootstrap */
            z-index: 1; /* Para que esté por encima de la línea base */
            width: 0%; /* Empezará sin ancho y se llenará */
            transition: width 0.4s ease-in-out; /* Animación de llenado */
        }

        /* Contenido de los pasos del formulario */
        .form-step-content {
            display: none; /* Ocultar todos los pasos por defecto */
        }

        .form-step-content.active {
            display: block; /* Mostrar el paso activo */
        }

.btn-minus, .btn-plus {
    border: 1px solid #dee2e6;
}
.spinner-input {
    background-color: #F5F4F8;
    padding-left: 20px;
}

#drop-area {
    transition: background-color 0.2s ease-in-out;
}
#drop-area:hover {
    background-color: #f8f9fa;
}

label {
    font-size: 0.9rem;
}

.app-btn-primary {
    background-color: var(--color-primary);
    border-radius: 50rem !important;
}

.app-btn-secondary {
    border-radius: 50rem;
}

.app-btn-terciary {
    color: var(--color-primary);
    border-radius: 50rem;
}

.btn-selected {
    color: var(--color-primary);
    background: #E6F1FD;
    border: 1px solid #bcc1cb;
}

.btn-xs {
    padding: 0px 7px 0px 7px;
    border-radius: 50%;
    color:#FFFFFF;
}

.fs-sm {
    font-size: 90%;
}

.fs-xs {
    font-size: 80%;
}

/* Celda de fecha estandarizada para tablas de reporte */
.cell-date {
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #5d6778;
    letter-spacing: .01em;
    line-height: 1.3;
}

.cell-date small {
    font-size: .75rem;
    color: #9ca3af;
    font-weight: 400;
}

/* Botón de acción en tablas de reporte */
.cell-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    background: #f0f1f3;
    border-radius: .4375rem;
    text-decoration: none;
    transition: background .15s ease;
}

.cell-action-btn img {
    opacity: .55;
    transition: opacity .15s ease;
}

.cell-action-btn:hover {
    background: #e4e6ea;
}

.cell-action-btn:hover img {
    opacity: .8;
}

/* ── Pills de estado para tablas de reporte ────────────── */
td:has(.pill-status) {
    text-align: center;
}

.pill-status {
    display: inline-block;
    font-size: 0.54rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.pill-success {
    background: #DAF7EE;
    color: #5cb377;
}

.pill-warning {
    background: #fef3c7;
    color: #d6ab3a;
}

.pill-danger {
    background: #fee2e2;
    color: #d26d69;
}

.pill-muted {
    background: #f3f4f6;
    color: #9ca3af;
}

.pill-light {
    background: #f3f4f6;
    color: #6b7280;
}

.pill-info {
    background: #dbeafe;
    color: #3b82f6;
}

/* ── ID abreviado + botón copiar (global) ──────────────── */
.meta-id {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.02em;
}

.btn-copy-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    vertical-align: middle;
    margin-left: 2px;
}
.btn-copy-id svg {
    opacity: 0.35;
    stroke: currentColor;
    color: #6b7280;
    transition: opacity 0.15s;
}
.btn-copy-id:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.btn-copy-id:hover svg {
    opacity: 0.65;
}
.btn-copy-id.copied {
    background: #ecfdf5;
    border-color: #10b981;
}
.btn-copy-id.copied svg {
    opacity: 0.8;
    color: #059669;
}

.modal-dialog.modal-80 {
  max-width: 80%;
}

.select2-container--default {
    width: 100% !important;
}

.bi-pencil, .bi-files, .bi-trash {
    top:0px !important;
}

.nav-link-text {
    padding-left: 10px;
    font-size: 14px;
}

.app-nav .nav-link {
    padding-top: 8px;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    position: relative;
}

.app-nav .nav-link:hover {
    color: var(--color-primary);
}

.app-nav .nav-link.active {
    color: var(--color-primary);
    background: #E6F1FD;
    border-left: 3px solid var(--color-primary);
    font-weight: 500;
}

.app-nav .nav-icon {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.app-nav .nav-icon img,
.app-nav .nav-icon svg {
    width: 18px;
    height: 18px;
}

.app-nav .nav-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn:disabled {
    border-color: #dee2e6 !important;
}

/* Botones no activos */
button.nav-link {
  background: #ffffff !important;
  color: #666276 !important;
  font-family: 'Sora', sans-serif !important;
  font-weight: bold;
}

/* Botón activo */
button.nav-link.active {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent) !important;
  color: var(--color-primary) !important;
}

.w-35 {
 width: 35%;
}
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e9ecef; /* gris claro */
  color: #333;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.step-circle.active {
  background-color: #0d6efd; /* azul Bootstrap */
  color: white;
}

/* ── Toggle switch — Componente global ──────────────────── */
.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.form-check-input {
    background-color: #a5a4a4dd;
    border-color: #a5a4a4dd;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.iframe-desktop {
    transform: scale(1.5);
    transform-origin: top left;
    width: 150%; /* necesario para compensar el scale */
    height: 750px;
    border: none;
}


 .table-custom {
    border-collapse: separate;   /* Permite el border-spacing */
    border-spacing: 0 10px;      /* Espacio vertical entre filas */
  }

  .table-custom td, 
  .table-custom th {
    padding: 12px 16px;          /* Padding interno */
    background: #fff;            /* Fondo para que no se vea transparente */
    border: 1px solid #dee2e6;   /* Borde de cada celda */
  }

  /* Opcional: bordes redondeados por fila */
  .table-custom tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
  }
  .table-custom tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
  }

  .format-option {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 5px;
    transition: border-color 0.2s ease;
}

.format-option input + img  {
    border: 1px solid #565758; 
    border-radius: 8px;
}

.format-option input:checked + img {
    border: 2px solid #0d6efd; 
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(13, 110, 253, 0.6);
}

.format-img {
    width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.form-actions-fixed {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    border-radius: 0 0 12px 12px;
    z-index: 999;
}

.border-dashed {
  border-style: dashed !important;
}

/* Compact color pill */
.color-pill {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 4px 14px 4px 4px;
    border: 1px solid #d1d5db;
    border-radius: 50rem;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.color-pill:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.color-pill:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.color-pill input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    background: none;
}
.color-pill input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
.color-pill input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}
.color-pill input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}
.color-pill .color-hex {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.8rem;
    color: #374151;
    text-transform: uppercase;
    cursor: pointer;
    min-width: 5.6ch;
    letter-spacing: 0.02em;
}

/* Hint & description text in settings sections */
.settings-section .drop-area + .mb-2,
.settings-section .form-group p small {
    font-size: 12px;
    color: #6b7280;
}
.settings-section .app-card-body > p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}
/* Select styled to match color pills */
.settings-section .form-select.select-pill {
    height: 44px;
    max-width: 90%;
    border: 1px solid #d1d5db;
    border-radius: 50rem;
    padding: 4px 36px 4px 16px;
    font-size: 0.8rem;
    color: #374151;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-top: 6px;
}
.settings-section .form-select.select-pill:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.settings-section .form-select.select-pill:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Color picker labels - match upload hint style */
.settings-section .form-group > label:first-child {
    font-size: 12px;
    color: #6b7280;
}
.settings-section .form-group p[style] {
    min-height: auto !important;
    margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════
   Sites listing — Stripe / Mercury style
   ══════════════════════════════════════════════════════════ */

/* ── Container reset ────────────────────────────────────── */
.sites-listing {
    border: none !important;
    box-shadow: none !important;
}

/* ── Card base ──────────────────────────────────────────── */
.sites-listing .site-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.sites-listing .site-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
    border-color: #d1d5db;
}

/* ── Thumbnail area ─────────────────────────────────────── */
.sites-listing .site-card-thumb {
    background: linear-gradient(135deg, #8b929c 0%, #7a828d 100%);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow: visible;
    border-bottom: 1px solid #d1d5db;
    position: relative;
}
/* ── Overflow menu (top-right of thumbnail) ─────────────── */
.sites-listing .site-card-overflow {
    position: absolute;
    top: 8px;
    right: 8px;
}
/* Hereda estilos de .card-overflow-btn (componente global) */
.sites-listing .site-card-thumb img {
    max-height: 85%;
    max-width: 85%;
    object-fit: contain;
    border-radius: 4px;
}

/* ── Card content ───────────────────────────────────────── */
.sites-listing .site-card-content {
    padding: 16px 16px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Title ──────────────────────────────────────────────── */
.sites-listing .site-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.sites-listing .site-card-name a {
    color: #111827;
    text-decoration: none;
}
.sites-listing .site-card-name a:hover {
    color: var(--color-primary);
}

/* ── Meta ID pill ───────────────────────────────────────── */
.sites-listing .meta-id-label {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 400;
    color: #374151;
    margin-right: 4px;
}
.sites-listing .meta-id {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 5px 8px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.02em;
    margin-top: 2px;
}

/* ── URL link ───────────────────────────────────────────── */
/* ── ID row (pill + copy btn) ───────────────────────────── */
/* ── Badges row ─────────────────────────────────────────── */
.sites-listing .site-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── ID row ─────────────────────────────────────────────── */
.sites-listing .site-card-id-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.sites-listing .btn-copy-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.sites-listing .btn-copy-id svg {
    opacity: 0.35;
    stroke: currentColor;
    color: #6b7280;
    transition: opacity 0.15s;
}
.sites-listing .btn-copy-id:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.sites-listing .btn-copy-id:hover svg {
    opacity: 0.65;
}
.sites-listing .btn-copy-id.copied {
    background: #ecfdf5;
    border-color: #10b981;
}
.sites-listing .btn-copy-id.copied svg {
    opacity: 0.8;
    color: #059669;
}

/* ── URL link ───────────────────────────────────────────── */
/* ── Email ──────────────────────────────────────────────── */
.sites-listing .site-card-email {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    overflow: hidden;
}
.sites-listing .site-card-email i {
    font-size: 0.7rem;
    flex-shrink: 0;
    color: #9ca3af;
}
.sites-listing .site-card-email span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── URL ───────────────────────────────────────────────── */
.sites-listing .site-card-url {
    font-size: 0.75rem;
    color: #374151;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sites-listing .site-card-url:hover {
    color: var(--color-primary);
}

/* ── Feature icons row ──────────────────────────────────── */
.sites-listing .site-card-features {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Card footer (Material Design) ──────────────────────── */
.sites-listing .site-card-footer {
    display: flex;
    align-items: center;
    padding: 8px 16px;              /* MD3: 16px horizontal, 8px vertical */
    min-height: 52px;
    border-top: 1px solid #f0f1f3;
}
.sites-listing .site-card-footer .footer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}
/* Hereda estilos de .action-btn.has-label (componente global)
.sites-listing .site-card-footer .card-action-btn — DEPRECATED */
.sites-listing .site-card-footer .card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.sites-listing .site-card-footer .card-action-btn svg {
    color: #374151;
    transition: color 0.15s;
}
.sites-listing .site-card-footer .card-action-btn:hover {
    background: #f3f4f6;
    color: #111827;
}
.sites-listing .site-card-footer .card-action-btn:hover svg {
    color: #111827;
}
.sites-listing .site-card-footer .card-action-btn i {
    font-size: 0.8rem;
}
/* ── Overflow dropdown (now in thumbnail) ──────────────── */
.sites-listing .site-card-overflow .dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    padding: 4px;
    min-width: 140px;
    animation: siteDropFade 0.15s ease;
}
.sites-listing .site-card-overflow .dropdown-item {
    border-radius: 6px;
    font-size: 0.78rem;
    padding: 7px 12px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sites-listing .site-card-overflow .dropdown-item:hover {
    background: #f3f4f6;
    color: #111827;
}
.sites-listing .site-card-overflow .dropdown-item.text-danger:hover {
    background: #fef2f2;
}
@keyframes siteDropFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── View toggle (grid / list) ─────────────────────────── */
/* ── View toggle — Componente global ───────────────────── */
.view-toggle {
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: background 0.15s, color 0.15s;
}
.view-toggle-btn + .view-toggle-btn {
    border-left: 1px solid #e5e7eb;
}
.view-toggle-btn:hover {
    background: #f9fafb;
    color: #6b7280;
}
.view-toggle-btn.active {
    background: #f3f4f6;
    color: #111827;
}
.view-toggle-btn svg {
    stroke: currentColor;
    fill: none;
    color: inherit;
}

/* ── List/table view ───────────────────────────────────── */
.sites-listing .sites-table-wrap {
    margin-top: 1rem;
}
.sites-listing .sites-table {
    font-size: 0.82rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
}
/* thead usa componente global .tbl-thead */
.sites-listing .sites-table tbody tr {
    transition: background 0.12s;
}
.sites-listing .sites-table tbody tr:hover {
    background: #f9fafb;
}
.sites-listing .sites-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f1f3;
    color: #374151;
}
.sites-listing .sites-table .meta-id {
    font-size: 0.72rem;
    padding: 4px 8px;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
/* ── List favicon cell ──────────────────────────────────── */
.sites-listing .td-favicon {
    width: 44px;
    padding: 8px !important;
}
.sites-listing .list-favicon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b929c 0%, #7a828d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.sites-listing .list-favicon--img {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 4px;
}
.sites-listing .list-favicon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── List web link icon ────────────────────────────────── */
.sites-listing .site-list-weblink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
}
.sites-listing .site-list-weblink:hover {
    background: #f3f4f6;
    color: var(--color-primary);
}
.sites-listing .site-list-weblink svg {
    stroke: currentColor;
    fill: none;
}

.sites-listing .site-list-name {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.sites-listing .site-list-name:hover {
    color: var(--color-primary);
}
.sites-listing .footer-edit-btn {
    margin-left: auto;
}

/* ── Empty state ────────────────────────────────────────── */
.sites-listing .sites-empty {
    text-align: center;
    padding: 60px 20px;
}
.sites-listing .sites-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 14px;
    margin-bottom: 14px;
    color: #9ca3af;
    font-size: 1.4rem;
}
.sites-listing .sites-empty h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.sites-listing .sites-empty p {
    font-size: 0.82rem;
    color: #9ca3af;
    margin: 0;
}

/* ── Badge de proyecto (reutilizable) ───────────────────── */
.badge-project {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px 3px 7px;
    border-radius: 50rem;
    letter-spacing: 0.01em;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-project::before {
    content: '' !important;
    display: inline-block !important;
    width: 6px !important;
    min-width: 6px;
    height: 6px !important;
    min-height: 6px;
    border-radius: 50% !important;
    flex-shrink: 0;
}
.badge-project.is-active    { background: #ecfdf5; color: #059669; }
.badge-project.is-active::before    { background: #10b981; }
.badge-project.is-inactive  { background: #fef2f2; color: #dc2626; }
.badge-project.is-inactive::before  { background: #ef4444; }
.badge-project.is-pending   { background: #fffbeb; color: #d97706; }
.badge-project.is-pending::before   { background: #f59e0b; }
.badge-project.is-draft     { background: #f3f4f6; color: #6b7280; }
.badge-project.is-draft::before     { background: #9ca3af; }

/* ── Environment badge — Componente reutilizable (.badge-env) ── */
.badge-env {
    font-size: 0.54rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}
.badge-env.is-prod {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.badge-env.is-test {
    background: #f3f4f6;
    color: #6b7280;
}
.badge-env.is-active {
    background: #ecfdf5;
    color: #059669;
}
.badge-env.is-inactive {
    background: #fef2f2;
    color: #dc2626;
}

/* ══════════════════════════════════════════════════════════
   Card overflow button — Componente reutilizable (.card-overflow-btn)
   Uso:  <button class="card-overflow-btn" data-bs-toggle="dropdown">
             <i class="bi bi-three-dots"></i>
         </button>
   Tamaño: 28px (estándar Shopify / Stripe)
   ══════════════════════════════════════════════════════════ */
.card-overflow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.25);
    cursor: pointer;
    color: #6b7280;
    font-size: 0.9rem;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.card-overflow-btn:hover {
    background: #fff;
    color: #374151;
}
/* Variante para fondos claros (sin glass) */
.card-overflow-btn.on-light {
    background: #f3f4f6;
    backdrop-filter: none;
    border-color: #e5e7eb;
}
.card-overflow-btn.on-light:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ══════════════════════════════════════════════════════════
   Icon sizing — Untitled UI Featured Icon tiers
   Uso:  class="icon-md"  →  40 × 40 contenedor, 20 × 20 icono
         class="icon-sm"  →  32 × 32 contenedor, 16 × 16 icono
         class="icon-lg"  →  48 × 48 contenedor, 24 × 24 icono
   ══════════════════════════════════════════════════════════ */
.icon-sm  { --icon-box: 32px; --icon-size: 16px; }
.icon-md  { --icon-box: 40px; --icon-size: 20px; }
.icon-lg  { --icon-box: 48px; --icon-size: 24px; }

/* ══════════════════════════════════════════════════════════
   Feature icon — Componente reutilizable (.feat-icon)
   Uso:  <span class="feat-icon icon-md feat-biometric" title="...">
             <img src="/images/icons/face-id.svg" alt="">
         </span>
   ══════════════════════════════════════════════════════════ */
.feat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-box, 40px);
    height: var(--icon-box, 40px);
    border-radius: 50%;
    font-size: var(--icon-size, 20px);
    flex-shrink: 0;
    cursor: default;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feat-icon img {
    width: var(--icon-size, 20px);
    height: var(--icon-size, 20px);
}
.feat-icon:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* Tooltip nativo mejorado */
.feat-icon[title] {
    cursor: help;
}
/* ── Variantes de color ─────────────────────────────────── */
/* Formulario corto — rosa */
.feat-icon.feat-shortform { background: #fce7f3; color: #db2777; }
.feat-icon.feat-shortform img { filter: brightness(0) saturate(100%) invert(22%) sepia(90%) saturate(3000%) hue-rotate(320deg) brightness(90%); }
/* Muestra precios — violeta */
.feat-icon.feat-prices { background: #ede9fe; color: #7c3aed; }
.feat-icon.feat-prices img { filter: brightness(0) saturate(100%) invert(28%) sepia(80%) saturate(4000%) hue-rotate(255deg) brightness(95%); }
/* Niveles regulatorios — cyan */
.feat-icon.feat-levels { background: #cffafe; color: #0891b2; }
.feat-icon.feat-levels img { filter: brightness(0) saturate(100%) invert(45%) sepia(90%) saturate(800%) hue-rotate(155deg) brightness(90%); }
/* Reclamar activo — sky */
.feat-icon.feat-reedim { background: #e0f2fe; color: #0284c7; }
.feat-icon.feat-reedim img { filter: brightness(0) saturate(100%) invert(35%) sepia(90%) saturate(1500%) hue-rotate(190deg) brightness(95%); }
/* Mercado cesiones — lila */
.feat-icon.feat-p2p { background: #e8d5f5; color: #a020f0; }
.feat-icon.feat-p2p img { filter: brightness(0) saturate(100%) invert(25%) sepia(95%) saturate(5000%) hue-rotate(270deg) brightness(90%); }
/* Verificación biométrica — azul */
.feat-icon.feat-biometric { background: #dbeafe; color: #2563eb; }
.feat-icon.feat-biometric img { filter: brightness(0) saturate(100%) invert(33%) sepia(93%) saturate(1700%) hue-rotate(217deg) brightness(97%); }
/* Plan Empleados — amber */
.feat-icon.feat-employee-plan { background: #fef3c7; color: #d97706; }
.feat-icon.feat-employee-plan img { filter: brightness(0) saturate(100%) invert(47%) sepia(98%) saturate(1000%) hue-rotate(15deg) brightness(95%); }

/* ── Header section ─────────────────────────────────────── */
.sites-listing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.sites-listing-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    margin-bottom: 2px;
}
.sites-listing-header .subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}
.sites-listing-header .btn-new-site {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}
.sites-listing-header .btn-new-site:hover {
    background: #2b63d9;
    box-shadow: 0 2px 8px rgba(60,118,242,0.25);
}

/* ── Filters bar spacing ────────────────────────────────── */
.sites-listing .filters-bar {
    margin-bottom: 1.25rem;
}

/* ── Search bar ─────────────────────────────────────────── */
.sites-listing .search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.sites-listing .search-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 0 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 38px;
}
.sites-listing .search-input-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(60,118,242,0.1);
}
.sites-listing .search-input-wrap i {
    color: #9ca3af;
    font-size: 0.85rem;
}
.sites-listing .search-input-wrap input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0 8px;
    font-size: 0.85rem;
    color: #374151;
    width: 180px;
}
.sites-listing .search-input-wrap input::placeholder {
    color: #9ca3af;
}
.sites-listing .search-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.sites-listing .search-btn:hover {
    background: #f0f4ff;
}
.sites-listing .search-btn-reset {
    color: #6b7280;
}
.sites-listing .search-btn-reset:hover {
    background: #f3f4f6;
}

/* ── Results counter ────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════
   Results badge — Componente reutilizable (.results-badge)
   Uso:  <span class="results-badge">
             <i class="bi bi-check-circle"></i>
             <span>123 resultados</span>
         </span>
   ══════════════════════════════════════════════════════════ */
.results-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    color: #374151;
    padding: 0;
    font-size: 0.7rem;
    font-weight: 400;
    white-space: nowrap;
    font-weight: 500;
    margin-left: auto;
}
.results-badge i {
    font-size: 0.65rem;
    color: #374151;
}

/* ══════════════════════════════════════════════════════════
   Pagination — Componente reutilizable (.app-pagination)
   Estilo Stripe/Shopify 2026 — minimalista, limpio
   ══════════════════════════════════════════════════════════ */
.app-pagination {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0 0.5rem;
}
.app-pagination .pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.app-pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    background: none;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    gap: 4px;
}
.app-pagination .page-item .page-link:hover {
    background: #f3f4f6;
    color: #111827;
}
/* Active page */
.app-pagination .page-item.active .page-link {
    background: #111827;
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
/* Disabled (prev/next when at edges) */
.app-pagination .page-item.disabled .page-link {
    color: #d1d5db;
    cursor: default;
    pointer-events: none;
}
/* Prev / Next buttons */
.app-pagination .page-item.prev .page-link,
.app-pagination .page-item.next .page-link {
    font-weight: 500;
    gap: 6px;
    padding: 0 12px;
    border-radius: 50rem;
    min-width: auto;
}
.app-pagination .page-item.prev .page-link i,
.app-pagination .page-item.next .page-link i {
    font-size: 0.65rem;
}
/* Ellipsis */
.app-pagination .page-item.ellipsis .page-link {
    cursor: default;
    color: #9ca3af;
    min-width: 24px;
}
/* Responsive */
@media (max-width: 575.98px) {
    .app-pagination .page-item .page-link {
        min-width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    .app-pagination .page-item.prev .page-link,
    .app-pagination .page-item.next .page-link {
        padding: 0 10px;
    }
}

/* ── Bootstrap Tooltip override (Stripe-style) ──────────── */
.tooltip .tooltip-inner {
    background: #1f2937;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.tooltip .tooltip-arrow::before {
    border-top-color: #1f2937 !important;
}

/* ══════════════════════════════════════════════════════════
   Discount Codes — Premium Fintech (Mercury / Stripe)
   ──────────────────────────────────────────────────────────
   Grid discipline:
     • Every row = 12 columns. No partial rows.
     • Allowed splits: 12 | 6+6 | 4+4+4 | 6+3+3
     • Form max-width: 840px (prevents wide-screen stretch)
     • Spacing: g-4 (24px) between fields, 32px sections
   ══════════════════════════════════════════════════════════ */

/* ── Shared: header icon block (used by both pages) ───────── */
.dsc-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #f0f4ff;
    border-radius: 10px;
    flex-shrink: 0;
}
.dsc-header-icon img {
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════
   CREATE / EDIT  (.discount-page)
   Single card, 3 field rows, Material Design grid.
   Row 1: 6+2+2+2=12 | Row 2: 4+4+4=12 | Row 3: 3+3+3+3=12
   ═══════════════════════════════════════════════════════════ */

/* ── Overline section label (Material Design pattern) ─────── */
.dsc-overline {
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af !important;
    margin-bottom: 12px !important;
    padding-bottom: 0;
    border: none;
}

/* ── Labels ───────────────────────────────────────────────── */
.discount-page .form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

/* ── Inputs & selects — refined focus/disabled ────────────── */
.discount-page .form-control,
.discount-page .form-select {
    font-size: 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    color: #1f2937;
    background-color: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    height: 38px;
}
.discount-page .form-control:focus,
.discount-page .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(60, 118, 242, 0.1);
    outline: none;
}
.discount-page .form-control:disabled,
.discount-page .form-select:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 1;
}
.discount-page .form-control::placeholder {
    color: #9ca3af;
}

/* ── Helper text ──────────────────────────────────────────── */
.discount-page .form-text {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 4px;
    line-height: 1.35;
}

/* ── Validation ───────────────────────────────────────────── */
.discount-page .invalid-feedback {
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   INDEX / LISTING  (.discount-listing)
   ═══════════════════════════════════════════════════════════ */

/* ── Header ───────────────────────────────────────────────── */
.discount-listing .listing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 16px;
}
.discount-listing .listing-header-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.discount-listing .listing-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}
.discount-listing .listing-header .subtitle {
    font-size: 0.82rem;
    color: #6b7280;
    margin: 2px 0 0;
}
.discount-listing .btn-new-code {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    height: 40px;
}
.discount-listing .btn-new-code:hover {
    background: #2b63d9;
    box-shadow: 0 2px 8px rgba(60, 118, 242, 0.25);
    color: #fff;
}
.discount-listing .btn-new-code img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* ── Filter bar ───────────────────────────────────────────── */
.discount-listing .filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.discount-listing .search-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 0 12px;
    height: 38px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.discount-listing .search-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(60, 118, 242, 0.1);
}
.discount-listing .search-wrap img {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    flex-shrink: 0;
}
.discount-listing .search-wrap input {
    border: none;
    outline: none;
    background: transparent;
    padding: 0 8px;
    font-size: 0.85rem;
    color: #374151;
    width: 200px;
}
.discount-listing .search-wrap input::placeholder {
    color: #9ca3af;
}
.discount-listing .filter-btn {
    background: none;
    border: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.discount-listing .filter-btn:hover {
    background: #f0f4ff;
}
.discount-listing .filter-btn-reset {
    color: #6b7280;
}
.discount-listing .filter-btn-reset:hover {
    background: #f3f4f6;
}
.discount-listing .results-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f4ff;
    color: var(--color-primary);
    padding: 5px 14px;
    border-radius: 50rem;
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: auto;
}
.discount-listing .results-pill img {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* ── Table ────────────────────────────────────────────────── */
.discount-listing .table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.discount-listing .table-card .table {
    margin-bottom: 0;
}
.discount-listing .table-card .table thead th {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-top: none;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 12px 16px;
    white-space: nowrap;
}
.discount-listing .table-card .table tbody td {
    padding: 14px 16px;
    font-size: 0.84rem;
    color: #374151;
    border-bottom: 1px solid #f0f1f3;
    vertical-align: middle;
}
.discount-listing .table-card .table tbody tr:last-child td {
    border-bottom: none;
}
.discount-listing .table-card .table tbody tr:hover {
    background: #fafbfc;
}

/* ── Code cell ────────────────────────────────────────────── */
.discount-listing .code-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.discount-listing .code-mono {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: 0.03em;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 6px;
}
.discount-listing .btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f0f4ff;
    border: 1px solid #dbe4f8;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.discount-listing .btn-copy:hover {
    background: #dbe4f8;
    border-color: var(--color-primary);
}
.discount-listing .btn-copy img {
    width: 14px;
    height: 14px;
    opacity: 0.65;
}
.discount-listing .btn-copy.copied {
    background: #ecfdf5;
    border-color: #10b981;
}
.discount-listing .btn-copy.copied img {
    opacity: 0.8;
}

/* ── Pills ────────────────────────────────────────────────── */
.discount-listing .value-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.discount-listing .value-pill.is-percent {
    background: #eff6ff;
    color: #2563eb;
}
.discount-listing .value-pill.is-fixed {
    background: #ecfdf5;
    color: #059669;
}
.discount-listing .scope-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 50rem;
    background: #f3f4f6;
    color: #6b7280;
    text-transform: capitalize;
}
.discount-listing .status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}
.discount-listing .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.discount-listing .status-dot.is-active  { background: #10b981; }
.discount-listing .status-dot.is-inactive { background: #ef4444; }

/* ── Action btns ──────────────────────────────────────────── */
.discount-listing .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0f1f3;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    padding: 0;
}
.discount-listing .action-btn:hover { background: #e4e6ea; }
.discount-listing .action-btn img { width: 15px; height: 15px; opacity: 0.55; }
.discount-listing .action-btn:hover img { opacity: 0.8; }
.discount-listing .action-btn-danger:hover { background: #fee2e2; }
.discount-listing .action-btn-danger:hover img {
    filter: brightness(0) saturate(100%) invert(42%) sepia(67%) saturate(2600%) hue-rotate(335deg) brightness(92%) contrast(92%);
}

/* ── Empty state ──────────────────────────────────────────── */
.discount-listing .empty-state {
    text-align: center;
    padding: 48px 20px;
}
.discount-listing .empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 14px;
    margin-bottom: 12px;
}
.discount-listing .empty-state-icon img { width: 24px; height: 24px; opacity: 0.4; }
.discount-listing .empty-state h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.discount-listing .empty-state p { font-size: 0.8rem; color: #9ca3af; margin: 0; }

/* ── Pagination ───────────────────────────────────────────── */
.discount-listing .pagination-wrap { padding: 16px 0 4px; }

/* ── Discount table pills ────────────────────────────────── */
.dsc-code-pill {
    display: inline-block;
    font-family: 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 50rem;
    background: #f3f4f6;
    color: #1f2937;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.dsc-value-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 50rem;
    white-space: nowrap;
}
.dsc-value-pill.is-percent {
    background: transparent;
    color: #2563eb;
}
.dsc-value-pill.is-fixed {
    background: transparent;
    color: #059669;
}
.dsc-scope-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 16px;
    border-radius: 50rem;
    background: transparent;
    color: #6b7280;
    text-transform: capitalize;
}

/* ══════════════════════════════════════════════════════════
   Action Button — Componente único (.action-btn)
   Botón ghost para acciones en tablas, cards, listas.
   Usa SVG sprites sin width/height inline.

   Contenedor:
     <div class="action-group"> ... </div>

   Solo icono:
     <a class="action-btn" href="..." title="Editar">
         <svg><use href="/images/sprite.svg#icon-edit-03"/></svg>
     </a>

   Icono + texto:
     <a class="action-btn has-label" href="...">
         <svg><use href="/images/sprite.svg#icon-edit-03"/></svg> Editar
     </a>

   Variantes:
     .action-btn              → default (gris)
     .action-btn.is-danger    → rojo en hover (eliminar)
     .action-btn.copied       → feedback verde (copiar)
   ══════════════════════════════════════════════════════════ */
.action-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}
.action-btn svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    transition: color 0.15s ease;
    flex-shrink: 0;
}
.action-btn:hover {
    background: #f3f4f6;
    color: #111827;
}
.action-btn:hover svg {
    color: #374151;
}
.action-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}
/* Con label (icono + texto) */
.action-btn.has-label {
    width: auto;
    gap: 5px;
    padding: 6px 10px;
    white-space: nowrap;
}
/* Danger variant (eliminar) */
.action-btn.is-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}
.action-btn.is-danger:hover svg {
    color: #dc2626;
}
/* Copied feedback */
.action-btn.copied {
    background: #ecfdf5;
}
.action-btn.copied svg {
    color: #059669;
}

/* ── Legacy aliases (backward compat) ─────────────────── */
.tbl-actions { display: inline-flex; align-items: center; gap: 0; }
.tbl-act-btn { /* @deprecated → use .action-btn */ }
.tbl-act-danger { /* @deprecated → use .action-btn.is-danger */ }

/* ══════════════════════════════════════════════════════════
   Owner cards — Hereda diseño de sites-listing
   Archivo: owners/index.blade.php
   ══════════════════════════════════════════════════════════ */
.owners-listing {
    border: none !important;
    box-shadow: none !important;
}

/* ── Card base ─────────────────────────────────────────── */
.owners-listing .owner-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.owners-listing .owner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
    border-color: #d1d5db;
}

/* ── Thumbnail ─────────────────────────────────────────── */
.owners-listing .owner-card-thumb {
    background: linear-gradient(135deg, #8b929c 0%, #7a828d 100%);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border-bottom: 1px solid #d1d5db;
    position: relative;
}
.owners-listing .owner-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* ── Overflow menu (hereda .card-overflow-btn global) ──── */
.owners-listing .site-card-overflow {
    position: absolute;
    top: 8px;
    right: 8px;
}
.owners-listing .site-card-overflow .dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    padding: 4px;
    min-width: 140px;
    animation: siteDropFade 0.15s ease;
}
.owners-listing .site-card-overflow .dropdown-item {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s;
}
.owners-listing .site-card-overflow .dropdown-item:hover {
    background: #f3f4f6;
}
.owners-listing .site-card-overflow .dropdown-item svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
    flex-shrink: 0;
}

/* ── Card content ──────────────────────────────────────── */
.owners-listing .owner-card-content {
    padding: 16px 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Title ─────────────────────────────────────────────── */
.owners-listing .owner-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.owners-listing .owner-card-name a {
    color: #111827;
    text-decoration: none;
}
.owners-listing .owner-card-name a:hover {
    color: var(--color-primary);
}

/* ── Badges (hereda .site-card-badges) ─────────────────── */
.owners-listing .site-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Business model badges ─────────────────────────────── */
/* ── Status icons (cards) ───────────────────────────────── */
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.status-icon img {
    width: 20px;
    height: 20px;
}
.status-icon.is-active img {
    filter: brightness(0) saturate(100%) invert(50%) sepia(95%) saturate(500%) hue-rotate(100deg) brightness(90%);
}
.status-icon.is-inactive img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(5000%) hue-rotate(350deg) brightness(95%) contrast(95%);
    opacity: 0.8;
}

.badge-env.is-type-edificio {
    background: #eff8ff;
    color: #1570ef;
}
.badge-env.is-type-modular {
    background: #fef6ee;
    color: #b93815;
}
.badge-env.is-type-loteo {
    background: #ecfdf3;
    color: #067647;
}

.badge-env.is-model-venta {
    background: #ede9fe;
    color: #7c3aed;
}
.badge-env.is-model-alquiler {
    background: #dbeafe;
    color: #2563eb;
}
.badge-env.is-model-integracion {
    background: #fdf2fa;
    color: #c11574;
}

/* ── Unit status badges ────────────────────────────────── */
.badge-env.is-unit-activa {
    background: #ecfdf5;
    color: #059669;
}
.badge-env.is-unit-inactiva {
    background: #f3f4f6;
    color: #667085;
}
.badge-env.is-unit-destacada {
    background: #eff8ff;
    color: #1570ef;
}
.badge-env.is-unit-senada {
    background: #fffaeb;
    color: #dc6803;
}
.badge-env.is-unit-cerrada {
    background: #f4f3ff;
    color: #6938ef;
}
.badge-env.is-unit-vendida {
    background: #fef3f2;
    color: #d92d20;
}

/* ── ID row (hereda .site-card-id-row) ─────────────────── */
.owners-listing .site-card-id-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.owners-listing .meta-id-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #374151;
    margin-right: 4px;
}
.owners-listing .meta-id {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.6rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 5px 8px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.02em;
}
.owners-listing .btn-copy-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.owners-listing .btn-copy-id svg {
    opacity: 0.35;
    stroke: currentColor;
    color: #6b7280;
    transition: opacity 0.15s;
}
.owners-listing .btn-copy-id:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.owners-listing .btn-copy-id:hover svg {
    opacity: 0.65;
}
.owners-listing .btn-copy-id.copied {
    background: #ecfdf5;
    border-color: #10b981;
}
.owners-listing .btn-copy-id.copied svg {
    opacity: 0.8;
    color: #059669;
}

/* ── Location row ──────────────────────────────────────── */
.owners-listing .owner-card-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #6b7280;
}
.owners-listing .owner-card-location svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* ── Card footer ───────────────────────────────────────── */
.owners-listing .owner-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 48px;
    border-top: 1px solid #f0f1f3;
}
/* ── Card body metrics ─────────────────────────────────── */
.owners-listing .owner-card-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Footer metrics (definido arriba en .owner-card-footer) ── */
.metric-circle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #6b7280;
    cursor: help;
    background: none;
    padding: 0;
}
.metric-circle svg {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    flex-shrink: 0;
}
.metric-circle strong {
    font-weight: 600;
    color: #374151;
}

/* ── Empty state ───────────────────────────────────────── */
.owners-listing .sites-empty {
    text-align: center;
    padding: 60px 20px;
}
.owners-listing .sites-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #f3f4f6;
    border-radius: 14px;
    margin-bottom: 14px;
    color: #9ca3af;
    font-size: 1.4rem;
}
.owners-listing .sites-empty h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.owners-listing .sites-empty p {
    font-size: 0.82rem;
    color: #9ca3af;
    margin: 0;
}

/* ── Filter bar spacing for owners ─────────────────────── */
.owners-listing .filters-bar {
    margin-bottom: 1.25rem;
}

/* ── List/table view ───────────────────────────────────── */
.owners-listing .sites-table-wrap {
    margin-top: 1rem;
}
.owners-listing .sites-table {
    font-size: 0.82rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.owners-listing .sites-table tbody tr {
    transition: background 0.12s;
}
.owners-listing .sites-table tbody tr:hover {
    background: #f9fafb;
}
.owners-listing .sites-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f1f3;
    color: #374151;
}
.owners-listing .site-list-name {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
}
.owners-listing .site-list-name:hover {
    color: var(--color-primary);
}

/* ══ Preview Panel ══════════════════════════════════════ */
.preview-sticky-col {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    z-index: 10;
}
.preview-panel {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    overflow: hidden;
}
.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}
.preview-toolbar__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.preview-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.preview-device-toggle {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.preview-device-toggle .btn {
    border: none;
    background: transparent;
    color: #6b7280;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}
.preview-device-toggle .btn:hover { color: #374151; background: #e5e7eb; }
.preview-device-toggle .btn.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.preview-device-toggle .btn svg,
.preview-action-btn svg { color: inherit; vertical-align: middle; }
.preview-action-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}
.preview-action-btn:hover { color: #374151; background: #f3f4f6; }
.preview-toolbar__divider {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    margin: 0 4px;
}
.preview-frame-wrapper {
    background: #d1d5db;
    padding: 16px;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}
.preview-device-frame {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    overflow: hidden;
    margin: 0 5px;
    transition: max-width 0.3s ease;
}
.preview-device-frame--mobile {
    max-width: 375px;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12), 0 0 0 2px #d1d5db;
}
.preview-address-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.preview-address-bar__dots { display: flex; gap: 4px; }
.preview-address-bar__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #d1d5db;
}
.preview-address-bar__url {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.preview-iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}
.preview-iframe-container iframe {
    display: block;
    border: none;
    transform-origin: 0 0;
}
.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 5;
    gap: 12px;
    transition: opacity 0.3s ease;
}
.preview-loading.is-hidden { opacity: 0; pointer-events: none; }
.preview-loading__spinner {
    width: 28px; height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: preview-spin 0.7s linear infinite;
}
@keyframes preview-spin { to { transform: rotate(360deg); } }
.preview-loading__text { font-size: 0.78rem; color: #9ca3af; }
.preview-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    gap: 8px;
}
.preview-empty.is-visible { display: flex; }
.preview-empty__icon { font-size: 2rem; color: #d1d5db; }
.preview-empty__title { font-size: 0.85rem; font-weight: 600; color: #374151; margin: 0; }
.preview-empty__desc { font-size: 0.75rem; color: #9ca3af; margin: 0; }
.preview-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    font-size: 0.72rem;
    color: #9ca3af;
}
.preview-status__unsaved {
    display: none;
    align-items: center;
    gap: 4px;
    color: #d97706;
    font-weight: 500;
}
.preview-status__unsaved.is-visible { display: flex; }
.preview-status__unsaved i { font-size: 0.8rem; }
@media (max-width: 767.98px) {
    .preview-sticky-col { position: static; }
    .preview-frame-wrapper { min-height: 300px; padding: 12px; }
}

/* ══════════════════════════════════════════════════════════
   Payment Provider Cards — Connection Hub (Stripe-inspired)
   ══════════════════════════════════════════════════════════ */

/* ── Secure badge (header) ────────────────────────────── */
.badge-secure {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 50rem;
    padding: 4px 10px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.badge-secure i {
    font-size: 0.75rem;
}

/* ── Provider Card ────────────────────────────────────── */
.payment-provider-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.payment-provider-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

/* ── Provider Header ──────────────────────────────────── */
.payment-provider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

/* ── Provider Logo ────────────────────────────────────── */
.payment-provider-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
}
.payment-provider-logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.payment-provider-logo--icon {
    background: #f0f9ff;
    border-color: #bae6fd;
}
.payment-provider-logo--icon svg {
    stroke: #0ea5e9;
    stroke-width: 1.8;
}

/* ── Provider Name & Tag ──────────────────────────────── */
.payment-provider-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}
.payment-provider-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50rem;
    padding: 1px 8px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Status Badge ─────────────────────────────────────── */
.payment-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 50rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: all 0.25s ease;
}
.payment-status-badge svg {
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}
.payment-status-badge--connected svg {
    fill: currentColor;
    stroke: currentColor;
}
.payment-status-badge--disconnected {
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}
.payment-status-badge--connected {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.payment-status-badge--error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* ── Provider Body ────────────────────────────────────── */
.payment-provider-body {
    padding: 20px;
    animation: paymentFadeIn 0.25s ease;
}
@keyframes paymentFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Description text ─────────────────────────────────── */
.payment-provider-desc {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ── Field Label ──────────────────────────────────────── */
.payment-field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

/* ── Input styling ────────────────────────────────────── */
.payment-input {
    font-size: 0.82rem !important;
    padding: 9px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    color: #111827 !important;
    background: #fff !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}
.payment-input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(60,118,242,0.1) !important;
}
.payment-input::placeholder {
    color: #9ca3af !important;
    font-weight: 400;
}
.payment-input.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.08) !important;
}
/* ── Toggle password button inside input-group ────────── */
.payment-input-group {
    flex-wrap: nowrap !important;
}
.payment-input-group .payment-input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
    min-width: 0;
}
.payment-input-group .payment-toggle-btn {
    border: 1px solid #d1d5db !important;
    border-left: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    background: #f9fafb !important;
    color: #6b7280 !important;
    padding: 0 12px !important;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.payment-input-group .payment-toggle-btn:hover {
    background: #f3f4f6 !important;
    color: #374151 !important;
}
.payment-input-group:focus-within .payment-toggle-btn {
    border-color: var(--color-primary) !important;
}

/* ── Help link ────────────────────────────────────────── */
.payment-field-help {
    margin-top: 6px;
}
.payment-help-link {
    font-size: 0.72rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.payment-help-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}
.payment-help-link i {
    font-size: 0.65rem;
}

/* ── Inline field error ───────────────────────────────── */
.payment-field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #dc2626;
    font-weight: 500;
    animation: paymentShake 0.3s ease;
}
.payment-field-error svg {
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}
@keyframes paymentShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* ── Advanced toggle ──────────────────────────────────── */
.payment-advanced-toggle {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}
.payment-advanced-toggle:hover {
    color: #374151;
}
.payment-advanced-toggle svg {
    stroke: currentColor;
    stroke-width: 1.8;
    flex-shrink: 0;
}
.payment-chevron {
    transition: transform 0.25s ease;
}
.payment-advanced-toggle[aria-expanded="true"] .payment-chevron {
    transform: rotate(180deg);
}

/* ── Advanced fields container ────────────────────────── */
.payment-advanced-fields {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

/* ── Security note ────────────────────────────────────── */
.payment-security-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #9ca3af;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
}
.payment-security-note svg {
    stroke: #d1d5db;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ── Responsive tweaks ────────────────────────────────── */
@media (max-width: 575.98px) {
    .payment-provider-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .payment-provider-body {
        padding: 16px;
    }
    .payment-advanced-fields .row > div {
        flex: 0 0 100%;
        max-width: 100%;
    }
}


/* ── Contract Info Grid (read-only data) ──────────────── */
.contract-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.contract-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.contract-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.contract-info-row:first-child {
    padding-top: 0;
}
.contract-info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.01em;
}
.contract-info-label svg {
    stroke: #9ca3af;
    stroke-width: 1.8;
    flex-shrink: 0;
}
.contract-info-value {
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: #111827;
    word-break: break-all;
    padding: 6px 10px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
    min-height: 32px;
    line-height: 1.5;
}
.contract-info-value:empty::after {
    content: 'Sin datos';
    color: #d1d5db;
    font-style: italic;
    font-family: inherit;
}

/* ── Select styled as payment-input ───────────────────── */
select.payment-input {
    padding-right: 36px !important;
    appearance: auto;
}

/* ── Copyable contract info row ───────────────────────── */
.contract-info-copyable {
    display: flex;
    align-items: center;
    gap: 0;
}
.contract-info-copyable .contract-info-value {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: auto;
    align-self: stretch;
    border: 1px solid #f3f4f6;
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: #f9fafb;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.btn-copy:hover {
    background: #f3f4f6;
    color: #374151;
}
.btn-copy.copied {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.btn-copy svg {
    stroke: currentColor;
    stroke-width: 2;
}

/* ── Locked field (readonly wallet) ───────────────────── */
.payment-input--locked {
    background: #f9fafb !important;
    color: #6b7280 !important;
    cursor: default;
}
.payment-lock-btn svg {
    stroke: #9ca3af;
    stroke-width: 1.8;
    transition: stroke 0.15s;
}
.payment-lock-btn:hover svg {
    stroke: #374151;
}
.payment-lock-btn--unlocked svg {
    stroke: #059669;
}
.payment-lock-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #9ca3af;
}
.payment-lock-hint svg {
    stroke: #d1d5db;
    stroke-width: 1.8;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   Toast notifications
   ══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast-notification {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
}
.toast-notification--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.toast-notification--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.toast-notification--saving {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.toast-notification.is-hiding {
    animation: toastSlideOut 0.25s ease forwards;
}
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   Smart CTA button states
   ══════════════════════════════════════════════════════════ */
.form-actions-fixed .btn.is-saving {
    pointer-events: none;
    opacity: 0.7;
}
.form-actions-fixed .btn.is-pristine {
    opacity: 0.5;
    cursor: default;
}