﻿/* =========================
RESET
========================= */

*{
    box-sizing:border-box;
}

body{
    margin:0;
    padding:60px 0 0 230px;
    font-family:Arial, Helvetica, sans-serif;
    background:#f4f6f9;
}

/* =========================
HEADER
========================= */

.header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#2c3e50;
    color:white;
    padding:0 20px;
    height:60px;
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:1000;
}

.logo-link{
    display:flex;
    align-items:center;
    text-decoration:none;
    color:white;
}

.titulo-sistema{
    margin-left:10px;
    font-size:18px;
    font-weight:bold;
}

.header-der{
    display:flex;
    align-items:center;
    gap:15px;
}

.btn-salir{
    background:#e74c3c;
    color:white;
    padding:6px 12px;
    border-radius:5px;
    text-decoration:none;
    font-size:14px;
}

.btn-salir:hover{
    background:#c0392b;
}

/* =========================
MENU LATERAL
========================= */

.menu{
    width:230px;
    background:#2f4152;
    height:calc(100vh - 60px);
    position:fixed;
    left:0;
    top:60px;
    overflow:auto;
    z-index:900;
    padding:10px;
    box-sizing:border-box;
    border-right:1px solid #243544;
    box-shadow:3px 0 12px rgba(18,32,45,0.12);
}

.menu-group{
    margin-bottom:7px;
    border:1px solid rgba(255,255,255,0.06);
    border-radius:8px;
    overflow:hidden;
    background:#34495e;
}

.menu-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:12px 12px;
    background:#2c3e50;
    color:white;
    cursor:pointer;
    font-weight:bold;
    font-size:14px;
    user-select:none;
    transition:background .18s ease, color .18s ease;
}

.menu-title::after{
    content:"";
    width:8px;
    height:8px;
    border-right:2px solid #c9d6df;
    border-bottom:2px solid #c9d6df;
    transform:rotate(-45deg);
    transition:transform .18s ease;
    margin-left:8px;
}

.menu-title:hover{
    background:#3b5368;
}

.menu-group.open .menu-title{
    background:#3b5368;
}

.menu-group.open .menu-title::after{
    transform:rotate(45deg);
}

.submenu{
    display:none;
    padding:6px;
    background:#34495e;
}

.submenu a{
    display:block;
    padding:9px 10px 9px 16px;
    color:#f4f8fb;
    text-decoration:none;
    font-size:14px;
    border-radius:6px;
    margin:2px 0;
    transition:background .15s ease, color .15s ease;
}

.submenu a:hover{
    background:#40596f;
    color:#fff;
}

.submenu a.active{
    background:#eef4f8;
    color:#25384a;
    font-weight:700;
    box-shadow:inset 3px 0 0 #5f8fb7;
}

.menu-subtitle{
    padding:10px 10px 5px;
    font-size:11px;
    color:#b9cad6;
    background:transparent;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:0;
}

.menu{
    transition:box-shadow .2s ease;
}

.menu-search-wrap{
    position:sticky;
    top:0;
    z-index:5;
    background:#2f4152;
    padding:2px 0 10px 0;
    margin-bottom:6px;
}

.menu-search{
    width:100%;
    background:#22313f;
    color:#fff;
    border:1px solid #496174;
    border-radius:8px;
    padding:10px 12px;
    outline:none;
}

.menu-search::placeholder{
    color:#c8d7e3;
}

.menu-search:focus{
    border-color:#7ea6c7;
    box-shadow:0 0 0 3px rgba(126,166,199,0.18);
}

.menu-search-empty{
    margin-top:8px;
    padding:10px 12px;
    border-radius:8px;
    background:#40596f;
    color:#eaf2f8;
    font-size:13px;
}

.menu-title-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.menu-title-icon{
    width:18px;
    text-align:center;
    font-size:15px;
}

.menu-title-label{
    display:inline-block;
}

.menu-group.open{
    box-shadow:0 8px 18px rgba(0,0,0,0.10);
}

.menu-group.is-hidden{
    display:none;
}

.breadcrumb{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    margin-bottom:4px;
    padding:0;
    background:transparent;
    border-radius:0;
    box-shadow:none;
    font-size:14px;
}

.breadcrumb a{
    color:#6d2ea3;
    text-decoration:underline;
    font-weight:400;
}

.breadcrumb a:hover{
    text-decoration:underline;
}

.breadcrumb-sep{
    color:#8aa0b2;
}

.breadcrumb-current{
    color:#5d6d7e;
    font-weight:700;
}

/* =========================
CONTENIDO
========================= */

.contenido{
    width:100%;
    min-height:calc(100vh - 60px);
    padding:20px;
}

/* =========================
TARJETAS
========================= */

