@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-app: #f1f5f9;
    --card: #ffffff;
    --primary: #2563eb; /* Azul eléctrico de la imagen */
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    margin: 0; 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-app); 
    color: var(--text);
    line-height: 1.5;
}

/* Contenedor Maestro: Limita el ancho en PC para que no se deforme */
.app-container {
    width: 100%;
    max-width: 1200px; /* Ancho profesional de Dashboard */
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px; /* Espacio para menú móvil */
}

/* Tarjetas Estilo SaaS Moderno */
.card {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

/* Cabecera del Proyecto */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.project-header h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.5px; }

/* Status Badges */
.status-pill {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.activo { background: #dcfce7; color: #15803d; }
.finalizado { background: #e2e8f0; color: #64748b; }

/* Grid de Métricas (4 tarjetas superiores) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card { text-align: center; }
.metric-card small { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.metric-card strong { display: block; font-size: 1.8rem; font-weight: 800; margin-top: 5px; }

/* Estructura Principal del Detalle */
.main-detail-layout {
    display: grid;
    grid-template-columns: 1fr; /* 1 columna en celular */
    gap: 20px;
}

@media (min-width: 992px) {
    .main-detail-layout {
        grid-template-columns: 280px 1fr; /* Columna izquierda fija en PC */
    }
}

/* Listado de Partes (Columna Izquierda) */
.parts-list {
    height: 100%;
}

.part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

.part-item:hover { border-color: var(--primary); background: #f8fafc; }
.part-item.active { border-color: var(--primary); background: #eff6ff; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; }

/* Panel de Trabajo Central */
.work-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .work-panel {
        grid-template-columns: 1fr 1fr; /* Dos columnas en PC */
    }
}

/* Inputs y Botones Profesionales */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 1rem;
    margin-top: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none;
}

/* Fotos con Aspect Ratio fijo */
.photo-box {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    border: 2px dashed var(--border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }