* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0044cc;
    --secondary: #4da6ff;
    --success: #00cc44;
    --warning: #ff9900;
    --danger: #cc0044;
    --dark: #1a1a1a;
    --light: #f5f5f5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--dark);
}

/* Login Page - Estilo coherente con landing Fongas */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(77, 166, 255, 0.1) 0%, transparent 70%);
    animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.login-container {
    background: white;
    padding: 50px 45px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 68, 204, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 440px;
    width: 90%;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin: 8px 0;
}

.login-form .form-group {
    margin-bottom: 22px;
}

.login-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 68, 204, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 68, 204, 0.3);
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 166, 255, 0.4);
}

.offline-notice {
    text-align: center;
    margin-top: 24px;
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
}

/* App Container */
.app-container {
    min-height: 100vh;
    background: var(--light);
}

.app-header {
    background: var(--primary);
    color: white;
    padding: 18px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0, 68, 204, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard h2 {
    margin-bottom: 35px;
    color: var(--dark);
    font-size: 2rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 45px;
}

.module-card {
    background: white;
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 68, 204, 0.15);
    border-color: var(--secondary);
}

.module-icon {
    font-size: 3.5rem;
    margin-bottom: 18px;
}

.module-card h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.module-card p {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.badge-owner {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--warning);
    color: white;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.quick-actions {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.quick-actions h3 {
    margin-bottom: 18px;
    color: var(--dark);
    font-size: 1.2rem;
}

.quick-btn {
    display: inline-block;
    margin: 6px;
    padding: 12px 24px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 68, 204, 0.3);
}

/* Módulos */
.module-view {
    max-width: 900px;
    margin: 0 auto;
    padding: 25px 20px;
}

.module-header {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.module-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.back-btn {
    background: var(--light);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #e0e0e0;
}

.form-card {
    background: white;
    padding: 35px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-card h3 {
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 68, 204, 0.1);
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-photo {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.status-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.status-btn:hover {
    border-color: var(--secondary);
}

.status-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 68, 204, 0.3);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 204, 68, 0.3);
}

.submit-btn:hover {
    background: #00aa33;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 204, 68, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }

    .module-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .login-container {
        padding: 35px 30px;
    }

    .dashboard {
        padding: 25px 15px;
    }
}

/* Estilos para el módulo de Gas */
.section-title {
    background: #f0f4f8;
    padding: 10px;
    border-left: 4px solid var(--primary-color);
    margin: 20px 0 15px 0;
    font-size: 1.1rem;
    color: var(--dark);
}

.checklist-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.checklist-item label {
    font-weight: 500;
    flex: 1;
}

.radio-group {
    display: flex;
    gap: 10px;
}

.radio-group label {
    font-weight: normal;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.signature-container {
    border: 2px dashed #ccc;
    background: #fff;
    border-radius: 8px;
    position: relative;
    height: 200px;
    width: 100%;
    touch-action: none;
    /* Importante para dibujar en móviles */
}

canvas#signaturePad {
    width: 100%;
    height: 100%;
    display: block;
}

.clear-sig-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.results-summary {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #c8e6c9;
}

.results-summary.defect {
    background: #ffebee;
    border-color: #ffcdd2;
}