/* =============================================================================
   WF Field Address — styles.css  v2.1
   ============================================================================= */

/* ── Selects: forzar visibilidad contra estilos externos del tema ─────────── */
.wf-admin-wrap select,
.wf-location-dropdown select,
#wf-route-items select {
    display: block !important;
}

/* ── wf-location-dropdown: opción "Usar mi ubicación actual" ─────────────── */

.wf-location-dropdown {
    display: none;
    position: absolute;
    z-index: 9999999992 !important; /* Un nivel por encima del pac-container */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    box-sizing: border-box;
    overflow: hidden;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.wf-location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    color: #1a73e8;
    font-weight: 500;
    transition: background-color 0.12s ease;
    white-space: nowrap;
}

.wf-location-item:hover {
    background-color: #f5f7ff;
}

.wf-location-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Estado de carga: spinner en el input */
.wf-location-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%231a73e8' stroke-width='3' fill='none' stroke-dasharray='31.4' stroke-dashoffset='10'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px !important;
}

/* ── pac-container: dropdown del Autocomplete de Google Maps ──────────────── */

.pac-container {
    background-color: #fff;
    position: absolute !important;
    z-index: 9999999991 !important;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    border-top: none;
    font-family: Arial, sans-serif;
    font-size: 14px;
    -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
    margin-top: 2px;
}

.pac-item {
    z-index: 9999999991 !important;
    position: relative !important;
    display: flex;
    align-items: center;
    padding: 9px 14px;
    cursor: pointer !important;
    border-top: 1px solid #f0f0f0;
    line-height: 1.4;
    transition: background-color 0.12s ease;
    color: #333;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover,
.pac-item.pac-item-selected {
    background-color: #f5f7ff !important;
    cursor: pointer !important;
}

/* Icono de pin de Google */
.pac-icon {
    margin-right: 10px;
    margin-top: 0;
    flex-shrink: 0;
    opacity: 0.55;
}

/* Texto principal de la sugerencia */
.pac-item-query {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    padding-right: 4px;
}

/* Texto secundario (ciudad, país…) */
.pac-item span:not(.pac-icon):not(.pac-item-query) {
    font-size: 13px;
    color: #777;
}

/* Término resaltado dentro de la sugerencia */
.pac-matched {
    font-weight: 700;
    color: #1a73e8;
}

/* Ocultar el logo de Google en el dropdown */
.pac-container.pac-logo:after,
.pac-container.pac-logo.hdpi:after {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
/* ── wf-modal: modal de permiso de ubicación ─────────────────────────────── */

.wf-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999999999;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    /* Entrada suave */
    opacity: 0;
    transition: opacity 0.18s ease;
}

.wf-modal-overlay.wf-modal-visible {
    display: flex;
    opacity: 1;
}

.wf-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-family: Arial, sans-serif;
    animation: wf-modal-in 0.2s ease;
}

@keyframes wf-modal-in {
    from { transform: translateY(12px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.wf-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: #eef3ff;
    border-radius: 50%;
}

.wf-modal-icon svg {
    width: 28px;
    height: 28px;
    stroke: #1a73e8;
}

.wf-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.3;
}

.wf-modal-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 24px;
}

.wf-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wf-modal-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.14s ease, opacity 0.14s ease;
    line-height: 1;
}

.wf-modal-btn:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 2px;
}

.wf-modal-btn-primary {
    background: #1a73e8;
    color: #fff;
}

.wf-modal-btn-primary:hover {
    background: #1557b0;
}

.wf-modal-btn-secondary {
    background: #f1f3f4;
    color: #444;
}

.wf-modal-btn-secondary:hover {
    background: #e2e5e9;
}


/* =============================================================================
   WF Field Address — Admin UI v2.5
   Diseño: SaaS dashboard refinado
   ============================================================================= */

/* ── Reset base dentro del wrap ─────────────────────────────────────────────── */

.wf-wrap *,
.wf-wrap *::before,
.wf-wrap *::after { box-sizing: border-box; }

/* Todos los selects del plugin: forzar visibilidad contra estilos del tema */
.wf-wrap select,
.wf-admin-wrap select,
.wf-location-dropdown select,
#wf-route-items select { display: block !important; }

