/* ============================================================
   FloriApp — Design System v2
   Paleta: verde esmeralda profundo + crema cálido + rosa polvoso
   Tipografía: DM Sans (display) + Instrument Sans (body)
   Feeling: SaaS boutique · orgánico · refinado · confiable
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Sans:wght@400;500;600;700&display=swap');

/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  /* Superficie */
  --app-bg:           #f5f3ef;
  --app-bg-alt:       #ede9e1;
  --app-card:         #ffffff;
  --app-card-hover:   #fdfcfb;

  /* Texto */
  --app-text:         #1c2b24;
  --app-text-2:       #3d5046;
  --app-muted:        #7a8f83;
  --app-muted-light:  #adbdb4;

  /* Bordes */
  --app-line:         #e0dbd2;
  --app-line-soft:    #ece8e1;

  /* Verde primario — esmeralda profundo */
  --app-primary:        #1a7a48;
  --app-primary-dark:   #145e38;
  --app-primary-mid:    #2a9d5c;
  --app-primary-soft:   #eaf4ee;
  --app-primary-glow:   rgba(26,122,72,.14);

  /* Rosa polvoso — acento floral */
  --app-rose:           #c4768a;
  --app-rose-soft:      #faeef1;
  --app-rose-dark:      #9e4f63;

  /* Arena cálida — acento terciario */
  --app-sand:           #c9a96e;
  --app-sand-soft:      #faf4ea;

  /* Semánticos */
  --app-success:        #1a7a48;
  --app-success-soft:   #eaf4ee;
  --app-success-border: #b8dfc8;

  --app-warning:        #b07d2e;
  --app-warning-soft:   #fdf5e6;
  --app-warning-border: #e8d09a;

  --app-danger:         #b83c3c;
  --app-danger-soft:    #fdf0f0;
  --app-danger-border:  #e8b4b4;

  --app-info:           #2d6fa8;
  --app-info-soft:      #edf4fc;
  --app-info-border:    #b0d0ed;

  /* Radios */
  --app-radius-xl:  20px;
  --app-radius-lg:  14px;
  --app-radius-md:  10px;
  --app-radius-sm:  7px;
  --app-radius-xs:  5px;

  /* Sombras */
  --app-shadow:      0 4px 20px rgba(28,43,36,.07), 0 1px 4px rgba(28,43,36,.04);
  --app-shadow-soft: 0 2px 10px rgba(28,43,36,.05);
  --app-shadow-md:   0 8px 32px rgba(28,43,36,.10), 0 2px 6px rgba(28,43,36,.05);
  --app-shadow-lg:   0 20px 60px rgba(28,43,36,.13), 0 4px 12px rgba(28,43,36,.06);

  /* Sizing */
  --app-topbar-h: 62px;
  --app-nav-h:    72px;
  --app-input-h:  48px;
  --app-btn-h:    46px;

  /* Gaps */
  --app-gap:    16px;
  --app-gap-lg: 22px;

  /* Tipografía */
  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-body:    'Instrument Sans', system-ui, sans-serif;

  /* Transiciones */
  --t-fast:   .13s cubic-bezier(.4,0,.2,1);
  --t-base:   .2s  cubic-bezier(.4,0,.2,1);
  --t-slow:   .32s cubic-bezier(.4,0,.2,1);
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  background: var(--app-bg);
  color: var(--app-text);
}

body {
  font-family: var(--font-body);
  font-size: .9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px;
}

.app-main {
  max-width: 1240px;
  margin: auto;
  padding: 22px 20px;
  padding-bottom: 32px;
}

@media (max-width: 991.98px) {
  .app-main,
  .app-shell {
    padding-bottom: calc(var(--app-nav-h) + 20px);
  }
}

.app-page {
  display: grid;
  gap: 20px;
}

