/* BemBox — shared UI. Mobile-first. Baseline 360×640. 48px touch-targets. */

* { box-sizing: border-box; }

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --fg: #111827;
  --fg-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #0b5fff;
  --primary-hover: #094ed1;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.app-header__brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--fg);
}
.app-header__user {
  font-size: 14px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
}
.app-loading {
  padding: 24px;
  text-align: center;
  color: var(--fg-muted);
}

/* Buttons — 48px touch target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--primary); }

/* Inputs */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 14px; color: var(--fg-muted); }
.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--fg);
  font: inherit;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
  outline: 2px solid rgba(11,95,255,.25);
  border-color: var(--primary);
}

/* Card / list */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card__title { font-weight: 600; margin: 0 0 8px; }
.card__meta { font-size: 13px; color: var(--fg-muted); }
.card__row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}
.badge--ok { background: #ecfdf5; color: #047857; }
.badge--danger { background: #fef2f2; color: #b91c1c; }

/* Toast */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 1000;
  max-width: 92vw;
}
.toast {
  pointer-events: auto;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease-out;
}
.toast--error { background: var(--danger); }
.toast--ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  max-width: 460px;
  width: 92%;
  max-height: 88vh;
  overflow: auto;
}
.modal__title { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Tables (desktop) / cards stack (mobile) */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.table th { font-weight: 600; color: var(--fg-muted); }

/* Empty/error states */
.empty-state, .error-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--fg-muted);
}
.error-state { color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs__tab {
  padding: 10px 14px; cursor: pointer; border: none; background: transparent; color: var(--fg-muted);
  border-bottom: 2px solid transparent; font: inherit;
}
.tabs__tab--active { color: var(--fg); border-bottom-color: var(--primary); }

@media (max-width: 520px) {
  .app-main { padding: 12px; }
  .table, .table thead, .table tbody, .table tr, .table th, .table td { display: block; width: 100%; }
  .table th { display: none; }
  .table td { border: none; padding: 4px 0; }
  .table tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
}

/* ─── Catalog grid ─── */
.catalog-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.catalog-toolbar .input, .catalog-toolbar .select {
  min-height: 40px;
  width: auto;
  flex: 1 1 180px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px)  { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .catalog-grid { grid-template-columns: repeat(4, 1fr); } }

.pcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .12s;
}
.pcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }

.pcard__img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  overflow: hidden;
}
.pcard__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pcard__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 12px;
}
.pcard__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pcard__title { font-size: 13px; line-height: 1.3; font-weight: 500; color: var(--fg); margin: 0; }
.pcard__price { font-size: 16px; font-weight: 700; margin-top: 4px; }
.pcard__bonus { font-size: 12px; color: var(--ok); }

/* ─── Product page ─── */
.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .product { grid-template-columns: 1fr 1fr; align-items: flex-start; }
}

.gallery__main {
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f3f4f6;
  overflow: hidden;
  cursor: pointer;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb--active { border-color: var(--primary); }

.product__title { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.product__meta { color: var(--fg-muted); font-size: 13px; margin-bottom: 12px; }
.product__price-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.product__price { font-size: 28px; font-weight: 800; }
.product__compare { font-size: 16px; color: var(--fg-muted); text-decoration: line-through; }
.product__bonus {
  display: inline-block;
  margin-left: auto;
  font-size: 13px;
  color: var(--ok);
}
.product__actions { display: flex; gap: 8px; margin-top: 12px; }
.product__desc { margin-top: 20px; line-height: 1.55; }
.product__desc p { margin: 0 0 10px; }
.product__section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.product__section h3 { font-size: 15px; margin: 0 0 6px; }

/* ─── Cart ─── */
.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item__img {
  width: 72px; height: 72px;
  background: #f3f4f6; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.cart-item__img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item__title { font-size: 13px; color: var(--fg); margin: 0 0 2px; line-height: 1.3; }
.cart-item__meta  { font-size: 12px; color: var(--fg-muted); }
.cart-item__ctrl {
  display: flex; align-items: center; gap: 6px;
}
.qty-btn {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-summary {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 700;
}

/* ─── Concierge form & service card ─── */
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.service-card h2 { margin: 0 0 6px; font-size: 18px; }
.service-card__tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: #eef2ff; color: #3730a3;
  margin-left: 6px;
}

.attach-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
@media (min-width: 640px) { .attach-list { grid-template-columns: repeat(6, 1fr); } }
.attach-tile {
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 12px;
}
.attach-tile img, .attach-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.attach-tile__del {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; font-size: 14px;
}

.ticket-list__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: #fff;
}
.ticket-list__row:hover { box-shadow: var(--shadow); }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: #eef2ff; color: #3730a3;
}
.status-badge--queued   { background: #fff7ed; color: #c2410c; }
.status-badge--assigned { background: #e0f2fe; color: #075985; }
.status-badge--in_progress { background: #ecfdf5; color: #047857; }
.status-badge--awaiting_client { background: #fef9c3; color: #854d0e; }
.status-badge--done     { background: #ecfdf5; color: #047857; }
.status-badge--cancelled{ background: #fee2e2; color: #991b1b; }
.status-badge--rejected { background: #fee2e2; color: #991b1b; }

.rating-stars { display: inline-flex; gap: 4px; font-size: 24px; }
.rating-star {
  cursor: pointer;
  background: none; border: none;
  padding: 0; color: #d1d5db;
  line-height: 1;
}
.rating-star--active { color: #f59e0b; }

/* ─── Hero on home ─── */
.hero {
  background: linear-gradient(135deg, #0b5fff 0%, #6d28d9 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
}
.hero h1 { margin: 0 0 8px; font-size: 24px; }
.hero p  { margin: 0 0 12px; opacity: .92; }
.hero .btn { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; }
.hero .btn:hover { background: #f5f5f5; }

