/* =========================================================
   components.css  —  buttons, nav, cards, lists, forms, modals
   ========================================================= */

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0 var(--s-4);
  height: 40px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-dark); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-soft); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-dark); }
.btn-danger:hover { background: #6f1414; }
.btn-block { width: 100%; }
.btn-xs { height: 28px; padding: 0 var(--s-3); font-size: 12px; border-radius: var(--r-sm); min-width: 64px; }
.btn-sm { height: 32px; padding: 0 var(--s-3); font-size: 12px; border-radius: var(--r-sm); }
.btn-x  { width: 36px; height: 36px; padding: 0; border-radius: 50%; min-width: 0; }
.icn { display: inline-block; flex: 0 0 auto; }

/* ===== Nav links ===== */
.nav-link, .side-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 var(--s-3);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease;
}
.nav-link:hover, .side-link:hover { background: var(--surface-soft); color: var(--ink); }
.nav-link.is-active, .side-link.is-active {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border);
}
.side-link { width: 100%; height: 40px; }

/* Bottom-nav items */
.bn-item, .bn-fab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--r-sm);
}
.bn-item.is-active { color: var(--primary); }
.bn-fab {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-dark);
  border: 3px solid var(--bottom);
  box-shadow: 0 6px 16px rgba(168, 50, 50, 0.36);
  position: relative;
  z-index: 1;
}
.bn-fab:hover { background: var(--primary-hover); }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border-soft);
}
.card-title {
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.link-muted {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.link-muted:hover { color: var(--primary); }

/* ===== Avatars ===== */
.ava {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}
.ava-lg { width: 60px; height: 60px; font-size: 18px; border-radius: 14px; }

/* ===== Plan badges & chips ===== */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.plan-veg    { background: var(--forest-soft); color: var(--forest); }
.plan-nonveg { background: var(--accent-soft); color: var(--warn-text); }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-ok   { background: var(--forest-soft); color: var(--forest); }
.chip-warn { background: var(--accent-soft); color: var(--warn-text); }
.chip-bad  { background: var(--danger-soft); color: var(--danger); }

/* ===== Lists ===== */
.list { display: flex; flex-direction: column; gap: var(--s-1); }
.empty-state {
  padding: var(--s-5) var(--s-3);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.empty-state-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-8);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ===== Forms ===== */
.form-input, .form-textarea, select.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 var(--s-3);
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  height: 44px;
}
.form-textarea {
  height: auto;
  min-height: 80px;
  padding: var(--s-3);
  resize: vertical;
  line-height: 1.5;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

/* Radio pills (plan selector) */
.radio-group {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex: 1 1 200px;
  height: 44px;
  padding: 0 var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.radio-pill input[type="radio"] {
  accent-color: var(--primary);
  margin: 0;
}
.radio-pill:hover { background: var(--surface-soft); }
.radio-pill:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Modal ===== */
#modal-host { display: none; }
#modal-host.is-open { display: block; }
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 22, 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  animation: scrim-in 180ms ease both;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: modal-in 200ms ease both;
}
@keyframes scrim-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98) }
  to { opacity: 1; transform: none }
}
body.modal-open { overflow: hidden; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: 22px;
  font-weight: 600;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}
.modal-body {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

/* ===== Reset link (footer) ===== */
.dev-footer {
  margin-top: var(--s-8);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: 11px;
  color: var(--muted-soft);
}
.dev-footer button {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  margin-left: 6px;
}
.dev-footer button:hover { color: var(--primary); }