/* ── TIPOGRAFÍA ───────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: var(--app-text);
}

.page-subtitle {
  margin-top: 5px;
  color: var(--app-muted);
  font-size: .9rem;
  line-height: 1.55;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: var(--app-topbar-h);
  background: rgba(245,243,239,.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(224,219,210,.7);
}

.app-topbar__inner {
  max-width: 1240px;
  margin: 0 auto;
  min-height: var(--app-topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-topbar__brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--app-primary) 0%, var(--app-primary-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .95rem;
  box-shadow: 0 4px 12px var(--app-primary-glow);
  flex-shrink: 0;
}

.app-topbar__brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--app-text);
  letter-spacing: -.01em;
}

.app-topbar__title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--app-text);
  font-size: .95rem;
  letter-spacing: -.01em;
}

.app-topbar__desktop-nav,
nav.app-topbar__desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.app-topbar__desk-link {
  min-height: 36px;
  padding: 0 11px;
  border-radius: var(--app-radius-md);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--app-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: color var(--t-base), background var(--t-base);
  white-space: nowrap;
}

.app-topbar__desk-link:hover {
  text-decoration: none;
  color: var(--app-text);
  background: rgba(28,43,36,.06);
}

.app-topbar__desk-link.is-active {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
  font-weight: 600;
}

.app-topbar__icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--app-line);
  background: var(--app-card);
  border-radius: var(--app-radius-md);
  color: var(--app-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-base);
  font-size: .9rem;
}

.app-topbar__icon-btn:hover {
  color: var(--app-text);
  border-color: rgba(28,43,36,.2);
  background: var(--app-card-hover);
}

.app-topbar__user-name {
  color: var(--app-muted);
  font-size: .85rem;
  font-weight: 500;
}

.app-topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--app-muted);
  font-size: .875rem;
}

@media (max-width: 991.98px) {
  .app-topbar__title {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── TOOLBAR ──────────────────────────────────────────────── */
.app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-toolbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── CARDS ────────────────────────────────────────────────── */
.app-card {
  background: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-xl);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
}

.app-card--soft {
  box-shadow: var(--app-shadow);
}

.app-card--elevated {
  box-shadow: var(--app-shadow-md);
  border-color: var(--app-line-soft);
}

.app-card__head {
  padding: 18px 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 600;
  color: var(--app-text);
  letter-spacing: -.01em;
}

.app-card__desc {
  margin: 3px 0 0;
  color: var(--app-muted);
  font-size: .85rem;
  line-height: 1.5;
}

.app-card__body {
  padding: 18px 20px;
}

.app-card__footer {
  padding: 0 20px 18px;
}

/* ── KPIs ─────────────────────────────────────────────────── */
.app-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}

.app-kpi {
  background: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-lg);
  padding: 16px 18px;
  box-shadow: var(--app-shadow-soft);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.app-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--app-primary-soft), transparent);
  opacity: 0;
  transition: opacity var(--t-base);
}

.app-kpi:hover::before { opacity: 1; }

.app-kpi__label {
  font-size: .775rem;
  font-weight: 600;
  color: var(--app-muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.app-kpi__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--app-text);
  letter-spacing: -.02em;
}

.app-kpi__meta {
  margin-top: 6px;
  color: var(--app-muted-light);
  font-size: .78rem;
}

/* ── GRIDS ────────────────────────────────────────────────── */
.app-grid { display: grid; gap: 20px; }
.app-grid--2 { grid-template-columns: 1.1fr .9fr; }
.app-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

/* ── BOTONES ──────────────────────────────────────────────── */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--app-btn-h);
  padding: 0 18px;
  border-radius: var(--app-radius-lg);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-base);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.app-btn:hover { text-decoration: none; }

.app-btn:active {
  transform: scale(.98);
  transition: transform .08s;
}

/* Primario */
.app-btn--primary {
  background: var(--app-primary);
  color: #fff;
  border-color: var(--app-primary);
  box-shadow: 0 2px 8px var(--app-primary-glow), 0 1px 2px rgba(0,0,0,.08);
}

.app-btn--primary:hover {
  background: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
  color: #fff;
  box-shadow: 0 4px 14px var(--app-primary-glow);
  transform: translateY(-1px);
}

/* Claro / light */
.app-btn--light {
  background: var(--app-card);
  color: var(--app-text-2);
  border-color: var(--app-line);
  box-shadow: var(--app-shadow-soft);
}

.app-btn--light:hover {
  background: var(--app-bg-alt);
  border-color: rgba(28,43,36,.2);
  color: var(--app-text);
  transform: translateY(-1px);
}

/* Peligro */
.app-btn--danger {
  background: var(--app-danger-soft);
  color: var(--app-danger);
  border-color: var(--app-danger-border);
}

.app-btn--danger:hover {
  background: #fce5e5;
  transform: translateY(-1px);
}

/* Success soft */
.app-btn--success-soft {
  background: var(--app-success-soft);
  color: var(--app-primary-dark);
  border-color: var(--app-success-border);
}

