/* ESTILOS.CSS - V33 Restauración Agenda */
:root {
    --primary: #15803d; --primary-light: #dcfce7;
    --bg-body: #f3f4f6; --surface: #ffffff;
    --text-main: #111827; --text-light: #6b7280;
    --border: #e5e7eb; 
    --danger: #dc2626; --warning: #d97706; --info: #2563eb; --tax: #7e22ce;
    --whatsapp: #25D366; /* Color Oficial WA */
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; font-size: 13px; }
body { background-color: var(--bg-body); color: var(--text-main); height: 100vh; display: flex; overflow: hidden; }

/* SIDEBAR */
.sidebar { width: 250px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 1.5rem 1rem; flex-shrink: 0; height: 100vh; overflow: hidden; }
.sidebar nav { display: flex; flex-direction: column; overflow-y: auto; flex: 1; padding-bottom: 0.5rem; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: var(--text-light); text-decoration: none; border-radius: 6px; margin-bottom: 2px; cursor: pointer; transition: 0.2s; font-weight: 500; }
.nav-item:hover, .nav-item.active { background-color: var(--primary-light); color: var(--primary); }
.nav-group { font-size: 0.7rem; color: #9ca3af; text-transform: uppercase; margin-top: 1.5rem; margin-bottom: 0.5rem; padding-left: 0.8rem; font-weight: 700; letter-spacing: 0.05em; }

/* MAIN CONTENT */
.main-content { flex: 1; padding: 2rem; overflow-y: auto; background: var(--bg-body); }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.header h1 { font-size: 1.5rem; font-weight: 700; color: #111; }

/* CARDS */
.card { background: var(--surface); padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border); margin-bottom: 1.5rem; }

/* TABLAS ESTETICA V28 */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th { text-align: left; padding: 12px; border-bottom: 2px solid var(--border); color: #6b7280; font-size: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
td { padding: 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; color: #374151; }
tr:hover { background-color: #f9fafb; }
tr.low-stock { background-color: #fef2f2; }
tr.low-stock td { color: #b91c1c; }

/* FORMS */
.row { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: flex-end; }
.col { flex: 1; display: flex; flex-direction: column; }
label { margin-bottom: 4px; font-weight: 600; font-size: 0.8rem; color: #4b5563; }
input, select, textarea { width: 100%; padding: 0.7rem; border: 1px solid #d1d5db; border-radius: 6px; outline: none; background: #fff; transition: border 0.2s; font-size: 0.9rem; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); ring: 2px var(--primary-light); }
input:disabled { background-color: #f3f4f6; color: #9ca3af; cursor: not-allowed; }
.uppercase { text-transform: uppercase; }

/* CHECKBOX FIX */
.checkbox-row { display: flex; flex-direction: row !important; align-items: center; gap: 10px; margin-top: 5px; }
.checkbox-row input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.checkbox-row label { margin: 0; cursor: pointer; font-size: 0.9rem; }
.text-fiscal { color: var(--tax); font-weight: 700; }

/* BUTTONS */
.btn { padding: 0.6rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center; transition: 0.2s; font-size: 0.85rem; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: white; border: 1px solid var(--border); color: var(--text-main); }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-warning { background: #fef3c7; color: #92400e; }
.btn-info { background: #dbeafe; color: #1e40af; }
.btn-success { background: #16a34a; color: white; }
.btn-wa { background: var(--whatsapp); color: white; } /* Botón WhatsApp */
.btn-sm { padding: 0.4rem 0.6rem; font-size: 0.75rem; }

/* KANBAN */
.kanban-container { display: flex; gap: 12px; overflow-x: auto; height: calc(100vh - 120px); padding-bottom: 10px; }
.kanban-col { min-width: 280px; background: #f1f5f9; border-radius: 8px; display: flex; flex-direction: column; max-height: 100%; border: 1px solid #e2e8f0; }
.kanban-header { padding: 12px; font-weight: 700; text-transform: uppercase; color: #475569; font-size: 0.8rem; border-bottom: 1px solid #cbd5e1; display: flex; justify-content: space-between; background: #e2e8f0; border-radius: 8px 8px 0 0; }
.kanban-body { padding: 10px; overflow-y: auto; flex: 1; }
.kanban-card { background: white; padding: 12px; border-radius: 6px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); cursor: pointer; border-left: 4px solid var(--primary); transition: transform 0.1s; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.kc-title { font-weight: 700; color: #1e293b; display: flex; justify-content: space-between; font-size: 0.95rem; }
.kc-sub { font-size: 0.85rem; color: #64748b; margin-top: 6px; }

/* Colores Kanban */
.col-ingreso { border-top: 4px solid #64748b; }
.col-diag { border-top: 4px solid #eab308; }
.col-espera { border-top: 4px solid #f97316; }
.col-garantia { border-top: 4px solid #a855f7; }
.col-rep { border-top: 4px solid #3b82f6; }
.col-fin { border-top: 4px solid #22c55e; }
.col-ent { border-top: 4px solid #1e293b; opacity: 0.7; }

/* MODALS & SEARCH */
.search-container { position: relative; width: 100%; }
.search-results { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 100%; 
    background: white; 
    border: 1px solid var(--border); 
    z-index: 1000; /* Z-index alto para que tape todo */
    max-height: 200px; 
    overflow-y: auto; 
    display: none; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
}
.search-item { padding: 10px; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.search-item:hover { background: #dcfce7; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(2px); }
#modal-login { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); z-index: 10000; }
.modal-content { background: white; padding: 2rem; border-radius: 12px; width: 95%; max-width: 900px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.hidden { display: none !important; }

/* OT FORM SPECIFICS */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 15px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #334155; }
.check-item input { width: 16px; height: 16px; }

.tab-btn { padding: 10px 20px; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600; color: #64748b; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding-top: 20px; }
.tab-content.active { display: block; }

.config-list-item { display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid #eee; align-items: center; }
.danger-zone { border: 1px solid #fca5a5; background: #fef2f2; padding: 15px; border-radius: 8px; margin-top: 20px; }

/* PRINT */
#print-area { display: none; }
@media print { 
    body * { visibility: hidden; } 
    #print-area, #print-area * { visibility: visible; } 
    #print-area { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 40px; background: white; } 
    @page { size: A4; margin: 0; } 
}

/* FILTROS TALLER */
.filtro-tipo, .filtro-estado {
    transition: all 0.2s;
}
.filtro-tipo:not(.active), .filtro-estado:not(.active) {
    opacity: 0.3;
    background: #e5e7eb !important;
    color: #9ca3af !important;
}
.filtro-tipo.active, .filtro-estado.active {
    opacity: 1;
}