/* ============================================================
   Recetario v2 — Estilos
   Paleta: pasteles alegres y armoniosos (fresa, durazno, miel, salvia, lila)
   Tipografía: Fraunces (display) + Inter (UI)
   ============================================================ */

:root {
  /* ─── Paleta ─────────────────────────────────────────────── */
  --bg:        #FFF8F0;        /* crema muy clara, cálida */
  --bg-2:      #FBEEDD;        /* crema un punto más cálida */
  --surface:   #FFFFFF;
  --surface-2: #FFFAF3;

  /* Acentos pasteles alegres */
  --strawberry:      #F8B5C1;
  --strawberry-deep: #D9536A;
  --strawberry-soft: #FDE7EC;

  --peach:      #FFCBA4;
  --peach-deep: #E68250;
  --peach-soft: #FFEEDD;

  --honey:      #F5D77A;
  --honey-deep: #C99518;
  --honey-soft: #FBEFC2;

  --sage:      #B5D3B0;
  --sage-deep: #4F8C5B;
  --sage-soft: #E2F0DE;

  --lilac:      #C9B8E3;
  --lilac-deep: #7459A8;
  --lilac-soft: #EFE7F8;

  --sky:       #B5D8E8;
  --sky-deep:  #3F7896;

  /* Texto */
  --text:    #2A1F2D;
  --text-2:  #5A4A60;
  --text-3:  #8E7E94;
  --text-on-dark: #FFFAF3;

  /* Estructura */
  --border:        #E8DCD0;
  --border-strong: #C9B8AB;
  --shadow:        0 4px 24px rgba(88, 50, 70, 0.08);
  --shadow-lg:     0 12px 40px rgba(88, 50, 70, 0.14);
  --shadow-card:   0 2px 12px rgba(88, 50, 70, 0.06);

  /* Semantic */
  --warn:    #B9444E;
  --warn-bg: #FCE7EA;
  --ok:      #4F8C5B;
  --ok-bg:   #E2F0DE;

  /* Layout */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body { min-height: 100vh; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
input, select, textarea { background: none; border: none; outline: none; }

a { color: var(--strawberry-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ─── Vistas ─────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }
#login-view.active { display: flex; }
#app-view.active   { display: flex; flex-direction: column; min-height: 100vh; }

.subview { display: none; }
.subview.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* ╔══════════════════════════════════════════════════════════════
   LOGIN
   ╚══════════════════════════════════════════════════════════════ */
#login-view {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--strawberry-soft) 0%, var(--peach-soft) 35%, var(--honey-soft) 65%, var(--lilac-soft) 100%);
  padding: 24px;
}

.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bg-blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.blob-1 { width: 380px; height: 380px; background: var(--strawberry); top: -120px; left: -80px; }
.blob-2 { width: 320px; height: 320px; background: var(--lilac); bottom: -100px; right: -60px; }
.blob-3 { width: 260px; height: 260px; background: var(--honey); top: 40%; right: 20%; opacity: .35; }

.bg-emoji { position: absolute; opacity: .18; user-select: none; }
.em-1 { font-size: 120px; top: 8%; left: 6%; transform: rotate(-12deg); }
.em-2 { font-size: 100px; bottom: 10%; right: 8%; transform: rotate(14deg); }
.em-3 { font-size: 80px;  top: 22%; right: 14%; transform: rotate(-8deg); }

.login-card {
  position: relative; z-index: 1;
  background: var(--surface);
  width: 100%; max-width: 440px;
  padding: 48px 40px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: cardIn .5s cubic-bezier(.22,1,.36,1);
}
@keyframes cardIn { from{opacity:0;transform:translateY(20px) scale(.97)} to{opacity:1;transform:translateY(0) scale(1)} }

.login-brand { text-align: center; margin-bottom: 36px; }
.brand-mark {
  display: inline-block; font-size: 24px; color: var(--strawberry-deep);
  margin-bottom: 4px;
}
.brand-title {
  font-family: var(--font-display); font-weight: 900; font-size: 38px;
  letter-spacing: -1px; color: var(--text); line-height: 1;
}
.brand-title em { font-style: italic; font-weight: 500; color: var(--strawberry-deep); }
.brand-sub {
  margin-top: 8px; font-size: 13px; color: var(--text-3);
  font-style: italic; letter-spacing: .2px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 13px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus {
  border-color: var(--strawberry-deep);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--strawberry-soft);
}

.error-text {
  color: var(--warn); font-size: 13px; font-weight: 600;
  text-align: center; margin-top: 14px; min-height: 18px;
}

/* ╔══════════════════════════════════════════════════════════════
   BOTONES
   ╚══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; letter-spacing: .2px;
  transition: transform .1s, background .2s, box-shadow .2s, color .2s, border-color .2s;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--strawberry-deep); color: #fff;
  padding: 13px 22px;
}
.btn-primary:hover { background: #C0445A; box-shadow: var(--shadow); }

.btn-secondary {
  background: var(--surface); color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--strawberry-deep); color: var(--strawberry-deep); }

.btn-ghost {
  background: transparent; color: var(--text-2);
}
.btn-ghost:hover { background: var(--strawberry-soft); color: var(--strawberry-deep); }

.btn-success {
  background: var(--sage-deep); color: #fff;
}
.btn-success:hover { background: #3F7549; }

.btn-danger {
  background: var(--warn); color: #fff;
}
.btn-danger:hover { background: #9A363F; }

.btn-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-2);
  border: 2px solid var(--border);
  background: var(--surface);
  transition: all .2s;
}
.btn-icon:hover { border-color: var(--strawberry-deep); color: var(--strawberry-deep); }

.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  margin-bottom: 20px;
  transition: all .2s;
}
.btn-back:hover { border-color: var(--strawberry-deep); color: var(--strawberry-deep); }

/* ╔══════════════════════════════════════════════════════════════
   HEADER + NAV
   ╚══════════════════════════════════════════════════════════════ */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 8px; }
.header-brand .brand-mark { font-size: 20px; margin: 0; }
.header-title {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: var(--text); letter-spacing: -.5px;
}
.header-actions { display: flex; align-items: center; gap: 6px; }

.btn-nav {
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-pill);
  transition: all .2s;
}
.btn-nav:hover { background: var(--strawberry-soft); color: var(--strawberry-deep); }
.btn-nav.active {
  background: var(--strawberry-deep); color: #fff;
}

