/* ==================================================================================================================
   Portal del Empleado · Limpiezas SALYM
   Misma estructura visual que la Gestión de Hierros Sainz, con los colores corporativos de SALYM
   (rojo #e30218 de limpiezassalym.com y tipografía Fira Sans).
   ================================================================================================================== */

:root {
    --sy-red-900: #990321;
    --sy-red-800: #b0031f;
    --sy-red-700: #c2041e;
    --sy-red-600: #e30218;
    --sy-red-100: #fbdfe2;
    --sy-red-50: #fdf0f1;
    --sy-text: #2b2526;
    --sy-ink: #313131;
    --sy-muted: #6c6466;
    --sy-line: #ece4e5;
    --sy-page: #f7f5f5;
    --sy-white: #ffffff;
    --sy-ok: #1d7a46;
    --sy-ok-50: #e7f4ec;
    --sy-ok-line: #c3e3cf;
    --sy-warn: #8a5a00;
    --sy-warn-50: #fff5e0;
    --sy-warn-line: #f1dba6;
    --sy-sombra: 0 12px 30px rgba(153, 3, 33, 0.08);
    --sy-foco: 0 0 0 3px rgba(227, 2, 24, 0.18);
}

* { box-sizing: border-box; }

/* hidden siempre oculta, aunque el elemento tenga display: flex / grid / block */
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: "Fira Sans", "Segoe UI", Arial, sans-serif;
    background: var(--sy-page);
    color: var(--sy-text);
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--sy-red-700); }

.icono { display: block; flex: none; }

/* --- Barra superior ------------------------------------------------------------------------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 32px;
    background: var(--sy-white);
    border-bottom: 1px solid var(--sy-line);
}

.topbar::after {               /* filete rojo SALYM bajo la barra */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, var(--sy-red-600), var(--sy-red-900));
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.topbar-brand img {
    display: block;
    height: 46px;
    width: auto;
}

.topbar-app {
    padding-left: 16px;
    border-left: 1px solid var(--sy-line);
    color: var(--sy-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sy-red-600);
    color: var(--sy-white);
    font-weight: 700;
    text-transform: uppercase;
}

.user-name { font-weight: 600; line-height: 1.2; }
.user-code { display: block; color: var(--sy-muted); font-size: 0.78rem; font-weight: 500; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--sy-muted);
    cursor: pointer;
    text-decoration: none;
}

.icon-btn:hover { background: var(--sy-page); color: var(--sy-red-600); }

/* --- Contenido ----------------------------------------------------------------------------------------------------- */
.content {
    max-width: 1140px;
    margin: 0 auto;
    padding: 56px 32px 72px;
}

.content.wide { max-width: 1320px; padding-top: 36px; }
.content.narrow { max-width: 760px; padding-top: 36px; }

.greeting { margin: 0 0 8px; font-size: 1.9rem; font-weight: 700; color: var(--sy-ink); }
.lead { margin: 0 0 36px; color: var(--sy-muted); font-size: 1.05rem; }

.breadcrumb { margin: 0 0 14px; font-size: 0.85rem; color: var(--sy-muted); }
.breadcrumb a { color: var(--sy-red-700); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 26px;
}

.page-title { margin: 0 0 6px; font-size: 1.7rem; font-weight: 700; color: var(--sy-ink); }
.page-lead { margin: 0; color: var(--sy-muted); }

.section-title {
    margin: 34px 0 14px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sy-ink);
}

/* --- Mensajes ------------------------------------------------------------------------------------------------------ */
.message {
    margin: 0 0 18px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
}

.message.success { background: var(--sy-ok-50); border: 1px solid var(--sy-ok-line); color: #11502d; }
.message.error { background: var(--sy-red-50); border: 1px solid var(--sy-red-100); color: var(--sy-red-900); }
.message.warning, .message.info { background: var(--sy-warn-50); border: 1px solid var(--sy-warn-line); color: var(--sy-warn); }

/* --- Botones ------------------------------------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:focus-visible { outline: none; box-shadow: var(--sy-foco); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    border: none;
    background: linear-gradient(135deg, var(--sy-red-600), var(--sy-red-700));
    color: var(--sy-white);
}

.btn-primary:hover:not(:disabled) { opacity: 0.93; }

.btn-secondary {
    border: 1px solid var(--sy-line);
    background: var(--sy-white);
    color: var(--sy-text);
}

.btn-secondary:hover:not(:disabled) { background: var(--sy-page); border-color: #dccfd1; }

.btn-ok { border: none; background: var(--sy-ok); color: var(--sy-white); }

.btn-small { padding: 8px 13px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* --- Módulos (tarjetas del inicio) --------------------------------------------------------------------------------- */
.modules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.module {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px 28px;
    background: var(--sy-white);
    border: 1px solid var(--sy-line);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.module:hover { border-color: var(--sy-red-600); box-shadow: var(--sy-sombra); }

.module-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: var(--sy-red-600);
    color: var(--sy-white);
}

.module-name { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; color: var(--sy-ink); }
.module-desc { flex: 1; margin: 0 0 18px; color: var(--sy-muted); font-size: 0.92rem; line-height: 1.5; }

.module-enter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--sy-red-600);
    font-weight: 600;
}