.card{
    background:white;
    padding:15px;
    border-radius:6px;
    box-shadow:0 2px 5px rgba(0,0,0,0.1);
    margin-bottom:15px;
}

/* =========================
TABLAS
========================= */

table{
    width:100%;
    border-collapse:collapse;
    background:white;
}

th{
    background:#2c3e50;
    color:white;
    text-align:left;
}

th,td{
    padding:8px;
    border:1px solid #ddd;
    font-size:14px;
}

/* =========================
FORMULARIOS
========================= */

input,select,textarea{
    padding:8px;
    border:1px solid #ccc;
    border-radius:5px;
    font-size:14px;
    max-width:100%;
}

input[type=text]{
    text-transform:uppercase;
}

button{
    background:#3498db;
    color:white;
    border:none;
    padding:8px 14px;
    border-radius:5px;
    cursor:pointer;
}

button:hover{
    background:#2980b9;
}

.btn-secundario{
    display:inline-block;
    background:#6c757d;
    color:white;
    border:none;
    padding:8px 14px;
    border-radius:5px;
    cursor:pointer;
    text-decoration:none;
}

.btn-secundario:hover{
    background:#5a6268;
}

.btn-outline{
    display:inline-block;
    background:white;
    color:#2c3e50;
    border:1px solid #cfd6dd;
    padding:8px 14px;
    border-radius:5px;
    cursor:pointer;
    text-decoration:none;
}

.btn-outline:hover{
    background:#f3f6f9;
}

/* =========================
REPORTES
========================= */

.report-toolbar{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:end;
    margin-bottom:15px;
}

.report-toolbar label{
    display:flex;
    flex-direction:column;
    gap:5px;
    font-size:13px;
    color:#2c3e50;
    font-weight:bold;
}

.report-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}

.kpi-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    gap:12px;
    margin-bottom:18px;
}