.app-btn--success-soft:hover {
  background: #d6eede;
  transform: translateY(-1px);
}

/* Block */
.app-btn--block { width: 100%; }

/* Small */
.app-btn--sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: .8125rem;
  border-radius: var(--app-radius-md);
}

/* ── FORMULARIOS ──────────────────────────────────────────── */
.app-form { display: grid; gap: 16px; }

.app-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.app-field { display: grid; gap: 6px; }

.app-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--app-text-2);
  letter-spacing: .01em;
}

.app-input,
.app-select,
.app-textarea {
  width: 100%;
  border: 1.5px solid var(--app-line);
  border-radius: var(--app-radius-lg);
  background: var(--app-card);
  color: var(--app-text);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
  font-size: .9rem;
}

.app-input,
.app-select {
  min-height: var(--app-input-h);
  padding: 0 14px;
}

.app-textarea {
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.55;
}

.app-input::placeholder,
.app-textarea::placeholder {
  color: var(--app-muted-light);
}

.app-input:hover,
.app-select:hover,
.app-textarea:hover {
  border-color: rgba(28,43,36,.25);
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
  border-color: var(--app-primary-mid);
  box-shadow: 0 0 0 3px rgba(26,122,72,.12);
  background: #fff;
}

/* ── LISTAS ───────────────────────────────────────────────── */
.app-list { display: grid; gap: 8px; }

.app-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--app-line-soft);
  border-radius: var(--app-radius-lg);
  background: var(--app-card);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.app-list-item:hover {
  border-color: rgba(26,122,72,.2);
  box-shadow: 0 2px 8px rgba(28,43,36,.05);
}

.app-list-item__main { min-width: 0; }

.app-list-item__title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--app-text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-list-item__meta {
  font-size: .82rem;
  color: var(--app-muted);
  line-height: 1.5;
}

.app-list-item__side {
  text-align: right;
  flex: 0 0 auto;
}

/* ── BADGES ───────────────────────────────────────────────── */
.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.app-badge--success {
  background: var(--app-success-soft);
  color: var(--app-primary-dark);
  border-color: var(--app-success-border);
}

.app-badge--warning {
  background: var(--app-warning-soft);
  color: var(--app-warning);
  border-color: var(--app-warning-border);
}

.app-badge--danger {
  background: var(--app-danger-soft);
  color: var(--app-danger);
  border-color: var(--app-danger-border);
}

.app-badge--info {
  background: var(--app-info-soft);
  color: var(--app-info);
  border-color: var(--app-info-border);
}

.app-badge--primary {
  background: var(--app-info-soft);
  color: var(--app-info);
  border-color: var(--app-info-border);
}

.app-badge--muted {
  background: var(--app-bg-alt);
  color: var(--app-muted);
  border-color: var(--app-line);
}

/* Rose — estatus "Listo" visual alternativo */
.app-badge--rose {
  background: var(--app-rose-soft);
  color: var(--app-rose-dark);
  border-color: #e9c3cc;
}

/* ── ALERTS ───────────────────────────────────────────────── */
.app-alert {
  padding: 13px 16px;
  border-radius: var(--app-radius-lg);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.app-alert--success {
  background: var(--app-success-soft);
  color: var(--app-primary-dark);
  border-color: var(--app-success-border);
}

.app-alert--danger {
  background: var(--app-danger-soft);
  color: var(--app-danger);
  border-color: var(--app-danger-border);
}

.app-alert--warning {
  background: var(--app-warning-soft);
  color: var(--app-warning);
  border-color: var(--app-warning-border);
}

.app-alert--info {
  background: var(--app-info-soft);
  color: var(--app-info);
  border-color: var(--app-info-border);
}

/* ── TABLAS ───────────────────────────────────────────────── */
.app-table-wrap { overflow-x: auto; }

.app-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 680px;
}

.app-table th {
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--app-line);
  background: var(--app-bg);
  white-space: nowrap;
}

.app-table th:first-child { border-radius: var(--app-radius-sm) 0 0 0; }
.app-table th:last-child  { border-radius: 0 var(--app-radius-sm) 0 0; }

.app-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--app-line-soft);
  vertical-align: middle;
  color: var(--app-text);
  font-size: .875rem;
}

.app-table tr:last-child td { border-bottom: 0; }

.app-table tbody tr {
  transition: background var(--t-fast);
}

