/* Presupuestos por teléfono — estilos sobre los tokens de marca.
   La paleta vive en tokens.css (identidad corporativa oficial); aquí no se
   escriben colores literales, solo variables. */

* { box-sizing: border-box; }

/* El navegador oculta [hidden] con una regla muy débil, y cualquier "display"
   propio se la come. Como la entrada, el tablero y la ficha se muestran y se
   esconden con esa propiedad desde el JavaScript, aquí se le da la fuerza que
   le falta. Sin esto, la ficha sale abierta y vacía nada más cargar. */
[hidden] { display: none !important; }

body { font-size: 15px; line-height: 1.55; }

.logo {
  width: 205px;
  height: 44px;
  background-image: url("img/sprite-logo.png");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 205px auto;
  flex: none;
}

/* Entrada ------------------------------------------------------------------ */
.entrada {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.entrada form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 32px;
  width: 100%;
  max-width: 380px;
}
.entrada h1 { font-size: 18px; margin: 18px 0 22px; color: var(--ink); }
.entrada button { width: 100%; margin-top: 8px; }

/* Cabecera ----------------------------------------------------------------- */
header {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}

.separador { width: 1px; height: 30px; background: var(--line-2); }

.titulo { display: flex; flex-direction: column; line-height: 1.2; }
.titulo strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.titulo span {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

nav { display: flex; gap: 4px; margin-left: auto; }

.tab {
  border: 0;
  background: none;
  color: var(--ink-2);
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { background: var(--brand-soft); color: var(--brand-ink); }
.tab.active { background: var(--brand); color: #fff; }

.quien { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); }

.enlace {
  background: none;
  border: 0;
  color: var(--brand-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
}

main { padding: 22px; }
.panel { display: none; }
.panel.active { display: block; }

/* Tablero ------------------------------------------------------------------ */
.tablero {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 12px;
}

.columna {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 160px;
  transition: background 0.15s, border-color 0.15s;
}
.columna.encima { background: var(--brand-soft); border-color: var(--brand); }

.columna > header {
  position: static;
  box-shadow: none;
  background: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  gap: 8px;
  justify-content: space-between;
}
.columna > header strong { font-size: 14px; color: var(--ink); }
.columna > header span { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.tarjetas { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.vacia { color: var(--ink-3); font-size: 13px; text-align: center; padding: 14px 0; margin: 0; }

.tarjeta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.1s;
}
.tarjeta:hover { border-color: var(--brand); }
.tarjeta.arrastrando { opacity: 0.45; transform: rotate(1.5deg); }

.tarjeta .cabeza {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.tarjeta .cabeza strong { font-size: 14px; }
.tarjeta .importe {
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  padding: 1px 7px;
  border-radius: 99px;
  white-space: nowrap;
  font-size: 12px;
}
.tarjeta .contacto {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.tarjeta .tel { font-size: 13px; color: var(--ink-2); }
.tarjeta .tel.falta { color: var(--ink-3); font-style: italic; }

/* Cliente de siempre u oportunidad nueva. Verde el que ya compra, ámbar el que
   todavía no: son dos llamadas distintas. */
.tipo {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.tipo.cliente { color: var(--ok); background: var(--ok-soft); }
.tipo.oportunidad { color: var(--warn); background: var(--warn-soft); }
.tarjeta .productos { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.tarjeta .pie {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Ficha -------------------------------------------------------------------- */
.ficha {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 40, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 20;
}
.ficha-caja {
  background: var(--surface);
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 26px 28px 40px;
  position: relative;
}
.cerrar {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 8px;
}
.cerrar:hover { color: var(--ink); background: none; }

.ficha h2 { margin: 0; font-size: 19px; }
.ficha h2 .tipo { vertical-align: middle; margin-left: 9px; }
.ficha h3 { font-size: 14px; margin: 26px 0 8px; }

.datos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin: 18px 0 22px; }
.datos dt { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.datos dd { margin: 2px 0 0; font-weight: 500; }
.datos a { color: var(--brand-ink); }

.lineas { width: 100%; border-collapse: collapse; font-size: 13px; }
.lineas th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
  padding: 6px 8px;
}
.lineas td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lineas .num { text-align: right; white-space: nowrap; }
.lineas .ref { display: block; font-size: 11px; color: var(--ink-3); }
.lineas .personalizacion td { font-size: 12px; color: var(--ink-3); padding-top: 0; border-bottom: 0; }

.llamar {
  margin: 24px 0 0;
  padding: 16px;
  background: var(--panel);
  border-radius: 10px;
  text-align: center;
}
.llamar button { width: 100%; }

.nota {
  background: var(--surface-2);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.nota .quien { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }

/* Usuarios ----------------------------------------------------------------- */
.usuario {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 8px;
}
.usuario .hint { display: block; }

/* Formularios -------------------------------------------------------------- */
form label { display: block; margin-bottom: 16px; font-weight: 600; font-size: 14px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row label { flex: 1; min-width: 180px; }

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.hint { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-top: 3px; }

/* El verde es solo para la acción principal de cada pantalla. */
button {
  background: var(--cta);
  color: var(--cta-ink);
  border: 0;
  padding: 11px 20px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 0.15s;
}
button:hover { background: var(--cta-hover); }
button:disabled { background: var(--line-2); color: var(--ink-3); cursor: not-allowed; }

button.danger {
  background: transparent;
  color: #c0392b;
  border: 1px solid #c0392b;
  padding: 6px 12px;
  font-size: 13px;
}
button.danger:hover { background: var(--warn-soft); }

.actions { display: flex; gap: 10px; align-items: center; margin: 14px 0 26px; flex-wrap: wrap; }
.msg { color: var(--ink-3); font-size: 13px; }
.msg.err { color: #c0392b; }
.msg.ok { color: var(--ok); }

.empty { color: var(--ink-3); padding: 40px 24px; text-align: center; }
