/* ===== Components & Layout (mobile-first) ===== */

#app { min-height: 100dvh; }

/* --- App shell --- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.app-header__left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-header__title { font-weight: 600; font-size: 1.1rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.app-header__house { background: none; border: none; color: var(--accent);
  font-size: 0.78rem; padding: 0; }
.app-header__right { display: flex; align-items: center; gap: 6px; }

.app-main { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: 14px; }

.full-screen { min-height: 100dvh; max-width: 480px; margin: 0 auto; padding: 20px; }

/* --- Connection pill --- */
.conn-pill { font-size: 0.68rem; padding: 3px 8px; border-radius: 16px; white-space: nowrap; }
.conn-pill--online { color: var(--accent); background: var(--accent-soft); }
.conn-pill--offline { color: var(--warning-text); background: var(--warning-bg); }

/* --- Buttons --- */
.btn { border: none; border-radius: 8px; padding: 12px 16px; font-size: 0.95rem;
  font-weight: 500; min-height: 44px; transition: transform .05s, opacity .2s; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--block { width: 100%; }

.icon-btn { background: none; border: none; font-size: 1.1rem; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); }
.icon-btn.danger { color: var(--danger-text); }
.link-btn { background: none; border: none; color: var(--accent); font-size: 0.9rem; min-width: 44px; min-height: 44px; padding: 6px; }

/* --- Fields --- */
.field { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); color: var(--text);
  font-size: 1rem; min-height: 46px; }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* iOS Safari: input[type=date/time] มีความกว้างในตัวเองและไม่ยอมหด → ล้น
   ปิด native appearance + ชิดซ้าย ให้ width:100% คุมได้จริง */
input[type="date"].field, input[type="time"].field, input[type="datetime-local"].field {
  -webkit-appearance: none; appearance: none; text-align: left;
}
.field-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.field-pair { display: flex; gap: 8px; align-items: start; }
.field-pair .field, .field-pair .unit-field { flex: 1; }
/* Dropdown ระบบกลาง: ลบ native chrome + ใส่ลูกศร ▾ (ทั้ง native select เดิม + custom .menu-field) */
select.field, .menu-field {
  -webkit-appearance: none; appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
[data-theme="dark"] select.field, [data-theme="dark"] .menu-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aeb6c2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* --- Custom dropdown (menu-field) --- */
.menu-field { display: flex; align-items: center; text-align: left; }
.menu-field__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.menu-item { display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 1rem; min-height: 46px; cursor: pointer; }
.menu-item:active { transform: scale(0.99); }
.menu-item--sel { border-color: var(--accent); background: var(--accent-soft); }
.menu-item--action { color: var(--accent); border-style: dashed; }
.menu-item__hint { font-size: 0.78rem; color: var(--text-muted); }

/* --- Date field (ปุ่มเปิดปฏิทินกลาง) --- */
.date-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.date-field__icon { color: var(--text-muted); flex-shrink: 0; }

/* --- ปฏิทินในแอป --- */
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-weight: 600; font-size: 1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.72rem; color: var(--text-muted); padding: 4px 0; }
.cal-day { min-height: 44px; border: none; background: none; border-radius: 8px;
  color: var(--text); font-size: 0.95rem; cursor: pointer; }
.cal-day:active { transform: scale(0.95); }
.cal-day--empty { background: none; cursor: default; }
.cal-day--today { outline: 1.5px solid var(--accent); }
.cal-day--sel { background: var(--accent); color: #fff; font-weight: 600; }
.cal-footer { display: flex; gap: 8px; justify-content: flex-end; }
.flip-x { transform: scaleX(-1); }

/* --- Unit dropdown field --- */
.unit-field { display: flex; flex-direction: column; gap: 8px; }
.unit-field__custom[hidden] { display: none; }

/* --- Navigation drawer (เปิดจากปุ่มแฮมเบอร์เกอร์บน header) --- */
.nav-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity .22s ease; touch-action: none; }
.nav-scrim.is-open { opacity: 1; }
.nav-scrim[hidden] { display: none; }

.nav-drawer { position: fixed; z-index: 41; top: 0; left: 0; bottom: 0;
  width: min(84vw, 300px); background: var(--card);
  border-right: 1px solid var(--border); box-shadow: var(--shadow-strong);
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(12px + env(safe-area-inset-top)) 0 calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-100%); transition: transform .22s ease; }
.nav-drawer.is-open { transform: none; }

