/* =========================================================
   MediCasa · Design System
   Paleta médica: azul profundo + verde salud + neutros cálidos
   ========================================================= */

:root {
  /* Brand */
  --c-blue: #1A4FE0;
  --c-blue-600: #1740B8;
  --c-blue-50: #EEF2FF;
  --c-blue-100: #DCE5FF;

  --c-green: #1FBF75;
  --c-green-600: #169A5D;
  --c-green-50: #E8F8F1;
  --c-green-100: #CFEFDF;

  --c-amber: #F59E0B;
  --c-amber-50: #FEF5E2;
  --c-red: #E53935;
  --c-red-50: #FDECEC;

  /* Neutrals */
  --c-ink: #0E1B3D;
  --c-ink-2: #34456B;
  --c-mute: #6B7793;
  --c-line: #E5E9F2;
  --c-line-2: #EFF2F8;
  --c-bg: #F5F7FB;
  --c-card: #FFFFFF;

  /* Surfaces */
  --shadow-sm: 0 1px 2px rgba(15, 27, 61, 0.04), 0 1px 4px rgba(15, 27, 61, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 27, 61, 0.06), 0 1px 4px rgba(15, 27, 61, 0.04);
  --shadow-lg: 0 12px 32px rgba(26, 79, 224, 0.14), 0 2px 6px rgba(15, 27, 61, 0.04);
  --shadow-fab: 0 10px 24px rgba(26, 79, 224, 0.35);

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;

  /* Type */
  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fz-12: 12px;
  --fz-13: 13px;
  --fz-14: 14px;
  --fz-15: 15px;
  --fz-16: 16px;
  --fz-18: 18px;
  --fz-20: 20px;
  --fz-22: 22px;
  --fz-26: 26px;
  --fz-30: 30px;

  /* Layout */
  --nav-h: 76px;
  --screen-w: 390px;     /* iPhone 14 Pro logical width */
  --screen-h: 844px;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--c-blue); text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }

/* =========================================================
   Body / Desktop preview frame
   ========================================================= */
body {
  font-family: var(--ff);
  font-size: var(--fz-15);
  color: var(--c-ink);
  background: radial-gradient(1200px 600px at 20% -10%, #E9EFFF 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 100%, #E6F7EF 0%, transparent 50%),
              #F5F7FB;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.phone-frame {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 16px 60px;
  gap: 14px;
}

.phone-caption {
  font-size: var(--fz-12);
  color: var(--c-mute);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.phone-screen {
  position: relative;
  width: min(100%, var(--screen-w));
  height: var(--screen-h);
  background: var(--c-bg);
  border-radius: 44px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 27, 61, 0.18), 0 8px 20px rgba(15, 27, 61, 0.08);
  border: 1px solid rgba(15, 27, 61, 0.06);
}

.phone-notch {
  display: none; /* hidden, the phone-screen is the visual frame */
}

@media (max-width: 480px) {
  .phone-frame { padding: 0; }
  .phone-screen { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; border: 0; }
  .phone-caption { display: none; }
  :root { --screen-h: 100dvh; }
}

/* =========================================================
   App shell + screens
   ========================================================= */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  background: var(--c-bg);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
  scrollbar-width: none;
  padding-bottom: 0;
}
.screen::-webkit-scrollbar { display: none; }
.screen.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.screen--welcome.is-active { transform: none; }

.screen--home,
.screen--inventory {
  padding-bottom: calc(var(--nav-h) + 24px);
}

/* =========================================================
   Bottom Navigation
   ========================================================= */
.bottom-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--c-line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 6px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 20;
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--c-mute);
  font-size: 11px;
  font-weight: 500;
  height: 100%;
  transition: color .2s;
}
.bn-item svg { width: 22px; height: 22px; }
.bn-item.is-active { color: var(--c-blue); font-weight: 600; }
.bn-item.is-active svg path,
.bn-item.is-active svg circle,
.bn-item.is-active svg rect { stroke: var(--c-blue); }

.bn-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transform: translateY(-14px);
  box-shadow: var(--shadow-fab);
  transition: transform .15s ease, background .2s;
}
.bn-fab svg { width: 26px; height: 26px; }
.bn-fab:hover { background: var(--c-green-600); }
.bn-fab:active { transform: translateY(-12px) scale(.96); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--r-md);
  font-size: var(--fz-16);
  font-weight: 600;
  transition: transform .12s ease, background .2s, color .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--c-blue); color: #fff; }
