:root {
  --jsh-orange: #F97316;
  --jsh-orange-dark: #ea6a0e;
  --jsh-black: #111111;
  --jsh-light: #F8F8F8;
}
* { -webkit-tap-highlight-color: transparent; }
body.jsh-body {
  background: var(--jsh-light);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #212529;
  min-height: 100vh;
}
.btn-warning { background: var(--jsh-orange); border-color: var(--jsh-orange); color: #fff; }
.btn-warning:hover, .btn-warning:focus { background: var(--jsh-orange-dark); border-color: var(--jsh-orange-dark); color: #fff; }

/* Login */
.jsh-login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #111 0%, #1f1f1f 100%);
  padding: 1rem;
}
.jsh-login-card { max-width: 420px; width: 100%; border-radius: 1rem; }
.jsh-logo-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--jsh-orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem;
}

/* Admin layout */
.jsh-layout { display: flex; min-height: 100vh; }
.jsh-sidebar {
  width: 240px; flex: 0 0 240px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.jsh-main { flex: 1; padding: 1.25rem; min-width: 0; }

/* KPI cards */
.jsh-kpi { border-left: 4px solid var(--jsh-orange); }

/* Waiter */
.jsh-waiter-hero { background: #111; }
.jsh-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #111; display: flex; justify-content: space-around;
  padding: .35rem 0; z-index: 1030;
  border-top: 2px solid var(--jsh-orange);
}
.jsh-bottom-link {
  color: #bbb; text-decoration: none; font-size: .72rem;
  display: flex; flex-direction: column; align-items: center;
  padding: .25rem .75rem; min-width: 64px;
}
.jsh-bottom-link i { font-size: 1.25rem; }
.jsh-bottom-link.active { color: var(--jsh-orange); }

/* Mobile: collapse sidebar into offcanvas-like drawer handled via JS later */
@media (max-width: 767.98px) {
  .jsh-sidebar { display: none; }
  .jsh-main { padding: .85rem; }
}

/* Touch-friendly buttons */
.btn { min-height: 40px; }
.btn-lg { min-height: 52px; }

/* ============================================================
   PHASE 2 — Products & Categories
   ============================================================ */

/* Product thumbnails in list */
.jsh-thumb {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: .35rem;
  border: 1px solid #eee;
  display: flex; align-items: center; justify-content: center;
}
.jsh-thumb-empty {
  background: #f1f1f1; color: #999; font-size: 1.1rem;
}

/* Product form preview */
.jsh-img-preview {
  width: 100%; max-height: 220px; object-fit: cover;
  border-radius: .5rem; border: 1px solid #eee;
}
.jsh-img-placeholder {
  width: 100%; height: 180px; border-radius: .5rem;
  background: #f1f1f1; color: #aaa;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

/* Menu preview cards */
.jsh-menu-card { border-radius: .6rem; overflow: hidden; }
.jsh-menu-img {
  width: 100%; height: 130px; object-fit: cover; background: #f1f1f1;
}
.jsh-menu-img-empty {
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 2rem;
}

/* ============================================================
   PHASE 3 — Waiter POS
   ============================================================ */

.jsh-pos-header { background: #111; border-bottom: 3px solid var(--jsh-orange); }

/* Category tabs */
.jsh-cat-tabs { position: sticky; top: 0; z-index: 5; background: var(--jsh-light); }
.jsh-cat-btn { white-space: nowrap; border-radius: 999px; padding: .35rem .85rem; font-size: .9rem; }
.jsh-cat-btn.active { background: var(--jsh-orange); border-color: var(--jsh-orange); color: #fff; }

/* Product grid */
.jsh-prod-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  padding-bottom: 160px; /* room for cart sheet */
}
@media (min-width: 576px) { .jsh-prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .jsh-prod-grid { grid-template-columns: repeat(4, 1fr); } }

.jsh-pos-card {
  background: #fff; border: 1px solid #eee; border-radius: .6rem;
  padding: 0; overflow: hidden; text-align: left;
  display: flex; flex-direction: column;
  transition: transform .08s ease, box-shadow .08s ease;
  min-height: 150px;
}
.jsh-pos-card:active { transform: scale(.98); }
.jsh-pos-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); }

.jsh-pos-img {
  width: 100%; height: 90px; object-fit: cover; background: #f1f1f1;
}
.jsh-pos-img-empty {
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 1.6rem;
}
.jsh-pos-info { padding: .5rem .6rem .6rem; }
.jsh-pos-name { font-size: .86rem; font-weight: 600; line-height: 1.15; }
.jsh-pos-price { font-size: .85rem; font-weight: 700; color: var(--jsh-orange); margin-top: .2rem; }

/* Cart sheet */
.jsh-cart {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.15);
  z-index: 1040;
  max-height: 70vh;
  display: flex; flex-direction: column;
  transform: translateY(calc(100% - 56px));
  transition: transform .22s ease-out;
}
.jsh-cart.jsh-cart-open { transform: translateY(0); }