/* ╔══════════════════════════════════════════════════════════════
   MAIN
   ╚══════════════════════════════════════════════════════════════ */
.app-main {
  flex: 1; width: 100%; max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: 40px; line-height: 1; letter-spacing: -1.2px;
  color: var(--text);
}
.page-sub {
  margin-top: 6px; color: var(--text-3);
  font-size: 13px; font-weight: 500;
}

/* ╔══════════════════════════════════════════════════════════════
   FILTROS + SEARCH
   ╚══════════════════════════════════════════════════════════════ */
.filters-bar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 28px;
  flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 16px; pointer-events: none;
}
.search-input, .search-wrap input {
  width: 100%; padding: 11px 16px 11px 40px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  transition: all .2s;
}
.search-input { padding-left: 16px; min-width: 200px; }
.search-wrap input:focus, .search-input:focus {
  border-color: var(--strawberry-deep);
  box-shadow: 0 0 0 4px var(--strawberry-soft);
}

.select {
  padding: 10px 38px 10px 16px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%238E7E94' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 14px center;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  transition: all .2s;
}
.select:hover { border-color: var(--strawberry-deep); color: var(--strawberry-deep); }
.select:focus { border-color: var(--strawberry-deep); box-shadow: 0 0 0 4px var(--strawberry-soft); }

/* ╔══════════════════════════════════════════════════════════════
   GRILLA DE RECETAS
   ╚══════════════════════════════════════════════════════════════ */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.recipe-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  animation: cardPop .35s cubic-bezier(.22,1,.36,1) both;
}
@keyframes cardPop { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--strawberry);
}