/* ── Variables ──────────────────────────────────────────────────────────────── */

.wf-wrap {
    --wf-bg:        #f1f5f9;
    --wf-surface:   #ffffff;
    --wf-border:    #e2e8f0;
    --wf-border-2:  #cbd5e1;
    --wf-text:      #0f172a;
    --wf-text-2:    #475569;
    --wf-text-3:    #94a3b8;
    --wf-blue:      #2563eb;
    --wf-blue-lt:   #eff6ff;
    --wf-blue-dk:   #1d4ed8;
    --wf-green:     #16a34a;
    --wf-green-lt:  #f0fdf4;
    --wf-amber:     #d97706;
    --wf-amber-lt:  #fffbeb;
    --wf-red:       #dc2626;
    --wf-header-h:  #0f172a;
    --wf-radius:    10px;
    --wf-radius-sm: 6px;
    --wf-shadow:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --wf-shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--wf-text);
    margin: 0 !important;
    padding: 0 !important;
    background: var(--wf-bg);
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */

.wf-header {
    background: var(--wf-header-h);
    margin-left: -20px;
    margin-right: 0;
    padding: 0 28px;
}

.wf-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.wf-logo { display: flex; align-items: center; gap: 12px; }

.wf-logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,.4);
    flex-shrink: 0;
}
.wf-logo-icon svg { width: 20px; height: 20px; }

.wf-logo-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.2px;
    line-height: 1.2;
}
.wf-logo-version {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-left: 6px;
    background: rgba(255,255,255,.08);
    padding: 1px 6px;
    border-radius: 4px;
}
.wf-logo-site {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,.4);
    margin-top: 1px;
}

.wf-header-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 500;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    transition: color .15s;
}
.wf-header-link:hover { color: rgba(255,255,255,.85); }

/* ── Tabs ───────────────────────────────────────────────────────────────────── */

.wf-tabs {
    display: flex;
    gap: 2px;
    padding: 12px 0 0;
    background: transparent !important;
}

.wf-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    transition: color .15s, background .15s;
    position: relative;
}
.wf-tab:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.05); }
.wf-tab.is-active {
    color: var(--wf-text);
    background: var(--wf-bg);
    border-color: rgba(255,255,255,.1);
}
.wf-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: #3b82f6;
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}
.wf-tab.is-active .wf-tab-count { background: var(--wf-blue); }

/* ── Toast / notice ──────────────────────────────────────────────────────────── */

.wf-toast {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 20px;
    font-size: 13px; font-weight: 500;
    margin-bottom: 0;
}
.wf-toast-success {
    background: var(--wf-green-lt);
    color: var(--wf-green);
    border-bottom: 1px solid #bbf7d0;
}

/* ── Content wrapper ─────────────────────────────────────────────────────────── */

.wf-content {
    padding: 28px;
    max-width: 1200px;
}

/* ── 2-col grid ──────────────────────────────────────────────────────────────── */

.wf-grid-2col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
.wf-form-col { display: flex; flex-direction: column; gap: 16px; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */

.wf-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    overflow: hidden;
}

.wf-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--wf-border);
    background: #fafbfc;
}