.jsh-cart-handle {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  border-radius: 1rem 1rem 0 0;
  background: #111; color: #fff;
}
.jsh-cart-handle .badge { font-size: .72rem; }

.jsh-cart-body {
  overflow-y: auto; padding: .75rem 1rem 1rem;
}
.jsh-cart-items { max-height: 40vh; overflow-y: auto; }
.jsh-cart-item {
  display: flex; padding: .5rem 0; border-bottom: 1px dashed #eee;
}
.jsh-cart-item:last-child { border-bottom: none; }

@media (min-width: 992px) {
  .jsh-cart {
    position: sticky;
    top: 1rem; right: 0; bottom: auto;
    max-height: none;
    border-radius: 1rem;
    transform: none !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
    margin-top: 0;
  }
  .jsh-cart-handle { cursor: default; }
  .jsh-prod-grid { padding-bottom: 1rem; }
}

/* ============================================================
   PHASE 5 — Inventory
   ============================================================ */
.jsh-mov-row-sign-plus { color: #198754; }
.jsh-mov-row-sign-minus { color: #dc3545; }
.jsh-table-tight td, .jsh-table-tight th { padding: .35rem .5rem; }

/* ============================================================
   PHASE 4.2 — Waiter profile
   ============================================================ */
.jsh-avatar-circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--jsh-orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem;
  flex-shrink: 0;
}

/* ============================================================
   PHASE 6a — Recipes
   ============================================================ */
.jsh-recipe-row .form-control[readonly],
.jsh-recipe-row .form-control[readonly]:focus {
  background: #f8f9fa;
  cursor: default;
}

/* ============================================================
   PHASE 7a — Expenses
   ============================================================ */
.jsh-receipt-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: .35rem;
  border: 1px solid #eee;
}

/* ============================================================
   PHASE 7b — Customers
   ============================================================ */
.jsh-cust-cell-name { font-weight: 600; }
.jsh-cust-cell-sub  { font-size: .8rem; color: #6c757d; }

/* ============================================================
   PHASE 4.3 — Payments list
   ============================================================ */
.jsh-pay-amount { font-variant-numeric: tabular-nums; }

/* ============================================================
   PHASE 7c — Staff management
   ============================================================ */
.jsh-staff-role  { font-weight: 700; }
.jsh-staff-you   { font-size: .75rem; padding: .15rem .4rem; }

/* ============================================================
   PHASE 8 — Reports
   ============================================================ */
.jsh-report-kpi-label { font-size: .75rem; }
.jsh-report-row-margin-good   { color: #198754; }
.jsh-report-row-margin-warn   { color: #d39e00; }
.jsh-report-row-margin-danger { color: #dc3545; }
@media print {
  .jsh-layout .jsh-sidebar,
  .jsh-layout .jsh-waiter-topbar { display: none; }
  .jsh-main { padding: 0; }
}

/* ============================================================
   PHASE 8b — Audit log viewer
   ============================================================ */
.jsh-audit-row-desc {
  max-width: 480px;
  white-space: normal;
  word-break: break-word;
}
@media (min-width: 1200px) {
  .jsh-audit-row-desc { max-width: 640px; }
}