.recipe-card-img {
  width: 100%; height: 190px;
  object-fit: cover; display: block;
  background: var(--peach-soft);
}
.recipe-card-img-placeholder {
  width: 100%; height: 190px;
  background: linear-gradient(135deg, var(--strawberry-soft), var(--honey-soft), var(--lilac-soft));
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; opacity: .8;
}
.recipe-card-body { padding: 16px 18px 20px; }
.recipe-card-cat {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--strawberry-deep);
  background: var(--strawberry-soft);
  padding: 3px 9px; border-radius: var(--radius-pill);
  margin-bottom: 8px;
}
.recipe-card-cat.is-base {
  color: var(--lilac-deep);
  background: var(--lilac-soft);
}
.recipe-card-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  line-height: 1.15; color: var(--text);
  margin-bottom: 8px;
}
.recipe-card-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
}
.recipe-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

.empty-state {
  grid-column: 1/-1;
  text-align: center; padding: 60px 20px;
  color: var(--text-3);
}
.empty-state .em { font-size: 56px; margin-bottom: 10px; }
.empty-state h3 { font-family: var(--font-display); font-size: 24px; color: var(--text-2); margin-bottom: 6px; }

/* ╔══════════════════════════════════════════════════════════════
   DETALLE DE RECETA
   ╚══════════════════════════════════════════════════════════════ */
.detail-hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px; margin-bottom: 32px;
}
@media (max-width: 760px) {
  .detail-hero { grid-template-columns: 1fr; }
}
.detail-hero-img {
  width: 100%; height: 360px; object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--peach-soft);
}
.detail-hero-img-placeholder {
  width: 100%; height: 360px;
  background: linear-gradient(135deg, var(--strawberry-soft), var(--honey-soft), var(--lilac-soft));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center; font-size: 100px;
}
.detail-info { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.detail-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: 44px; line-height: 1.05; letter-spacing: -1.4px;
  color: var(--text);
}
.detail-cat {
  display: inline-block; align-self: flex-start;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--strawberry-deep);
  background: var(--strawberry-soft);
  padding: 4px 12px; border-radius: var(--radius-pill);
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; color: var(--text-2); }
.detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.etapa {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.etapa-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.etapa-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--strawberry-deep); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.etapa-nombre {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; color: var(--text);
}
.etapa-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
}
@media (max-width: 720px) { .etapa-grid { grid-template-columns: 1fr; } }
.etapa-ing-title, .etapa-proc-title {
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 8px;
}
.etapa-ing-list { list-style: none; }
.etapa-ing-list li {
  padding: 7px 0; border-bottom: 1px dashed var(--border);
  display: flex; justify-content: space-between; gap: 10px; font-size: 14px;
}
.etapa-ing-list li:last-child { border-bottom: none; }
.etapa-ing-list .qty { color: var(--text-3); font-variant-numeric: tabular-nums; }
.etapa-proceso {
  font-size: 15px; line-height: 1.65; color: var(--text-2);
  white-space: pre-wrap;
}

