:root {
    --primary: #1F4E3D; /* Deep Agricultural Green */
    --primary-light: #2D6B54;
    --accent: #E9C46A; /* Earthy Yellow */
    --accent-hover: #F4A261;
    --bg-color: #F0F4F2;
    --text-main: #2C3E35;
    --text-muted: #6B7D73;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-radius: 16px;
    --shadow: 0 8px 32px rgba(31, 78, 61, 0.08);
    
    /* Status Colors */
    --status-good: #2A9D8F;
    --status-bad: #E76F51;
    --status-na: #A8DADC;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: 
        radial-gradient(at 0% 0%, hsla(152, 43%, 90%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(43, 74%, 90%, 1) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo-text .highlight {
    color: var(--accent-hover);
}

.date-display {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.5);
    padding: 6px 12px;
    border-radius: 20px;
}

/* VIEWS */
.view {
    display: none;
    flex: 1;
    flex-direction: column;
    padding: 24px;
    animation: fadeIn 0.4s ease forwards;
}

.active-view {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HOME VIEW */
.welcome-section h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.welcome-section p {
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.notes-card {
    background: rgba(233, 196, 106, 0.15);
    border-left: 4px solid var(--accent);
    padding: 16px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.notes-card strong {
    display: block;
    color: var(--primary);
    margin-bottom: 8px;
}

.notes-card ul {
    margin-left: 20px;
    color: var(--text-main);
}

.notes-card li {
    margin-bottom: 4px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(31, 78, 61, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: var(--text-main);
    transition: all 0.2s;
    outline: none;
}

select:focus, input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 61, 0.1);
}

.equipments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.equipment-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.equipment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.equipment-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(31, 78, 61, 0.1);
}

.equipment-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    padding: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.equipment-card h3 {
    font-size: 0.85rem;
    padding: 12px;
    text-align: center;
    font-weight: 600;
}

/* CHECKLIST VIEW */
.checklist-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 16px;
    padding: 8px 0;
}

#checklist-title {
    font-size: 1.2rem;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 24px;
}

.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.equipment-image-container {
    width: 100%;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.equipment-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.question-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.section-badge {
    display: inline-block;
    background: rgba(31, 78, 61, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.question-card h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 24px;
    line-height: 1.4;
}

.answer-inputs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Status Buttons */
.btn-status {
    flex: 1;
    min-width: 80px;
    padding: 14px;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    background: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.btn-status[data-value="Bien"]:hover, .btn-status[data-value="Bien"].selected {
    border-color: var(--status-good);
    background: var(--status-good);
    color: white;
}

.btn-status[data-value="Mal"]:hover, .btn-status[data-value="Mal"].selected {
    border-color: var(--status-bad);
    background: var(--status-bad);
    color: white;
}

.btn-status[data-value="N/A"]:hover, .btn-status[data-value="N/A"].selected {
    border-color: var(--status-na);
    background: var(--status-na);
    color: white;
}

/* Controls */
.checklist-controls {
    display: flex;
    gap: 16px;
    margin-top: auto;
}

.btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(31, 78, 61, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(31, 78, 61, 0.05);
}

/* SUCCESS VIEW */
.success-card {
    background: white;
    padding: 40px 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    margin: auto 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--status-good);
    color: white;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 24px auto;
    box-shadow: 0 8px 24px rgba(42, 157, 143, 0.3);
}

.success-card h2 {
    color: var(--primary);
    margin-bottom: 16px;
}

.success-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Gauge Styles */
.gauge-wrapper {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-svg {
    width: 100%;
    overflow: visible;
}

.gauge-arc {
    cursor: pointer;
    transition: stroke-width 0.2s, stroke-opacity 0.2s;
    stroke-opacity: 0.4;
}

.gauge-arc:hover {
    stroke-opacity: 0.8;
}

.gauge-arc.selected-arc {
    stroke-width: 32;
    stroke-opacity: 1;
}

.gauge-needle {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 10px;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.gauge-na-container {
    margin-top: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
}


.app-logo {
    height: 40px;
    width: auto;
    display: block;
}


/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(31, 78, 61, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.hidden-view {
    display: none !important;
}

.modal-overlay.hidden-view {
    display: none;
}

.modal-card {
    background: white;
    padding: 32px 24px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    margin: auto;
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
    text-align: center;
    transform: translateY(0);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-card h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.modal-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    padding: 12px;
}

.modal-actions .btn.hidden-view {
    display: none;
}


.equipment-card img, .equipment-image-container img {
    mix-blend-mode: multiply;
    background-color: transparent;
}


/* Info Button */
.btn-info {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-color);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}

.btn-info:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

.btn-info svg {
    width: 20px;
    height: 20px;
}

.equipment-card {
    position: relative;
}


/* Question Help Button */
.btn-question-help {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 50%;
    transition: opacity 0.2s;
    opacity: 0.6;
}

.btn-question-help:hover {
    opacity: 1;
}


/* --- Admin Dashboard --- */
.admin-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.admin-header h2 {
    color: var(--primary-dark);
    margin: 0;
}
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 4px solid var(--primary);
}
.kpi-title {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}
.kpi-value {
    font-size: 32px;
    color: var(--primary-dark);
    line-height: 1;
}
.filters-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.admin-filter {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    flex: 1;
    min-width: 150px;
}
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.admin-table th, .admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.admin-table th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}
.admin-table tbody tr:hover {
    background-color: #f1f8f5;
}
.badge-mal {
    background: #FFEBEE;
    color: #C62828;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}
.badge-clean {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}


.app-container.admin-expanded {
    max-width: 1200px;
    width: 95%;
    margin-top: 20px;
    margin-bottom: 20px;
    transition: max-width 0.3s ease;
}


#modal-input.hidden-view {
    display: none !important;
}


#modal-textarea.hidden-view {
    display: none !important;
}


#modal-btn-mic.hidden-view {
    display: none !important;
}

