.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4SiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ─── Login ──────────────────────────────────────────────────────────────── */
.layout-login {
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
}

.login-titulo {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.login-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff8080;
    border-radius: 0.6rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.login-campo {
    margin-bottom: 1.1rem;
}

.login-label {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-input-grupo {
    position: relative;
    display: flex;
    align-items: center;
}

.login-icono {
    position: absolute;
    left: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    pointer-events: none;
}

.login-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.65rem;
    color: #fff;
    padding: 0.65rem 2.75rem 0.65rem 2.5rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

    .login-input::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

    .login-input:focus {
        outline: none;
        border-color: #4e9af1;
        background: rgba(255, 255, 255, 0.1);
    }

.login-ojo {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

    .login-ojo:hover {
        color: rgba(255, 255, 255, 0.75);
    }

.login-validacion {
    color: #ff8080;
    font-size: 0.78rem;
    margin-top: 0.3rem;
    display: block;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: #4e9af1;
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

    .login-btn:hover:not(:disabled) {
        background: #3a84d8;
    }

    .login-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    .login-btn:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }
/* ─── Perfil ─────────────────────────────────────────────────────────────── */
.perfil-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.perfil-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 1.25rem;
}

.perfil-avatar {
    font-size: 3rem;
    line-height: 1;
    color: #4e9af1;
}

.perfil-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.perfil-usuario {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.perfil-rol {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.perfil-acciones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.perfil-btn-salir {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff8080;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

    .perfil-btn-salir:hover:not(:disabled) {
        background: rgba(220, 53, 69, 0.28);
    }

    .perfil-btn-salir:active:not(:disabled) {
        transform: scale(0.98);
    }

    .perfil-btn-salir:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

/* ═══════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════ */
.dash-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    padding-bottom: 100px;
}

/* Saludo */
.dash-saludo {
    background: linear-gradient(135deg, #1e3a5f, #2e5fa3);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
}

.dash-saludo-nombre {
    font-size: 1rem;
    font-weight: 600;
}

.dash-saludo-fecha {
    font-size: 0.8rem;
    opacity: .75;
    margin-top: 2px;
    text-transform: capitalize;
}

/* KPIs */
.dash-kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dash-kpi {
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-kpi--hoy {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.dash-kpi--semana {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.dash-kpi-titulo {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #666;
    letter-spacing: .05em;
}

.dash-kpi-valor {
    font-size: 2rem;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1;
}

.dash-kpi-sub {
    font-size: 0.78rem;
    color: #888;
}

.dash-kpi-ok {
    font-size: 0.78rem;
    color: #166534;
    margin-top: 4px;
}

/* Barra progreso */
.dash-progreso-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.dash-progreso-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 6px;
}

.dash-progreso-bar {
    background: #e9ecef;
    border-radius: 99px;
    height: 10px;
    overflow: hidden;
}

.dash-progreso-fill {
    background: linear-gradient(90deg,#1e3a5f,#2e5fa3);
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
}

/* Strip semanal */
.dash-semana-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: #fff;
    border-radius: 10px;
    padding: 10px 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.dash-dia {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 8px;
}

.dash-dia--hoy {
    background: #1e3a5f;
    color: #fff;
}

.dash-dia--vacio {
    opacity: .45;
}

.dash-dia-nombre {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dash-dia-num {
    font-size: 0.9rem;
    font-weight: 700;
}

.dash-dia-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.dash-dia-dot--pend {
    background: #dc3545;
}

.dash-dia-dot--ok {
    background: #198754;
}

.dash-dia-dot--none {
    background: transparent;
}

.dash-dia-count {
    font-size: 0.65rem;
    color: inherit;
}

/* Urgentes */
.dash-seccion-titulo {
    font-size: 0.8rem;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 0 2px;
}

.dash-urgente-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-left: 4px solid #dc3545;
    cursor: pointer;
    transition: box-shadow .15s;
}

    .dash-urgente-card:hover {
        box-shadow: 0 3px 10px rgba(0,0,0,.12);
    }

.dash-urgente-izq {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-urgente-der {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-urgente-modelo {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e3a5f;
}

.dash-urgente-cliente {
    font-size: 0.78rem;
    color: #555;
}

.dash-urgente-zona {
    font-size: 0.75rem;
    color: #888;
}

.dash-urgente-fecha {
    font-size: 0.8rem;
    font-weight: 600;
    color: #dc3545;
}

/* Acceso rápido */
.dash-acceso-rapido {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
    cursor: pointer;
    transition: background .15s;
}

    .dash-acceso-rapido:hover {
        background: #e9f0fb;
    }

/* ═══════════════════════════════════════════════════════════════════════
   PWA BASE — clases compartidas por todas las páginas de Web.Operarios
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Layout principal ────────────────────────────────────────────────── */
.pwa-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: #f1f5f9;
    font-family: system-ui, -apple-system, sans-serif;
    padding-bottom: 80px; /* espacio para la action-bar fija */
}

/* ── Toolbar superior ────────────────────────────────────────────────── */
.pwa-toolbar {
    display: flex;
    align-items: center;
    background: #1e3a5f;
    color: #fff;
    padding: 12px 16px;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.pwa-toolbar-titulo {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.pwa-toolbar-acciones {
    display: flex;
    gap: 8px;
}

.pwa-btn-icono {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    border-radius: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background 0.15s;
}

    .pwa-btn-icono:hover {
        background: rgba(255,255,255,0.22);
    }

.pwa-btn-icono-claro {
    background: rgba(0,0,0,0.07);
    border: none;
    color: #333;
    border-radius: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background 0.15s;
}

    .pwa-btn-icono-claro:hover {
        background: rgba(0,0,0,0.14);
    }

/* ── Zona de filtros ─────────────────────────────────────────────────── */
.pwa-filtros {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buscador */
.pwa-busqueda {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-busqueda-icono {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.pwa-busqueda-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px 8px 32px;
    border: 1px solid #cbd5e1;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}

    .pwa-busqueda-input:focus {
        border-color: #3b82f6;
        background: #fff;
    }

/* Toggle Pendientes / Todos */
.pwa-filtro-toggle {
    display: flex;
    gap: 6px;
}

.pwa-toggle-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 0.6rem;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .pwa-toggle-btn.activo {
        background: #1e3a5f;
        color: #fff;
        border-color: #1e3a5f;
    }

/* ── Estados de contenido ────────────────────────────────────────────── */
.pwa-cargando {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

.pwa-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.95rem;
}

/* ── Cabecera de libro (cuando todos los artículos son del mismo libro) ─ */
.pwa-cabecera-libro {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px 8px;
}

.pwa-cabecera-cliente {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
}

/* ── Lista de tarjetas ───────────────────────────────────────────────── */
.pwa-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 10px 80px;
}

/* ── Tarjeta individual ──────────────────────────────────────────────── */
.pwa-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    overflow: hidden;
}

    .pwa-card:active {
        transform: scale(0.985);
        box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    }

.pwa-card--pendiente {
    border-left-color: #f59e0b;
}

.pwa-card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 14px;
    gap: 10px;
}

.pwa-card-izq {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pwa-card-der {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.pwa-card-titulo {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-card-subtitulo {
    font-size: 0.78rem;
    color: #64748b;
}

.pwa-card-zona {
    font-size: 0.78rem;
    color: #94a3b8;
}

.pwa-card-serie {
    font-size: 0.75rem;
    color: #64748b;
    font-family: monospace;
}

.pwa-card-visitas {
    font-size: 0.78rem;
    color: #475569;
}

/* ── Badge genérico ──────────────────────────────────────────────────── */
.pwa-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.pwa-badge--pendiente {
    background-color: #f59e0b;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
}

/* ── FAB (botón flotante) ────────────────────────────────────────────── */
.pwa-fab {
    position: fixed;
    bottom: 80px; /* encima de la action-bar si existe */
    right: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1e3a5f;
    color: #fff;
    border: none;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 90;
    transition: background 0.15s, transform 0.1s;
}

    .pwa-fab:hover {
        background: #2a4f80;
    }

    .pwa-fab:active {
        transform: scale(0.92);
    }
/* ── Cabecera de artículo en Actuaciones ─────────────────────────────── */
.pwa-cabecera-articulo {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 16px 8px;
}

.pwa-cabecera-modelo {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.pwa-cabecera-fila {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.pwa-cabecera-detalle {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

/* ── Progreso de tareas ──────────────────────────────────────────────── */
.pwa-tareas-progreso {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.pwa-tareas-num {
    font-weight: 700;
    font-size: 0.95rem;
}

/* ── Badge estados ───────────────────────────────────────────────────── */
.pwa-badge--ok {
    background-color: #16a34a;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.pwa-card--finalizado {
    opacity: 0.75;
    border-left: 4px solid #16a34a;
}

/* ── Barra de acciones inferior ──────────────────────────────────────── */
.pwa-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom);
    z-index: 100;
}

.pwa-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: #475569;
    font-size: 0.65rem;
    gap: 2px;
    padding: 4px 6px;
    cursor: pointer;
    transition: color 0.15s;
}

    .pwa-action-btn i {
        font-size: 1.15rem;
    }

    .pwa-action-btn:active {
        color: #2563eb;
    }

/* Espacio para que la lista no quede detrás de la action-bar */
.pwa-lista {
    padding-bottom: 72px;
}

/* ═══════════════════════════════════════════════════════════════════════
   ORDEN DETALLE — pantalla de tareas
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Barra de progreso ───────────────────────────────────────────────── */
.orden-progreso-bar-wrap {
    margin-top: 6px;
}

.orden-progreso-texto {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 3px;
}

.orden-progreso-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.orden-progreso-fill {
    height: 100%;
    background: #16a34a;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ── Tarjeta de tarea ────────────────────────────────────────────────── */
.tarea-card {
    background: #fff;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #f59e0b;
    margin: 0 10px 6px;
    transition: border-left-color 0.2s, opacity 0.2s;
}

.tarea-card--hecha {
    border-left-color: #16a34a;
    opacity: 0.8;
}

.tarea-card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tarea-descripcion {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.35;
}

.tarea-card--hecha .tarea-descripcion {
    text-decoration: line-through;
    color: #94a3b8;
}

/* ── Input de valor ──────────────────────────────────────────────────── */
.tarea-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}

    .tarea-input:focus {
        border-color: #3b82f6;
        background: #fff;
    }

.tarea-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #16a34a;
    cursor: pointer;
}

/* ── Botones Hecho / Pendiente ───────────────────────────────────────── */
.tarea-acciones {
    display: flex;
    gap: 6px;
}

.tarea-btn {
    flex: 1;
    padding: 5px 8px;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
}

.tarea-btn--hecho.activo {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.tarea-btn--pendiente.activo {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ── Footer Subir / Finalizar ────────────────────────────────────────── */
.orden-footer {
    position: fixed;
    bottom: 60px; /* encima de la action-bar */
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0,0,0,.1);
    z-index: 40;
}

.orden-footer-botones {
    display: flex;
    gap: 8px;
}

.orden-btn-subir {
    flex: 1;
    padding: 10px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .orden-btn-subir:hover:not(:disabled) {
        background: #2a4f80;
    }

    .orden-btn-subir:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.orden-btn-finalizar {
    flex: 1;
    padding: 10px;
    background: #58ACFA;
    color: #fff;
    border: none;
    border-radius: 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .orden-btn-finalizar:hover:not(:disabled) {
        background: #3a8fd8;
    }

    .orden-btn-finalizar:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ── Fila de tarea (descripción + valor en la misma línea) ───────────── */
.tarea-fila {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 4px;
}

.tarea-descripcion {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}

/* Colores según estado — equiv. TextColor="{Binding Color}" en Xamarin */
.tarea-descripcion--pendiente {
    color: #c0392b; /* rojo, como en la captura */
}

.tarea-descripcion--hecha {
    color: #16a34a; /* verde */
    text-decoration: line-through;
    opacity: 0.75;
}

.tarea-valor-wrap {
    flex-shrink: 0;
    width: 100px;
}

/* Input compacto para el valor numérico/texto */
.tarea-input-valor {
    width: 100%;
    padding: 4px 8px;
    border: none;
    border-bottom: 1px solid #94a3b8;
    background: transparent;
    font-size: 0.9rem;
    color: #1e293b;
    text-align: right;
    outline: none;
    transition: border-color 0.2s;
}

    .tarea-input-valor:focus {
        border-bottom-color: #3b82f6;
    }

/* Separador entre fila y botones */
.tarea-acciones {
    display: flex;
    gap: 6px;
    padding: 4px 12px 8px;
    border-top: 1px solid #f1f5f9;
}

.orden-mensaje-guardado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 10px 6px 12px;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.orden-mensaje-cerrar {
    background: none;
    border: none;
    color: #166534;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
    line-height: 1;
    opacity: 0.6;
    flex-shrink: 0;
}

    .orden-mensaje-cerrar:hover {
        opacity: 1;
    }

.pwa-ultima-actualizacion {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    align-self: center;
}

/* ── Modal confirmación PWA ─────────────────────────────────────── */
.pwa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pwa-modal {
    background: #fff;
    border-radius: 12px;
    width: min(90vw, 360px);
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    overflow: hidden;
}

.pwa-modal-header {
    padding: .9rem 1.1rem .6rem;
    font-size: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.pwa-modal-body {
    padding: 1rem 1.1rem;
    font-size: .95rem;
    color: #333;
    line-height: 1.5;
}

.pwa-modal-footer {
    padding: .75rem 1.1rem;
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    border-top: 1px solid #e9ecef;
}

/* ── Tarjetas averías ────────────────────────────────────────────── */
.averia-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border-radius: 10px;
    margin: 6px 12px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-left: 4px solid #dc3545;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

    .averia-card:hover {
        box-shadow: 0 3px 10px rgba(0,0,0,.12);
    }

.averia-card-izq {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 70px;
}

.averia-card-der {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.averia-ot {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e3a5f;
}

.averia-fecha {
    font-size: 0.75rem;
    color: #6c757d;
}

.averia-actuacion {
    font-size: 0.88rem;
    color: #333;
    line-height: 1.3;
}

.averia-usuario {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ── Campo formulario modal ──────────────────────────────────────── */
.averia-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .averia-campo label {
        font-size: 0.8rem;
        font-weight: 500;
        color: #555;
    }

    .averia-campo textarea.tarea-input-valor {
        resize: vertical;
        min-height: 80px;
    }

/* ── Filtros pantalla Libros (exclusivo LibrosMantenimiento.razor) ── */
.libros-filtros {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.libros-filtros-fila {
    display: flex;
    gap: 12px;
}

.libros-filtro-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

    .libros-filtro-campo label {
        font-size: 0.72rem;
        text-transform: uppercase;
        color: #6c757d;
        font-weight: 600;
        letter-spacing: 0.05em;
    }

.libros-select {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #f8f9fa;
    width: 100%;
    appearance: none;
    cursor: pointer;
}

/* ── Tarjetas libros ─────────────────────────────────────────────── */
.libro-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border-radius: 10px;
    margin: 6px 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-left: 4px solid #dee2e6;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.libro-card--pendiente {
    border-left-color: #dc3545;
}

.libro-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
}

.libro-card-izq {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.libro-card-cliente {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e3a5f;
    line-height: 1.2;
}

.libro-card-poblacion {
    font-size: 0.78rem;
    color: #6c757d;
}

.libro-card-descripcion {
    font-size: 0.78rem;
    color: #888;
    font-style: italic;
}

.libro-card-der {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 80px;
}

.libro-badge-pendiente {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc3545;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

.libro-badge-ok {
    font-size: 0.75rem;
    font-weight: 600;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

.libro-card-total {
    font-size: 0.72rem;
    color: #6c757d;
}

/* ── Modal escáner QR ────────────────────────────────────────────── */
.qr-modal {
    background: #111;
    border-radius: 16px;
    width: min(95vw, 400px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qr-modal-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #1e3a5f;
    color: #fff;
    font-size: 1rem;
    gap: 6px;
}

.qr-modal-cerrar {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    opacity: .8;
}

    .qr-modal-cerrar:hover {
        opacity: 1;
    }

.qr-visor-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    overflow: hidden;
}

.qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Guía visual de encuadre */
.qr-visor-guia {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.qr-visor-esquina {
    position: absolute;
    width: 44px;
    height: 44px;
    border-color: #4e9af1;
    border-style: solid;
    border-width: 0;
}

.qr-tl {
    top: 20%;
    left: 20%;
    border-top-width: 3px;
    border-left-width: 3px;
    border-radius: 4px 0 0 0;
}

.qr-tr {
    top: 20%;
    right: 20%;
    border-top-width: 3px;
    border-right-width: 3px;
    border-radius: 0 4px 0 0;
}

.qr-bl {
    bottom: 20%;
    left: 20%;
    border-bottom-width: 3px;
    border-left-width: 3px;
    border-radius: 0 0 0 4px;
}

.qr-br {
    bottom: 20%;
    right: 20%;
    border-bottom-width: 3px;
    border-right-width: 3px;
    border-radius: 0 0 4px 0;
}

.qr-instruccion {
    color: #aaa;
    font-size: 0.82rem;
    text-align: center;
    padding: 10px;
}

.qr-error {
    color: #ff8080;
    font-size: 0.82rem;
    text-align: center;
    padding: 10px 14px;
    background: rgba(220,53,69,.12);
}

/* ══ Tarjeta compacta (modo sin OT, estilo app nativa) ══════════════ */
.pwa-card-compacto {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 14px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s;
    gap: 8px;
}

    .pwa-card-compacto:active {
        background: #f0f4ff;
    }

.pwa-card-compacto-izq {
    flex: 1;
    min-width: 0;
}

.pwa-card-compacto-der {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pwa-card-compacto .pwa-card-titulo {
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-card-compacto .pwa-card-subtitulo,
.pwa-card-compacto .pwa-card-zona {
    font-size: 0.78rem;
    color: #6c757d;
}

.pwa-card-compacto .pwa-card-serie {
    font-size: 0.82rem;
    font-weight: 500;
    color: #495057;
}

.pwa-card-visita-label {
    font-size: 0.72rem;
    color: #adb5bd;
    line-height: 1;
}

.pwa-card-visita-num {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0d6efd;
}