.nav-drawer__head { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 4px 8px 12px 20px; border-bottom: 1px solid var(--border); }
.nav-drawer__brand { min-width: 0; }
.nav-drawer__app { font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.nav-drawer__house { color: var(--text-muted); font-size: 0.78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-drawer__lists { display: flex; flex-direction: column; }
.nav-drawer__list { list-style: none; margin: 0; padding: 8px 12px 8px 0;
  display: flex; flex-direction: column; gap: 2px; }
.nav-drawer__sep { border: none; border-top: 1px solid var(--border); margin: 0 20px; }
.nav-drawer__item { width: 100%; background: none; border: none; color: var(--text);
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 0 16px 0 20px; min-height: 48px; font-size: 0.95rem;
  border-radius: 0 24px 24px 0; }
.nav-drawer__item.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.nav-drawer__icon { display: inline-flex; color: var(--text-muted); }
.nav-drawer__item.is-active .nav-drawer__icon { color: var(--accent); }

/* ล็อกการเลื่อนหน้าหลังขณะลิ้นชักเปิด */
html.scroll-locked, html.scroll-locked body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .nav-scrim, .nav-drawer { transition: none; }
}

/* --- FAB --- */
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 31;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 1.6rem;
  box-shadow: var(--shadow-strong); display: flex; align-items: center; justify-content: center; }
.fab:active { transform: scale(0.94); }

/* --- Cards / sections --- */
.card-section { background: var(--card); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 1rem; font-weight: 600; }
.section-note { color: var(--text-muted); font-size: 0.85rem; }
.page-title { font-size: 1.4rem; margin: 8px 0; }

/* --- Stat grid (dashboard) --- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: none; border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow); color: var(--text); }
.stat-card__icon { font-size: 1.5rem; }
.stat-card__value { font-size: 1.4rem; font-weight: 600; line-height: 1.1; }
.stat-card__label { font-size: 0.75rem; color: var(--text-muted); }
.stat-card--warn .stat-card__value { color: var(--warning-text); }
.stat-card--danger .stat-card__value { color: var(--danger-text); }
.stat-card--money .stat-card__value { color: var(--accent); font-size: 1.1rem; }

/* --- Status bar (แถบสีซ้ายการ์ด) --- */
.status-bar { width: 6px; border-radius: 6px; align-self: stretch; flex: 0 0 6px; }
.status-bar--ok { background: var(--status-ok); }
.status-bar--low { background: var(--status-low); }
.status-bar--out { background: var(--status-out); }

