/* css/style.css - Pañol Industrial Theme */
:root {
    --primary: #f59e0b;      /* Naranja Industrial (Amber 500) */
    --primary-dark: #b45309;
    --dark: #1c1917;         /* Stone 900 (Gris muy oscuro) */
    --darker: #0c0a09;       /* Stone 950 */
    --light: #f5f5f4;        /* Stone 100 */
    --white: #ffffff;
    --green: #22c55e;        /* Disponible */
    --red: #ef4444;          /* Prestado/Roto */
    --gray: #78716c;
    --sidebar-width: 260px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--light); color: #292524; display: flex; min-height: 100vh; }

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width); background: var(--darker); color: #d6d3d1;
    display: flex; flex-direction: column; position: fixed; height: 100vh; left: 0; top: 0; z-index: 1000;
    overflow-y: auto; border-right: 1px solid #292524;
}
.brand { padding: 20px; font-size: 1.3rem; font-weight: 800; border-bottom: 1px solid #292524; color: white; display:flex; align-items:center; gap:10px; }
.brand span { background: var(--primary); color: black; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; }
.nav-menu { list-style: none; padding: 20px 0; flex-grow: 1; }
.nav-item a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: #a8a29e; text-decoration: none; transition: 0.2s; border-left: 4px solid transparent; }
.nav-item a:hover, .nav-item a.active { background: #292524; color: var(--primary); border-left-color: var(--primary); }

/* --- MAIN --- */
.main-content { margin-left: var(--sidebar-width); flex-grow: 1; width: calc(100% - var(--sidebar-width)); }

.dashboard-hero {
    height: 200px;
    background-image: linear-gradient(to right, rgba(28,25,23,0.9), rgba(28,25,23,0.7)), url('../../img/hero-panol.jpg');
    background-size: cover; background-position: center;
    color: white; padding: 40px; display: flex; flex-direction: column; justify-content: center;
}
.dashboard-hero h2 { font-size: 2rem; margin-bottom: 5px; color: var(--primary); }

.container { max-width: 1200px; margin: -30px auto 20px auto; padding: 0 20px; position: relative; z-index: 10; }

/* --- COMPONENTES --- */
.btn { padding: 10px 15px; border-radius: 6px; text-decoration: none; font-weight: bold; border: none; cursor: pointer; color: white; display: inline-flex; align-items: center; gap: 5px; font-size: 0.9rem; }
.btn-add { background: var(--primary); color: black; }
.btn-action { background: var(--dark); }
.btn-search { background: #44403c; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.kpi-card { background: white; padding: 1.5rem; border-radius: 8px; box-shadow: var(--shadow); border-bottom: 4px solid var(--primary); }
.kpi-value { font-size: 2rem; font-weight: 800; color: var(--dark); margin: 5px 0; }

/* --- AJUSTE PARA 6 COLUMNAS Y TARJETAS MÁS COMPACTAS --- */

.tools-grid { 
    display: grid; 
    /* Bajamos de 280px a 180px para que entren 6 en pantallas normales */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 1rem; 
}

.tool-card { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    transition: 0.3s; 
    border: 1px solid #e7e5e4; 
    /* Fuente un poco más chica para que entre todo */
    font-size: 0.9rem; 
}

.tool-card:hover { 
    transform: translateY(-3px); 
    border-color: var(--primary); 
}

.tool-img { 
    /* Bajamos la altura de la foto para que no queden tarjetas eternas */
    height: 120px; 
    width: 100%; 
    object-fit: cover; 
    background: #e7e5e4; 
    display:flex; align-items:center; justify-content:center; 
    color:#a8a29e; font-size:1.5rem; 
}

.tool-body { padding: 10px; }

.tool-body h3 {
    font-size: 1rem; /* Título más chico */
    margin: 5px 0;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; /* Puntos suspensivos si es muy largo */
}

/* Botones más compactos */
.tool-body .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
}
.tool-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; float: right; }

/* Estilos para botones de Edición/Borrado */
.tool-actions {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.9); padding: 5px; border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; gap: 5px;
}
.btn-mini {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; color: #555; text-decoration: none; transition: 0.2s;
}
.btn-mini:hover { background: #e7e5e4; color: var(--primary); }
.btn-mini.delete:hover { background: #fee2e2; color: var(--red); }
/* Forms */
.form-card { background: white; padding: 2rem; border-radius: 8px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 15px; }
.form-control { width: 100%; padding: 10px; border: 1px solid #d6d3d1; border-radius: 6px; background: #fafaf9; }

/* Badges de Estado Nuevos */
.status-perdido { 
    background: #1c1917; /* Casi negro */
    color: #d6d3d1;      /* Texto gris claro */
    border: 1px solid #44403c;
}

.status-averiado { 
    background: #7f1d1d; /* Rojo sangre oscuro */
    color: #fecaca;      /* Rojo muy claro */
    border: 1px solid #991b1b;
}

/* (Recordatorio de los que ya tenías para que combinen) */
.status-disponible { background: #dcfce7; color: #166534; }
.status-prestado { background: #fee2e2; color: #991b1b; }
.status-reparacion { background: #ffedd5; color: #9a3412; }

/* Mobile */
.menu-toggle { display: none; position: fixed; top: 15px; right: 15px; z-index: 2000; background: var(--primary); border:none; color:black; padding:10px; border-radius:5px; }
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: block; }
}