/* Mi Taller | Cristi Costura — rosa degradado, letras Fredoka (logo) y Poppins, como los diseños de Cristi */
:root {
  --fondo: #fff5f7;
  --tarjeta: #ffffff;
  --rosa-claro: #ffe4e9;
  --rosa: #ffd0d9;
  --marca: #d94a6c;        /* rosa fuerte: botones (se lee bien con letra blanca) */
  --marca-hover: #c33b5c;
  --barra: #3f383b;        /* letra del menú lateral */
  --degradado: linear-gradient(180deg, #ff8197 0%, #ffb3c1 55%, #ffd9de 100%);
  --texto: #463c40;
  --suave: #8c7a80;
  --linea: #fbe0e6;
  --verde: #2f8a5b;
  --verde-claro: #e2f4ea;
  --ambar: #a86b0c;
  --ambar-claro: #fdf0d6;
  --azul: #3c6aa8;
  --azul-claro: #e4edfa;
  --rojo: #c0392b;
  --rojo-claro: #fbe3e0;
  --gris-claro: #efe9ea;
  --sombra: 0 1px 2px rgba(217, 74, 108, .06), 0 6px 20px rgba(217, 74, 108, .08);
  --abajo: env(safe-area-inset-bottom, 0px);
  --arriba: env(safe-area-inset-top, 0px);
  --letra: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --firma: "Fredoka", "Poppins", sans-serif;
  /* la florecita de 4 pétalos del logo */
  --flor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='6' cy='6' r='5'/%3E%3Ccircle cx='14' cy='6' r='5'/%3E%3Ccircle cx='6' cy='14' r='5'/%3E%3Ccircle cx='14' cy='14' r='5'/%3E%3Crect x='5' y='5' width='10' height='10'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.5 var(--letra); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--marca); }
.cargando { text-align: center; padding: 30vh 20px; color: var(--suave); }