.btn--primary:hover { background: var(--c-blue-600); }
.btn--ghost { background: #fff; color: var(--c-ink); border: 1.5px solid var(--c-line); }
.btn--ghost:hover { border-color: var(--c-blue); color: var(--c-blue); }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 14px; font-size: var(--fz-14); border-radius: 10px; }
.btn--green { background: var(--c-green); color: #fff; }
.btn--green:hover { background: var(--c-green-600); }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink);
  background: transparent;
  transition: background .2s;
  position: relative;
}
.icon-btn:hover { background: var(--c-line-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn--bell::after { content: none; }
.dot-badge {
  position: absolute;
  top: 9px; right: 9px;
  width: 9px; height: 9px;
  background: var(--c-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* =========================================================
   Welcome screen
   ========================================================= */
.screen--welcome {
  background: linear-gradient(180deg, #EEF3FF 0%, #F5F7FB 60%, #ECF7F1 100%);
  padding: 0 28px;
}
.welcome-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.decor-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .6;
}
.decor-blob--1 { width: 260px; height: 260px; background: #C8D5FF; top: -80px; right: -60px; }
.decor-blob--2 { width: 200px; height: 200px; background: #BFEED5; bottom: 80px; left: -60px; opacity: .5; }
.decor-blob--3 { width: 120px; height: 120px; background: #D9E2FF; top: 40%; right: 30px; opacity: .4; }

.welcome-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
  padding-bottom: 32px;
}

.welcome-logo {
  text-align: center;
  margin-bottom: 18px;
}
.logo-mark {
  position: relative;
  display: inline-block;
  width: 160px;
  height: 130px;
}
.logo-mark svg { width: 100%; height: 100%; overflow: visible; }
.logo-pill {
  position: absolute;
  right: 6px; bottom: 14px;
  width: 40px; height: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1A4FE0 0%, #1A4FE0 50%, #fff 50%, #fff 100%);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(15, 27, 61, .12);
  transform: rotate(-25deg);
}

.logo-text {
  margin-top: 18px;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo-medi { color: var(--c-blue); }
.logo-casa { color: var(--c-green); }

.welcome-tagline {
  text-align: center;
  color: var(--c-ink-2);
  font-size: var(--fz-15);
  line-height: 1.55;
  margin: 6px 0 26px;
  font-weight: 500;
}
.text-blue { color: var(--c-blue); font-weight: 700; }

.welcome-benefits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  margin-top: 4px;
}
.welcome-benefits li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  padding: 14px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.welcome-benefits h3 { font-size: var(--fz-15); font-weight: 700; color: var(--c-ink); }
.welcome-benefits p { font-size: var(--fz-13); color: var(--c-mute); margin-top: 2px; line-height: 1.45; }

.benefit-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.benefit-icon svg { width: 20px; height: 20px; }
.benefit-icon--blue { background: var(--c-blue-50); color: var(--c-blue); }
.benefit-icon--green { background: var(--c-green-50); color: var(--c-green); }

.welcome-cta { margin-top: 24px; }
.welcome-login {
  text-align: center;
  font-size: var(--fz-14);
  color: var(--c-mute);
  margin-top: 14px;
}
.welcome-login a { font-weight: 600; }

/* Reveal animation */
.reveal {
  opacity: 1;
  transform: translateY(0);
  animation: reveal .55s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: var(--delay, 0ms);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
}

/* =========================================================
   Home screen
   ========================================================= */
.home-header,
.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 8px;
  background: transparent;
}
.home-greeting { flex: 1; }
.home-title {
  font-size: var(--fz-26);
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.02em;
}
.wave { display: inline-block; animation: wave 1.6s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}
.home-subtitle { color: var(--c-mute); font-size: var(--fz-14); margin-top: 2px; }

.home-body { padding: 8px 16px 20px; }
.section-title { font-size: var(--fz-16); font-weight: 700; color: var(--c-ink); }
.link-blue { color: var(--c-blue); font-weight: 600; font-size: var(--fz-13); }

.summary-card {
  background: var(--c-green-50);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  margin-bottom: 22px;
}
.summary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.summary-title { color: var(--c-ink); font-size: var(--fz-16); font-weight: 700; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.summary-item {
  background: #fff;
  border-radius: var(--r-md);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.summary-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--c-green-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.summary-icon svg { width: 22px; height: 22px; }
.summary-num { font-size: var(--fz-22); font-weight: 800; color: var(--c-ink); line-height: 1.1; }
.summary-num--ok { font-size: var(--fz-18); color: var(--c-green-600); }
.summary-label { font-size: 11px; color: var(--c-mute); line-height: 1.25; }

/* Quick actions */
.quick-actions { margin-bottom: 22px; }
.quick-actions .section-title { margin-bottom: 12px; }
.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.qa-item {
  background: #fff;
  border-radius: var(--r-md);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s;
}
.qa-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.qa-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-blue);
  background: var(--c-blue-50);
}
.qa-icon svg { width: 22px; height: 22px; }
.qa-label { font-size: 11px; color: var(--c-ink); font-weight: 600; text-align: center; line-height: 1.25; }

/* Expiring list */
.expiring-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.expiring-list { display: flex; flex-direction: column; gap: 10px; }
.expiring-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.expiring-item:hover { box-shadow: var(--shadow-md); }
.expiring-thumb {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--c-blue-50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.expiring-thumb svg { width: 26px; height: 26px; }
.expiring-info { flex: 1; min-width: 0; }
.expiring-info h4 { font-size: var(--fz-14); font-weight: 700; color: var(--c-ink); }
.expiring-info p { font-size: 12px; color: var(--c-mute); margin-top: 2px; }
.expiring-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.expiring-tag--warn { background: var(--c-amber-50); color: #B26A00; }
.expiring-tag--ok { background: var(--c-green-50); color: var(--c-green-600); }
.expiring-item .chev { color: var(--c-mute); }

/* =========================================================
   Inventory screen
   ========================================================= */
.page-header { padding: 14px 14px 6px; }
.icon-btn--back { margin-right: 4px; }
.page-title {
  flex: 1;
  text-align: center;
  font-size: var(--fz-18);
  font-weight: 700;
  color: var(--c-ink);
}
.page-title--spacer { visibility: hidden; }
.page-actions { display: flex; gap: 2px; }

.inventory-body { padding: 6px 16px 20px; }

.search-wrap {
  position: relative;
  margin: 6px 0 14px;
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--c-mute);
  display: inline-flex;
}
.search-icon svg { width: 18px; height: 18px; }
.search-wrap input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-pill);
  padding: 0 16px 0 42px;
  background: #fff;
  font-size: var(--fz-14);
  color: var(--c-ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap input::placeholder { color: var(--c-mute); }
.search-wrap input:focus { border-color: var(--c-blue); box-shadow: 0 0 0 4px var(--c-blue-50); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1.5px solid var(--c-line);
  color: var(--c-ink-2);
  font-size: var(--fz-13);
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--c-blue); color: var(--c-blue); }
.chip.is-active { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }
.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-blue-50);
  color: var(--c-blue);
  font-size: 11px;
  font-weight: 700;
}
.chip.is-active .chip-count { background: rgba(255,255,255,.25); color: #fff; }

.sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fz-13);
  color: var(--c-mute);
  padding: 4px 4px 12px;
}
.sort-row strong { color: var(--c-ink); font-weight: 600; }
.sort-row .caret { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-left: 2px; }

.view-toggle { display: inline-flex; gap: 4px; }
.view-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--c-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.view-btn svg { width: 18px; height: 18px; }
.view-btn.is-active { color: var(--c-blue); background: var(--c-blue-50); }

/* Medicine list */
.med-list { display: flex; flex-direction: column; gap: 10px; }
.med-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.med-item:hover { box-shadow: var(--shadow-md); }
.med-thumb {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--c-blue-50);
  position: relative;
  overflow: hidden;
}
.med-thumb svg { width: 32px; height: 32px; }
.med-info { flex: 1; min-width: 0; }
.med-info h4 { font-size: var(--fz-15); font-weight: 700; color: var(--c-ink); }
.med-info .form { font-size: var(--fz-13); color: var(--c-ink-2); margin-top: 2px; }
.med-info .exp { font-size: 12px; color: var(--c-mute); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.med-info .exp svg { width: 12px; height: 12px; }
.med-right { text-align: right; flex-shrink: 0; }
.med-right .units { font-size: var(--fz-18); font-weight: 700; color: var(--c-ink); line-height: 1; }
.med-right .units-label { font-size: 11px; color: var(--c-mute); }
.med-right .chev { color: var(--c-mute); margin-top: 4px; display: inline-block; }
.med-right .chev svg { width: 16px; height: 16px; }

.med-thumb.bell { background: #FDE7E7; }
.med-thumb.calendar { background: #FEF0E2; }
.med-thumb.pink { background: #FFE0EC; }
.med-thumb.bottle { background: #FFF1D6; }
.med-thumb.inhaler { background: #DDF0FB; }

.empty-state {
  text-align: center;
  color: var(--c-mute);
  padding: 32px 16px;
  font-size: var(--fz-14);
}

/* =========================================================
   Detail screen
   ========================================================= */
.detail-body { padding: 4px 16px 100px; }

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 18px;
}
.detail-thumb {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-blue-50);
  flex-shrink: 0;
}
.detail-thumb svg { width: 40px; height: 40px; }
.detail-hero h2 { font-size: var(--fz-20); font-weight: 800; color: var(--c-ink); }
.detail-form { display: inline-flex; align-items: center; gap: 6px; color: var(--c-mute); font-size: var(--fz-13); margin-top: 4px; }
.detail-form .dot { width: 6px; height: 6px; background: var(--c-mute); border-radius: 50%; display: inline-block; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--c-green-50);
  color: var(--c-green-600);
}

.expiry-alert {
  background: var(--c-amber-50);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.expiry-alert .alert-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--c-amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.expiry-alert .alert-icon svg { width: 18px; height: 18px; }
.expiry-alert h4 { font-size: var(--fz-14); font-weight: 700; color: #8A5A00; }
.expiry-alert p { font-size: 12px; color: #8A5A00; margin-top: 2px; line-height: 1.5; }
.expiry-alert .days { font-weight: 700; }
.expiry-alert .exp-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8A5A00;
  margin-top: 8px;
}
.expiry-alert .exp-date svg { width: 12px; height: 12px; }

.stock-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stock-card {
  background: #fff;
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.stock-card h5 { font-size: 12px; color: var(--c-mute); font-weight: 500; }
.stock-card .val { font-size: 30px; font-weight: 800; color: var(--c-ink); margin-top: 6px; line-height: 1; }
.stock-card .unit { font-size: 12px; color: var(--c-mute); margin-top: 4px; }
.stock-card .edit-link {
  position: absolute;
  bottom: 12px; right: 12px;
  font-size: 12px;
  color: var(--c-blue);
  font-weight: 600;
}

.info-section h3 { font-size: var(--fz-16); font-weight: 700; color: var(--c-ink); margin-bottom: 12px; }
.info-list {
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-line-2);
}
.info-row:last-child { border-bottom: 0; }
.info-row .ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--c-blue-50);
  color: var(--c-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-row .ico svg { width: 16px; height: 16px; }
.info-row .label { font-size: var(--fz-14); color: var(--c-ink); flex: 1; }
.info-row .value { font-size: var(--fz-14); color: var(--c-ink-2); font-weight: 500; text-align: right; }
.info-row .chev-r { color: var(--c-mute); margin-left: 4px; }
.info-row .chev-r svg { width: 14px; height: 14px; }

.detail-actions {
  position: absolute;
  left: 16px; right: 16px; bottom: 100px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}
.detail-actions .btn--ghost { color: var(--c-blue); border-color: var(--c-blue); background: #fff; }
.detail-actions .btn--ghost:hover { background: var(--c-blue-50); }

/* =========================================================
   Form screen
   ========================================================= */
.screen--form { padding: 0 16px 40px; }
.form { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--c-mute); padding-left: 2px; }
.field input,
.field select {
  height: 46px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-md);
  background: #fff;
  padding: 0 14px;
  font-size: var(--fz-14);
  color: var(--c-ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #9aa3bb; }
.field input:focus,
.field select:focus { border-color: var(--c-blue); box-shadow: 0 0 0 4px var(--c-blue-50); }
.field input[type="color"] { padding: 4px; height: 46px; cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
  margin-top: 10px;
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(20px);
  background: var(--c-ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: var(--fz-13);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  transition: opacity .25s, transform .25s;
  max-width: 80%;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--success { background: var(--c-green-600); }
.toast--error { background: var(--c-red); }

/* =========================================================
   Modal
   ========================================================= */
.modal {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 61, 0.45);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 24px;
  width: calc(100% - 60px);
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.96);
  transition: transform .25s cubic-bezier(.2,.8,.3,1);
}
.modal.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-title { font-size: var(--fz-18); font-weight: 700; color: var(--c-ink); }
.modal-body { color: var(--c-mute); font-size: var(--fz-14); margin-top: 8px; line-height: 1.5; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.modal-actions .btn { height: 44px; }

/* =========================================================
   Small helpers
   ========================================================= */
.hidden { display: none !important; }