.kpi-card{
    background:linear-gradient(135deg,#2c3e50,#3f5973);
    color:white;
    padding:16px;
    border-radius:10px;
    box-shadow:0 10px 20px rgba(44,62,80,0.12);
}

.kpi-card h3,
.kpi-card p{
    margin:0;
}

.kpi-card h3{
    font-size:14px;
    font-weight:600;
    opacity:0.92;
}

.kpi-value{
    margin-top:8px;
    font-size:28px;
    font-weight:700;
    line-height:1.1;
}

.kpi-note{
    margin-top:6px;
    font-size:12px;
    opacity:0.9;
}

.kpi-positive{
    background:linear-gradient(135deg,#1f8f5f,#2ecc71);
}

.kpi-warning{
    background:linear-gradient(135deg,#c97a16,#f39c12);
}

.kpi-info{
    background:linear-gradient(135deg,#21618c,#3498db);
}

.kpi-accent{
    background:linear-gradient(135deg,#6c3483,#9b59b6);
}

.kpi-danger{
    background:linear-gradient(135deg,#922b21,#e74c3c);
}

.report-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:18px;
    align-items:start;
    margin-top:18px;
}

.report-panel{
    background:white;
    border-radius:10px;
    padding:16px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
}

.report-panel h3{
    margin:0 0 12px 0;
}

.report-list{
    margin:0;
    padding-left:18px;
}

.report-list li{
    margin-bottom:8px;
}

.delta{
    font-weight:bold;
}

.delta-up{
    color:#1e8449;
}

.delta-down{
    color:#c0392b;
}

.delta-neutral{
    color:#5d6d7e;
}

.table-summary{
    margin-top:14px;
}

@media (max-width: 900px){
    .report-grid{
        grid-template-columns:1fr;
    }
}

/* =========================
ABM
========================= */

.fila-abm,
.form-abm,
.form-editar{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:10px;
}

.input-abm,
.input-editar{
    width:450px;
}

table input[type=text]{
    width:100%;
    max-width:450px;
}

/* =========================
BOTONES
========================= */

.btn-eliminar{
    font-size:20px;
    cursor:pointer;
}

.btn-eliminar:hover{
    transform:scale(1.2);
}

/* =========================
SERVICIO TÃ‰CNICO
========================= */
.form-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:12px;
    margin-top:12px;
}

.form-grid label{
    display:flex;
    flex-direction:column;
    gap:6px;
    font-size:13px;
    font-weight:bold;
    color:#2c3e50;
}

.form-grid textarea{
    min-height:90px;
    resize:vertical;
}

.form-grid-wide{
    grid-column:span 2;
}

@media (max-width: 600px){
    .form-grid{
        grid-template-columns:1fr;
    }

    .form-grid-wide{
        grid-column:span 1;
    }
}

.form-actions{
    margin-top:18px;
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}

.status-chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:4px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.status-chip.status-ingresado{
    background:#f6e58d;
    color:#6b4e03;
}

.status-chip.status-en-revision{
    background:#d6eaf8;
    color:#1b4f72;
}

.status-chip.status-en-reparacion{
    background:#d6eaf8;
    color:#1b4f72;
}

.status-chip.status-listo{
    background:#a3e4d7;
    color:#0e6655;
}

.status-chip.status-entregado{
    background:#d5d8dc;
    color:#2c3e50;
}

/* =========================
MENSAJES
========================= */

.rubro-card{
    position:relative;
}

.mensaje-sistema{
    position:absolute;
    right:15px;
    top:55px;
    background:#27ae60;
    color:white;
    padding:10px 16px;
    border-radius:6px;
    font-weight:bold;
}

.mensaje-error{
    background:#e74c3c;
}

/* =========================
BUSQUEDA RAPIDA
========================= */

#resultadosBusqueda{
    margin-top:12px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.resultado-articulo{
    position:relative;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    padding:18px 20px 18px 24px;
    border:none;
    border-radius:16px;
    background:linear-gradient(135deg,#18324a,#274761 58%,#325975);
    box-shadow:0 12px 24px rgba(24,50,74,0.16);
    overflow:hidden;
}

.resultado-franja{
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:8px;
    background:linear-gradient(180deg,#f1c40f,#f39c12);
}

.resultado-principal{
    min-width:0;
    flex:1;
}

.resultado-etiqueta{
    display:inline-block;
    margin-bottom:8px;
    padding:4px 10px;
    border-radius:999px;
    background:rgba(255,255,255,0.14);
    color:#dbe7f3;
    font-size:11px;
    font-weight:700;
    letter-spacing:0.08em;
    text-transform:uppercase;
}

.resultado-nombre{
    font-size:21px;
    font-weight:700;
    color:#ffffff;
    line-height:1.2;
}

.resultado-meta{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:10px;
}

.resultado-chip{
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(255,255,255,0.1);
    color:#e8f1f8;
    font-size:12px;
    font-weight:600;
}

.resultado-lateral{
    text-align:right;
    min-width:170px;
    padding:14px 16px;
    border-radius:14px;
    background:rgba(255,255,255,0.1);
    backdrop-filter:blur(4px);
}

.resultado-precio-label{
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:0.08em;
    color:#c7d8e7;
    font-weight:700;
}

.resultado-precio{
    margin-top:4px;
    font-size:30px;
    font-weight:700;
    color:#ffe082;
    line-height:1.1;
}

.resultado-precio-detalle{
    margin-top:4px;
    font-size:12px;
    color:#d6e4f0;
    font-weight:600;
}

.resultado-stock-badge{
    display:inline-block;
    margin-top:10px;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    background:#ecf0f1;
}

.resultado-facturar-btn{
    display:inline-block;
    margin-top:10px;
    padding:7px 12px;
    border-radius:999px;
    background:#ffffff;
    color:#1f4e79;
    text-decoration:none;
    font-size:12px;
    font-weight:700;
}

.resultado-facturar-btn:hover{
    background:#dfefff;
}

.stock-ok{
    background:#d5f5e3;
    color:#196f3d;
}

.stock-bajo{
    background:#fdebd0;
    color:#b9770e;
}

.stock-critico{
    background:#fadbd8;
    color:#a93226;
}

.resultado-vacio{
    padding:12px 14px;
    border-radius:12px;
    background:linear-gradient(135deg,#fff4e5,#fde4ba);
    color:#8a5a00;
    border:1px solid #f1d19c;
}

@media (max-width: 700px){
    .resultado-articulo{
        flex-direction:column;
        align-items:flex-start;
        padding-right:18px;
    }

    .resultado-lateral{
        text-align:left;
        min-width:0;
        width:100%;
    }

}

/* =========================
IMAGEN PREVIEW
========================= */

.icono-foto{
    position:relative;
    display:inline-block;
    cursor:pointer;
}

.preview-img{
    display:none;
    position:absolute;
    top:25px;
    left:-50px;
    background:#fff;
    border:1px solid #ccc;
    padding:5px;
    border-radius:6px;
    box-shadow:0 4px 10px rgba(0,0,0,0.2);
}

.preview-img img{
    width:120px;
}

.icono-foto:hover .preview-img{
    display:block;
}

/* =========================
IMPRESION
========================= */

@media print{

.menu,
.header,
button,
form{
    display:none;
}

body{
    padding:0;
}

.contenido{
    min-height:auto;
    padding:0;
}

.card{
    border:none;
    box-shadow:none;
}

}

.submenu{
    display:none;
    padding:6px;
    background:#34495e;
}

.menu-group.open .submenu{
    display:block;
}