.app-table tbody tr:hover {
  background: rgba(26,122,72,.03);
}

/* ── STICKY SIDEBAR ───────────────────────────────────────── */
.app-sticky {
  position: sticky;
  top: calc(var(--app-topbar-h) + 12px);
}

/* ── BOTTOM NAV (mobile) ──────────────────────────────────── */
.app-bottom-nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(224,219,210,.8);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(28,43,36,.14), 0 2px 8px rgba(28,43,36,.06);
  backdrop-filter: blur(16px);
}

.app-bottom-nav__item {
  min-height: 56px;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  text-decoration: none;
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .7rem;
  font-weight: 600;
  transition: all var(--t-base);
  padding: 5px 4px;
  cursor: pointer;
  letter-spacing: .01em;
}

.app-bottom-nav__item:hover,
.app-bottom-nav__item:focus {
  text-decoration: none;
  color: var(--app-text);
  background: var(--app-bg-alt);
  outline: none;
}

.app-bottom-nav__item.is-active {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

.app-bottom-nav__item--primary {
  background: var(--app-primary);
  color: #fff !important;
  box-shadow: 0 4px 12px var(--app-primary-glow);
}

.app-bottom-nav__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.app-bottom-nav__label {
  line-height: 1;
  white-space: nowrap;
}

/* ── BOTTOM SHEET ─────────────────────────────────────────── */
.app-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,18,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
  z-index: 95;
}

.app-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.app-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -110%;
  z-index: 100;
  background: var(--app-card);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(28,43,36,.14);
  padding: 10px 18px 28px;
  transition: bottom var(--t-slow);
  border-top: 1px solid var(--app-line-soft);
}

.app-bottom-sheet.is-open { bottom: 0; }

.app-bottom-sheet__handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--app-line);
  margin: 4px auto 14px;
}

.app-bottom-sheet__head {
  text-align: center;
  color: var(--app-text);
  font-weight: 600;
  font-family: var(--font-display);
  margin-bottom: 14px;
  font-size: .95rem;
}

.app-bottom-sheet__body { display: grid; gap: 8px; }

.app-sheet-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: var(--app-radius-lg);
  color: var(--app-text);
  text-decoration: none;
  background: var(--app-bg);
  border: 1px solid var(--app-line-soft);
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--t-base);
}

.app-sheet-link:hover {
  text-decoration: none;
  color: var(--app-text);
  background: var(--app-bg-alt);
  border-color: rgba(28,43,36,.15);
}

.app-sheet-link--danger {
  color: var(--app-danger);
  background: var(--app-danger-soft);
  border-color: var(--app-danger-border);
}

/* ── MODALES ──────────────────────────────────────────────── */
.app-image-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.app-image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,18,13,.7);
  backdrop-filter: blur(6px);
}

.app-image-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(100%, 700px);
  background: var(--app-card);
  border-radius: var(--app-radius-xl);
  padding: 20px;
  box-shadow: var(--app-shadow-lg);
}

.app-image-modal__close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-md);
  background: var(--app-bg);
  color: var(--app-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-base);
  font-size: .9rem;
}

.app-image-modal__close:hover {
  background: var(--app-bg-alt);
  color: var(--app-text);
}

.app-image-modal__title {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 14px;
  padding-right: 42px;
  letter-spacing: -.01em;
}

.app-image-modal__img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--app-radius-lg);
  display: block;
  background: var(--app-bg);
}

/* ── RECETA EXPAND ────────────────────────────────────────── */
.receta-expand {
  animation: recetaExpandFade .18s ease;
}

@keyframes recetaExpandFade {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PEDIDO-CARDS (grid listado) ──────────────────────────── */
.pedido-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.pedido-card {
  background: var(--app-card);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-xl);
  padding: 18px;
  box-shadow: var(--app-shadow-soft);
  display: grid;
  gap: 13px;
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}

.pedido-card:hover {
  box-shadow: var(--app-shadow);
  border-color: rgba(26,122,72,.2);
  transform: translateY(-1px);
}

.pedido-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pedido-card__id {
  font-size: .775rem;
  color: var(--app-muted);
  font-weight: 500;
  letter-spacing: .02em;
  margin-bottom: 3px;
}

.pedido-card__cliente {
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 600;
  color: var(--app-text);
  line-height: 1.25;
  letter-spacing: -.01em;
}