/* --- Item card --- */
.item-list { display: flex; flex-direction: column; gap: 10px; }
/* --- แถวในคลังทั้งหมด (ข้ามบ้าน) --- */
.catalog-row { display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.catalog-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.catalog-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.catalog-row__btn { min-height: 44px; padding: 8px 14px; white-space: nowrap; flex-shrink: 0; }
.item-card { display: flex; align-items: stretch; gap: 10px; background: var(--card);
  border-radius: 14px; padding: 10px 12px 10px 8px; box-shadow: var(--shadow); }
.item-card__main { flex: 1; background: none; border: none; text-align: left;
  display: flex; flex-direction: column; gap: 4px; color: var(--text); min-width: 0; }
.item-card__name { font-weight: 500; font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card__qty { display: flex; align-items: baseline; gap: 4px; }
.item-card__qty-num { font-size: 1.5rem; font-weight: 600; color: var(--accent); }
.item-card__qty-unit { font-size: 0.8rem; color: var(--text-muted); }
.item-card__actions { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  font-size: 1.3rem; line-height: 1; background: var(--bg); color: var(--text); }
.qty-btn--plus { background: var(--accent); color: #fff; border-color: var(--accent); }
.qty-btn:disabled { opacity: 0.4; }

/* --- Mini list (dashboard low-stock) --- */
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 0;
  cursor: pointer; border: none; background: none; color: var(--text); text-align: left; }
.mini-row .status-bar { height: 28px; flex: 0 0 6px; }
.mini-row__name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row__qty { font-weight: 600; color: var(--accent); }

/* --- Filter chips --- */
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.filter-chip { white-space: nowrap; border: 1px solid var(--border); background: var(--card);
  color: var(--text); border-radius: 16px; padding: 7px 14px; font-size: 0.85rem; }
.filter-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-chip--accent.is-active { background: var(--status-low); color: #4a3500; border-color: var(--status-low); }
.search-field { margin-bottom: 2px; }

/* --- Detail --- */
.detail-head { background: var(--card); border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.detail-head__qty { display: flex; align-items: baseline; gap: 6px; }
.detail-head__num { font-size: 2.6rem; font-weight: 600; color: var(--accent); }
.detail-head__unit { font-size: 1rem; color: var(--text-muted); }
.detail-head__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-footer { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.lot-list { display: flex; flex-direction: column; gap: 10px; }
.lot-card { position: relative; background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; }
.lot-card__top { display: flex; justify-content: space-between; align-items: center; padding-right: 32px; }
.lot-card__qty { font-weight: 600; font-size: 1.1rem; }
.lot-card__bottom { display: flex; justify-content: space-between; font-size: 0.8rem; gap: 8px; }
.lot-card__edit { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; color: var(--text-muted); }
.lot-card__promo { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; }
.price-was { text-decoration: line-through; opacity: 0.6; margin-right: 5px; }
.price-off { background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.exp { font-size: 0.82rem; }
.exp--soon { color: var(--warning-text); font-weight: 500; }
.exp--over { color: var(--danger-text); font-weight: 500; }

/* --- Pills / chips --- */
.pill { font-size: 0.72rem; padding: 3px 10px; border-radius: 16px; }
.pill--info { background: var(--accent-soft); color: var(--accent); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft);
  color: var(--text); border-radius: 16px; padding: 6px 12px; font-size: 0.85rem; }
.chip__x { background: none; border: none; color: var(--text-muted); font-size: 0.8rem; padding: 0; }
.chip__edit { background: none; border: none; color: var(--accent); font-size: 0.8rem; padding: 0; }

/* --- Setting rows --- */
.setting-row { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border: none; background: none; color: var(--text); width: 100%;
  font-size: 0.95rem; }
.setting-row--link { cursor: pointer; }

/* --- Houses --- */
.houses-wrap, .auth-wrap { display: flex; flex-direction: column; gap: 14px; }
.auth-topbar { display: flex; justify-content: space-between; align-items: center; }
.house-list { display: flex; flex-direction: column; gap: 10px; }
.house-card { display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow);
  color: var(--text); text-align: left; }
.house-card__icon { font-size: 1.6rem; }
.house-card__body { flex: 1; }
.house-card__name { font-weight: 600; font-size: 1.05rem; }
.house-card__meta { font-size: 0.8rem; color: var(--text-muted); }
.house-card__chev { font-size: 1.4rem; color: var(--text-muted); }

/* --- Members --- */
.add-member-row { display: flex; gap: 8px; }
.add-member-row .field { flex: 1; }
.member-list { display: flex; flex-direction: column; gap: 8px; }
.member-item { display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.member-name { font-weight: 500; }
.member-email { font-size: 0.8rem; }

/* --- Auth --- */
.auth-card { background: var(--card); border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; margin-top: 8vh; }
.auth-logo { font-size: 3rem; text-align: center; }
.auth-title { text-align: center; font-size: 1.3rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* --- Modal --- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet { background: var(--bg); width: 100%; max-width: 640px;
  border-radius: 18px 18px 0 0; max-height: 90dvh; overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: sheet-up .2s ease; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-title { font-size: 1.1rem; }
.modal-body { display: flex; flex-direction: column; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }
.confirm-msg { margin: 4px 0 12px; }
.stock-form { display: flex; flex-direction: column; gap: 10px; }
.in-preview { margin: 0; font-weight: 500; color: var(--accent); }

/* --- Toast --- */
#toast-host { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 24px;
  font-size: 0.9rem; box-shadow: var(--shadow-strong); animation: sheet-up .2s ease; }
.toast--success { background: var(--accent); color: #fff; }
.toast--error { background: var(--danger); color: #fff; }

/* --- Scanner --- */
.scanner-wrap { display: flex; flex-direction: column; gap: 10px; }
.scanner-box { width: 100%; min-height: 220px; border-radius: 12px; overflow: hidden;
  background: #000; }
.scanner-box video { width: 100% !important; border-radius: 12px; }
.or-divider { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: 6px 0; }

/* --- Items extras --- */
.scan-btn { width: 100%; }
.search-row { display: flex; }

/* --- Shop / cart --- */
.shop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-line { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; }
.cart-line__head { display: flex; justify-content: space-between; align-items: center; }
.cart-line__name { font-weight: 500; }
.cart-line__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.cart-total { text-align: right; font-weight: 600; color: var(--accent); padding: 4px 2px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.pick-item { text-align: left; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; color: var(--text); }

/* --- Shopping list --- */
.shoplist { display: flex; flex-direction: column; gap: 8px; }
.shoplist__row { display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 12px; padding: 12px; box-shadow: var(--shadow); cursor: pointer; }
.shoplist__cb { width: 22px; height: 22px; accent-color: var(--accent); }
.shoplist__body { flex: 1; }
.shoplist__name { font-weight: 500; }
.shoplist__row .status-bar { height: 30px; }
.shoplist__sub { display: inline-block; margin-top: 4px; padding: 2px 0; font-size: 0.82rem; }
.shoplist__row--muted { cursor: default; opacity: 0.85; }

/* --- Reports --- */
.big-money { font-size: 1.9rem; font-weight: 600; color: var(--accent); }
.bar-row { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.bar-row__head { display: flex; justify-content: space-between; font-size: 0.85rem; }
.bar-row__label { color: var(--text); }
.bar-row__val { font-weight: 600; color: var(--accent); }
.bar-track { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar-fill--alt { background: var(--status-low); }
.kv-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: none; }

/* --- Transaction history --- */
.txn-list { display: flex; flex-direction: column; gap: 8px; }
.txn-row { display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.txn-badge { font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 8px; flex: 0 0 auto; }
.txn-badge--in { background: var(--accent-soft); color: var(--accent); }
.txn-badge--out { background: var(--warning-bg); color: var(--warning-text); }
.txn-body { flex: 1; min-width: 0; }
.txn-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-qty { text-align: right; display: flex; flex-direction: column; }
.txn-plus { color: var(--accent); font-weight: 600; }
.txn-minus { color: var(--status-out); font-weight: 600; }

/* --- Icons (SVG) --- */
.icon { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.btn--icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-btn .icon { pointer-events: none; }
.stat-card__icon .icon { color: var(--accent); }
.stat-card--warn .stat-card__icon .icon { color: #d29200; }
.stat-card--danger .stat-card__icon .icon { color: var(--status-out); }
.fab .icon { color: #fff; }
.qty-btn { display: inline-flex; align-items: center; justify-content: center; }
.app-header__house { display: inline-flex; align-items: center; gap: 2px; }
.setting-row__main { display: inline-flex; align-items: center; gap: 10px; }
.lot-meta { display: inline-flex; align-items: center; gap: 5px; }

/* search field with leading icon */
.search-row { position: relative; display: flex; align-items: center; }
.search-row .search-icon { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.search-row .search-field { padding-left: 38px; }

/* restructured house card (main + members shortcut) */
.house-card { padding: 0; overflow: hidden; }
.house-card__main { flex: 1; display: flex; align-items: center; gap: 12px; background: none;
  border: none; color: var(--text); text-align: left; padding: 14px; min-width: 0; }
.house-card__body { flex: 1; min-width: 0; }
.house-card__chev { color: var(--text-muted); }
.house-card__members { background: var(--accent-soft); border: none; color: var(--accent);
  padding: 0 16px; align-self: stretch; display: flex; align-items: center; }

/* share tip box (members page) */
.share-tip__head { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.share-tip__note { font-size: 0.78rem; line-height: 1.5; }

/* --- Misc --- */
.empty-note { text-align: center; color: var(--text-muted); padding: 20px; font-size: 0.9rem; }
.placeholder { align-items: center; text-align: center; padding-top: 12vh; }
.placeholder__icon { font-size: 3rem; }
.placeholder__title { margin-top: 8px; }
.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 70dvh; }
.spinner { width: 38px; height: 38px; border: 4px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* spinner เล็กสำหรับใส่ในปุ่ม */
.spinner--sm { width: 18px; height: 18px; border-width: 2px; flex-shrink: 0; }
.btn--primary .spinner { border-color: rgba(255,255,255,.45); border-top-color: #fff; }

/* --- ช่องรหัสผ่าน + ปุ่มดู/ซ่อน --- */
.pass-row { position: relative; display: flex; align-items: center; }
.pass-row .field { padding-right: 46px; }
.pass-row__toggle { position: absolute; right: 2px; width: 44px; height: 44px;
  color: var(--text-muted); }

.pill--status { font-weight: 500; }
.pill--status-ok { background: var(--accent-soft); color: var(--accent); }
.pill--status-low { background: var(--warning-bg); color: var(--warning-text); }
.pill--status-out { background: var(--danger-bg); color: var(--danger-text); }

.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; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