/* ---------- Estructura: menú lateral (compu/iPad) o barra de abajo (iPhone) ---------- */
.marco { display: flex; min-height: 100vh; }
.lateral { display: none; }
.contenido { flex: 1; min-width: 0; padding: calc(14px + var(--arriba)) 16px calc(92px + var(--abajo)); max-width: 1100px; margin: 0 auto; }
.abajo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .92); border-top: 1px solid var(--linea); padding: 0 2px var(--abajo);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.abajo button { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; font-size: 10.5px; color: var(--suave); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.abajo button.activo { color: var(--marca); font-weight: 700; }
@media (min-width: 900px) {
  .lateral {
    display: flex; flex-direction: column; gap: 4px; width: 220px; flex: none; position: sticky; top: 0; height: 100vh;
    background: var(--degradado); color: var(--barra); padding: 22px 14px; overflow: hidden;
  }
  .lateral .logo { margin: 0 0 18px; position: relative; }
  .lateral button { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; padding: 10px 12px; border-radius: 12px; cursor: pointer; text-align: left; font-weight: 600; position: relative; }
  .lateral button:hover { background: rgba(255, 255, 255, .35); }
  .lateral button.activo { background: #fff; color: var(--marca); box-shadow: 0 4px 14px rgba(217, 74, 108, .18); }
  .lateral .pie { margin-top: auto; font-size: 13px; opacity: .85; padding: 0 12px; }
  .abajo { display: none; }
  .contenido { padding: 28px 32px 40px; }
}
/* Logo "Cristi" blanco con florecitas en las íes + "Taller de costura" */
.logo { text-align: center; color: #fff; line-height: 1; }
.logo .cristi { display: inline-block; font: 600 46px/1 var(--firma); letter-spacing: .5px; text-shadow: 0 2px 6px rgba(200, 60, 95, .25); }
.logo .cristi i { font-style: normal; position: relative; }
.logo .cristi i::before { content: ""; position: absolute; left: 50%; top: .03em; width: .28em; height: .28em; transform: translateX(-50%); background: currentColor; -webkit-mask: var(--flor) center / contain no-repeat; mask: var(--flor) center / contain no-repeat; }
.logo small { display: block; font: 300 15px/1.2 var(--letra); margin-top: 6px; }
.decor { position: absolute; width: 90px; height: 90px; background: rgba(255, 255, 255, .3); -webkit-mask: var(--flor) center / contain no-repeat; mask: var(--flor) center / contain no-repeat; pointer-events: none; }
.caja-titulo { background: rgba(255, 228, 233, .9); border: 3px solid rgba(255, 255, 255, .8); padding: 10px 14px; font-weight: 800; text-transform: uppercase; color: #463c40; text-align: center; line-height: 1.2; }
/* Portada del inicio */
.portada { position: relative; overflow: hidden; background: var(--degradado); border-radius: 22px; padding: 26px 18px 18px; margin-bottom: 14px; box-shadow: var(--sombra); }
.portada .decor { top: 10px; left: 12px; width: 64px; height: 64px; }
.portada .caja-titulo { margin: 16px auto 8px; max-width: 420px; font-size: 18px; }
.portada .nota { color: #6b5a60; text-align: center; }

/* ---------- Encabezado de cada pantalla ---------- */
.cabeza { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cabeza h1 { font-size: 25px; font-weight: 700; flex: 1; min-width: 0; letter-spacing: -.2px; }
.cabeza .icono-titulo { color: var(--marca); display: flex; }
.volver { border: 0; background: var(--tarjeta); box-shadow: var(--sombra); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--marca); flex: none; }

/* ---------- Piezas ---------- */
.tarjeta { background: var(--tarjeta); border-radius: 18px; padding: 16px; box-shadow: var(--sombra); border: 1px solid var(--linea); margin-bottom: 12px; }
.tarjeta h2 { font-size: 16.5px; font-weight: 700; margin-bottom: 10px; }
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; min-height: 44px; padding: 10px 16px;
  background: var(--marca); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.boton:hover { background: var(--marca-hover); }
.boton.claro { background: var(--rosa-claro); color: var(--marca); }
.boton.claro:hover { background: var(--rosa); }
.boton.verde { background: #25a35a; }
.boton.peligro { background: var(--rojo-claro); color: var(--rojo); }
.boton.chico { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.boton[disabled] { opacity: .5; cursor: default; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.botones .boton { flex: 1; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--gris-claro); color: var(--suave); }
.chip.Pendiente { background: var(--gris-claro); color: #6d5b60; }
.chip.En.proceso, .chip.proceso { background: var(--ambar-claro); color: var(--ambar); }
.chip.Listo { background: var(--azul-claro); color: var(--azul); }
.chip.Entregado { background: var(--verde-claro); color: var(--verde); }
.chip.Cancelado { background: var(--rojo-claro); color: var(--rojo); }
.chip.urgente { background: var(--rojo-claro); color: var(--rojo); }

.pestanas { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.pestanas button { border: 1px solid var(--linea); background: var(--tarjeta); padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--suave); cursor: pointer; white-space: nowrap; }
.pestanas button.activo { background: var(--marca); border-color: var(--marca); color: #fff; }

.buscador { display: flex; align-items: center; gap: 8px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 12px; padding: 0 12px; margin-bottom: 12px; color: var(--suave); }
.buscador input { border: 0; outline: 0; background: none; flex: 1; padding: 11px 0; min-width: 0; color: var(--texto); }

/* Listas tipo tabla que en iPhone se vuelven renglones */
.lista { background: var(--tarjeta); border-radius: 18px; box-shadow: var(--sombra); border: 1px solid var(--linea); overflow: hidden; margin-bottom: 12px; }
.fila { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--linea); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.fila:first-child { border-top: 0; }
.fila:hover { background: #fdf7f8; }
.fila .principal { flex: 1; min-width: 0; }
.fila .principal b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .principal span { display: block; font-size: 13.5px; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila .lado { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 14px; }
.fila .lado b { font-size: 15px; }
.fila.atrasado { box-shadow: inset 4px 0 0 var(--rojo); }
.vacio { padding: 26px 16px; text-align: center; color: var(--suave); }
.subtitulo { font-size: 13px; font-weight: 800; color: var(--suave); text-transform: uppercase; letter-spacing: 1px; margin: 18px 4px 8px; }

.mosaico { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .mosaico { grid-template-columns: repeat(4, 1fr); } }
.mosaico button { border: 1px solid var(--linea); background: linear-gradient(160deg, #fff, var(--rosa-claro)); border-radius: 18px; padding: 14px; text-align: left; cursor: pointer; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 6px; }
.mosaico button svg { color: var(--marca); }
.mosaico b { font-size: 16.5px; }
.mosaico span { font-size: 13px; color: var(--suave); }

.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 700px) { .cifras { grid-template-columns: repeat(4, 1fr); } }
.cifra { background: var(--tarjeta); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--linea); box-shadow: var(--sombra); }
.cifra span { font-size: 13px; color: var(--suave); display: block; }
.cifra b { font-size: 22px; font-weight: 800; }
.cifra small { display: block; font-size: 12px; color: var(--suave); }
.gana { color: var(--verde); }
.pierde { color: var(--rojo); }

.dos { display: grid; gap: 12px; }
@media (min-width: 900px) { .dos { grid-template-columns: 1fr 1fr; align-items: start; } }

.linea { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; }
.linea + .linea { border-top: 1px dashed var(--linea); }
.linea span:first-child { color: var(--suave); }
.total { font-size: 28px; font-weight: 800; color: var(--marca); }
.nota { font-size: 13.5px; color: var(--suave); }
.ayuda { background: var(--rosa-claro); border-radius: 14px; padding: 10px 14px; font-size: 14px; margin: 10px 0; }
.alerta { background: var(--ambar-claro); color: #7a4e08; border-radius: 14px; padding: 10px 14px; font-size: 14px; margin: 10px 0; }

/* Barras de las gráficas */
.barra { margin: 8px 0; }
.barra .etiqueta { display: flex; justify-content: space-between; font-size: 14px; gap: 8px; }
.barra .fondo { height: 9px; background: var(--gris-claro); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.barra .relleno { height: 100%; background: var(--marca); border-radius: 5px; }
.columnas { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.columnas .grupo { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.columnas .par { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.columnas .col { width: 40%; max-width: 26px; border-radius: 6px 6px 0 0; min-height: 2px; }
.columnas .entra { background: var(--marca); }
.columnas .sale { background: #ffb3c1; }
.columnas small { font-size: 11px; color: var(--suave); white-space: nowrap; }
.leyenda { display: flex; gap: 14px; font-size: 13px; color: var(--suave); margin-top: 8px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Formularios ---------- */
label { display: block; font-size: 14px; font-weight: 700; margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; border: 1px solid #f3cfd8; background: #fff; border-radius: 12px; padding: 11px 12px; outline: none; min-height: 44px;
}
input:focus, select:focus, textarea:focus { border-color: var(--marca); box-shadow: 0 0 0 3px rgba(217, 74, 108, .15); }
textarea { min-height: 80px; resize: vertical; }
.casilla { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 14px 0 4px; }
.casilla input { width: 22px; height: 22px; min-height: 0; accent-color: var(--marca); }
.par-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.calculo { background: var(--rosa-claro); border-radius: 14px; padding: 12px 14px; margin-top: 14px; }
.calculo b { font-size: 24px; display: block; }

.velo { position: fixed; inset: 0; z-index: 50; background: rgba(70, 60, 64, .35); display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: var(--fondo); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--abajo)); animation: sube .2s ease-out; }
.hoja h2 { font-size: 21px; font-weight: 800; }
.hoja .titulo-hoja { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cerrar { border: 0; background: var(--rosa-claro); color: var(--marca); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; flex: none; }
@media (min-width: 700px) { .velo { align-items: center; } .hoja { border-radius: 22px; } }
@keyframes sube { from { transform: translateY(30px); opacity: 0; } }

/* Renglones del cotizador */
.renglon { display: grid; grid-template-columns: 1fr 74px 96px 30px; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--linea); }
.renglon:first-of-type { border-top: 0; }
.renglon input { min-height: 38px; padding: 7px 8px; font-size: 15px; }
.renglon .nombre { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.renglon .nombre small { display: block; font-weight: 400; color: var(--suave); font-size: 12px; }
.quitar { border: 0; background: none; color: var(--suave); cursor: pointer; font-size: 20px; padding: 0; }
.encabezado-renglon { display: grid; grid-template-columns: 1fr 74px 96px 30px; gap: 6px; font-size: 12px; color: var(--suave); font-weight: 700; }

/* Entrada con PIN */
body:has(.entrada) { background: var(--degradado) fixed; min-height: 100vh; }
.entrada { position: relative; max-width: 400px; margin: 0 auto; padding: calc(12vh + var(--arriba)) 20px 40px; text-align: center; }
.entrada .decor { top: calc(14px + var(--arriba)); left: 4px; }
.entrada .logo .cristi { font-size: 72px; }
.entrada .logo small { font-size: 21px; }
.entrada .caja-titulo { margin: 24px 0 14px; font-size: 15px; text-transform: none; font-weight: 600; }
.entrada p { color: var(--texto); }
.entrada input { text-align: center; font-size: 26px; letter-spacing: 10px; margin-top: 8px; }
.entrada .boton { width: 100%; margin-top: 14px; }

.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--abajo)); z-index: 60; background: var(--texto); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--sombra); max-width: 90vw; text-align: center; }
.aviso.error { background: var(--rojo); }
@media (min-width: 900px) { .aviso { bottom: 30px; } }
@media (max-width: 520px) {
  .cabeza h1 { font-size: 23px; }
  .cabeza > .boton { min-height: 40px; padding: 8px 12px; font-size: 15px; }
}
.dos > div { min-width: 0; }
.contenido { overflow-x: hidden; }
.columnas-precios { columns: 2 380px; column-gap: 12px; }
.columnas-precios > div { break-inside: avoid; display: inline-block; width: 100%; }
/* Límites de trabajos en Ajustes */
.fila-limite { display: grid; grid-template-columns: auto 64px 1fr 30px; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--linea); }
.fila-limite:first-child { border-top: 0; }
.fila-limite input, .fila-limite select { min-height: 40px; padding: 7px 8px; }
.fila-limite [data-l=meses] { grid-column: 2 / 4; }
.fila-limite .quitar { grid-row: 1; grid-column: 4; }
.fila-limite small { grid-column: 2 / 5; font-size: 12.5px; }
#limites { margin-bottom: 8px; }