.wf-card-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.wf-icon-key    { background: #fef3c7; color: #d97706; }
.wf-icon-globe  { background: #e0f2fe; color: #0284c7; }
.wf-icon-target { background: #fce7f3; color: #be185d; }

.wf-card-title {
    font-size: 13px; font-weight: 700;
    color: var(--wf-text);
    margin: 0 0 2px;
    line-height: 1.2;
}
.wf-card-subtitle {
    font-size: 11px; color: var(--wf-text-3);
    margin: 0; line-height: 1.3;
}

.wf-card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* ── Form elements ───────────────────────────────────────────────────────────── */

.wf-field { display: flex; flex-direction: column; gap: 6px; }

.wf-label {
    font-size: 12px; font-weight: 600;
    color: var(--wf-text-2);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.wf-input-wrap { position: relative; display: flex; }

.wf-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--wf-border-2);
    border-radius: var(--wf-radius-sm);
    font-size: 13px;
    color: var(--wf-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.wf-input:focus {
    border-color: var(--wf-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.wf-input-code { font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace; font-size: 12px; letter-spacing: .3px; }
.wf-input-wrap .wf-input { border-radius: var(--wf-radius-sm) 0 0 var(--wf-radius-sm); }

.wf-input-toggle {
    padding: 0 12px;
    border: 1px solid var(--wf-border-2);
    border-left: none;
    border-radius: 0 var(--wf-radius-sm) var(--wf-radius-sm) 0;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: var(--wf-text-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.wf-input-toggle:hover { background: var(--wf-border); }

.wf-select {
    display: block !important;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--wf-border-2);
    border-radius: var(--wf-radius-sm);
    font-size: 13px;
    color: var(--wf-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.wf-select-multi {
    height: auto !important;
    min-height: 120px;
    padding: 6px;
    background-image: none;
}
.wf-select:focus {
    border-color: var(--wf-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.wf-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wf-border-2);
    border-radius: var(--wf-radius-sm);
    font-size: 13px;
    color: var(--wf-text);
    background: #fff;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    line-height: 1.5;
}
.wf-textarea:focus {
    border-color: var(--wf-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.wf-textarea-code { font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace; font-size: 12px; }

.wf-hint { font-size: 11px; color: var(--wf-text-3); margin: 0; line-height: 1.5; }
.wf-hint code { background: #f1f5f9; padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* ── Chips ───────────────────────────────────────────────────────────────────── */

.wf-apis-required { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-api-chip {
    display: inline-block;
    padding: 3px 9px;
    background: var(--wf-blue-lt);
    color: var(--wf-blue);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
}

.wf-selector-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-example-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid var(--wf-border);
    border-radius: 6px;
    font-size: 11px; color: var(--wf-text-2);
}
.wf-example-chip code { background: none; padding: 0; font-size: 11px; color: var(--wf-blue); font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.wf-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0 18px;
    height: 38px;
    border: none;
    border-radius: var(--wf-radius-sm);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
}
.wf-btn:active { transform: scale(.98); }

.wf-btn-primary {
    background: var(--wf-blue);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37,99,235,.35);
}
.wf-btn-primary:hover { background: var(--wf-blue-dk); color: #fff; }

.wf-btn-ghost {
    background: transparent;
    color: var(--wf-text-2);
    border: 1px solid var(--wf-border-2);
}
.wf-btn-ghost:hover { background: var(--wf-bg); color: var(--wf-text); }

.wf-btn-danger {
    background: #fff;
    color: var(--wf-red);
    border: 1px solid #fecaca;
}
.wf-btn-danger:hover { background: #fef2f2; }

.wf-btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }

.wf-link-small {
    font-size: 12px; color: var(--wf-blue); text-decoration: none; font-weight: 500;
}
.wf-link-small:hover { text-decoration: underline; }

.wf-form-actions { padding-top: 4px; }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */

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

.wf-info-card {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    padding: 16px;
    box-shadow: var(--wf-shadow);
}
.wf-info-card-accent { border-color: #bfdbfe; background: var(--wf-blue-lt); }

.wf-info-title {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--wf-text-2);
    margin: 0 0 12px;
}
.wf-info-text { font-size: 12px; color: var(--wf-text-2); margin: 0 0 10px; line-height: 1.5; }

/* Status list */
.wf-status-list { display: flex; flex-direction: column; gap: 6px; }
.wf-status-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px; font-weight: 500;
}
.wf-status-item.is-ok      { background: var(--wf-green-lt); color: var(--wf-green); }
.wf-status-item.is-warn    { background: var(--wf-amber-lt); color: var(--wf-amber); }
.wf-status-item.is-neutral { background: #f8fafc; color: var(--wf-text-2); }

/* Feature list */
.wf-feature-list { display: flex; flex-direction: column; gap: 10px; }
.wf-feature { display: flex; align-items: flex-start; gap: 10px; }
.wf-feature-icon { font-size: 16px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.wf-feature strong { display: block; font-size: 12px; font-weight: 600; color: var(--wf-text); }
.wf-feature p { margin: 2px 0 0; font-size: 11px; color: var(--wf-text-3); }

/* API list */
.wf-api-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.wf-api-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #1e40af; font-weight: 500; }
.wf-api-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wf-blue); flex-shrink: 0; }
.wf-domain-chip {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255,255,255,.7);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    width: 100%;
}
.wf-domain-chip code { font-size: 11px; color: #1e40af; word-break: break-all; }

/* ── Routes toolbar ───────────────────────────────────────────────────────────── */

.wf-routes-toolbar {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    margin-bottom: 20px;
}
.wf-routes-title { font-size: 18px; font-weight: 700; color: var(--wf-text); margin: 0 0 4px; }
.wf-routes-subtitle { font-size: 13px; color: var(--wf-text-2); margin: 0; }

/* ── Route items — repeater ───────────────────────────────────────────────────── */

#wf-route-items { display: flex; flex-direction: column; gap: 12px; }

.wf-route-item {
    background: var(--wf-surface);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    overflow: hidden;
    transition: box-shadow .2s;
}
.wf-route-item:hover { box-shadow: var(--wf-shadow-md); }

.wf-route-item-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    background: #fafbfc;
    border-bottom: 1px solid var(--wf-border);
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.wf-route-item-header:hover { background: #f1f5f9;display: flex;flex-wrap: nowrap; }
.wf-route-item-header.is-open { background: #eff6ff; border-bottom-color: #bfdbfe;display: flex;flex-wrap: nowrap; }

/* ── Drag & Drop ─────────────────────────────────────────────────────────── */

.wf-route-drag {
    cursor: grab !important;
}
.wf-route-drag:active { cursor: grabbing !important; }

.wf-dragging {
    opacity: 0;
}
.wf-dragging-hidden {
    opacity: 0;
    pointer-events: none;
}

.wf-drag-placeholder {
    background: var(--wf-blue-lt);
    border: 2px dashed var(--wf-blue);
    border-radius: var(--wf-radius);
    margin-bottom: 12px;
    transition: height .1s;
}

/* Ocultar botón collapse (eliminado del diseño) */
.wf-route-collapse-btn { display: none !important; }

.wf-route-drag {
    color: var(--wf-text-3);
    font-size: 16px;
    cursor: grab;
    flex-shrink: 0;
    line-height: 1;
}

.wf-route-mode-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.mode-DRIVE   { background: #dbeafe; color: #1d4ed8; }
.mode-WALK    { background: #d1fae5; color: #065f46; }
.mode-BICYCLE { background: #fef3c7; color: #92400e; }
.mode-TRANSIT { background: #ede9fe; color: #5b21b6; }

.wf-route-item-title {
    flex: 1;
    font-size: 13px; font-weight: 600;
    color: var(--wf-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wf-route-header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.wf-route-collapse-btn {
    width: 28px; height: 28px;
    border: 1px solid var(--wf-border);
    border-radius: 6px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--wf-text-2);
    transition: background .15s;
    font-size: 11px;
}
.wf-route-collapse-btn:hover { background: var(--wf-bg); }

/* ── Route item body ─────────────────────────────────────────────────────────── */

.wf-route-item-body { padding: 0; }

.wf-route-section {
    border-bottom: 1px solid var(--wf-border);
    padding: 0;
}
.wf-route-section:last-child { border-bottom: none; }

.wf-route-section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 18px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--wf-text-2);
    background: #fafbfc;
    border-bottom: 1px solid var(--wf-border);
    cursor: pointer;
    user-select: none;
}
.wf-route-section-header:hover { background: #f1f5f9; }
.wf-section-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dot-fields   { background: #3b82f6; }
.dot-waypoint { background: #8b5cf6; }
.dot-config   { background: #f59e0b; }
.dot-result   { background: #10b981; }
.dot-trigger  { background: #ef4444; }

.wf-route-section-body {
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 12px;
}

/* ── Route fields grid ────────────────────────────────────────────────────────── */

.wf-route-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.wf-route-fields-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.wf-route-field { display: flex; flex-direction: column; gap: 5px; }
.wf-route-label {
    font-size: 11px; font-weight: 600;
    color: var(--wf-text-2); letter-spacing: .3px;
}
.wf-route-label .wf-required { color: #ef4444; margin-left: 2px; }

.wf-route-input {
    display: block !important;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--wf-border-2);
    border-radius: var(--wf-radius-sm);
    font-size: 12px; font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
    color: var(--wf-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.wf-route-input:focus {
    border-color: var(--wf-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.wf-route-select {
    display: block !important;
    width: 100%;
    height: 34px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--wf-border-2);
    border-radius: var(--wf-radius-sm);
    font-size: 12px;
    color: var(--wf-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
    outline: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}
.wf-route-select:focus {
    border-color: var(--wf-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.wf-route-hint { font-size: 11px; color: var(--wf-text-3); margin: 2px 0 0; }

/* ── Checkboxes y radios ──────────────────────────────────────────────────────── */

.wf-check-group { display: flex; flex-direction: column; gap: 7px; }
.wf-radio-group { display: flex; flex-direction: column; gap: 7px; }

.wf-check-label, .wf-radio-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--wf-text);
    cursor: pointer; user-select: none;
}
.wf-check-label input[type="checkbox"],
.wf-radio-label input[type="radio"] {
    width: 15px; height: 15px;
    accent-color: var(--wf-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.wf-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wf-radio-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--wf-border-2);
    border-radius: 20px;
    font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all .15s;
    color: var(--wf-text-2);
}
.wf-radio-pill:has(input:checked) {
    background: var(--wf-blue-lt);
    border-color: var(--wf-blue);
    color: var(--wf-blue);
}
.wf-radio-pill input { display: none; }

/* ── Waypoints ───────────────────────────────────────────────────────────────── */

.wf-waypoints { display: flex; flex-direction: column; gap: 6px; }
.wf-waypoint-row {
    display: flex; align-items: center; gap: 6px;
}
.wf-waypoint-row .wf-route-input { flex: 1; }
.wf-waypoint-remove {
    width: 28px; height: 28px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff;
    color: var(--wf-red);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; line-height: 1;
    flex-shrink: 0; transition: background .15s;
}
.wf-waypoint-remove:hover { background: #fef2f2; }

/* ── Empty state ─────────────────────────────────────────────────────────────── */

#wf-route-empty {
    display: none;
    text-align: center;
    padding: 64px 32px;
    background: var(--wf-surface);
    border: 2px dashed var(--wf-border-2);
    border-radius: var(--wf-radius);
    color: var(--wf-text-3);
}
.wf-empty-icon {
    width: 72px; height: 72px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: var(--wf-text-3);
}
#wf-route-empty h3 { font-size: 16px; font-weight: 700; color: var(--wf-text-2); margin: 0 0 8px; }
#wf-route-empty p  { font-size: 13px; color: var(--wf-text-3); margin: 0 0 20px; }

/* ── Submit wrap ─────────────────────────────────────────────────────────────── */

#wf-routes-submit-wrap { margin-top: 20px; }

/* ── Responsive — móvil ─────────────────────────────────────────────────────── */

@media (max-width: 782px) {

    .wf-content {
        padding: 0px;
    }

    .wf-grid-2col {
        grid-template-columns: 1fr;
    }

    .wf-sidebar {
        order: -1; /* el sidebar sube arriba en móvil */
    }

    .wf-route-fields-grid,
    .wf-route-fields-grid.cols-3 {
        grid-template-columns: 1fr !important;
    }

    .wf-radio-row {
        flex-direction: column;
        gap: 6px;
    }

    .wf-routes-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .wf-routes-toolbar .wf-btn {
        width: 100%;
        justify-content: center;
    }

    .wf-header {
        margin-left: -10px;
        padding: 0 14px;
    }

    .wf-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 0 12px;
    }

    .wf-tabs {
        gap: 1px;
        overflow-x: auto;
    }

    .wf-tab {
        font-size: 12px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .wf-route-item-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .wf-route-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .wf-apis-required,
    .wf-selector-examples {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Frontend: route loading state ───────────────────────────────────────────── */

.wf-route-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%232563eb' stroke-width='3' fill='none' stroke-dasharray='31.4' stroke-dashoffset='10'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 34px !important;
    opacity: 0.7;
    pointer-events: none;
}
