:root {
    --primary-color: #2563eb;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --radius-lg: 20px;
    --radius-md: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 40px; /* Espacio para scroll */
}

/* Evitar zoom y selección en móviles */
* {
    touch-action: manipulation; 
    -webkit-tap-highlight-color: transparent;
}

/* NAVBAR FLOTANTE CON GLASSMORPHISM */
.glass-nav {
    background: rgba(33, 37, 41, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding-top: 15px;
    padding-bottom: 15px;
}

.main-wrapper {
    padding-top: 90px; /* Compensar navbar fixed */
    max-width: 600px; /* Que no se estire en PC */
}

/* TRANSICIONES SUAVES */
.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* BOTONES GIGANTES DE CONTEO (Cards estilo App) */
.counter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-defect {
    position: relative;
    height: 140px;
    border: none;
    border-radius: var(--radius-lg);
    background: white; /* Color base si falla el dinámico */
    color: white;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Gradiente sutil sobre el color de fondo para darle volumen */
.btn-defect::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.05) 100%);
    z-index: 1;
}

.btn-defect:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-defect span {
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 1.1rem;
    text-align: center;
    padding: 0 10px;
    line-height: 1.2;
}

/* CONTADOR FLOTANTE */
.badge-count {
    z-index: 2;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    padding: 5px 15px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* LISTAS Y ELEMENTOS DE UI */
.form-check.defect-item-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 12px 15px 12px 40px; /* Espacio para el checkbox */
    margin-bottom: 0;
    transition: background 0.2s;
}

/* Checkbox personalizado más grande */
.defect-checkbox, .defect-checkbox-edit {
    width: 1.3em;
    height: 1.3em;
    margin-left: -25px; /* Ajuste manual */
    margin-top: 0.1em;
    cursor: pointer;
}

.form-check.defect-item-container:active {
    background-color: #f3f4f6;
}

/* HISTORIAL CARDS */
.list-group-item {
    border: none;
    border-radius: var(--radius-md) !important;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    background: white;
    padding: 15px;
    transition: transform 0.2s;
}
.list-group-item:active {
    transform: scale(0.98);
}

/* BOTONES DE ACCIÓN */
.shadow-primary {
    box-shadow: 0 4px 14px 0 rgba(13, 110, 253, 0.39);
}
.shadow-danger {
    box-shadow: 0 4px 14px 0 rgba(220, 53, 69, 0.39);
}
.hover-scale:hover {
    transform: translateY(-2px);
}

/* UTILIDADES */
.tracking-wider { letter-spacing: 0.05em; }
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }

.transition-all {
    transition: all 0.3s ease;
}

/* BOTÓN DE DISMINUIR (MINUS) */
.btn-decrease {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.9); /* Blanco casi opaco */
    color: #dc3545; /* Rojo Bootstrap */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10; /* Por encima del resto */
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-decrease:active {
    transform: scale(0.8);
    background-color: #ffeaea;
}

.btn-decrease i {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 0;
}