/* Control de Lavados · estilos propios del módulo.
   Lo compartido (tokens, barra, botones, campos, pestañas, chips, panel, tabla,
   estados, alertas, pie) viene de wwwroot/ui/css/*.css, copiado desde
   plataforma/ui con `ui-sync.sh --css-en wwwroot/ui`: no se edita acá. La barra
   la genera Components/Layout/NavMenu.razor con el contrato de clases del
   estándar. Ningún color a mano salvo los de etapa del lavado, que son
   semánticos del proceso. Breakpoints: 520 y 820. */

h1, h2 { margin: 0; }

/* ---------- Transición entre pantallas (ui.js la dispara en cada navegación) ---------- */
@keyframes page-enter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wrap.page-enter { animation: page-enter .26s cubic-bezier(.2, .7, .2, 1) both; }

/* ---------- Pantalla de login ---------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(900px 500px at 50% -10%, rgba(178, 119, 70, .18), transparent), var(--bg);
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px 24px;
    box-shadow: var(--sombra);
    animation: page-enter .3s ease both;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-logo { width: 40px; height: 40px; object-fit: contain; }
.login-brand h1 { font-size: 19px; font-weight: 800; }
.login-brand p { margin: 2px 0 0; font-size: var(--fs-s); }
.login-card label { margin-bottom: 12px; }
.login-card .btn-block { margin-top: 6px; }
.login-error {
    background: rgba(226, 87, 78, .12);
    border: 1px solid var(--danger);
    color: var(--danger-txt);
    border-radius: var(--radius-s);
    padding: 9px 12px;
    font-size: var(--fs-s);
    margin: 0 0 14px;
}
.login-alt { text-align: center; font-size: var(--fs-s); color: var(--muted); margin: 14px 0 0; }
.login-alt a { color: var(--info-txt); font-weight: 600; text-decoration: none; }
.login-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* Botón de Microsoft: sobre el .btn del estándar, con el negro de esa marca. */
.btn-ms { background: #2f2f2f; border-color: #2f2f2f; color: #fff; }
.btn-ms:hover { filter: brightness(1.15); border-color: #2f2f2f; }

/* ---------- Resultado de invitación ---------- */
.invite-result {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-s);
    font-size: var(--fs-s);
}
.invite-result p { margin: 0 0 8px; }
.invite-result input { font-size: var(--fs-s); }

/* ---------- Widget de soporte (flotante) ---------- */
.soporte {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
.soporte-fab {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--sobre-primary);
    border: none;
    cursor: pointer;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, background .15s ease;
}
.soporte-fab:hover { background: var(--primary-bright); transform: translateY(-2px); }
.soporte-panel {
    width: 320px;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--sombra);
    animation: page-enter .18s ease both;
}
.soporte-panel .panel-cab { margin-bottom: 0; }
.soporte-panel textarea.campo { min-height: 96px; }

/* ---------- Cabecera de página (h1 + bajada), como .head/.lead del estándar ---------- */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-m); }

/* ---------- Pila de tarjetas ---------- */
.pila { display: flex; flex-direction: column; gap: 20px; }
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.card h2 { font-size: 15px; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* ---------- Nómina (cifras) ---------- */
.nomina-cifras { display: flex; flex-wrap: wrap; gap: 14px; }
.nomina-cifras .cifra {
    flex: 1 1 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
}
.nomina-cifras .cifra .n { font-size: 28px; font-weight: 800; color: var(--primary-bright); line-height: 1; font-variant-numeric: tabular-nums; }
.nomina-cifras .cifra .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Formularios: los campos de las páginas son elementos sueltos con <label><span> ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
label { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-s); }
label.full { margin-top: 12px; }
label > span { color: var(--muted); font-weight: 600; }
select, input, textarea {
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    color: var(--text);
    border-radius: var(--radius-s);
    padding: 11px 12px;
    font-size: 16px; /* >=16px evita el auto-zoom de iOS al enfocar */
    font-family: inherit;
    width: 100%;
    min-height: 48px; /* mismo alto que .campo del estándar */
}
input[disabled] { opacity: .8; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
textarea { resize: vertical; width: 100%; }

/* ---------- Stepper de cantidad (− valor +) ---------- */
.stepper { display: flex; align-items: stretch; }
.stepper-btn {
    width: 46px;
    min-height: 48px;
    flex: 0 0 auto;
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s;
}
.stepper-btn:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.stepper-btn:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.stepper-btn:hover:not(:disabled) { background: var(--primary); color: var(--sobre-primary); border-color: var(--primary); }
.stepper-btn:active:not(:disabled) { transform: scale(.95); }
.stepper-btn:disabled { opacity: .4; cursor: not-allowed; }
.stepper-val {
    width: 100%;
    min-width: 0;
    text-align: center;
    border: 1px solid var(--line-2);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background: var(--panel-2);
    color: var(--text);
    font-weight: 600;
    min-height: 48px;
}
.stepper-val:focus { outline: none; box-shadow: none; border-color: var(--line-2); background: var(--panel); }

/* ---------- Combo buscador (dropdown propio) ---------- */
.combo { position: relative; }
.combo > input { width: 100%; }
.combo-list {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    box-shadow: var(--sombra);
}
.combo-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: var(--tap);
    padding: 10px 11px;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--fs-m);
}
.combo-list li:hover { background: var(--primary); color: var(--sobre-primary); }
.combo-list li small { color: var(--muted); font-size: 12px; }
.combo-list li:hover small { color: var(--sobre-primary); }

