* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f4f6f8;
    color: #1f2933;
    font-family: 'Myriad Pro', 'Myriad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, 'Noto Sans', 'Helvetica Neue', sans-serif;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #b8580f;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* =============================
   Website público (website.html)
   Estilos scopeados para no afectar la app
   ============================= */

body:has(.header-container) {
    background: #0b1220;
    color: #e5e7eb;
}

header .header-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
}

header .logo-container {
    display: flex;
    align-items: center;
}

header .header-logo {
    height: 44px;
    width: auto;
    display: block;
}

header nav ul#primary-menu {
    list-style: none;
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

header nav ul#primary-menu a {
    color: #f9fafb;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

header nav ul#primary-menu a:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

header nav ul#primary-menu a.nav-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
}

/* Toggle con barras (website.html) */
header .header-container .nav-toggle {
    display: none;
    width: 44px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 8px;
}

header .header-container .nav-toggle .bar {
    display: block;
    height: 2px;
    background: #ffffff;
    margin: 5px 0;
    border-radius: 999px;
}

#header-spacer {
    height: 10px;
}

.hero-parallax {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.5rem 1.25rem 3.5rem;
    background: linear-gradient(180deg, rgba(2,6,23,0.65) 0%, rgba(2,6,23,0.55) 35%, rgba(2,6,23,0.85) 100%);
}

.hero-content {
    max-width: 1050px;
    width: 100%;
    text-align: center;
}

