/* ============================================================
   WooDash — components.css (cards, buttons, forms, modals, toasts…)
   ============================================================ */

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.tap { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.card.tap:active { transform: scale(.985); }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-row .grow { flex: 1; min-width: 0; }
.card h3 { font-size: .98rem; font-weight: 700; color: var(--navy-800); margin-bottom: 4px; }
.card .sub { font-size: .82rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-thumb { width: 46px; height: 46px; border-radius: 12px; background: var(--navy-800); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex: none; overflow: hidden; }
.logo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 6px; }
@media (min-width: 480px) { .stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.stat .label { font-size: .78rem; color: var(--text-soft); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 1.25rem; font-weight: 700; color: var(--navy-800); }
.stat .value small { font-size: .72rem; color: var(--text-faint); font-weight: 400; }
.stat.accent { background: var(--navy-800); }
.stat.accent .label, .stat.accent .value { color: #fff; }
.stat.accent .value small { color: #9fb6ca; }
.stat.emerald { background: var(--emerald-600); }
.stat.emerald .label, .stat.emerald .value { color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 12px 20px; font-size: .95rem; font-weight: 700;
  transition: filter .15s, transform .1s;
  min-height: 46px;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--emerald-600); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.navy { background: var(--navy-800); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy-800); border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; min-height: 38px; font-size: .85rem; border-radius: 8px; }
.icon-btn { background: none; border: none; padding: 8px; border-radius: 10px; display: inline-flex; color: var(--text-soft); }
.icon-btn:active { background: rgba(0,0,0,.06); }
.icon-btn svg { width: 22px; height: 22px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .84rem; font-weight: 500; color: var(--text-soft); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: #fbfcfe; color: var(--text);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus { border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(16,185,129,.14); background: #fff; }
.input.error { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: .76rem; margin-top: 5px; }
.field .hint { color: var(--text-faint); font-size: .76rem; margin-top: 5px; }
textarea.input { resize: vertical; min-height: 90px; }
.form-actions { margin-top: 18px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--emerald-600); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-soft); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 10px; font-size: .74rem; font-weight: 700; }
.badge.emerald { background: var(--emerald-100); color: #065f46; }
.badge.navy { background: #e2e8f0; color: var(--navy-800); }
.badge.blue { background: var(--info-soft); color: #1e40af; }
.badge.amber { background: var(--warn-soft); color: #92400e; }
.badge.red { background: var(--danger-soft); color: #991b1b; }
.badge.gray { background: #eef1f5; color: var(--text-soft); }

/* ---------- list rows (orders/products) ---------- */
.list-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f8fafc; }
.list-item .thumb { width: 52px; height: 52px; border-radius: 10px; background: #eef1f5; flex: none; object-fit: cover; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; font-size: .92rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: .78rem; color: var(--text-soft); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.list-item .end { text-align: left; flex: none; }
.list-item .price { font-weight: 700; font-size: .92rem; color: var(--navy-800); }

/* ---------- search + filter bar ---------- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-bar .input { flex: 1; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: #fff; color: var(--text-soft); border-radius: 999px; padding: 7px 14px; font-size: .8rem; font-weight: 500; }
.chip.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- skeleton ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; display: flex; gap: 12px; align-items: center; }
.skel-card .skel { height: 16px; }

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 42px 20px; color: var(--text-soft); }
.empty-state .icon { font-size: 2.6rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; margin-bottom: 16px; }

/* ---------- toasts ---------- */
.toast-root { position: fixed; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--navy-900); color: #fff; border-radius: 12px; padding: 12px 16px; font-size: .88rem; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; animation: toast-in .25s ease; }
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }

/* ---------- modal & bottom sheet ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,31,51,.5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
.modal { background: var(--card); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 20px; animation: sheet-up .25s ease; }
@media (min-width: 640px) { .modal { border-radius: 20px; margin: 20px; } }
.modal h3 { font-size: 1.02rem; color: var(--navy-800); margin-bottom: 14px; }
.modal .grab { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: -8px auto 16px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- steps (variable product wizard) ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps .step { flex: 1; text-align: center; font-size: .72rem; color: var(--text-faint); position: relative; padding-top: 6px; }
.steps .step::before { content: ''; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.steps .step.active { color: var(--emerald-600); font-weight: 700; }
.steps .step.active::before { background: var(--emerald-500); }
.steps .step.done { color: var(--emerald-600); }
.steps .step.done::before { background: var(--emerald-100); }

/* ---------- misc ---------- */
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; gap: 10px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-soft); flex: none; }
.kv .v { text-align: left; font-weight: 500; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.text-center { text-align: center; }
.muted { color: var(--text-soft); font-size: .84rem; }
.faint { color: var(--text-faint); font-size: .78rem; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; }
.flex { display: flex; align-items: center; gap: 8px; }
.pill-toggle { display: flex; background: #eef1f5; border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.pill-toggle button { flex: 1; border: none; background: transparent; border-radius: 999px; padding: 9px; font-weight: 700; font-size: .85rem; color: var(--text-soft); }
.pill-toggle button.active { background: #fff; color: var(--navy-800); box-shadow: var(--shadow); }