.bases-block {
  background: var(--lilac-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.bases-block strong { color: var(--lilac-deep); }
.base-chip {
  background: var(--surface); padding: 5px 12px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  color: var(--lilac-deep); cursor: pointer;
  border: 1px solid var(--lilac);
  transition: all .2s;
}
.base-chip:hover { background: var(--lilac); color: #fff; }

/* ╔══════════════════════════════════════════════════════════════
   FORMULARIO
   ╚══════════════════════════════════════════════════════════════ */
.form-section {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.form-section-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  margin-bottom: 16px; color: var(--text);
}
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-2);
}
.form-field input, .form-field textarea, .form-field select {
  padding: 11px 14px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all .2s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  background: var(--surface);
  border-color: var(--strawberry-deep);
  box-shadow: 0 0 0 4px var(--strawberry-soft);
}
.form-field textarea { min-height: 110px; resize: vertical; font-family: inherit; line-height: 1.55; }

.form-image-block {
  display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center;
}
@media (max-width: 600px) { .form-image-block { grid-template-columns: 1fr; } }
.form-image-preview {
  width: 100%; height: 150px;
  border-radius: var(--radius); object-fit: cover;
  background: var(--peach-soft);
  border: 2px dashed var(--border);
}
.form-image-actions { display: flex; flex-direction: column; gap: 8px; }
.form-image-actions input[type="file"] { display: none; }

/* Etapas en formulario */
.etapa-editor {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.etapa-editor-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.etapa-editor-head input {
  flex: 1; padding: 9px 12px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
}
.etapa-ing-row {
  display: grid; grid-template-columns: 2fr 80px 70px 36px;
  gap: 6px; margin-bottom: 6px; align-items: center;
}
.etapa-ing-row input, .etapa-ing-row select {
  padding: 8px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.btn-row-remove {
  width: 32px; height: 32px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
  transition: all .2s;
}
.btn-row-remove:hover { background: var(--warn); color: #fff; }

.btn-row-add {
  margin-top: 8px;
  padding: 7px 14px;
  background: var(--sage-soft); color: var(--sage-deep);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
}
.btn-row-add:hover { background: var(--sage); color: #fff; }

/* Autocomplete dropdown */
.ing-autocomplete { position: relative; }
.ing-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 220px; overflow-y: auto;
  margin-top: 4px;
}
.ing-dropdown-item {
  padding: 9px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.ing-dropdown-item:last-child { border-bottom: none; }
.ing-dropdown-item:hover { background: var(--strawberry-soft); }
.ing-dropdown-item.new { color: var(--sage-deep); font-weight: 600; }

/* ╔══════════════════════════════════════════════════════════════
   INGREDIENTES
   ╚══════════════════════════════════════════════════════════════ */
.ing-list {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ing-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 80px;
  gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background .15s;
}
.ing-row:last-child { border-bottom: none; }
.ing-row:hover { background: var(--surface-2); }
.ing-row.stale { background: var(--warn-bg); }
.ing-row .ing-name { font-weight: 600; color: var(--text); }
.ing-row .ing-prov, .ing-row .ing-cost, .ing-row .ing-fecha {
  font-size: 13px; color: var(--text-2);
}
.ing-row .ing-actions { display: flex; gap: 4px; justify-content: flex-end; }

@media (max-width: 640px) {
  .ing-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn);
  margin-bottom: 18px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}

/* ╔══════════════════════════════════════════════════════════════
   MODAL
   ╚══════════════════════════════════════════════════════════════ */
.modal-root {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(42, 31, 45, 0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: cardIn .25s cubic-bezier(.22,1,.36,1);
}
.modal-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 24px; margin-bottom: 16px; color: var(--text);
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px; flex-wrap: wrap;
}

/* ╔══════════════════════════════════════════════════════════════
   TOAST + LOADER
   ╚══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--text-on-dark);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.22,1,.36,1);
  pointer-events: auto;
  max-width: 360px;
}
.toast.success { background: var(--sage-deep); }
.toast.error   { background: var(--warn); }
@keyframes toastIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

.loading-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(255, 248, 240, 0.7);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.loader {
  width: 44px; height: 44px;
  border: 4px solid var(--strawberry-soft);
  border-top-color: var(--strawberry-deep);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ╔══════════════════════════════════════════════════════════════
   COSTOS
   ╚══════════════════════════════════════════════════════════════ */
.costos-table {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.costos-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center; font-size: 14px;
}
.costos-row.header {
  background: var(--surface-2);
  font-weight: 700; font-size: 12px;
  letter-spacing: .8px; text-transform: uppercase; color: var(--text-3);
}
.costos-row .num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.costos-row .num.cost { color: var(--peach-deep); }
.costos-row .num.price { color: var(--sage-deep); font-weight: 700; }

/* ╔══════════════════════════════════════════════════════════════
   RESPONSIVE
   ╚══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .app-header { padding: 0 16px; }
  .app-main { padding: 24px 16px 40px; }
  .page-title { font-size: 32px; }
  .detail-title { font-size: 32px; }
  .btn-nav { padding: 7px 12px; font-size: 12px; }
  .header-title { font-size: 18px; }
}