.hero-content h1 {
    font-size: clamp(1.7rem, 3vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 0.6rem;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.92;
    margin-bottom: 1.5rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.stat-item {
    border-radius: 1rem;
    padding: 1rem 1rem;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.stat-item.stat-clickable {
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.stat-item.stat-clickable:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
}

.stat-item .counter {
    font-size: 2rem;
    font-weight: 900;
    color: #ffedd5;
}

.stat-item p {
    margin-top: 0.25rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    opacity: 0.88;
}

body:has(.header-container) main {
    padding: 0;
}

.content-section {
    padding: 4rem 1.25rem;
    background: radial-gradient(circle at top, rgba(15,23,42,0.8) 0%, rgba(2,6,23,0.98) 65%);
}

.content-section.dark-section {
    background: radial-gradient(circle at top, rgba(184,88,15,0.22) 0%, rgba(2,6,23,0.98) 60%);
}

.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
}

.content-section h2 {
    font-size: 1.9rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.content-section p {
    font-size: 1.03rem;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.92);
}

.mission-vision {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.mission-box,
.vision-box {
    border-radius: 1rem;
    padding: 1.15rem 1.15rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.mission-box h3,
.vision-box h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    color: #fff;
}

.commitment-grid {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
}

.commitment-card {
    border-radius: 1rem;
    padding: 1.1rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.commitment-icon {
    font-size: 1.7rem;
    margin-bottom: 0.35rem;
}

.commitment-card h4 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.parallax-divider {
    min-height: 42vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-overlay {
    width: 100%;
    padding: 2.75rem 1.25rem;
    background: linear-gradient(180deg, rgba(2,6,23,0.60), rgba(2,6,23,0.82));
    text-align: center;
}

.parallax-text {
    font-size: clamp(1.3rem, 2.6vw, 2.2rem);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.services-grid {
    margin-top: 1.15rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.service-card {
    border-radius: 1rem;
    padding: 1.1rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.service-icon {
    font-size: 1.55rem;
    margin-bottom: 0.35rem;
}

.service-card h3 {
    color: #fff;
    margin-bottom: 0.25rem;
}

.service-cta {
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 800;
    color: #ffedd5;
}

.projects-gallery {
    margin-top: 1.15rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.project-item img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
    transition: transform 0.35s ease;
}

.project-item:hover img {
    transform: scale(1.06);
}

.project-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0.85rem 0.95rem;
    background: linear-gradient(180deg, rgba(2,6,23,0.0) 0%, rgba(2,6,23,0.85) 45%, rgba(2,6,23,0.92) 100%);
}

.project-overlay h3 {
    color: #fff;
    margin-bottom: 0.2rem;
}

.contact-grid {
    margin-top: 1.15rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.contact-card {
    border-radius: 1rem;
    padding: 1.1rem 1.1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-align: center;
}

.contact-icon {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
}

footer {
    padding: 1.25rem 1.25rem;
    background: #020617;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    text-align: center;
    color: rgba(226, 232, 240, 0.88);
}

footer a {
    color: #ffedd5;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

#back-to-top {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(184, 88, 15, 0.85);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    display: none;
    box-shadow: 0 12px 28px rgba(2,6,23,0.45);
}

#back-to-top:hover {
    background: rgba(234, 88, 12, 0.95);
}

@media (max-width: 900px) {
    header .header-container .nav-toggle {
        display: inline-block;
    }

    header nav ul#primary-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0.5rem;
        gap: 0.45rem;
        justify-content: flex-start;
    }

    header nav ul#primary-menu a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

.logo img {
    height: 48px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.user-info-email {
    opacity: 0.9;
}

#btn-logout {
    border: none;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background-color: #f9fafb;
    color: #b8580f;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

#btn-logout:hover {
    background-color: #fee2e2;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.nav-main ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Navbar del sistema: alinear botones a la derecha y estilo tipo "pill" */
.nav-main {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-main ul {
    justify-content: flex-end;
}

.nav-main a {
    color: #e5e7eb;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav-item-has-dropdown {
    position: relative;
}

.nav-item-has-dropdown > a::after {
    content: '\25BE';
    margin-left: 0.25rem;
    font-size: 0.7em;
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    color: #111827;
    min-width: 180px;
    border-radius: 0.5rem;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
    padding: 0.35rem 0;
    display: none !important;
    z-index: 50;
}

.nav-dropdown li {
    list-style: none;
}

.nav-dropdown a {
    display: block;
    padding: 0.25rem 0.9rem;
    color: #111827;
    border-radius: 0;
    font-size: 0.9rem;
}

.nav-admin-only {
    display: none;
}

.nav-dropdown a:hover {
    background-color: #f3f4f6;
}

.nav-item-has-dropdown.is-open > .nav-dropdown {
    display: block !important;
}

 .nav-item-has-subdropdown {
     position: relative;
 }

 .nav-item-has-subdropdown > a::after {
     content: '\25B8';
     float: right;
     font-size: 0.75em;
     margin-left: 0.5rem;
     color: #6b7280;
 }

 .nav-subdropdown {
     position: absolute;
     top: 0;
     left: 100%;
     background: #ffffff;
     color: #111827;
     min-width: 180px;
     border-radius: 0.5rem;
     box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
     padding: 0.35rem 0;
     display: none;
     z-index: 60;
 }

 .nav-item-has-subdropdown.is-open > .nav-subdropdown {
     display: block;
 }

 .nav-subdropdown a {
     display: block;
     padding: 0.25rem 0.9rem;
     color: #111827;
     font-size: 0.9rem;
 }

 .nav-subdropdown a:hover {
     background-color: #f3f4f6;
 }

 @media (min-width: 769px) {
     .nav-item-has-subdropdown:hover > .nav-subdropdown {
         display: block;
     }
 }

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logo img {
        height: 40px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-main {
        width: 100%;
        display: none;
    }

    .nav-main ul {
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        margin-top: 0.25rem;
    }

    .nav-main a {
        font-size: 0.9rem;
        padding: 0.35rem 0.75rem;
    }

    .nav-item-has-dropdown {
        width: 100%;
    }

    .nav-dropdown {
        position: static;
        box-shadow: none;
        background: transparent;
        padding-left: 0.75rem;
        display: none !important;
    }

    .nav-dropdown a {
        color: #e5e7eb;
        font-size: 0.85rem;
        padding-left: 1.5rem;
    }

    .nav-item-has-dropdown.is-open > .nav-dropdown {
        display: block !important;
    }

    .nav-main.is-open {
        display: block;
    }

    .nav-item-has-subdropdown {
        width: 100%;
    }

    .nav-subdropdown {
        position: static;
        box-shadow: none;
        background: transparent;
        padding-left: 0.75rem;
        display: none;
    }

    .nav-item-has-subdropdown.is-open > .nav-subdropdown {
        display: block;
    }

    .nav-subdropdown a {
        color: #e5e7eb;
        font-size: 0.85rem;
        padding-left: 2.25rem;
    }
}

.nav-main a:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.nav-main a.active {
    background-color: #10b981;
    color: #b8580f;
}

main {
    padding: 1.5rem;
}

.dashboard-page {
    max-width: 1200px;
    margin: 1.75rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.dash-card {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top left, #ffffff 0%, #f9fafb 45%, #eef2ff 100%);
    border-radius: 1rem;
    padding: 1.15rem 1.35rem 1.1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dash-card::before {
    content: '';
    position: absolute;
    inset: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #22c55e, #facc15);
    opacity: 0.9;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
    border-color: rgba(59, 130, 246, 0.7);
    background: radial-gradient(circle at top left, #ffffff 0%, #eff6ff 40%, #e0f2fe 100%);
}

.dash-card-label {
    font-size: 0.84rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.dash-card-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
}

/* Tarjeta seleccionada (vista activa) */
.dash-card[data-active="1"] {
    border: 3px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 12px 22px rgba(15, 23, 42, 0.18);
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 55%);
    transform: translateY(-1px);
}

.dash-card[data-active="1"] .dash-card-value {
    color: #1d4ed8;
    font-weight: 800;
}

/* Dashboard stats inside cards */
.dash-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 360px;
}

.dash-stat-row:nth-child(odd) {
    background: rgba(15, 23, 42, 0.03);
    border-radius: 8px;
    padding: 0.2rem 0.35rem;
}

.dash-stat-row:nth-child(even) {
    background: rgba(59, 130, 246, 0.04);
    border-radius: 8px;
    padding: 0.2rem 0.35rem;
}

.dash-stat-row .row-left {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-stat-row.small {
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 600;
}

.dash-badges-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 0.82rem;
    font-weight: 700;
    background: #ffffff;
    color: #0f172a;
}

.badge.blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.badge.amber { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.badge.red { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.badge.gray { background: #f3f4f6; border-color: #e5e7eb; color: #374151; }
.badge.black { background: #0f172a; border-color: #0f172a; color: #ffffff; }

/* Actividad OC/OS: zebra striping for readability */
.doc-os-table tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.02);
}

.doc-os-table tbody tr:nth-child(even) {
    background: rgba(59, 130, 246, 0.03);
}

.dashboard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dash-link {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.dash-link:hover {
    background-color: #0ea5e9;
    color: #f9fafb;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.pruebas-page {
    max-width: 1100px;
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Inputs y selects coherentes */
.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    min-height: 36px;
    padding: 0.45rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #111827;
    font-size: 0.9rem;
}

.form-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Controles del listado de inspecciones: coherentes con .campo */
#tabla-inspecciones input[type="text"],
#tabla-inspecciones select {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
    width: 100%;
}

#tabla-inspecciones input[type="text"]:focus,
#tabla-inspecciones select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Controles del listado de actividades: coherentes con .campo */
.actividadlist-wrap table input[type="text"],
.actividadlist-wrap table select {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
}

.actividadlist-wrap table input[type="text"]:focus,
.actividadlist-wrap table select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Controles del listado de inspecciones */
#tabla-inspecciones input[type="text"],
#tabla-inspecciones select {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
    width: 100%;
}

#tabla-inspecciones input[type="text"]:focus,
#tabla-inspecciones select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Controles del listado de actividades */
.actividadlist-wrap table input[type="text"],
.actividadlist-wrap table select {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
}

.actividadlist-wrap table input[type="text"]:focus,
.actividadlist-wrap table select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

select.form-input {
    padding-right: 2rem;
}

/* Botones coherentes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #0f172a;
    cursor: pointer;
}

.btn:hover {
    background: #eef2ff;
}

.btn-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.btn-danger:hover {
    background: #fecaca;
}

/* Tablas de pruebas */
#tabla-pruebas-listado th,
#tabla-pruebas-listado td {
    padding: 0.5rem;
    text-align: left;
}

#tabla-pruebas-listado thead tr {
    background: #f3f4f6;
}

#tabla-pruebas-listado tbody tr:hover {
    background-color: #f3f4f6;
}

#tabla-pruebas-listado tbody tr.pl-active {
    background-color: #eff6ff;
    border-left: 4px solid #60a5fa;
}

/* Controles del listado de pruebas: coherentes con .campo input/select */
#tabla-pruebas-listado input[type="text"],
#tabla-pruebas-listado select {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
    width: 100%;
}

#tabla-pruebas-listado input[type="text"]:focus,
#tabla-pruebas-listado select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Chips (filtros de rango) */
.chip {
    transition: transform 0.05s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.chip:hover {
    transform: translateY(-1px);
}

.chip.chip-active {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Chips grandes (resumen de vigencia) */
.chip-large {
    position: relative;
    overflow: hidden;
    padding: 1.2rem 1.6rem !important;
    font-size: 1.3rem !important;
    font-weight: 700;
    background: radial-gradient(circle at top left, #ffffff 0%, #f9fafb 45%, #eef2ff 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
    border-radius: 1rem;
    min-width: 300px;
    min-height: 110px;
    text-align: center;
}

.chip-large strong {
    font-size: 1.6rem;
    font-weight: 800;
}

.chip.chip-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
}

.chip-large::before {
    content: '';
    position: absolute;
    inset: 0;
    height: 4px;
    background: var(--chip-bar, linear-gradient(90deg, #0ea5e9, #22c55e, #facc15));
    opacity: 0.9;
}

/* Modificadores de color para chips (barra superior) */
.chip-blue { --chip-bar: linear-gradient(90deg, #60a5fa, #0ea5e9); }
.chip-amber { --chip-bar: linear-gradient(90deg, #fbbf24, #f59e0b); }
.chip-red { --chip-bar: linear-gradient(90deg, #fb7185, #ef4444); }
.chip-green { --chip-bar: linear-gradient(90deg, #34d399, #22c55e); }
.chip-black { --chip-bar: linear-gradient(90deg, #111827, #000000); }

/* Tabla informativa (resumen por categoría) */
#tabla-informativa {
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

#tabla-informativa thead th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    font-size: 0.9rem;
}

#tabla-informativa th,
#tabla-informativa td {
    border-bottom: 1px solid #e5e7eb;
}

#tabla-informativa tbody tr:last-child th,
#tabla-informativa tbody tr:last-child td {
    border-bottom: none;
}

/* Colores por severidad (columnas) */
#tabla-informativa tbody td:nth-child(2) { /* > 60 */
    background: #f0fdf4; /* green-50 */
    color: #14532d;
}
#tabla-informativa tbody td:nth-child(3) { /* 31-60 */
    background: #eff6ff; /* blue-100 */
    color: #1d4ed8;
}
#tabla-informativa tbody td:nth-child(4) { /* 15-30 */
    background: #fef3c7; /* amber-100 */
    color: #92400e;
}
#tabla-informativa tbody td:nth-child(5) { /* 0-15 */
    background: #fee2e2; /* red-100 */
    color: #991b1b;
}

#tabla-informativa tbody td:nth-child(6) { /* 0 días (vencidas) */
    background: #a9a9aa; /* gray-100 (light) */
    color: #111827; /* near-black */
}

/* Utilidades */
.min-260 {
    min-width: 260px;
}

.actividad-page {
    max-width: 1200px;
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Estado (ABIERTO/CERRADO) en actividadlist */
.estado-pill {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.estado-pill.abierto {
    background: #dcfce7; /* green-100 */
    color: #14532d;
    border-color: #bbf7d0;
}
.estado-pill.cerrado {
    background: #e5e7eb; /* gray-200 */
    color: #111827;
    border-color: #d1d5db;
}
.estado-select.abierto {
    background: #dcfce7; /* green-100 */
    color: #14532d;
    border-color: #bbf7d0;
}
.estado-select.cerrado {
    background: #e5e7eb; /* gray-200 */
    color: #111827;
    border-color: #d1d5db;
}

/* En el listado de actividades queremos usar todo el ancho del navegador */
.actividad-page.actividadlist-wrap {
    max-width: 100%;
    margin: 0;
    padding: 0; /* quitamos el padding heredado de main en esta página */
}

.card-prueba {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.card-prueba h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

/* Badge para indicar múltiples pruebas por equipo en pruebaslist */
.pl-badge-multi {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.35rem;
    border-radius: 9999px;
    background: #eef2ff; /* indigo-100 */
    color: #3730a3; /* indigo-700 */
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid #c7d2fe; /* indigo-200 */
    vertical-align: middle;
}

.grid-datos-prueba {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

.grid-inventario-prueba {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem 1rem;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.campo label {
    font-size: 0.8rem;
    color: #4b5563;
}

.campo input,
.campo select,
.campo textarea {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
}

.campo textarea {
    resize: vertical;
}

.inspeccion-page {
    max-width: 1100px;
    margin: 1rem auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
    gap: 1.5rem;
}

.selector-equipo,
.detalle-equipo {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    /* max-width eliminado para permitir ancho completo donde se requiera */
    margin: 1rem auto;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

/* Contenedor de listado de inspecciones a ancho completo */
.inspectlist-wrap {
    background: #ffffff;
    width: 100vw;
    margin: 0;
    padding: 1rem 1.5rem 2rem;
}

/* Contenedor de listado de pruebas a ancho completo */
.pruebaslist-wrap {
    background: #ffffff;
    width: 100%;
    margin: 0;
    padding: 1rem 1.5rem 2rem;
}

/* Contenedor de listado de actividades a ancho completo */
.actividadlist-wrap {
    background: #ffffff;
    width: 100%;
    min-height: calc(100vh - 64px);
    margin: 0;
    padding: 1rem 0 2rem;
}

.actividadlist-wrap .detalle-equipo {
    margin: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

.selector-equipo h1 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.selector-equipo label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #4b5563;
}

.equipo-input-wrapper {
    position: relative;
}

#equipo-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
}

.equipo-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    max-height: min(60vh, 520px);
    overflow: auto;
    z-index: 9999;
}

.equipo-dropdown-item {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.2;
}

.equipo-dropdown-item:last-child {
    border-bottom: none;
}

.equipo-dropdown-item:active {
    background: #eff6ff;
}

.detalle-equipo h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

#detalle-equipo-contenido p {
    font-size: 0.95rem;
    color: #6b7280;
}

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
}

.detalle-item {
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.detalle-item-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}

.detalle-item-valor {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
}

.acciones-inspeccion {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

 .tipo-inspeccion-chips {
     display: flex;
     flex-wrap: wrap;
     gap: 0.45rem;
     align-items: center;
     margin-bottom: 0.65rem;
 }

 .tipo-inspeccion-chip {
     appearance: none;
     border: 1px solid #cbd5e1;
     background: #ffffff;
     color: #0f172a;
     border-radius: 999px;
     padding: 0.45rem 0.75rem;
     font-size: 0.9rem;
     font-weight: 700;
     cursor: pointer;
     line-height: 1.1;
 }

 .tipo-inspeccion-chip.is-selected {
     border-color: #1d4ed8;
     background: #dbeafe;
     color: #1d4ed8;
 }

#btn-guardar-inspeccion {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    background-color: #10b981;
    color: #062b42;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

#btn-guardar-inspeccion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btn-exportar-jpg {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background-color: #eff6ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

#btn-exportar-jpg:hover {
    background-color: #dbeafe;
}

#btn-exportar-jpg:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Vista móvil / tablet para inspeccion.html */
@media (max-width: 900px) {
    .inspeccion-page {
        max-width: 100%;
        margin: 0.75rem auto;
        padding: 0 0.75rem 1.25rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .selector-equipo,
    .detalle-equipo {
        margin: 0;
        border-radius: 0.75rem;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
        padding: 1rem 1.1rem;
    }

    .selector-equipo h1 {
        font-size: 1.1rem;
    }

    #equipo-input {
        font-size: 0.95rem;
    }

    .acciones-inspeccion {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    #btn-guardar-inspeccion {
        width: 100%;
        justify-content: center;
    }

    #btn-exportar-jpg {
        width: 100%;
        justify-content: center;
    }

    .link-inspecciones {
        text-align: center;
        display: block;
    }
}

.link-inspecciones {
    font-size: 0.85rem;
    color: #0b3b5c;
    text-decoration: underline;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}

.toast {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 0.75rem;
    padding: 10px 12px;
    min-width: 260px;
    max-width: 380px;
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.toast .toast-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.toast .toast-body {
    font-size: 0.9rem;
    line-height: 1.35;
}

.toast .toast-close {
    background: transparent;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    float: right;
    font-size: 0.95rem;
}

#btn-guardar-prueba {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: none;
    background-color: #0ea5e9;
    color: #f9fafb;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.parametros-inspeccion {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.parametros-inspeccion h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.parametros-inspeccion ul {
    list-style: disc;
    padding-left: 1.25rem;
    font-size: 0.95rem;
    color: #374151;
}

.parametros-tabla {
    margin-top: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

 .dano-chips {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
     gap: 0.35rem;
     align-items: center;
 }

 .dano-chip {
     appearance: none;
     border: 1px solid #cbd5e1;
     background: #ffffff;
     color: #0f172a;
     border-radius: 999px;
     padding: 0.35rem 0.6rem;
     font-size: 0.85rem;
     font-weight: 600;
     cursor: pointer;
     line-height: 1.1;
 }

 .dano-chip:disabled {
     opacity: 0.55;
     cursor: not-allowed;
 }

 .dano-chip.is-selected {
     border-color: #1d4ed8;
     background: #dbeafe;
     color: #1d4ed8;
 }

.parametros-header,
.parametros-fila {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.15fr) minmax(0, 1.35fr) minmax(0, 1.15fr);
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.75rem;
}

.parametros-header {
    background-color: #f3f4f6;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.parametros-fila:nth-child(odd) {
    background-color: #ffffff;
}

.parametros-fila:nth-child(even) {
    background-color: #f9fafb;
}

.parametros-fila .col-estado label {
    font-size: 0.8rem;
    margin-right: 0.35rem;
    white-space: nowrap;
}

 .estado-switch {
     position: relative;
     display: grid;
     grid-template-columns: auto auto;
     grid-template-rows: auto auto;
     align-items: center;
     column-gap: 0.45rem;
     row-gap: 0.05rem;
     padding: 0.1rem 0.15rem;
     user-select: none;
 }

 .estado-switch-track {
     display: none;
 }

 .estado-switch-input {
     appearance: none;
     -webkit-appearance: none;
     width: 24px;
     height: 44px;
     border-radius: 999px;
     background: #bbf7d0;
     border: 1px solid #cbd5e1;
     position: relative;
     cursor: pointer;
     outline: none;
     grid-column: 1;
     grid-row: 1 / 3;
 }

 .estado-switch-input::after {
     content: '';
     position: absolute;
     top: 2px;
     left: 2px;
     width: 18px;
     height: 18px;
     border-radius: 999px;
     background: #ffffff;
     box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
     transition: transform 160ms ease;
 }

 .estado-switch-input:checked {
     background: #fecaca;
     border-color: #fca5a5;
 }

 .estado-switch-input:checked::after {
     transform: translateY(20px);
 }

 .estado-switch-label {
     font-size: 0.8rem;
     font-weight: 700;
     color: #64748b;
     white-space: nowrap;
 }

 .estado-switch-label-bueno {
     color: #15803d;
     grid-column: 2;
     grid-row: 1;
 }

 .estado-switch-label-malo {
     grid-column: 2;
     grid-row: 2;
 }

 .estado-switch-input:checked ~ .estado-switch-label-bueno {
     color: #64748b;
 }

 .estado-switch-input:checked ~ .estado-switch-label-malo {
     color: #b91c1c;
 }

.parametros-fila .col-dano select {
    width: 100%;
    padding: 0.25rem 0.3rem;
    border-radius: 0.35rem;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
}

.parametros-fila .col-evidencia {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

 .parametros-fila .col-evidencia img {
     align-self: flex-start;
 }

.parametros-fila .col-evidencia .btn {
    display: inline-flex;
    white-space: nowrap;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}

/* Ajustes específicos para parámetros en vista móvil: evitar que el select
   de tipo de daño se salga visualmente del área de inspección */
@media (max-width: 900px) {
    .parametros-tabla {
        overflow: visible;
    }

    .parametros-header,
    .parametros-fila {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
        grid-template-rows: auto auto;
    }

    .parametros-header .col-dano {
        grid-column: 1 / -1;
        margin-top: 0.25rem;
    }

    .parametros-fila .col-dano {
        grid-column: 1 / -1;
        margin-top: 0.15rem;
    }

    .parametros-fila .col-evidencia {
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 0.15rem;
    }
}

/* Actividad (registro de servicio) */
.actividad-resumen {
    margin-bottom: 0.5rem;
}

.actividad-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.actividad-toolbar-left input[type="search"] {
    min-width: 220px;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
}

.actividad-toolbar-right {
    display: flex;
    gap: 0.5rem;
}

.actividad-toolbar-right button {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f9fafb;
    font-size: 0.85rem;
    cursor: pointer;
}

.actividad-toolbar-right button#act-btn-guardar {
    background-color: #10b981;
    color: #062b42;
    border-color: #10b981;
    font-weight: 600;
}

.actividad-form-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.actividad-form-card h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.actividad-form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}

.actividad-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem 1rem;
}

.actividad-equipos-panel {
    margin-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
}

.actividad-equipos-panel-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.actividad-equipos-list-header {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 2fr) auto;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
}

.actividad-equipos-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.actividad-equipos-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 2fr) auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 0.8rem;
}

.actividad-equipos-row-remove {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Encabezado fijo para la tabla de inventario en invre.html */
.tabla-invre-wrapper thead th {
    position: sticky;
    top: 0;
    background: #f3f4f6;
    z-index: 2;
}

/* Tarjetas de formatos en forxmat.html */
.forxmat-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
}

.forxmat-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.forxmat-card small {
    font-size: 0.8rem;
    color: #6b7280;
}

.forxmat-parametros {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
}

.forxmat-tag {
    font-size: 0.8rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background-color: #f3f4ff;
    border: 1px solid #e0e7ff;
    color: #3730a3;
}
