/* Panel General — estilos. Sigue el mismo lenguaje visual que los dashboards
   de cliente (tarjetas blancas, bordes suaves, azul/verde de Cielito). */

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: #f5f6f8; color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.barra-color { height: 4px; background: linear-gradient(90deg,#3d7bc4,#67aa6a); }

.logo-cuadro {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg,#3d7bc4,#67aa6a);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.logo-cuadro.grande { width: 52px; height: 52px; font-size: 20px; margin: 0 auto 14px; }

.btn {
  border: 0; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: inherit;
}
.btn-primario { background: #3d7bc4; color: #fff; }
.btn-primario:hover { opacity: .9; }
.btn-primario:disabled { opacity: .6; cursor: default; }
.btn-suave { background: #f3f4f6; color: #4b5563; }
.btn-suave:hover { background: #e5e7eb; }
.ancho { width: 100%; justify-content: center; }

/* ── Login ─────────────────────────────────────────────────────────────── */
.login-fondo {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(135deg,#3d7bc4 0%,#67aa6a 100%);
}
.login-caja { background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.18); width: 100%; max-width: 360px; overflow: hidden; }
.login-cuerpo { padding: 32px; text-align: center; }
.login-cuerpo h1 { margin: 0 0 3px; font-size: 19px; }
.login-cuerpo .sub { margin: 0 0 22px; font-size: 13px; color: #6b7280; }
.login-cuerpo input {
  width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; margin-bottom: 12px; font-family: inherit;
}
.login-cuerpo input:focus { outline: none; border-color: #3d7bc4; box-shadow: 0 0 0 3px rgba(61,123,196,.15); }
.login-pie { border-top: 1px solid #f3f4f6; padding: 12px; text-align: center; font-size: 11.5px; color: #9ca3af; }
.error { color: #dc2626; font-size: 12.5px; margin: 0 0 10px; }

/* ── Cabecera ──────────────────────────────────────────────────────────── */
header { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 50; }
.head-in { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 16px; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: 12px; }
.marca h1 { margin: 0; font-size: 15px; font-weight: 700; }
.marca p  { margin: 1px 0 0; font-size: 12px; color: #6b7280; }
.acciones { display: flex; align-items: center; gap: 10px; }

/* ── Totales ───────────────────────────────────────────────────────────── */
.totales { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 14px; margin: 22px 0; }
.tarjeta { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; }
.tarjeta .rotulo { font-size: 11px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tarjeta .valor  { font-size: 22px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.tarjeta .pie    { font-size: 12px; color: #9ca3af; margin-top: 3px; }
.sube { color: #dc2626; } .baja { color: #16a34a; }

h2.seccion { font-size: 13px; font-weight: 700; color: #4b5563; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.cuenta-chip { background: #e5e7eb; color: #4b5563; border-radius: 99px; padding: 1px 8px; font-size: 11px; }

/* ── Tarjetas de cliente ───────────────────────────────────────────────── */
.grilla { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 14px; }
.cliente {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px;
  cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s;
  position: relative; overflow: hidden; text-align: left; font-family: inherit; width: 100%;
}
.cliente:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); border-color: #d1d5db; }
.cliente:focus-visible { outline: 2px solid #3d7bc4; outline-offset: 2px; }
.cliente::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #e5e7eb; }
.cliente.alto::before  { background: #ef4444; }
.cliente.medio::before { background: #f59e0b; }
.cliente.ok::before    { background: #16a34a; }

.cli-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cli-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cli-logo { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; }
.cli-nombre { font-size: 14px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-cuenta { font-size: 11px; color: #9ca3af; margin: 1px 0 0; }

.etiqueta { border-radius: 99px; padding: 3px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.e-alto  { background: #fee2e2; color: #b91c1c; }
.e-medio { background: #fef3c7; color: #92400e; }
.e-ok    { background: #dcfce7; color: #15803d; }

.metricas { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 12px 0; border-top: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; }
.metrica .m-rot { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.metrica .m-val { font-size: 15px; font-weight: 700; margin-top: 2px; }
.metrica .m-var { font-size: 11px; margin-top: 1px; font-weight: 600; }

.avisos { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; }
.aviso { font-size: 12px; display: flex; align-items: flex-start; gap: 7px; line-height: 1.4; }
.aviso .ico { flex-shrink: 0; margin-top: 1px; }
.aviso.alto { color: #b91c1c; } .aviso.medio { color: #92400e; } .aviso.gris { color: #6b7280; }

.cli-pie { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px solid #f3f4f6; }
.actualizado { font-size: 11px; color: #9ca3af; }
.abrir { font-size: 12px; font-weight: 700; color: #3d7bc4; }

/* ── Alta ──────────────────────────────────────────────────────────────── */
.nuevo {
  border: 2px dashed #d1d5db; background: #fafafa; border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; min-height: 190px; transition: all .15s; color: #6b7280;
  font-family: inherit; width: 100%;
}
.nuevo:hover { border-color: #3d7bc4; background: #f0f6fc; color: #3d7bc4; }
.nuevo .mas { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.nuevo strong { font-size: 13px; }
.nuevo span { font-size: 11.5px; margin-top: 4px; max-width: 210px; line-height: 1.4; }

/* ── Sistema ───────────────────────────────────────────────────────────── */
.sistema { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; margin: 26px 0 40px; overflow: hidden; }
.sistema h3 { margin: 0; padding: 13px 16px; font-size: 13px; font-weight: 700; border-bottom: 1px solid #f3f4f6; }
.sis-fila { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; font-size: 12.5px; border-bottom: 1px solid #f9fafb; gap: 12px; }
.sis-fila:last-child { border-bottom: 0; }
.punto { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 8px; flex-shrink: 0; }
.p-ok { background: #16a34a; } .p-mal { background: #ef4444; } .p-medio { background: #f59e0b; }
.sis-dato { color: #6b7280; font-size: 12px; text-align: right; }

.nota { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #1e40af; margin: 20px 0; line-height: 1.55; }
.nota-alerta { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #92400e; margin: 20px 0; line-height: 1.55; }
.cargando { text-align: center; padding: 60px 0; color: #9ca3af; font-size: 13px; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-fondo { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal-caja { background: #fff; border-radius: 12px; padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-caja h2 { margin: 0 0 6px; font-size: 17px; }
.modal-texto { font-size: 13px; color: #6b7280; margin: 0 0 18px; line-height: 1.5; }
.modal-caja label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.modal-caja label small { font-weight: 400; color: #9ca3af; }
.modal-caja input { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 9px 11px; font-size: 13.5px; margin-bottom: 14px; font-family: inherit; }
.modal-caja input:focus { outline: none; border-color: #3d7bc4; box-shadow: 0 0 0 3px rgba(61,123,196,.15); }
.comando { background: #1f2937; color: #e5e7eb; border-radius: 8px; padding: 12px 13px; font-size: 12px; overflow-x: auto; margin-bottom: 12px; }
.comando code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.modal-pie { font-size: 12px; color: #6b7280; margin: 0 0 18px; }
.modal-botones { display: flex; gap: 10px; }