.module-enter .icono { transition: transform 0.2s ease; }
a.module:hover .module-enter .icono { transform: translateX(3px); }

.module-count {
    position: absolute;
    top: 22px;
    right: 22px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--sy-red-50);
    color: var(--sy-red-700);
    font-size: 0.78rem;
    font-weight: 700;
}

.module.soon { background: transparent; border-style: dashed; }
.module.soon .module-icon { background: #d9d1d2; }
.module.soon .module-name { color: var(--sy-muted); }
.module.soon .module-enter { color: var(--sy-muted); font-weight: 500; font-size: 0.88rem; }

.module.admin .module-icon { background: var(--sy-ink); }

/* --- Paneles y tablas ---------------------------------------------------------------------------------------------- */
.panel {
    margin: 0 0 24px;
    background: var(--sy-white);
    border: 1px solid var(--sy-line);
    border-radius: 14px;
    overflow: hidden;
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sy-line);
}

.panel-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--sy-ink); }
.panel-body { padding: 20px; }

.panel-step {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--sy-red-600);
    color: var(--sy-white);
    font-size: 0.85rem;
    font-weight: 700;
    vertical-align: 1px;
}

.table-wrap { overflow-x: auto; }

table.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
}

.tabla th, .tabla td { padding: 11px 16px; text-align: left; vertical-align: middle; }
.tabla thead th {
    background: #f7f1f2;
    color: var(--sy-red-900);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tabla tbody tr { border-top: 1px solid var(--sy-line); }
.tabla tbody tr:hover { background: #fcf8f8; }
.tabla .num { text-align: right; }
.tabla .min { width: 1%; white-space: nowrap; }
.tabla a.fila-link { color: var(--sy-ink); font-weight: 700; text-decoration: none; }
.tabla a.fila-link:hover { color: var(--sy-red-600); }

.muted { color: var(--sy-muted); }
.small { font-size: 0.82rem; }
.strong { font-weight: 700; }

.empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--sy-muted);
}

