/* Encargos de clientes */
.encargos-shell{
 display:grid;
 gap:16px;
 color:var(--pos-text,#172033);
}
.encargos-header{
 padding-bottom:12px;
 border-bottom:1px solid var(--pos-line,#dbe3ef);
}
.encargos-header h2{ margin:0; font-size:22px; font-weight:800; letter-spacing:-.02em; }
.encargos-header p{ margin:4px 0 0; color:var(--pos-muted,#687386); font-weight:600; font-size:13px; }

.encargos-grid{
 display:grid;
 grid-template-columns:1.2fr 1fr;
 gap:16px;
 align-items:start;
}
.encargos-panel{
 padding:16px;
 border:1px solid var(--pos-line,#dbe3ef);
 border-radius:14px;
 background:var(--pos-surface-strong,#fff);
}
.encargos-panel h3{ display:flex; align-items:center; gap:8px; margin:0 0 12px; font-size:15px; font-weight:800; }
.encargos-panel h3 .ui-icon{ width:18px; height:18px; flex-shrink:0; color:var(--brand-color,#0d6efd); }
.encargos-panel-titulo-fila{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.encargos-panel-titulo-fila h3{ margin:0; }

.encargos-stats{
 display:grid;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:12px;
}
.encargo-stat-tarjeta{
 display:flex;
 align-items:center;
 gap:10px;
 padding:12px 14px;
 border:1px solid var(--pos-line,#dbe3ef);
 border-radius:12px;
 background:var(--pos-surface-strong,#fff);
}
.encargo-stat-tarjeta strong{ display:block; font-size:19px; font-weight:800; line-height:1.15; color:var(--pos-text,#172033); }
.encargo-stat-tarjeta span{ display:block; font-size:11.5px; font-weight:700; color:var(--pos-muted,#687386); }
.encargo-stat-icono{
 flex-shrink:0;
 width:34px;
 height:34px;
 display:grid;
 place-items:center;
 border-radius:10px;
}
.encargo-stat-icono .ui-icon{ width:18px; height:18px; }
.stat-pendiente .encargo-stat-icono{ background:rgba(217,119,6,.14); color:#b45309; }
.stat-listo .encargo-stat-icono{ background:rgba(37,99,235,.14); color:#1d4ed8; }
.stat-vencido .encargo-stat-icono{ background:rgba(100,116,139,.14); color:#475569; }
.stat-vencido.con-alerta .encargo-stat-icono{ background:rgba(220,38,38,.14); color:#dc2626; }
.stat-vencido.con-alerta strong{ color:#dc2626; }
.stat-anticipo .encargo-stat-icono{ background:rgba(22,163,74,.14); color:#15803d; }

@media (max-width:900px){
 .encargos-stats{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}

.encargo-form-cliente,
.encargo-form-fila{
 display:grid;
 grid-template-columns:1fr 1fr;
 gap:12px;
 margin-bottom:12px;
}
.encargo-form-notas{ display:grid; gap:5px; margin-bottom:14px; color:var(--pos-muted,#687386); font-size:12px; font-weight:700; }

.encargo-form-cliente label,
.encargo-form-fila label,
.encargo-add-row label{
 display:grid;
 gap:5px;
 color:var(--pos-muted,#687386);
 font-size:12px;
 font-weight:700;
}
.encargo-form-cliente input,
.encargo-form-fila input,
.encargo-form-notas input,
.encargo-add-row input{
 min-height:38px;
 border:1px solid var(--pos-line,#dbe3ef);
 border-radius:10px;
 padding:0 10px;
 background:var(--pos-surface,#f8fafc);
 color:var(--pos-text,#172033);
 font-size:13px;
}

.encargo-add-row{
 display:grid;
 grid-template-columns:2fr .8fr .9fr auto;
 gap:10px;
 align-items:end;
 margin-bottom:12px;
}

.btn-encargo-agregar,
.btn-encargo-primario{
 min-height:38px;
 border:0;
 border-radius:10px;
 padding:0 16px;
 background:var(--brand-color,#0d6efd) !important;
 color:#fff !important;
 font-weight:800;
 font-size:13px;
 cursor:pointer;
 white-space:nowrap;
}
.btn-encargo-secundario{
 min-height:38px;
 border:1px solid var(--pos-line,#dbe3ef) !important;
 border-radius:10px;
 padding:0 16px;
 background:transparent !important;
 color:var(--pos-text,#172033) !important;
 font-weight:700;
 font-size:13px;
 cursor:pointer;
}
.btn-encargo-whatsapp{
 min-height:38px;
 border:0;
 border-radius:10px;
 padding:0 16px;
 background:#25d366 !important;
 color:#fff !important;
 font-weight:800;
 font-size:13px;
 cursor:pointer;
 white-space:nowrap;
}
.btn-encargo-quitar{
 min-height:28px;
 border:0;
 border-radius:8px;
 padding:0 10px;
 background:rgba(220,38,38,.12) !important;
 color:#dc2626 !important;
 font-weight:700;
 font-size:11px;
 cursor:pointer;
}
.encargo-btn-full{ width:100%; min-height:44px; margin-top:6px; }

.encargo-items-vacio{ color:var(--pos-muted,#687386); font-size:13px; margin:8px 0; }

.encargo-tabla-items{
 width:100%;
 border-collapse:collapse;
 margin-bottom:10px;
 font-size:13px;
}
.encargo-tabla-items th{
 text-align:left;
 padding:6px 8px;
 color:var(--pos-muted,#687386);
 font-size:11px;
 text-transform:uppercase;
 letter-spacing:.04em;
 border-bottom:1px solid var(--pos-line,#dbe3ef);
}
.encargo-tabla-items td{
 padding:8px;
 border-bottom:1px solid var(--pos-line,#dbe3ef);
}

.encargos-filtros{ display:flex; gap:6px; flex-wrap:wrap; }
.encargos-filtros button{
 min-height:32px;
 border:1px solid var(--pos-line,#dbe3ef) !important;
 border-radius:999px;
 padding:0 12px;
 background:transparent !important;
 color:var(--pos-muted,#687386) !important;
 font-weight:700;
 font-size:12px;
 cursor:pointer;
}
.encargos-filtros button.activo{
 background:var(--brand-color,#0d6efd) !important;
 color:#fff !important;
 border-color:transparent !important;
}
.encargo-filtro-conteo{
 display:inline-flex;
 align-items:center;
 justify-content:center;
 min-width:16px;
 padding:0 4px;
 margin-left:2px;
 border-radius:999px;
 background:rgba(104,115,134,.16);
 font-size:10px;
 font-weight:800;
}
.encargos-filtros button.activo .encargo-filtro-conteo{ background:rgba(255,255,255,.28); }
.encargo-filtro-conteo.alerta{ background:rgba(220,38,38,.16); color:#dc2626; }

.encargo-buscador{
 display:flex;
 align-items:center;
 gap:8px;
 min-height:38px;
 margin-bottom:10px;
 padding:0 12px;
 border:1px solid var(--pos-line,#dbe3ef);
 border-radius:10px;
 background:var(--pos-surface,#f8fafc);
}
.encargo-buscador .ui-icon{ width:16px; height:16px; flex-shrink:0; color:var(--pos-muted,#687386); }
.encargo-buscador input{
 flex:1;
 min-width:0;
 border:0;
 background:transparent;
 color:var(--pos-text,#172033);
 font-size:13px;
}
.encargo-buscador input:focus{ outline:none; }

.encargos-lista{ display:grid; gap:10px; max-height:560px; overflow-y:auto; }
.encargo-card{
 display:grid;
 gap:4px;
 padding:12px;
 border:1px solid var(--pos-line,#dbe3ef);
 border-radius:12px;
 background:var(--pos-surface,#f8fafc);
 cursor:pointer;
}
.encargo-card:hover{ border-color:var(--brand-color,#0d6efd); }
.encargo-card.encargo-vencido{ box-shadow:inset 3px 0 0 #dc2626; }
.encargo-card-cabecera{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.encargo-card-cabecera strong{ font-size:14px; }
.encargo-card-cliente{ display:flex; align-items:center; gap:8px; min-width:0; }
.encargo-card-cliente strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.encargo-card-detalle{ display:flex; align-items:center; gap:4px; color:var(--pos-muted,#687386); font-size:12px; }
.encargo-card-detalle-vencido{ color:#dc2626; font-weight:700; }
.encargo-card-detalle .ui-icon{ width:13px; height:13px; flex-shrink:0; }

.encargo-avatar{
 flex-shrink:0;
 width:28px;
 height:28px;
 display:grid;
 place-items:center;
 border-radius:50%;
 background:rgba(13,110,253,.12);
 color:var(--brand-color,#0d6efd);
 font-size:11px;
 font-weight:800;
}
.encargo-avatar-grande{ width:44px; height:44px; font-size:15px; }

.encargo-vacio-estado{
 display:flex;
 flex-direction:column;
 align-items:center;
 gap:8px;
 padding:32px 16px;
 color:var(--pos-muted,#687386);
 text-align:center;
}
.encargo-vacio-estado .ui-icon{ width:30px; height:30px; opacity:.45; }
.encargo-vacio-estado p{ margin:0; font-size:13px; }

.encargo-badge{
 display:inline-flex;
 align-items:center;
 padding:2px 10px;
 border-radius:999px;
 font-size:11px;
 font-weight:800;
 white-space:nowrap;
}
.encargo-badge.estado-pendiente{ background:rgba(217,119,6,.14); color:#b45309; }
.encargo-badge.estado-listo{ background:rgba(37,99,235,.14); color:#1d4ed8; }
.encargo-badge.estado-entregado{ background:rgba(22,163,74,.14); color:#15803d; }
.encargo-badge.estado-cancelado{ background:rgba(100,116,139,.14); color:#475569; }

.modal-detalle-encargo{
 position:fixed;
 inset:0;
 z-index:9999;
 display:flex;
 align-items:center;
 justify-content:center;
 padding:18px;
 background:rgba(15,23,42,.38);
 backdrop-filter:blur(10px);
}
.encargo-detalle-card{
 width:min(640px,94vw);
 max-height:calc(100vh - 48px);
 overflow:auto;
 border-radius:16px;
 border:1px solid rgba(255,255,255,.55);
 background:var(--pos-surface-strong,#fff);
 box-shadow:0 24px 70px rgba(15,23,42,.24);
 padding:18px;
 backdrop-filter:blur(18px) saturate(135%);
 color:var(--pos-text,#172033);
}
.encargo-detalle-card .modal-card-header{
 display:grid;
 grid-template-columns:1fr auto;
 align-items:start;
 gap:14px;
 margin-bottom:14px;
}
.encargo-detalle-card .modal-card-header span{
 display:block;
 color:var(--brand-color,#0d6efd);
 font-size:11px;
 font-weight:950;
 letter-spacing:.08em;
 text-transform:uppercase;
}
.encargo-detalle-card .modal-card-header h3{ margin:2px 0 0; font-size:20px; }
.encargo-detalle-header-cliente{ display:flex; align-items:center; gap:12px; min-width:0; }
.encargo-detalle-header-cliente h3{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.encargo-detalle-aviso-vencido{
 display:flex;
 align-items:center;
 gap:8px;
 margin:0 0 14px;
 padding:10px 12px;
 border-radius:10px;
 background:rgba(220,38,38,.1);
 color:#dc2626;
 font-size:12.5px;
 font-weight:700;
}
.encargo-detalle-aviso-vencido .ui-icon{ width:16px; height:16px; flex-shrink:0; }
.encargo-detalle-card .modal-card-header button{
 min-height:32px;
 border:1px solid var(--pos-line,#dbe3ef) !important;
 border-radius:8px;
 padding:0 12px;
 background:transparent !important;
 color:var(--pos-text,#172033) !important;
 font-weight:700;
 font-size:12px;
 cursor:pointer;
}

.encargo-detalle-info{
 display:grid;
 gap:4px;
 margin-bottom:14px;
 padding:10px 12px;
 border-radius:10px;
 background:var(--pos-surface,#f8fafc);
 color:var(--pos-muted,#687386);
 font-size:12px;
}
.encargo-detalle-total{ text-align:right; font-size:13px; color:var(--pos-muted,#687386); }
.encargo-detalle-acciones{ display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }

@media (max-width:900px){
 .encargos-grid{ grid-template-columns:1fr; }
 .encargo-form-cliente,
 .encargo-form-fila{ grid-template-columns:1fr; }
 .encargo-add-row{ grid-template-columns:1fr; }
}

body.oscuro .encargo-card:hover{ border-color:var(--brand-color,#0d6efd); }

.lista-detalle-cantidad-input{
 width:70px;
 min-height:32px;
 border:1px solid var(--pos-line,#dbe3ef);
 border-radius:8px;
 padding:0 8px;
 background:var(--pos-surface,#f8fafc);
 color:var(--pos-text,#172033);
 font-size:13px;
}
