:root {
  --idee-primary: #32b5f4;
  --idee-primary-dark: #168fce;
  --idee-bg: #eaf6fc;
  --idee-bg-soft: #f4f8fc;
  --idee-card: #ffffff;
  --idee-card-soft: #f8fcff;
  --idee-border: #b8c7d9;
  --idee-text: #16263d;
  --idee-muted: #52657a;
  --idee-shadow: 0 14px 36px rgba(30, 73, 108, .11);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 38px 20px 50px;
  color: var(--idee-muted);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  background:
    radial-gradient(circle at 8% 5%, rgba(50, 181, 244, .15), transparent 28rem),
    linear-gradient(135deg, var(--idee-bg) 0%, var(--idee-bg-soft) 56%, #edf5fb 100%);
}

/* Tarjeta principal */
.card {
  position: relative;
  width: min(1100px, 100%);
  max-width: 1100px;
  margin: 0 auto;
  padding: 185px 30px 32px;
  overflow: visible;
  background: linear-gradient(145deg, var(--idee-card), var(--idee-card-soft));
  border: 1px solid rgba(184, 199, 217, .72);
  border-radius: 22px;
  box-shadow: var(--idee-shadow);
}

/* Encabezado visual */
.card > h2 {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  min-height: 145px;
  align-items: center;
  margin: 0;
  padding: 28px 34px 49px 126px;
  overflow: hidden;
  color: var(--idee-text);
  font-size: clamp(1.75rem, 3vw, 2.3rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.025em;
  background: linear-gradient(145deg, #fff, #f5fbff);
  border-bottom: 1px solid #d7e4ed;
  border-radius: 22px 22px 0 0;
}

.card > h2::before {
  content: "$";
  position: absolute;
  top: 50%;
  left: 34px;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  color: #087fb9;
  font-size: 34px;
  font-weight: 600;
  background: linear-gradient(145deg, #dff4ff, #c9ecff);
  border: 1px solid #abe0fa;
  border-radius: 18px;
  box-shadow: 0 9px 20px rgba(50, 181, 244, .18);
  transform: translateY(-50%);
}

.card > h2::after {
  content: "Registro de depósitos, retiros y movimientos de inversión.";
  position: absolute;
  bottom: 27px;
  left: 126px;
  color: var(--idee-muted);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

/* Formulario */
.card form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 20px;
  padding: 24px;
  background: rgba(248, 252, 255, .82);
  border: 1px solid #d9e5ee;
  border-radius: 16px;
}

.card input,
.card select {
  width: 100%;
  min-width: 0;
  min-height: 49px;
  padding: 11px 14px;
  color: var(--idee-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  background: #fbfdff;
  border: 1px solid var(--idee-border);
  border-radius: 10px;
  outline: none;
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.card input::placeholder {
  color: #7a8c9e;
  opacity: 1;
}

.card input:hover,
.card select:hover {
  border-color: #8db4d0;
}

.card input:focus,
.card select:focus {
  background: #fff;
  border-color: var(--idee-primary);
  box-shadow: 0 0 0 4px rgba(50, 181, 244, .14);
}

.card input[readonly] {
  color: #536c7e;
  background: #edf6fb;
  border-color: #c2d9e6;
}

.card form > div[style*="position"] {
  min-width: 0;
}

/* Buscador de clientes */
.lista-clientes {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 1000;
  max-height: 230px;
  overflow-y: auto;
  color: var(--idee-text);
  background: #fff;
  border: 1px solid var(--idee-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(30, 73, 108, .16);
}

.lista-clientes:empty {
  display: none;
}

.lista-clientes div {
  padding: 10px 12px !important;
  color: var(--idee-text);
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px solid #e2eaf0 !important;
  cursor: pointer;
}

.lista-clientes div:last-child {
  border-bottom: 0 !important;
}

.lista-clientes div:hover {
  color: #087fb9;
  background: #edf9ff !important;
}

/* Monto y ticket */
.ticket-linea {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: stretch;
  gap: 7px;
}

.ticket-linea input {
  flex: 1;
  width: auto;
  height: auto;
}

.card .btn-ticket {
  display: inline-grid;
  width: 50px;
  min-width: 50px;
  min-height: 49px;
  height: auto;
  margin: 0;
  padding: 0;
  place-items: center;
  color: #fff;
  font-size: 17px;
  background: #29465e;
  border: 1px solid #20394e;
  border-radius: 10px;
  box-shadow: 0 7px 15px rgba(41, 70, 94, .18);
  cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.card .btn-ticket:hover {
  background: #20394e;
  box-shadow: 0 9px 18px rgba(41, 70, 94, .25);
  transform: translateY(-2px);
}

/* Acción principal y enlace */
.card button[type="submit"] {
  grid-column: 1 / -1;
  min-height: 50px;
  margin-top: 4px;
  padding: 12px 22px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--idee-primary), var(--idee-primary-dark));
  border: 1px solid var(--idee-primary-dark);
  border-radius: 11px;
  box-shadow: 0 9px 20px rgba(22, 143, 206, .22);
  cursor: pointer;
  transition: box-shadow .2s ease, filter .2s ease, transform .2s ease;
}

.card button[type="submit"]:hover {
  filter: brightness(.96);
  box-shadow: 0 12px 24px rgba(22, 143, 206, .3);
  transform: translateY(-2px);
}

.card button:focus-visible,
.card a:focus-visible {
  outline: 3px solid rgba(50, 181, 244, .3);
  outline-offset: 2px;
}

.card form > a {
  grid-column: 1 / -1;
  justify-self: center;
  color: #087fb9 !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .025em;
  text-decoration: none !important;
}

.card form > a:hover {
  color: var(--idee-primary-dark) !important;
  text-decoration: underline !important;
}

/* Componentes auxiliares disponibles en el módulo */
.info-cliente,
.totales {
  padding: 14px;
  color: var(--idee-text);
  background: #f2f9fd;
  border: 1px solid #d5e4ee;
  border-radius: 11px;
}

.totales {
  display: flex;
  gap: 10px;
  justify-content: space-around;
  margin: 15px 0;
  font-weight: 600;
}

.totales p {
  min-width: 160px;
  padding: 10px 14px;
  text-align: center;
  border-radius: 9px;
}

table {
  width: 100%;
  margin-top: 15px;
  color: var(--idee-text);
  font-size: 13.5px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #d3dfe9;
  border-radius: 12px;
  overflow: hidden;
}

th {
  padding: 12px 10px;
  color: #fff;
  font-weight: 600;
  background: #29465e;
  border: 0;
}

td {
  padding: 10px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #dce5ed;
}

tbody tr:nth-child(even) td {
  background: #f5faff;
}

tbody tr:hover td {
  background: #eaf7fd;
}

.neg {
  color: #bd3545;
  font-weight: 600;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 800px) {
  body {
    padding: 20px 13px 35px;
  }

  .card {
    padding: 168px 18px 22px;
    border-radius: 17px;
  }

  .card > h2 {
    min-height: 133px;
    padding: 23px 17px 48px 82px;
    border-radius: 17px 17px 0 0;
  }

  .card > h2::before {
    left: 17px;
    width: 50px;
    height: 50px;
    font-size: 25px;
    border-radius: 14px;
  }

  .card > h2::after {
    right: 15px;
    bottom: 21px;
    left: 82px;
    font-size: .84rem;
  }

  .card form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 18px;
  }
}

@media (max-width: 570px) {
  .card form {
    grid-template-columns: 1fr;
  }

  .card button[type="submit"],
  .card form > a {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