.pedido-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--app-radius-md);
  background: var(--app-bg);
  border: 1px solid var(--app-line-soft);
}

.pedido-card__meta-label {
  display: block;
  font-size: .725rem;
  color: var(--app-muted);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.pedido-card__money {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}

.pedido-money {
  border-radius: var(--app-radius-md);
  padding: 10px 12px;
  border: 1px solid var(--app-line-soft);
}

.pedido-money span {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: 5px;
}

.pedido-money strong {
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 600;
  color: var(--app-text);
  letter-spacing: -.01em;
}

.pedido-money--total  { background: var(--app-bg); }
.pedido-money--paid   { background: var(--app-success-soft); }
.pedido-money--pending{ background: var(--app-warning-soft); }

.pedido-money--paid   strong { color: var(--app-primary-dark); }
.pedido-money--pending strong { color: var(--app-warning); }

.pedido-card__progress-wrap { display: grid; gap: 6px; }

.pedido-card__progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
  color: var(--app-muted);
  font-weight: 500;
}

.pedido-card__progress-label strong { color: var(--app-text); }

.pedido-card__progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--app-line-soft);
  overflow: hidden;
}

.pedido-card__progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--app-primary) 0%, var(--app-primary-mid) 100%);
  transition: width var(--t-slow);
}

.pedido-card__actions {
  display: flex;
  justify-content: flex-end;
}

/* ── DESKTOP — ocultar nav/sheet móvil ────────────────────── */
@media (min-width: 992px) {
  .app-bottom-nav,
  .app-sheet-backdrop,
  .app-bottom-sheet {
    display: none;
  }
  .app-main {
    padding-bottom: 28px;
  }
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .app-kpi-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 992px) {
  .app-grid--2,
  .app-grid--3 {
    grid-template-columns: 1fr;
  }
  .app-sticky { position: static; }
  .pedido-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 768px) {
  .app-shell,
  .app-main { padding: 14px; }

  .page-title { font-size: 1.35rem; }

  .app-form__row { grid-template-columns: 1fr; }

  .app-toolbar { align-items: flex-start; }
  .app-toolbar__actions { width: 100%; }
  .app-toolbar__actions .app-btn { flex: 1 1 auto; }

  .app-card { border-radius: var(--app-radius-lg); }

  .app-card__body,
  .app-card__head,
  .app-card__footer { padding-left: 14px; padding-right: 14px; }

  .app-list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-list-item__side {
    width: 100%;
    text-align: left;
  }

  .pedido-card__meta { grid-template-columns: 1fr; }
  .pedido-card__money { grid-template-columns: 1fr; }
  .pedido-card__actions { justify-content: stretch; }
  .pedido-card__actions .app-btn { width: 100%; }
}

@media (max-width: 640px) {
  .pedido-grid { grid-template-columns: 1fr; }
  .pedido-card { border-radius: var(--app-radius-lg); }
}

@media (max-width: 520px) {
  .app-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .app-topbar__inner { padding: 0 14px; }
  .app-input, .app-select { min-height: 46px; }
  .app-btn { min-height: 44px; font-size: .875rem; }
  .app-table { min-width: 600px; }
}

/* ── UTILIDADES ───────────────────────────────────────────── */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--app-muted); }
.small { font-size: .8125rem; }
.d-none { display: none; }
.d-md-none { display: none; }
.d-none.d-md-block { display: block; }

@media (max-width: 768px) {
  .d-md-none { display: block; }
  .d-none.d-md-block { display: none; }
}

/* ── MICROINTERACCIONES GLOBALES ──────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .app-card,
  .app-kpi,
  .app-list-item,
  .pedido-card {
    animation: fadeSlideUp .28s cubic-bezier(.4,0,.2,1) both;
  }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Escalonar hijos directos de app-page */
.app-page > *:nth-child(1) { animation-delay: .00s; }
.app-page > *:nth-child(2) { animation-delay: .04s; }
.app-page > *:nth-child(3) { animation-delay: .08s; }
.app-page > *:nth-child(4) { animation-delay: .12s; }
.app-page > *:nth-child(5) { animation-delay: .16s; }
.app-page > *:nth-child(n+6) { animation-delay: .20s; }

/* ── SCROLLBAR (webkit) ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--app-line);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--app-muted-light); }

/* ── SELECCIÓN ────────────────────────────────────────────── */
::selection {
  background: rgba(26,122,72,.18);
  color: var(--app-text);
}