/* ---------- Tags de operarios seleccionados ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: var(--sobre-primary);
    border-radius: var(--radius-pill);
    padding: 4px 6px 4px 12px;
    font-size: var(--fs-s);
    font-weight: 700;
}
.tag button {
    border: none;
    background: rgba(0, 0, 0, .18);
    color: var(--sobre-primary);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 1;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tag button:hover { background: rgba(0, 0, 0, .32); }

/* ---------- Botones: sobre .btn del estándar ---------- */
.btn-block { width: 100%; }
/* Botón de acción según el estadio actual del lavado (colores semánticos del proceso) */
.btn-estado-Atracado { background: #e07b39; border-color: #e07b39; color: #1a1208; }         /* Atracado → naranja */
.btn-estado-Lavando { background: var(--success); border-color: var(--success); color: #fff; } /* Lavando → verde */
.btn-estado-Lavadoterminado { background: #8a6df0; border-color: #8a6df0; color: #fff; }      /* Lavado terminado → violeta */

.error { color: var(--danger-txt); font-weight: 600; margin: 6px 0; }
.muted { color: var(--muted); }

/* ---------- Ícono de info con tooltip ---------- */
.info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--info);
    color: #06222b;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    margin-left: 8px;
    position: relative;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: 0;
}
/* Marca de solape (⚠) junto al operario: usa el mismo tooltip que .info. */
.solape {
    color: var(--warn-txt);
    font-size: 13px;
    cursor: help;
    margin-left: 6px;
    position: relative;
    vertical-align: middle;
}
.info::after,
.solape::after {
    content: attr(data-tip);
    position: absolute;
    top: 145%;
    left: 0;
    z-index: 60;
    width: 340px;
    max-width: 78vw;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    padding: 11px 13px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 400;
    white-space: pre-line;
    line-height: 1.5;
    text-align: left;
    box-shadow: var(--sombra);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s;
    pointer-events: none;
}
.info:hover::after,
.info:focus::after,
.solape:hover::after,
.solape:focus::after { opacity: 1; visibility: visible; }

/* ---------- En curso ---------- */
.curso-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.curso {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    padding: 14px;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.curso:hover {
    border-color: var(--info);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.curso-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.curso-head strong { font-size: 16px; }
.badge { background: var(--info); color: #06222b; font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.curso-times { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-s); color: var(--muted); margin-bottom: 8px; }
.curso-times b { color: var(--text); }
.curso-ops { font-size: var(--fs-s); margin-bottom: 10px; }
.curso-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.editor .mini { display: flex; gap: 10px; }

/* ---------- Etapa del lavado (badge de la tarjeta en curso) ---------- */
.etapa { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: 6px; text-transform: uppercase; margin-left: auto; }
.etapa-Pendiente { background: var(--line-2); color: var(--text); }
.etapa-Atracado { background: var(--warn); color: #1a1208; }
.etapa-Lavando { background: var(--info); color: #06222b; }
.etapa-Lavadoterminado { background: #8a6df0; color: #fff; }
.etapa-Finalizado { background: var(--success); color: #fff; }

/* ---------- Grilla (sobre .tabla-marco.con-scroll del estándar: conserva el scroll en celular) ---------- */
.grilla { border-collapse: collapse; width: 100%; white-space: nowrap; font-size: 12.5px; }
.grilla th, .grilla td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.grilla th { background: var(--panel-2); color: var(--muted); position: sticky; top: 0; font-weight: 700; font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
.grilla tr:hover td { background: rgba(178, 119, 70, .06); }
.grilla .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Reportería: todo centrado (encabezados y valores, incluidos los numéricos). */
.grilla-center th,
.grilla-center td,
.grilla-center .num { text-align: center; }
.grilla .ops { white-space: normal; min-width: 160px; max-width: 240px; }
.grilla .acciones { display: flex; gap: 6px; }
.grilla .btn { min-height: 36px; padding: 0 10px; font-size: var(--fs-s); }

/* ---------- Responsive (sólo 820 y 520) ---------- */
@media (max-width: 520px) {
    /* padding-bottom extra: deja espacio para que el botón flotante de ayuda (?)
       no tape el botón de acción al final del formulario. */
    .wrap { padding-bottom: 96px; }
    .card { padding: 14px; }
    .form-grid { grid-template-columns: 1fr; gap: 10px; }
    .curso-grid { grid-template-columns: 1fr; }
    .curso-actions .btn { flex: 1; }
    .editor .mini { flex-direction: column; }
    .grilla { font-size: 12px; }
    .soporte { right: 14px; }
}

/* ---------- Blazor defaults ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger-txt); }

#blazor-error-ui {
    color-scheme: light dark;
    background: var(--warn);
    color: #1a1208;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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: var(--danger);
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ocurrió un error."; }