.empty .icono { margin: 0 auto 12px; color: #cfc4c6; }

/* --- KPIs ---------------------------------------------------------------------------------------------------------- */
.kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

.kpi { padding: 16px 20px; background: var(--sy-white); border: 1px solid var(--sy-line); border-radius: 14px; }
.kpi-label {
    margin: 0 0 6px;
    color: var(--sy-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.kpi-value { margin: 0; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.destacado { background: var(--sy-red-600); border-color: var(--sy-red-600); color: var(--sy-white); }
.kpi.destacado .kpi-label { color: rgba(255, 255, 255, 0.85); }
.kpi.ok .kpi-value { color: var(--sy-ok); }

/* --- Etiquetas de estado ------------------------------------------------------------------------------------------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f1eded;
    color: var(--sy-muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.chip-enviado { background: #fff1d9; color: #8a5a00; }
.chip-procesado, .chip-ok { background: var(--sy-ok-50); color: var(--sy-ok); }
.chip-cancelado { background: var(--sy-red-50); color: var(--sy-red-800); }
.chip-borrador { background: #eef0f3; color: #4a5361; }
.chip-rojo { background: var(--sy-red-50); color: var(--sy-red-700); }

/* --- Formularios --------------------------------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }

.field label, .label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--sy-red-900);
    text-transform: uppercase;
}

.input, .field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--sy-line);
    border-radius: 10px;
    background: var(--sy-white);
    padding: 11px 13px;
    font: inherit;
    font-size: 0.97rem;
    color: var(--sy-text);
    outline: none;
}

.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--sy-red-600);
    box-shadow: var(--sy-foco);
}

.field .help { margin: 6px 0 0; color: var(--sy-muted); font-size: 0.82rem; line-height: 1.45; }
.field .help ul { margin: 4px 0 0; padding-left: 18px; }
.errorlist { margin: 6px 0 0; padding: 0; list-style: none; color: var(--sy-red-800); font-size: 0.85rem; }

.input-icon { position: relative; }
.input-icon > .icono { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--sy-muted); }
.input-icon > .input { padding-left: 40px; }

/* --- Ventanas (dialog) --------------------------------------------------------------------------------------------- */
.dialogo {
    width: calc(100% - 32px);
    max-width: 380px;
    padding: 30px 28px 24px;
    border: 1px solid var(--sy-line);
    border-radius: 16px;
    background: var(--sy-white);
    color: var(--sy-text);
    box-shadow: 0 20px 50px rgba(153, 3, 33, 0.18);
}

.dialogo::backdrop { background: rgba(43, 37, 38, 0.45); }
.dialogo.centrado { text-align: center; }
.dialogo.ancho { max-width: 560px; padding: 24px; }

.dialogo-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: var(--sy-red-600);
    color: var(--sy-white);
}

.dialogo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dialogo-title { margin: 0 0 6px; font-size: 1.25rem; color: var(--sy-ink); }
.dialogo-text { margin: 0 0 22px; color: var(--sy-muted); font-size: 0.92rem; line-height: 1.5; }
.dialogo-actions { display: flex; gap: 10px; }
.dialogo-actions .btn { flex: 1; }
.salir-ahora { margin-top: 14px; text-align: center; }
.salir-ahora button { border: none; background: none; color: var(--sy-muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.salir-ahora button:hover { color: var(--sy-red-600); text-decoration: underline; }

/* --- Acceso (login, instalar): logo y título encima, caja con filete de color arriba ------------------------------ */
.acceso {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: radial-gradient(circle at 20% 0%, #fdeced 0, var(--sy-page) 45%);
}

.acceso-caja { width: 100%; max-width: 400px; }

.acceso-marca { margin-bottom: 26px; text-align: center; }
.acceso-marca img { display: block; height: 52px; width: auto; margin: 0 auto; }
.acceso-marca p { margin: 12px 0 0; color: var(--sy-red-800); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

.acceso-tarjeta {
    position: relative;
    padding: 32px 32px 22px;
    background: var(--sy-white);
    border: 1px solid var(--sy-line);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.acceso-tarjeta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--sy-red-900), var(--sy-red-600) 55%, #ff5a5f);
}

.acceso-sub { margin: 0 0 20px; text-align: center; color: var(--sy-muted); font-size: 0.92rem; }

.acceso .error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--sy-red-50);
    color: var(--sy-red-900);
    font-size: 0.9rem;
}

/* Etiquetas en texto normal, como en el resto de accesos de Redline (Nortunel) */
.acceso .field { margin-bottom: 18px; }
.acceso .field label { margin-bottom: 6px; color: var(--sy-text); font-size: 0.84rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.acceso .helper { margin: 16px 0 0; text-align: center; font-size: 0.86rem; }
.acceso .helper.solicitar { margin-top: 10px; color: var(--sy-text); }
.acceso .enviada { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 18px; text-align: center; line-height: 1.5; }
.acceso .enviada .icono { color: var(--sy-ok); }
.acceso .helper.olvido { margin-top: 8px; color: var(--sy-muted); font-size: 0.8rem; line-height: 1.45; }
.acceso .helper a { font-weight: 600; text-decoration: none; }
.acceso .helper a:hover { text-decoration: underline; }
.acceso .enlace-icono { display: inline-flex; align-items: center; gap: 6px; }
.acceso .copyright { margin: 16px 0 0; text-align: center; color: #a39a9c; font-size: 0.78rem; }
.acceso .copyright a { color: inherit; text-decoration: none; }
.acceso .copyright a:hover { color: var(--sy-red-600); text-decoration: underline; }

/* --- Adaptación a móvil -------------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .topbar { padding: 6px 14px; gap: 10px; }
    .topbar-brand img { height: 36px; }
    .acceso-tarjeta { padding: 26px 22px 22px; }
    .acceso-marca img { height: 54px; }
    .topbar-app, .user-name { display: none; }
    .content, .content.wide, .content.narrow { padding: 26px 14px 56px; }
    .greeting { font-size: 1.5rem; }
    .lead { margin-bottom: 24px; }
    .page-title { font-size: 1.4rem; }
    .modules { grid-template-columns: 1fr; gap: 14px; }
    .module { padding: 20px; }
    .kpis { gap: 10px; }
    .kpi { padding: 12px 14px; }
    .kpi-value { font-size: 1.3rem; }
    .kpi-label { font-size: 0.68rem; }
    .panel-body { padding: 16px; }
    .tabla th, .tabla td { padding: 10px 12px; }
    .ocultar-movil { display: none; }
}
