:root,
[data-theme="light"] {
  --sidebar-bg: #0f2e22;
  --sidebar-bg-accent: #174a35;
  --sidebar-bg-deep: #081a12;
  --sidebar-active: rgba(212, 175, 55, 0.16);
  --sidebar-text: #ecfdf5;
  --sidebar-muted: #8fb8a3;
  --sidebar-panel-bg: rgba(23, 74, 53, 0.72);
  --sidebar-border: rgba(212, 175, 55, 0.22);
  --sidebar-nav-hover: rgba(255, 255, 255, 0.08);
  --sidebar-glow: rgba(212, 175, 55, 0.5);
  --sidebar-accent: #d4af37;
  --sidebar-on-accent: #0f2e22;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --gold: #b45309;
  --gold-dark: #92400e;
  --gold-btn: #d97706;
  --gold-btn-hover: #b45309;
  --gold-soft: rgba(217, 119, 6, 0.1);
  --text: #111827;
  --muted: #6b7280;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --info: #2563eb;
  --radius: 8px;
  --radius-lg: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "DM Sans", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(17, 24, 39, 0.08), 0 2px 4px -2px rgba(17, 24, 39, 0.05);
  --loader-bg: #f3f4f6;
  --loader-text: #111827;
  --btn-on-gold: #ffffff;
  --badge-neutral-bg: #f3f4f6;
  --badge-neutral-text: #4b5563;
  color-scheme: light;
}

[data-theme="dark"] {
  --sidebar-bg: #061610;
  --sidebar-bg-accent: #0f2e22;
  --sidebar-bg-deep: #030d09;
  --sidebar-active: rgba(232, 197, 71, 0.18);
  --sidebar-text: #ecfdf5;
  --sidebar-muted: #7aa892;
  --sidebar-panel-bg: rgba(15, 46, 34, 0.9);
  --sidebar-border: rgba(232, 197, 71, 0.18);
  --sidebar-nav-hover: rgba(255, 255, 255, 0.06);
  --sidebar-glow: rgba(232, 197, 71, 0.42);
  --sidebar-accent: #e8c547;
  --sidebar-on-accent: #0f2e22;
  --bg: #0b0f17;
  --surface: #111827;
  --surface-soft: #0f141e;
  --border: #1f2937;
  --border-strong: #374151;
  --gold: #f59e0b;
  --gold-dark: #fbbf24;
  --gold-btn: #d97706;
  --gold-btn-hover: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.14);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --info: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --loader-bg: #0b0f17;
  --loader-text: #f3f4f6;
  --btn-on-gold: #ffffff;
  --badge-neutral-bg: #1f2937;
  --badge-neutral-text: #d1d5db;
  color-scheme: dark;
}

[data-theme="dark"] .badge.sold,
[data-theme="dark"] .badge.order-cancelled {
  background: rgba(197, 48, 48, 0.22);
}

[data-theme="dark"] .badge.reserved,
[data-theme="dark"] .badge.order-new,
[data-theme="dark"] .badge.order-pending {
  background: rgba(230, 126, 34, 0.2);
}

[data-theme="dark"] .badge.order-confirmed {
  background: rgba(21, 101, 192, 0.22);
}

[data-theme="dark"] .badge.order-progress {
  background: rgba(123, 31, 162, 0.22);
}

[data-theme="dark"] .badge.order-ready,
[data-theme="dark"] .badge.order-completed {
  background: rgba(47, 133, 90, 0.22);
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app {
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background:
    linear-gradient(180deg, var(--sidebar-bg-accent) 0%, var(--sidebar-bg) 45%, var(--sidebar-bg-deep) 100%);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.9rem 1rem;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
  position: relative;
  z-index: 3;
}

/* Desktop: the menu is pinned to the viewport and scrolls on its own, so
   the bottom entries (Settings, the metal-rate panel) are always reachable
   even when the page content is short or the window is small. */
@media (min-width: 769px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 999px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }
  .nav { flex: 1 0 auto; }
  .sidebar-footer { flex: 0 0 auto; padding-bottom: 0.5rem; }
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--sidebar-glow) 30%,
    var(--sidebar-accent) 50%,
    var(--sidebar-glow) 70%,
    transparent 100%
  );
  opacity: 0.65;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem 1rem;
  margin-bottom: 0.5rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 1rem;
  background: var(--gold-soft);
  border-radius: 8px;
}

.brand strong {
  display: block;
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--sidebar-text);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  padding: 0.58rem 0.7rem;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--sidebar-muted);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-btn:hover {
  background: var(--sidebar-nav-hover);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover .nav-icon {
  color: var(--sidebar-accent);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.12);
}

.nav-btn.is-active {
  background: var(--sidebar-active);
  border-color: rgba(212, 175, 55, 0.35);
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.nav-btn.is-active .nav-icon {
  background: linear-gradient(145deg, #e8c547, #b8860b);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--sidebar-on-accent);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.settings-nav-btn.is-active {
  background: var(--sidebar-active);
  border-color: rgba(212, 175, 55, 0.35);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.settings-nav-btn.is-active .nav-icon {
  background: linear-gradient(145deg, #e8c547, #b8860b);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--sidebar-on-accent);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metal-rates {
  background: var(--sidebar-panel-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 14px;
  padding: 0.9rem 0.95rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.metal-rates h3 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sidebar-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metal-rates-body {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.metal-rates-warning {
  color: var(--danger);
}

.metal-rate-detail {
  margin: 0.2rem 0;
  font-size: 0.82rem;
  color: var(--sidebar-text);
}

.metal-rates .rate-edit {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--sidebar-accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  padding: 0.58rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.settings-nav-btn:hover {
  background: var(--sidebar-nav-hover);
  border-color: rgba(255, 255, 255, 0.05);
}

.settings-nav-btn:hover .nav-icon {
  color: var(--sidebar-accent);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.12);
}

.settings-nav-btn.settings-icon-only {
  justify-content: flex-start;
  padding: 0.58rem 0.7rem;
  width: 100%;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ── Workspace ── */
.workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.home-hero {
  display: block;
  position: relative;
  width: min(100%, 520px);
  max-width: 520px;
  height: clamp(88px, 11vw, 120px);
  margin: 0.65rem auto 0;
  overflow: hidden;
  background: #1a0a10;
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--sidebar-accent);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.home-hero[hidden] {
  display: none !important;
}

.home-hero-track {
  position: absolute;
  inset: 0;
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.65s ease-in-out;
  pointer-events: none;
}

.home-hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.home-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.home-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(74, 14, 28, 0.75) 0%,
    rgba(74, 14, 28, 0.25) 45%,
    rgba(0, 0, 0, 0.15) 100%
  );
  pointer-events: none;
}

.home-hero-caption {
  position: absolute;
  left: 0.85rem;
  bottom: 0.65rem;
  z-index: 2;
  max-width: 72%;
  color: #fff;
}

.home-hero-tag {
  display: inline-block;
  margin-bottom: 0.2rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a0e1c;
  background: linear-gradient(145deg, #f5e6a8, #d4af37);
  border-radius: 999px;
}

.home-hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(74, 14, 28, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.home-hero-nav svg {
  width: 14px;
  height: 14px;
}

.home-hero-nav:hover {
  background: rgba(74, 14, 28, 0.85);
  border-color: var(--sidebar-accent);
}

.home-hero-prev { left: 0.4rem; }
.home-hero-next { right: 0.4rem; }

.home-hero-dots {
  position: absolute;
  bottom: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.3rem;
}

.home-hero-dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.home-hero-dot.is-active {
  background: var(--sidebar-accent);
  transform: scale(1.25);
}

.workspace .main {
  flex: 1;
  min-height: 0;
}

@media (max-width: 768px) {
  .home-hero {
    width: calc(100% - 1.5rem);
    max-width: 420px;
    height: clamp(76px, 22vw, 96px);
    margin-top: 0.5rem;
  }
  .home-hero-nav {
    width: 24px;
    height: 24px;
  }
  .home-hero-nav svg {
    width: 12px;
    height: 12px;
  }
  .home-hero-prev { left: 0.3rem; }
  .home-hero-next { right: 0.3rem; }
  .home-hero-caption {
    left: 0.6rem;
    bottom: 0.45rem;
    max-width: 75%;
  }
  .home-hero-title {
    font-size: 0.72rem;
  }
}

/* ── Workspace (auth states) ── */

body.auth-pending .app {
  opacity: 0;
  pointer-events: none;
}

body.auth-ready .app {
  opacity: 1;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--bg);
  color: var(--text);
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

body.auth-ready .app-loading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

body.auth-signed-out .workspace {
  pointer-events: none;
  user-select: none;
  opacity: 0.94;
}

body.auth-signed-out .sidebar,
body.auth-signed-out .modal,
body.auth-signed-out .toast {
  pointer-events: auto;
  user-select: auto;
  opacity: 1;
  visibility: visible;
}

.pos-view .pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  align-items: start;
}

.pos-view .pos-main {
  min-width: 0;
}

.pos-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 0 1.25rem;
  min-height: 0;
}

.main {
  padding: 1rem 1.75rem 2rem;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pos-topbar,
.page-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.25rem;
}

/* ── POS layout ── */
.pos-block {
  margin-bottom: 1.75rem;
}

.pos-block-title {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.search-field {
  position: relative;
  width: 100%;
}

.search-field .field-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.35rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.add-customer-pos-btn {
  margin-top: 0.65rem;
  display: inline-flex;
}

.add-customer-pos-btn svg {
  width: 14px;
  height: 14px;
}

.customer-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(44, 42, 38, 0.1);
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}

.customer-suggestions button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.customer-suggestions button:last-child { border-bottom: 0; }
.customer-suggestions button:hover { background: rgba(212, 175, 55, 0.08); }
.customer-suggestions .suggestion-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.selected-customer {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.catalog-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  align-items: center;
}

.catalog-search {
  flex: 1;
  min-width: 200px;
}

.catalog-select {
  min-width: 100px;
  max-width: 130px;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
}

.catalog-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 280px;
  padding: 0.75rem;
}

.catalog-grid .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 2rem 1.5rem;
}

.catalog-grid .empty-state p {
  max-width: 360px;
  line-height: 1.5;
  font-size: 0.88rem;
}

.pos-catalog-meta {
  margin-bottom: 0.5rem;
}

.pos-item-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.pos-product-list.catalog-grid {
  padding: 0;
  min-height: 200px;
}

.pos-product-list.catalog-grid:not(.has-products) {
  display: block;
  padding: 0.75rem;
}

.pos-product-list.catalog-grid.has-products {
  display: block;
}

.pos-catalog-table-wrap {
  border: 0;
  border-radius: var(--radius-lg);
  max-height: min(520px, 55vh);
  overflow: auto;
}

.pos-item-list .pos-item-name-cell strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.35;
}

.pos-item-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.pos-item-price {
  font-weight: 600;
  color: var(--gold-dark);
  white-space: nowrap;
}

.product-stock-inline {
  display: inline-block;
  min-width: 1.75rem;
  text-align: center;
}

.pos-list-action-col {
  width: 48px;
  text-align: right;
  white-space: nowrap;
}

.pos-item-row.is-unavailable td {
  opacity: 0.72;
}

.pos-item-row.is-unavailable .pos-item-name-cell strong {
  color: var(--muted);
}

.product-stock-inline.is-zero {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
}

.product-cart-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pos-item-list .badge {
  font-size: 0.72rem;
  white-space: nowrap;
}

.pos-item-row:hover td {
  background: rgba(212, 175, 55, 0.05);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.product-grid.catalog-grid:not(.has-products) {
  display: block;
}

.product-grid.catalog-grid.has-products {
  display: grid;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: var(--surface-soft);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.product-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.product-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--gold-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.product-cart-btn svg {
  pointer-events: none;
}

.product-cart-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold);
}

.product-card strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.product-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.product-stock {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(90, 143, 90, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pos-customer-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.pos-customer-search-wrap {
  flex: 1;
  min-width: 180px;
}

.pos-customer-display {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius);
  display: grid;
  gap: 0.5rem;
  position: relative;
}

.pos-customer-display-head {
  display: flex;
  justify-content: flex-end;
  margin: -0.15rem 0 -0.35rem;
}

.pos-customer-clear-btn {
  font-size: 1.25rem;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius);
}

.pos-customer-clear-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

.pos-customer-display[hidden] {
  display: none !important;
}

.pos-customer-display-row {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) 1fr;
  gap: 0.65rem;
  align-items: baseline;
  font-size: 0.88rem;
}

.pos-customer-display-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.pos-customer-display-row strong {
  font-weight: 600;
  word-break: break-word;
}

.field-error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--danger);
  line-height: 1.35;
}

.product-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.product-card .product-price {
  margin-top: 0;
  font-weight: 700;
  color: var(--gold-dark);
  font-size: 0.92rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.35;
  margin-bottom: 0.75rem;
}

/* ── Sale panel ── */
.sale-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  flex: 1;
  min-height: 0;
}

.sale-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.sale-panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.sale-customer {
  margin: -0.35rem 0 0.85rem;
  padding: 0.55rem 0.75rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.sale-customer-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.sale-customer strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
}

.sale-customer-phone {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.sale-panel-head .btn-xs svg {
  width: 12px;
  height: 12px;
}

.cart-lines {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
}

.cart-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.cart-line-info {
  flex: 1;
  min-width: 0;
}

.cart-line-info strong,
.cart-line-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.cart-line-info span { color: var(--muted); font-size: 0.78rem; }

.cart-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.cart-line-total {
  order: -1;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.cart-qty-btn {
  border: 0;
  background: var(--surface-soft);
  color: var(--text);
  width: 26px;
  height: 26px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover:not(:disabled) { background: var(--gold-soft); color: var(--gold-dark); }
.cart-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cart-qty-input {
  width: 40px;
  height: 26px;
  text-align: center;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  -moz-appearance: textfield;
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-remove {
  border: 0;
  background: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.7;
}
.cart-remove:hover { opacity: 1; }

.sale-summary {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.summary-row.total {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.summary-row input {
  width: 90px;
  text-align: right;
  padding: 0.35rem 0.5rem;
}

.old-gold-tradein { margin-bottom: 0.6rem; }
.old-gold-tradein-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.old-gold-tradein-title { font-size: 0.82rem; font-weight: 600; opacity: 0.75; }
.og-items { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.4rem; }
.og-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.55rem 0.6rem; background: var(--surface-soft); }
.og-item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 0.6rem; }
.og-item-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; opacity: 0.75; }
.og-item-grid input { width: 100%; padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.og-item-grid input[readonly] { opacity: 0.7; background: var(--surface); }
.og-item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.45rem; padding-top: 0.4rem; border-top: 1px dashed var(--border); }
.og-item-foot .og-item-value { font-weight: 700; font-size: 0.88rem; }
@media (min-width: 900px) {
  .og-item-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.summary-row-tax {
  align-items: center;
}

.tax-row-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tax-type-select {
  padding: 0.25rem 0.4rem;
  font: inherit;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.sale-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sale-actions .btn svg {
  width: 14px;
  height: 14px;
}

.ai-suggestions {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.ai-suggestions strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

/* ── Shared components ── */
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 45%, transparent);
  outline-offset: 0;
  border-color: var(--gold);
}

.btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}

.btn:hover { background: var(--surface-soft); }

.btn-primary, .btn-gold {
  background: var(--gold-btn);
  border-color: var(--gold-btn);
  color: var(--btn-on-gold);
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
}

.btn-primary:hover, .btn-gold:hover {
  background: var(--gold-btn-hover);
  border-color: var(--gold-btn-hover);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.82rem; }

.btn-xs {
  padding: 0.3rem 0.55rem;
  font-size: 0.76rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.panel-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.stat-card span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.stat-card strong {
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 700;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

#search-items { flex: 1; min-width: 200px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--surface-soft);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--badge-neutral-bg);
  color: var(--badge-neutral-text);
}

.badge.sold { background: #fef2f2; color: var(--danger); }
.badge.reserved { background: #fff7ed; color: var(--warning); }
.badge.order-new { background: #fff7ed; color: #e65100; }
.badge.order-pending { background: #fff7ed; color: var(--warning); }
.badge.order-confirmed { background: #eff6ff; color: var(--info); }
.badge.order-progress { background: #f5f3ff; color: #7c3aed; }
.badge.order-ready { background: #ecfdf5; color: var(--success); }
.badge.order-completed { background: #ecfdf5; color: var(--success); }
.badge.order-cancelled { background: #fef2f2; color: var(--danger); }

.panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.panel-head-row h2 { margin: 0; }

.panel-head-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.panel-head-row .panel-desc {
  margin: 0;
}

/* Pull the description up only when it sits directly under a heading —
   elsewhere (after <strong>, <legend>, another paragraph) the old blanket
   negative margin made it overlap the line above (Settings → Theme). */
h1 + .panel-desc,
h2 + .panel-desc,
h3 + .panel-desc,
.modal-head + .panel-desc { margin-top: -0.5rem; }

.orders-list { display: flex; flex-direction: column; gap: 0.75rem; }

.order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface-soft);
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.order-card-head strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.order-card-body p {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}

.order-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.3rem;
}

.order-card-actions {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.muted-inline { color: var(--muted); font-size: 0.82rem; }

.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.link-btn {
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.2rem 0.35rem;
  text-decoration: underline;
}

.link-btn.danger { color: var(--danger); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.form-grid label[hidden],
.weight-entry label[hidden] {
  display: none !important;
}

.form-grid .span-2 { grid-column: span 2; }

.check-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  color: var(--text) !important;
}

.order-form .btn-primary { margin-top: 0.75rem; }

.settings-form input[readonly] { background: var(--surface-soft); }

.settings-hint { margin: 0; font-size: 0.82rem; color: var(--muted); }
.settings-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.settings-updated { font-size: 0.85rem; color: var(--muted); }
.language-row { max-width: 280px; }
.language-row select { width: 100%; }

.category-chart { display: flex; flex-direction: column; gap: 0.6rem; }
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.85rem;
}
.bar-track { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold-btn); border-radius: 999px; }

.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.simple-list li:last-child { border-bottom: 0; }

.empty { color: var(--muted); font-size: 0.9rem; padding: 1rem 0; }

.placeholder-view {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.placeholder-view h2 {
  font-family: var(--display);
  color: var(--text);
  margin-bottom: 0.5rem;
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  width: min(560px, calc(100vw - 2rem));
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(44, 42, 38, 0.15);
}

.modal::backdrop { background: rgba(44, 42, 38, 0.4); }
.modal form { padding: 1.25rem; }
.modal-wide {
  width: min(640px, calc(100vw - 2rem));
}
.modal-section {
  border: 0;
  margin: 0 0 1.1rem;
  padding: 0;
}
.modal-section legend {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  color: var(--gold-dark);
  padding: 0;
}
.modal-section-grid {
  margin-top: 0.75rem;
}
.order-customer-display {
  margin-top: 0.75rem;
}

.order-price-breakdown {
  margin: 0;
}

.order-price-breakdown .gold-calc-table {
  margin-top: 0.35rem;
}

.modal-search {
  margin-bottom: 0.5rem;
}
.modal-inline-btn {
  margin-bottom: 0.25rem;
}
#custom-item-price-preview {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: default;
}

/* ── Sale bill ── */
.bill-modal {
  width: min(980px, calc(100vw - 2rem));
  max-width: none;
}

.bill-modal-head,
.bill-modal-foot {
  padding: 1rem 1.25rem;
}

.bill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  padding: 0.75rem 1.25rem;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.bill-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.bill-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
}

.bill-signatory-field {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  flex: 1;
  min-width: 180px;
}

.bill-signatory-field input {
  width: 100%;
  max-width: 260px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.85rem;
  background: var(--surface);
}

.bill-content {
  padding: 1rem 1.25rem 1.25rem;
  max-height: 62vh;
  overflow-y: auto;
  background: #f0ebe0;
}

.bill-receipt-premium {
  background: transparent;
  border: 0;
  padding: 0;
}

.bill-frame {
  position: relative;
  background: linear-gradient(180deg, #fffef8 0%, #fdf9ee 100%);
  border: 2px solid #c9a84c;
  border-radius: 4px;
  padding: 1.5rem 1.35rem 1.25rem;
  box-shadow: 0 4px 24px rgba(168, 137, 79, 0.12);
}

.bill-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #a8894f;
  border-style: solid;
}

.bill-corner-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.bill-corner-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.bill-corner-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.bill-corner-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.bill-header {
  text-align: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.45);
}

.bill-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.bill-logo {
  width: 88px;
  height: 88px;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(139, 105, 20, 0.18));
}

.bill-emblem {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.5rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #a8894f;
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  border-radius: 50%;
}

.bill-shop strong {
  display: block;
  font-family: var(--display);
  font-size: 1.45rem;
  color: #8b6914;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}

.bill-shop p {
  margin: 0.1rem 0;
  font-size: 0.8rem;
  color: #6b665c;
}

.bill-receipt-type {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a8894f;
}

.bill-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.84rem;
}

.bill-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bill-meta-wide {
  grid-column: 1 / -1;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(201, 168, 76, 0.35);
}

.bill-meta-cell strong {
  color: #2c2a26;
  font-size: 0.9rem;
}

.bill-meta-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.bill-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a8894f;
  font-weight: 600;
}

.bill-table-wrap {
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.bill-table-premium {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.bill-table-premium thead {
  background: linear-gradient(180deg, #f5e6b8 0%, #e8d49a 100%);
}

.bill-table-premium th {
  padding: 0.55rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c4a1f;
  border-bottom: 1px solid #c9a84c;
}

.bill-table-premium td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  vertical-align: top;
  background: #fffef9;
}

.bill-table-premium tbody tr:last-child td {
  border-bottom: 0;
}

.bill-table-premium .bill-num {
  width: 28px;
  text-align: center;
  color: #a8894f;
  font-weight: 600;
}

.bill-table-premium td:nth-child(3),
.bill-table-premium th:nth-child(3) {
  text-align: center;
  width: 40px;
}

.bill-table-premium td:nth-child(4),
.bill-table-premium th:nth-child(4),
.bill-table-premium td:nth-child(5),
.bill-table-premium th:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

.bill-item-name {
  display: block;
  color: #2c2a26;
  font-size: 0.84rem;
}

.bill-line-meta {
  display: block;
  font-size: 0.72rem;
  color: #8a8478;
  margin-top: 0.12rem;
}

.bill-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.bill-totals-premium {
  flex: 1;
  min-width: 200px;
  border-top: 0;
  padding-top: 0;
}

.bill-total-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.86rem;
  margin-bottom: 0.3rem;
  color: #4a463f;
}

.bill-discount-line span:last-child {
  color: var(--danger);
}

.bill-grand-total {
  margin-top: 0.4rem;
  padding-top: 0.5rem;
  border-top: 2px solid #c9a84c;
  font-size: 1.05rem;
}

.bill-grand-total strong {
  color: #8b6914;
  font-size: 1.15rem;
}

.bill-stamp {
  flex-shrink: 0;
}

.bill-stamp-ring {
  width: 88px;
  height: 88px;
  border: 3px double #c0392b;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-12deg);
  color: #c0392b;
  opacity: 0.88;
  background: rgba(192, 57, 43, 0.04);
}

.bill-stamp-top,
.bill-stamp-bottom {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bill-stamp-center {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0.1rem 0;
}

.bill-signatures {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(201, 168, 76, 0.45);
}

.bill-signatures-dual {
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.bill-sign-block-customer {
  margin-right: auto;
}

.bill-sign-block-authorized {
  margin-left: auto;
}

.shop-name-status.is-available {
  color: var(--success, #2d6a4f);
}

.shop-name-status.is-taken {
  color: var(--danger);
}

.settings-shop-name-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bill-sign-block {
  text-align: center;
  width: min(220px, 50%);
}

.bill-sign-line {
  min-height: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid #8b6914;
  margin-bottom: 0.35rem;
  padding-bottom: 0.25rem;
}

.bill-sign-scribble {
  width: 100px;
  height: 32px;
  color: #4a463f;
  opacity: 0.7;
}

.bill-sign-line-blank {
  min-height: 48px;
}

.bill-sign-name {
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 1.25rem;
  color: #2c4a7c;
  line-height: 1;
}

.bill-sign-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a8478;
}

.bill-thanks {
  text-align: center;
  margin: 1.1rem 0 0.25rem;
  font-family: var(--display);
  font-size: 0.95rem;
  color: #8b6914;
}

.bill-footer-note {
  text-align: center;
  margin: 0;
  font-size: 0.68rem;
  color: #a8a095;
  letter-spacing: 0.04em;
}

/* ---- Guarantee bill (ग्यारेन्टी बिल) — bilingual jewellery-shop bill pad ---- */
.gbill {
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #14532d;
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
  font-family: var(--font, sans-serif);
  font-size: 0.85rem;
  line-height: 1.4;
}
.gbill span:not(.gbill-sign-name) { color: #4b5563; font-size: 0.85em; }
.gbill-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
  border-bottom: 2px solid #14532d;
  padding-bottom: 0.6rem;
}
.gbill-head-left { justify-self: start; display: grid; gap: 0.35rem; }
.gbill-head-right { justify-self: end; text-align: right; display: grid; gap: 0.15rem; }
.gbill-head-center { text-align: center; }
.gbill-shop-name { margin: 0; font-size: 1.5rem; color: #14532d; font-weight: 800; letter-spacing: 0.02em; }
.gbill-shop-line { margin: 0.1rem 0; font-size: 0.82rem; }
.gbill-pan-box, .gbill-billno {
  border: 1px solid #14532d;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  width: fit-content;
}
.gbill-badge {
  display: inline-block;
  margin: 0.35rem auto 0;
  padding: 0.15rem 0.9rem;
  border: 1.5px solid #14532d;
  border-radius: 999px;
  font-weight: 700;
  color: #14532d;
}
.gbill-customer {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.15rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #9ca3af;
}
.gbill-cust-line { margin: 0; border-bottom: 1px dotted #9ca3af; padding: 0.15rem 0; }
.gbill-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
.gbill-table th, .gbill-table td {
  border: 1px solid #14532d;
  padding: 0.3rem 0.35rem;
  font-size: 0.78rem;
  word-wrap: break-word;
}
.gbill-table td.gb-r { white-space: nowrap; }
.gbill-table th { background: #f0fdf4; color: #14532d; font-weight: 700; text-align: center; }
.gbill-table th span { display: block; font-weight: 500; font-size: 0.85em; }
.gbill-th-particulars { width: 14%; }
.gbill-table .gb-c { text-align: center; }
.gbill-table .gb-l { text-align: left; }
.gbill-table .gb-r { text-align: right; font-variant-numeric: tabular-nums; }
.gbill-sum td { font-weight: 700; background: #f0fdf4; }
.gbill-blank td { height: 1.4rem; }
.gbill-bottom {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0.75rem;
  margin-top: 0.6rem;
  align-items: start;
}
.gbill-mini-table { border-collapse: collapse; width: 100%; }
.gbill-mini-table td {
  border: 1px solid #14532d;
  padding: 0.26rem 0.5rem;
  font-size: 0.8rem;
}
.gbill-mini-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gbill-totals-table .gb-grand td { font-weight: 800; background: #f0fdf4; }
.gbill-words { margin: 0.5rem 0 0.35rem; }
.gbill-words em { color: #4b5563; font-style: italic; }
.gbill-notes { margin-top: 0.6rem; font-size: 0.78rem; }
.gbill-notes ul { margin: 0.15rem 0 0; padding-left: 1.1rem; }
.gbill-notes li { margin: 0.1rem 0; }
.gbill-signs {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 1.6rem;
}
.gbill-sign-block { text-align: center; font-size: 0.75rem; }
.gbill-sign-line {
  border-top: 1px dotted #1a1a1a;
  min-width: 160px;
  padding-top: 0.2rem;
  min-height: 1.1rem;
}
.gbill-sign-name { font-family: 'Brush Script MT', cursive; font-size: 1rem; }
.gbill-rate-note { font-size: 0.7rem; color: #4b5563; margin: 0; }
.gbill-voided {
  text-align: center;
  color: #b91c1c;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-top: 0.6rem;
}

@media print {
  body > *:not(#bill-modal) {
    display: none !important;
  }

  #bill-modal {
    display: block !important;
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  #bill-modal::backdrop {
    display: none;
  }

  .bill-modal-head,
  .bill-modal-foot,
  .bill-options {
    display: none !important;
  }

  .bill-content {
    max-height: none;
    overflow: visible;
    padding: 0;
    background: #fff;
  }

  .bill-frame {
    box-shadow: none;
  }

  .gbill {
    border-width: 1.5px;
    font-size: 9pt;
    padding: 8mm 6mm;
  }

  @page {
    size: A4 portrait;
    margin: 8mm;
  }
}

/* POS guarantee-bill details block */
.pos-bill-details {
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 0.4rem 0.6rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.pos-bill-details summary { cursor: pointer; font-weight: 600; }
.pos-bill-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.pos-bill-details-grid label { display: grid; gap: 0.15rem; font-size: 0.78rem; }
.pos-bill-details-grid input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.summary-row-skillfee .skillfee-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
#cart-payref { max-width: 11rem; }
.bill-style-field select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.modal-head, .modal-foot { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-family: var(--font); font-size: 1.1rem; font-weight: 600; }
.modal-foot { justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

.quick-calc-modal {
  width: min(100vw - 2rem, 320px);
  padding: 0;
  border: 0;
}

.quick-calc-modal .modal-head {
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.quick-calc-body {
  padding: 1rem 1.15rem 1.15rem;
}

.quick-calc-display {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  min-height: 2.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-calc-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.quick-calc-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.85rem 0.5rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.quick-calc-btn:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.quick-calc-btn:active {
  transform: scale(0.98);
}

.quick-calc-op {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-dark);
  font-weight: 600;
}

.quick-calc-fn {
  color: var(--muted);
  font-weight: 600;
}

.quick-calc-eq {
  grid-column: 4;
  grid-row: 4 / span 2;
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 700;
}

.quick-calc-eq:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.quick-calc-zero {
  grid-column: span 2;
}

.auth-modal {
  width: min(440px, calc(100vw - 2rem));
}

/* Facebook-style auth modal */
.fb-auth-modal {
  --fb-blue: #1877f2;
  --fb-blue-hover: #166fe5;
  --fb-green: #42b72a;
  --fb-green-hover: #36a420;
  --fb-border: #dddfe2;
  --fb-text: #1c1e21;
  --fb-muted: #606770;
  --fb-bg: #ffffff;
  position: relative;
  border: none;
  border-radius: 8px;
  background: var(--fb-bg);
  color: var(--fb-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: visible;
  width: min(420px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 0;
}

.fb-auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.fb-auth-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e4e6eb;
  color: #606770;
  font-size: 1.35rem;
  line-height: 1;
  z-index: 2;
}

.fb-auth-close:hover {
  background: #d8dadf;
}

.auth-modal-body {
  padding: 1.5rem 1.25rem 1.25rem;
  overflow: auto;
  max-height: calc(100vh - 2rem);
}

.auth-guest {
  display: flex;
  flex-direction: column;
}

.fb-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
}

.fb-auth-brand-compact {
  gap: 0;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}

.fb-logo-badge {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fb-blue);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.fb-auth-logo {
  display: block;
  filter: brightness(0) invert(1);
}

.fb-auth-heading {
  margin: 0 0 1rem;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fb-text);
  line-height: 1.25;
  text-align: center;
}

.fb-auth-tagline {
  margin: -0.35rem 0 0;
  color: var(--fb-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.fb-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  width: 100%;
}

.fb-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--fb-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fb-text);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.2;
}

.fb-input::placeholder {
  color: #90949c;
}

.fb-input:focus {
  outline: none;
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.15);
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0 1rem;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fb-btn-pill {
  border-radius: 999px;
  min-height: 48px;
  font-size: 1.1rem;
}

.fb-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.fb-btn-primary {
  background: var(--fb-blue);
  color: #fff;
  margin-top: 0.15rem;
}

.fb-btn-primary:hover:not(:disabled) {
  background: var(--fb-blue-hover);
}

.fb-btn-signup {
  background: var(--fb-green);
  color: #fff;
  margin-top: 0.15rem;
}

.fb-btn-signup:hover:not(:disabled) {
  background: var(--fb-green-hover);
}

.fb-btn-outline-blue {
  background: #fff;
  color: var(--fb-blue);
  border: 1px solid var(--fb-blue);
  font-size: 1.05rem;
}

.fb-btn-outline-blue:hover:not(:disabled) {
  background: #f0f6ff;
}

.fb-btn-outline {
  background: #e4e6eb;
  color: var(--fb-text);
  font-size: 1.05rem;
}

.fb-btn-outline:hover:not(:disabled) {
  background: #d8dadf;
}

.fb-link-btn {
  margin-top: 0.15rem;
  padding: 0.5rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--fb-blue);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.fb-link-btn:hover {
  text-decoration: underline;
}

.fb-google-link {
  margin-top: 0;
}

.fb-auth-footer-actions {
  margin-top: 1.25rem;
  width: 100%;
}

.fb-auth-footer-compact {
  margin-top: 0.75rem;
  text-align: center;
}

.auth-field-hint {
  margin: -0.35rem 0 0;
  color: var(--fb-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.auth-error {
  margin: 0;
  color: #d93025;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.auth-success {
  margin: 0;
  color: #1e7e34;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: center;
}

.auth-signed-in {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* This class lands on <body> once signed in (auth.js), so no text-align
     here — it centred every heading in the app. */
}

.auth-user-name {
  margin: 0;
  font-weight: 700;
  color: var(--fb-text);
  font-size: 1rem;
}

.auth-user-meta {
  margin: 0;
  color: var(--fb-muted);
  font-size: 0.88rem;
  word-break: break-all;
}

.auth-signout-btn {
  width: 100%;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-width: min(360px, calc(100vw - 2rem));
  font-size: 0.88rem;
  line-height: 1.4;
}

.toast.toast-error {
  background: #dc2626;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.1rem;
}

.toast.toast-error strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.toast.toast-error span {
  font-size: 0.85rem;
  opacity: 0.95;
}

@media (max-width: 1100px) {
  .pos-view .pos-layout { grid-template-columns: 1fr; }
  .pos-sidebar {
    padding: 0 0 1.25rem;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0.85rem 0.75rem;
  }
  .sidebar::before { display: none; }
  .brand {
    padding-bottom: 0.75rem;
    margin-bottom: 0.35rem;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .nav-btn,
  .settings-nav-btn {
    flex: 1 1 calc(33.333% - 0.35rem);
    min-width: 5.5rem;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
    font-size: 0.72rem;
    text-align: center;
    justify-content: center;
  }
  .nav-btn span:not(.nav-icon),
  .settings-nav-btn span:not(.nav-icon) {
    line-height: 1.2;
  }
  .nav-icon {
    width: 32px;
    height: 32px;
  }
  .sidebar-footer { margin-top: 0.75rem; }
  .metal-rates { display: none; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-2 { grid-column: span 1; }
}

/* ── Page headers ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-icon {
  padding: 0.55rem;
  min-width: 40px;
}

.page-header-actions .btn-icon svg {
  width: 16px;
  height: 16px;
}

.page-header-actions .btn-sm {
  padding: 0.45rem 0.8rem;
}

.filter-bar {
  margin-bottom: 1rem;
}

.filter-bar input[type="search"],
.filter-bar input[type="text"] {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.filter-bar.stacked {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.data-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.data-card .table-wrap { padding: 0; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.data-table th .sort-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.25rem;
  width: 14px;
  height: 14px;
  opacity: 0.45;
}
.data-table th input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
}
.data-table td input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
}
.data-table tbody tr:hover { background: rgba(212, 175, 55, 0.04); }
.data-table .empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}
.data-table .name-cell,
.data-table .receipt-cell {
  position: relative;
}
.data-table .name-cell .row-actions,
.data-table .receipt-cell .row-actions {
  display: none;
  gap: 0.35rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.data-table tbody tr:hover .name-cell .row-actions,
.data-table tbody tr:hover .receipt-cell .row-actions {
  display: flex;
}
.data-table .actions-col { white-space: nowrap; }

.inventory-actions-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
  white-space: nowrap;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.table-footer-simple {
  justify-content: flex-start;
}

.pagination { display: flex; gap: 0.35rem; }

/* ── Order groups ── */
.order-group-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
}

.order-group-tab {
  border: 0;
  background: transparent;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}

.order-group-tab.is-active {
  background: var(--gold-btn);
  color: #1f2937;
  font-weight: 600;
}

.order-group-tab.has-search-matches:not(.is-active) {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.orders-card .table-wrap,
.orders-content .table-wrap {
  padding: 0;
}

.orders-content {
  min-height: 200px;
}

.order-group-head-single {
  border-bottom: 1px solid var(--border);
}

.order-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface-soft);
}

.order-group-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.order-group-title h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.order-group-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.order-group-dot-new { background: #e65100; }
.order-group-dot-progress { background: #7b1fa2; }
.order-group-dot-completed { background: #1565c0; }
.order-group-dot-other { background: #e65100; }

.order-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.order-group-table .data-table th {
  background: var(--surface);
}

.order-group-table .data-table tr:last-child td {
  border-bottom: 0;
}

/* ── Reports ── */
.reports-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.date-range {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-range.compact { margin-bottom: 1rem; }

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-self: flex-end;
  padding-bottom: 0.15rem;
}
.date-preset {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}
.date-preset:hover { color: var(--text); border-color: var(--gold, #b8860b); }
.date-preset.is-active {
  background: var(--gold, #b8860b);
  border-color: var(--gold, #b8860b);
  color: #fff;
}
.report-period-note { margin: -0.25rem 0 0.9rem; font-size: 0.82rem; }
.return-sale-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0.9rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.82rem;
}
.return-sale-preview div span { display: block; color: var(--muted); font-size: 0.72rem; }
.return-sale-preview div strong { font-size: 0.95rem; }
#return-sale-lines input[type="number"] { width: 5rem; }
.badge.badge-return { background: #fef3c7; color: #b45309; }

.nav-count {
  margin-left: auto;
  min-width: 1.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}
.returned-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}
.returned-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.returned-card.is-decided { opacity: 0.8; }
.returned-card-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.returned-card-head h3 { margin: 0; font-size: 1rem; }
.returned-card-meta { font-size: 0.78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; }
.returned-card-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; font-size: 0.8rem; }
.returned-card-figures span { display: block; color: var(--muted); font-size: 0.7rem; }
.returned-card-figures strong { font-size: 0.92rem; }
.returned-card-reason { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.returned-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.returned-card-actions .btn { flex: 1 1 auto; justify-content: center; }
.badge.badge-source-void { background: #fee2e2; color: #b91c1c; }
.badge.badge-source-return { background: #fef3c7; color: #b45309; }
.badge.badge-status-restocked { background: #d1fae5; color: #065f46; }
.badge.badge-status-scrapped { background: #e0e7ff; color: #3730a3; }
.badge.badge-status-deleted { background: #e5e7eb; color: #374151; }
.badge.badge-status-pending { background: #fef3c7; color: #b45309; }

.date-range label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.report-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.report-tab {
  border: 0;
  background: transparent;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}

.report-tab.is-active {
  background: var(--gold-btn);
  color: #fff;
  font-weight: 600;
}

.report-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.report-section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.kpi-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.kpi-card span.label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.kpi-card strong {
  font-size: 1.5rem;
  color: var(--text);
}

.kpi-card strong.profit { color: var(--success); }
.kpi-card strong.loss { color: var(--danger); }

.report-summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.report-summary-list strong {
  color: var(--text);
  font-size: 1rem;
}

.kpi-card .kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  color: var(--gold);
  opacity: 0.7;
}

/* ── Settings grid ── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.settings-grid .span-2 { grid-column: span 2; }

.settings-account-card {
  margin-top: 1rem;
}

.settings-account-user {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.settings-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.settings-password-form {
  max-width: 28rem;
  margin-bottom: 1rem;
}

.settings-password-form .auth-error {
  margin: 0;
}

.settings-logout-btn {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.settings-logout-btn:hover {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border-color: var(--danger);
}

.settings-card h2 {
  font-family: var(--display);
  font-size: 1.1rem;
}

.settings-subheading {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 0.02em;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.85rem;
}

.settings-form label input,
.settings-form label select { width: 100%; }

.store-locations-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.store-locations-section h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1rem;
}

.location-tag-list {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.location-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  pointer-events: auto;
}

.location-remove:hover { color: var(--danger, #c0392b); }

.location-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.location-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.location-add-row input {
  flex: 1;
  min-width: 0;
}

.settings-section-save {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.order-source-desc {
  margin: 0 0 0.75rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.segment-btn {
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segment-btn:hover {
  color: var(--text);
}

.segment-btn.is-active {
  background: var(--surface);
  color: var(--gold-dark);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.order-source-panel {
  margin-bottom: 0.85rem;
}

.order-summary-fields {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.weight-entry.form-grid {
  gap: 0.65rem;
  margin-bottom: 0.15rem;
}

.weight-entry[data-weight-mode="grams"] .weight-panel-grams {
  grid-column: 1 / -1;
}

.weight-entry[data-weight-mode="tola"] .weight-panel-laal {
  grid-column: span 2;
}

.weight-entry .weight-conversion-hint {
  margin-top: -0.15rem;
}

.form-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings-currency-row {
  margin-bottom: 0.25rem;
}

.price-mode {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.radio-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  color: var(--text) !important;
  font-size: 0.9rem !important;
}

.radio-label input[type="radio"] {
  accent-color: var(--gold);
  width: auto;
}

.appearance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.gold-heading { color: var(--text); font-weight: 600; }

.rate-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.5rem 0 0.75rem;
}

.rate-history-head .rate-history-title {
  margin: 0;
}

.rate-history-clear-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.rate-history-clear-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--danger, #b42318);
}

.rate-history-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.95rem;
}

.rate-history-period {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.live-daily-rate-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius, 8px);
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.1);
}

.live-daily-rate-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-dark, #9a7b1a);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.2);
}

.live-daily-rate-price {
  font-size: 1rem;
  color: var(--text, #2c2a26);
}

.live-daily-rate-time {
  font-size: 0.85rem;
  color: var(--muted);
}

.live-daily-rate-hint {
  font-size: 0.75rem;
  color: var(--muted);
  width: 100%;
}

.rate-row-live {
  background: rgba(201, 162, 39, 0.08);
}

.rate-row-live td {
  font-weight: 600;
}

.rate-history-chart {
  margin-bottom: 0.5rem;
}

.rate-chart-empty {
  margin: 0;
  padding: 1.25rem;
  background: var(--surface-2, #f8f6f2);
  border-radius: var(--radius, 8px);
  border: 1px dashed var(--border);
}

.gold-rate-chart-wrap {
  background: var(--surface-2, #f8f6f2);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 0.75rem 1rem 0.5rem;
  overflow: visible;
}

.gold-rate-chart-stock {
  background: linear-gradient(180deg, var(--surface, #fff) 0%, var(--surface-2, #f8f6f2) 100%);
  border-color: var(--border);
}

.stock-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.stock-chart-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stock-chart-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stock-chart-price {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text, #2c2a26);
}

.stock-chart-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.15rem;
}

.stock-chart-header-up .stock-chart-price { color: #15803d; }
.stock-chart-header-down .stock-chart-price { color: #b91c1c; }

.stock-chart-change {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.stock-chart-change.is-up {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
}

.stock-chart-change.is-down {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
}

.stock-chart-change.is-flat {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.stock-chart-arrow {
  font-size: 0.65rem;
}

.stock-chart-change-pct {
  opacity: 0.9;
}

.stock-live-price.is-up { color: #15803d; }
.stock-live-price.is-down { color: #b91c1c; }

.stock-live-change {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
}

.stock-chart-baseline {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 6 4;
  opacity: 0.55;
}

.stock-chart-baseline-label {
  fill: var(--muted);
  font-size: 9px;
}

.gold-rate-line-segment {
  stroke-width: 2.5;
  stroke-linecap: round;
}

.gold-rate-line-up {
  stroke: #16a34a;
}

.gold-rate-line-down {
  stroke: #dc2626;
}

.gold-rate-line-flat {
  stroke: #64748b;
}

.gold-rate-area-stock {
  stroke: none;
  opacity: 0.9;
}

.gold-rate-dot-live.gold-rate-dot-up {
  fill: #16a34a;
  stroke: #fff;
}

.gold-rate-dot-live.gold-rate-dot-down {
  fill: #dc2626;
  stroke: #fff;
}

.gold-rate-dot-live.gold-rate-dot-flat {
  fill: #64748b;
  stroke: #fff;
}

/* ── GoldPrice.org-style chart ── */
.goldprice-chart {
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(44, 42, 38, 0.06);
}

.goldprice-chart-header {
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid #f0ebe0;
  background: linear-gradient(180deg, #fffdf8 0%, #fff 100%);
}

.goldprice-header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.65rem;
}

.goldprice-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.goldprice-icon {
  color: #d4af37;
  font-size: 1.1rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.45);
}

.goldprice-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #2c2a26;
  text-transform: uppercase;
}

.goldprice-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a8478;
  margin-top: 0.1rem;
}

.goldprice-quote {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.65rem;
}

.goldprice-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #2c2a26;
  line-height: 1.1;
}

.goldprice-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8a8478;
}

.goldprice-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

.goldprice-quote.is-up .goldprice-change {
  color: #15803d;
  background: rgba(22, 163, 74, 0.1);
}

.goldprice-quote.is-down .goldprice-change {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

.goldprice-quote.is-flat .goldprice-change {
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
}

.goldprice-arrow {
  font-size: 0.65rem;
}

.goldprice-pct {
  opacity: 0.9;
}

.goldprice-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: #6b6560;
}

.goldprice-stat em {
  font-style: normal;
  font-weight: 700;
  color: #8a8478;
  margin-right: 0.25rem;
}

.goldprice-updated {
  margin-left: auto;
}

.goldprice-canvas-wrap {
  padding: 0.25rem 0.5rem 0;
  background: #faf9f7;
}

.goldprice-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}

.gp-bg {
  fill: #faf9f7;
}

.gp-hgrid {
  stroke: #ebe6dc;
  stroke-width: 1;
}

.gp-vgrid {
  stroke: #f0ebe0;
  stroke-width: 1;
}

.gp-y-label {
  fill: #8a8478;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.gp-x-label {
  fill: #8a8478;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.gp-area {
  stroke: none;
}

.gp-line {
  fill: none;
  stroke: #c9a227;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gp-point {
  fill: #c9a227;
  opacity: 0;
  pointer-events: all;
  cursor: default;
}

.gp-point:hover,
.gp-point:focus {
  opacity: 1;
}

.gp-live-dot {
  fill: #d4af37;
  stroke: #fff;
  stroke-width: 2.5;
}

.gp-live-dot.is-up { fill: #16a34a; }
.gp-live-dot.is-down { fill: #dc2626; }

.gp-live-pulse {
  fill: none;
  stroke: #d4af37;
  stroke-width: 1.5;
  opacity: 0.45;
  transform-origin: center;
  transform-box: fill-box;
  animation: goldprice-pulse 2s ease-out infinite;
}

.gp-live-pulse.is-up { stroke: #16a34a; }
.gp-live-pulse.is-down { stroke: #dc2626; }

@keyframes goldprice-pulse {
  0% { transform: scale(0.55); opacity: 0.55; }
  100% { transform: scale(1.75); opacity: 0; }
}

.goldprice-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.5rem 1.15rem 0.75rem;
  font-size: 0.72rem;
  color: #8a8478;
  border-top: 1px solid #f0ebe0;
  background: #fff;
}

.goldprice-powered {
  font-weight: 600;
  color: #b8962e;
}

.goldprice-chart .rate-intraday-readings {
  margin: 0 1rem 1rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #ebe6dc;
}

.goldprice-live-banner {
  background: linear-gradient(180deg, #fffdf8 0%, #fff 100%) !important;
  border-color: #e8e4dc !important;
}

.goldprice-live-banner .live-daily-rate-badge {
  background: rgba(201, 162, 39, 0.15);
  color: #9a7b1a;
}

.goldprice-live-banner .live-daily-rate-time,
.goldprice-live-banner .live-daily-rate-hint {
  color: #8a8478;
}

/* Legacy stock chart helpers (weekly/monthly table dots) */
.stock-exchange-chart {
  background: #131722;
  border: 1px solid #2a2e39;
  border-radius: 10px;
  overflow: hidden;
  color: #d1d4dc;
}

.stock-exchange-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2a2e39;
  background: #1e222d;
}

.stock-exchange-ticker {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stock-exchange-symbol {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f0b90b;
}

.stock-exchange-sub {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #787b86;
}

.stock-exchange-quote {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.stock-exchange-last {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-exchange-quote.is-up .stock-exchange-last { color: #26a69a; }
.stock-exchange-quote.is-down .stock-exchange-last { color: #ef5350; }
.stock-exchange-quote.is-flat .stock-exchange-last { color: #d1d4dc; }

.stock-exchange-chg {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stock-exchange-quote.is-up .stock-exchange-chg { color: #26a69a; }
.stock-exchange-quote.is-down .stock-exchange-chg { color: #ef5350; }

.stock-exchange-ohlc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-left: auto;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #787b86;
}

.stock-exchange-ohlc em {
  font-style: normal;
  font-weight: 700;
  color: #9598a1;
  margin-right: 0.2rem;
}

.stock-exchange-canvas-wrap {
  padding: 0.35rem 0.5rem 0;
}

.stock-exchange-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
}

.stock-exchange-bg {
  fill: #131722;
}

.stock-hgrid {
  stroke: #2a2e39;
  stroke-width: 1;
}

.stock-vgrid {
  stroke: #1e222d;
  stroke-width: 1;
}

.stock-y-label {
  fill: #787b86;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stock-time-label {
  fill: #787b86;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stock-open-line {
  stroke: #787b86;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.5;
}

.stock-price-line {
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.85;
}

.stock-price-line.is-up { stroke: #26a69a; }
.stock-price-line.is-down { stroke: #ef5350; }
.stock-price-line.is-flat { stroke: #787b86; }

.stock-price-tag {
  stroke: none;
}

.stock-price-tag.is-up { fill: #26a69a; }
.stock-price-tag.is-down { fill: #ef5350; }
.stock-price-tag.is-flat { fill: #434651; }

.stock-price-tag-text {
  fill: #fff;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-exchange-area {
  stroke: none;
}

.stock-exchange-chart .gold-rate-line-up {
  stroke: #26a69a;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stock-exchange-chart .gold-rate-line-down {
  stroke: #ef5350;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stock-exchange-chart .gold-rate-line-flat {
  stroke: #434651;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stock-last-dot {
  stroke: #131722;
  stroke-width: 2;
}

.stock-last-dot.is-up { fill: #26a69a; }
.stock-last-dot.is-down { fill: #ef5350; }
.stock-last-dot.is-flat { fill: #787b86; }

.stock-exchange-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem 1rem 0.65rem;
  font-size: 0.7rem;
  color: #787b86;
  border-top: 1px solid #2a2e39;
}

.stock-exchange-live-banner {
  background: #1e222d !important;
  border-color: #2a2e39 !important;
  color: #d1d4dc;
}

.stock-exchange-live-banner .live-daily-rate-badge {
  background: rgba(240, 185, 11, 0.15);
  color: #f0b90b;
}

.stock-exchange-live-banner .live-daily-rate-time,
.stock-exchange-live-banner .live-daily-rate-hint {
  color: #787b86;
}

.stock-exchange-chart + .rate-intraday-readings,
.stock-exchange-chart .rate-intraday-readings {
  margin: 0.75rem 1rem 1rem;
  color: #d1d4dc;
}

.gold-rate-chart-svg {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  overflow: visible;
}

.chart-axis-label-y {
  font-size: 10px;
}

.chart-point-label {
  fill: var(--text, #2c2a26);
  font-size: 10px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--surface-2, #f8f6f2);
  stroke-width: 3px;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.gold-rate-line {
  fill: none;
  stroke: var(--gold, #c9a227);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.gold-rate-line-step {
  stroke-linejoin: miter;
  stroke-linecap: square;
}

.gold-rate-area-step {
  opacity: 0.85;
}

.gold-rate-area {
  fill: rgba(201, 162, 39, 0.12);
  stroke: none;
}

.gold-rate-dot {
  fill: var(--gold-dark, #9a7b1a);
  stroke: #fff;
  stroke-width: 1.5;
}

.gold-rate-dot-up {
  fill: var(--success, #2d6a4f);
}

.gold-rate-dot-down {
  fill: var(--danger, #b42318);
}

.gold-rate-dot-live {
  fill: var(--gold, #c9a227);
  stroke: var(--gold-dark, #9a7b1a);
  stroke-width: 2;
}

.gold-rate-dot-flat {
  fill: var(--muted, #8a8478);
}

.rate-chart-compare {
  font-weight: 600;
}

.rate-chart-compare.is-up {
  color: var(--success, #2d6a4f);
}

.rate-chart-compare.is-down {
  color: var(--danger, #b42318);
}

.rate-chart-compare.is-flat {
  color: var(--muted, #8a8478);
}

.rate-chart-caption {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text, #2c2a26);
  text-align: center;
  line-height: 1.45;
  word-break: break-word;
}

.rate-intraday-readings {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.rate-intraday-title,
.rate-history-table-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.rate-intraday-table {
  font-size: 0.85rem;
}

/* ── Expenses ── */
.expense-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 480px;
}

.expense-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.expense-total {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.expense-total strong { color: var(--gold-dark); font-size: 1.1rem; }

.gold-calc-card {
  margin-top: 0;
}

.gold-calc-price-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.gold-price-calc-form {
  margin-bottom: 0.75rem;
}

.gold-conv-weight {
  margin-top: 0.85rem;
}

.gold-conv-results {
  margin-top: 1rem;
}

.gold-price-result {
  margin-top: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.gold-price-calc-form select:disabled {
  opacity: 1;
  color: var(--text);
  cursor: default;
  background: var(--surface);
}

.gold-price-summary {
  margin: 0;
}

.gold-price-summary .gold-calc-total-row td strong {
  font-size: 1.2rem;
  color: var(--gold-dark);
}

.gold-price-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.35);
}

.gold-price-total-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gold-price-total-value {
  font-size: 1.75rem;
  color: var(--gold-dark);
  line-height: 1.2;
}

.gold-conv-output {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.gold-conv-output-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.gold-conv-output-item {
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.gold-conv-output-item span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.gold-conv-output-item strong {
  font-size: 1.2rem;
  color: var(--gold-dark);
}

.gold-conv-grams-value {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.gold-conv-grams-value strong {
  font-size: 2rem;
  color: var(--gold-dark);
  line-height: 1;
}

.gold-conv-grams-value span {
  font-size: 1.1rem;
  color: var(--muted);
}

.gold-conv-breakdown {
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  font-size: 0.9rem;
  color: var(--text);
}

.gold-conv-detail,
.gold-conv-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
}

.gold-conv-sub {
  margin-top: 0.35rem;
  color: var(--muted);
}

.gold-calc-tabs {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1rem;
}

.gold-unit-reference {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.gold-unit-reference h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.gold-unit-ref-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.35rem 1rem;
  font-size: 0.88rem;
  color: var(--text);
}

.gold-live-conversion {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(212, 175, 55, 0.35);
}

.gold-live-conversion[hidden] {
  display: none !important;
}

.gold-live-title,
.gold-results-title {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gold-unit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.gold-unit-card {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.gold-unit-card-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.gold-unit-card strong {
  font-size: 1.05rem;
  color: var(--gold-dark);
}

.gold-calc-panels {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gold-calc-section[hidden] {
  display: none !important;
}

.gold-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.gold-calc-section h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.gold-calc-section .form-hint {
  margin-bottom: 0.75rem;
}

.gold-calc-cost-fields {
  margin-bottom: 0.5rem;
}

.gold-calc-results {
  margin-top: 0.85rem;
}

.gold-calc-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.gold-calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.gold-calc-table th,
.gold-calc-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.gold-calc-table th {
  width: 46%;
  color: var(--muted);
  font-weight: 500;
}

.gold-calc-total-row td strong {
  color: var(--gold-dark);
  font-size: 1.05rem;
}

.order-actions-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.options-cell {
  min-width: 220px;
}

.order-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--gold-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.order-cart-btn svg {
  pointer-events: none;
}

.order-cart-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold);
}

.order-cart-icon {
  width: 16px;
  height: 16px;
}

.order-status-btn.is-current {
  font-weight: 600;
  color: var(--text);
  opacity: 0.65;
  cursor: default;
}

.order-option-btn {
  white-space: nowrap;
}

/* ── Sliding background (auth + app) ── */
.bg-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-slider--fixed {
  position: fixed;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity var(--bg-slide-fade-ms, 1.4s) ease-in-out;
  will-change: opacity, transform;
}

.bg-slide.is-active {
  opacity: 1;
  animation: bg-slide-kenburns 18s ease-out forwards;
}

@keyframes bg-slide-kenburns {
  from { transform: scale(1.06); }
  to { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-slide.is-active {
    animation: none;
    transform: scale(1);
  }
}

.bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.bg-overlay--fixed {
  position: fixed;
}

.bg-overlay--auth-brand {
  background: linear-gradient(
    160deg,
    rgba(17, 24, 39, 0.82) 0%,
    rgba(61, 53, 40, 0.72) 45%,
    rgba(138, 115, 72, 0.55) 100%
  );
}

.bg-overlay--auth-page {
  background: linear-gradient(
    135deg,
    rgba(243, 244, 246, 0.92) 0%,
    rgba(252, 249, 237, 0.88) 50%,
    rgba(255, 248, 232, 0.9) 100%
  );
}

.bg-overlay--app {
  background: linear-gradient(
    135deg,
    rgba(243, 244, 246, 0.72) 0%,
    rgba(249, 250, 251, 0.65) 45%,
    rgba(243, 244, 246, 0.75) 100%
  );
}

[data-theme="dark"] .bg-overlay--app {
  background: linear-gradient(
    135deg,
    rgba(11, 15, 23, 0.84) 0%,
    rgba(17, 24, 39, 0.78) 45%,
    rgba(11, 15, 23, 0.86) 100%
  );
}

/* ── Auth login page ── */
body.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f0e3 0%, #fcf9ed 45%, #fff8e8 100%);
}

.auth-page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-page-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  overflow: hidden;
  background: linear-gradient(160deg, #3d3528 0%, #5c4f38 55%, #8a7348 100%);
  color: #faf6ee;
}

body.auth-page .auth-page-shell,
body.auth-page .auth-page-main {
  position: relative;
  z-index: 2;
}

.auth-page-brand-inner {
  position: relative;
  z-index: 2;
  max-width: 22rem;
  text-align: center;
}

.auth-page-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold);
}

.auth-page-title {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-page-tagline {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(250, 246, 238, 0.88);
}

.auth-page-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 3rem;
}

.auth-page-toolbar {
  width: min(420px, 100%);
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.auth-phone-region-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-phone-region-field select,
.phone-region-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.auth-page-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-page-lang select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
}

.auth-page-card {
  --fb-blue: var(--gold-dark);
  --fb-blue-hover: #8f7340;
  --fb-green: var(--gold-btn);
  --fb-green-hover: var(--gold-btn-hover);
  --fb-border: var(--border-strong);
  --fb-text: var(--text);
  --fb-muted: var(--muted);
  width: min(420px, 100%);
  padding: 2rem 1.75rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(44, 42, 38, 0.08);
}

.auth-page .fb-input:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 25%, transparent);
}

.auth-page .fb-btn-primary {
  background: var(--gold-btn);
  color: #1f2937;
  border: 1px solid var(--gold-btn);
}

.auth-page .fb-btn-primary:hover:not(:disabled) {
  background: var(--gold-btn-hover);
  border-color: var(--gold-btn-hover);
}

.auth-page .fb-btn-signup {
  background: var(--gold-dark);
  color: #fff;
  border: 1px solid var(--gold-dark);
}

.auth-page .fb-btn-signup:hover:not(:disabled) {
  background: #8f7340;
  border-color: #8f7340;
}

.auth-page .fb-btn-outline-blue {
  background: var(--surface);
  color: var(--gold-dark);
  border: 1px solid var(--gold-dark);
}

.auth-page .fb-btn-outline-blue:hover:not(:disabled) {
  background: #faf6ee;
  border-color: var(--gold-btn-hover);
  color: #6b5a32;
}

.auth-page .fb-link-btn {
  color: var(--gold-dark);
}

.auth-page .fb-link-btn:hover {
  color: var(--gold-btn-hover);
}

.auth-page-heading {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.auth-page-subheading {
  margin: -0.75rem 0 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-page-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-page-divider::before,
.auth-page-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-page-back-link {
  display: block;
  width: 100%;
  margin-top: 1rem;
  text-align: center;
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-forgot-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-forgot-option {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.auth-forgot-option.is-active {
  background: var(--gold-btn);
  border-color: var(--gold-btn);
  color: #1f2937;
}

.auth-forgot-option:hover:not(.is-active) {
  border-color: var(--gold-dark);
  color: var(--gold-dark);
}

.auth-forgot-password-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-page .fb-link-btn.auth-page-back-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  text-decoration: none;
}

.auth-page-shell-single {
  grid-template-columns: 1fr;
}

.auth-page-main-centered {
  min-height: 100vh;
  justify-content: center;
}

@media (max-width: 860px) {
  .auth-page-shell {
    grid-template-columns: 1fr;
  }

  .auth-page-brand {
    min-height: auto;
    padding: 2.5rem 1.5rem 2rem;
  }

  .auth-page-brand-inner {
    max-width: 28rem;
  }

  .auth-page-main {
    padding-top: 1.5rem;
  }
}

/* ── Options Section ──────────────────────────────────────────────────────── */

.options-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.options-stat-card {
  flex: 1;
  min-width: 160px;
  background: var(--surface, #fff);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.opt-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  width: fit-content;
}

.opt-stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text, #111);
}

.opt-stat-lbl {
  font-size: 0.72rem;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.opt-stat-amt {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #111);
}

.opt-stat-rem {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 2px;
}

.options-table {
  width: 100%;
}

.options-row {
  transition: background 0.15s;
}

.options-row:hover {
  background: var(--surface-2, #f9fafb);
}

.options-row-overdue {
  background: #fff5f5 !important;
}

.opt-note {
  font-size: 0.73rem;
  color: var(--muted, #6b7280);
}

.opt-sub {
  font-size: 0.73rem;
  color: var(--muted, #6b7280);
}

/* Payment panel */
.opt-pay-panel-row td {
  background: var(--surface-2, #f8fafc);
}

.opt-pay-panel {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 2px solid var(--border, #e5e7eb);
}

.opt-pay-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.opt-pay-summary {
  font-size: 0.83rem;
  color: var(--muted, #6b7280);
}

.opt-pay-table {
  width: 100%;
  font-size: 0.83rem;
  border-collapse: collapse;
  margin-bottom: 0.85rem;
}

.opt-pay-table th {
  text-align: left;
  padding: 4px 10px;
  color: var(--muted, #6b7280);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.opt-pay-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.opt-add-pay-form {
  border-top: 1px dashed var(--border, #e5e7eb);
  padding-top: 0.75rem;
}

.opt-add-pay-fields {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.opt-pay-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
  font-weight: 600;
  flex: 1;
  min-width: 110px;
}

.opt-pay-label .input {
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .options-stats-row {
    flex-direction: column;
  }
  .opt-pay-panel {
    padding: 0.75rem 0.75rem 1rem;
  }
  .opt-add-pay-fields {
    flex-direction: column;
  }
}

/* ── Records search bar ───────────────────────────────────────────────────── */
.options-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.options-search-bar input[type="search"] {
  outline: none;
}

.options-search-bar input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

/* Money-only tag in table */
.opt-money-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.73rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ---- POS payment capture ---- */
.sale-payment {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.pay-method-select {
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-width: 130px;
}

.summary-row-change {
  font-weight: 600;
}
.summary-row-change #cart-change { color: var(--gold-dark); }
.summary-row-change #cart-change.is-short { color: var(--danger); }

/* ---- POS quick-add suggestions (replaces old AI placeholder) ---- */
.quick-suggestions {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.quick-suggestions-title {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.quick-suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  max-width: 100%;
}
.quick-chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.quick-chip-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.quick-chip-price { color: var(--gold-dark); font-weight: 600; }

.bill-pay-line { border-top: 1px dashed var(--border); padding-top: 0.3rem; margin-top: 0.3rem; }

/* ---- VAT stepper (POS) ---- */
.tax-value-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.tax-step-btn {
  border: 0;
  background: var(--surface-soft);
  color: var(--text);
  width: 26px;
  height: 30px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.tax-step-btn:hover { background: var(--gold-soft); color: var(--gold-dark); }
.tax-value-stepper input {
  width: 56px;
  height: 30px;
  text-align: right;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  -moz-appearance: textfield;
}
.tax-value-stepper input::-webkit-outer-spin-button,
.tax-value-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- Customer PAN (POS) ---- */
.pos-customer-pan-row { margin-top: 0.5rem; }
.pos-customer-pan-row input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

/* ---- Bill: PAN + amount in words ---- */
.bill-shop-pan { font-weight: 600; font-size: 0.8rem; }
.bill-amount-words {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  font-style: italic;
}
.bill-amount-words .bill-label { font-style: normal; }

/* ---- Karigar management detail ---- */
.karigar-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem 0.35rem;
  flex-wrap: wrap;
}

.karigar-panel-desc {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.4;
}

.karigar-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.karigar-filter-label select {
  min-width: 11rem;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--surface, #fff);
  color: var(--text);
}

.karigar-summary {
  padding: 0.35rem 1.25rem 0.85rem;
}

.karigar-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .karigar-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.karigar-stat {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--gold, #c9a227) 8%);
}

.karigar-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.karigar-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
}

.karigar-stat em {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: normal;
}

.karigar-detail {
  padding: 0 1.25rem 0.85rem;
}

.karigar-detail-card {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.9rem 1rem;
  background: var(--surface, #fff);
}

.karigar-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.karigar-detail-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.karigar-detail-head p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.karigar-detail-notes {
  margin-top: 0.4rem !important;
  color: var(--text) !important;
}

.karigar-detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 900px) {
  .karigar-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.karigar-detail-stats div {
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
}

.karigar-detail-stats span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

.karigar-detail-stats strong {
  display: block;
  margin-top: 0.15rem;
}

.karigar-detail-stats em {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  font-style: normal;
}

.karigar-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 800px) {
  .karigar-detail-columns { grid-template-columns: 1fr; }
}

.karigar-detail-columns h4 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
}

.karigar-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.karigar-mini-list li {
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--surface, #fff) 88%, #000 4%);
  border: 1px solid var(--border);
}

.karigar-mini-list .is-issue { color: var(--warning, #d97706); font-weight: 600; }
.karigar-mini-list .is-return { color: var(--success, #059669); font-weight: 600; }

.karigar-empty-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.karigar-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.karigar-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
}

.karigar-badge.is-active {
  color: #047857;
  background: color-mix(in srgb, #059669 16%, transparent);
}

.karigar-badge.is-inactive {
  color: #6b7280;
  background: color-mix(in srgb, #9ca3af 18%, transparent);
}

.karigar-cell-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.12rem;
  max-width: 14rem;
  white-space: normal;
  line-height: 1.3;
}

.data-table tr.is-selected-row {
  background: color-mix(in srgb, var(--gold, #c9a227) 12%, transparent);
}

/* ── POS extras: old-gold trade-in + scheme redemption ─────────────────── */
.pos-tradein-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0;
  border-top: 1px dashed var(--border, #e5e7eb);
}
.pos-tradein-block > .btn { align-self: flex-start; }
.old-gold-fields {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.old-gold-fields input,
#pos-scheme-select { max-width: 9rem; }
#cart-oldgold-credit, #cart-scheme-credit { color: #059669; font-weight: 600; }

/* The hidden attribute must always win over display:flex rows in the sale panel. */
.sale-panel [hidden],
.old-gold-fields[hidden],
.pos-tradein-block [hidden] { display: none !important; }

/* Empty-state notes inside table wrappers must not inherit the negative
   top margin .panel-desc uses when it sits under a panel heading —
   overflow:auto clips the pulled-up text. */
.table-wrap > .panel-desc,
#report-body > .panel-desc { margin: 0.35rem 0 0.85rem; }

/* ── Dashboard ─────────────────────────────────────────────────────────── */
.dash-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.dash-title { margin: 0; font-size: 1.7rem; }
.dash-date { margin: 0.2rem 0 0; color: var(--muted, #6b7280); font-size: 0.92rem; }
.dash-rate-chip {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  background: var(--gold-soft, rgba(217,119,6,0.1));
  border: 1px solid var(--gold, #b45309);
  border-radius: 0.75rem; padding: 0.55rem 0.9rem;
}
.dash-rate-chip strong { font-size: 1.15rem; color: var(--gold, #b45309); }
.dash-rate-chip strong small { font-size: 0.72rem; font-weight: 500; }
.dash-rate-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.dash-rate-silver { font-size: 0.8rem; color: var(--muted, #6b7280); }
.dash-rate-live { font-size: 0.72rem; color: #059669; font-weight: 700; }
.dash-kpis { margin-bottom: 1rem; }
.dash-quick { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.dash-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}
.dash-panel { padding: 1rem 1.1rem; }
.dash-panel-title { margin: 0 0 0.8rem; font-size: 1.02rem; }
.dash-table td { font-size: 0.86rem; }
.dash-td-sub { font-size: 0.72rem; color: var(--muted, #6b7280); }
.dash-td-amount { font-weight: 700; white-space: nowrap; }
.dash-td-due { font-size: 0.72rem; color: #b91c1c; font-weight: 600; }
.dash-dues { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.dash-dues li {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px dashed var(--border, #e5e7eb);
}
.dash-due-amt { color: #b91c1c; white-space: nowrap; }
/* 7-day sales chart: single gold series, thin bars, rounded data-ends */
.dash-chart { position: relative; }
.dash-chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 0.5rem; }
.dash-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; cursor: default; }
.dash-bar-fill {
  width: 60%; max-width: 34px; min-height: 3px;
  background: var(--gold-soft, rgba(217,119,6,0.25));
  border-top: 3px solid var(--gold, #b45309);
  border-radius: 4px 4px 0 0;
  transition: filter 0.12s ease;
}
.dash-bar-fill.is-today { background: var(--gold, #b45309); }
.dash-bar-col:hover .dash-bar-fill { filter: brightness(1.12); }
.dash-bar-day { margin-top: 0.35rem; font-size: 0.72rem; color: var(--muted, #6b7280); }
.dash-bar-day.is-today { font-weight: 700; color: var(--gold, #b45309); }
.dash-chart-tip {
  position: absolute; top: -0.4rem; left: 0; right: 0; text-align: center;
  font-size: 0.8rem; font-weight: 600;
}
.dash-dues li > div { display: flex; flex-direction: column; gap: 0.1rem; }
@media (min-width: 1180px) {
  .dash-grid { grid-template-columns: 1.05fr 1.65fr 1fr; }
}
.dash-table th, .dash-table td { padding-left: 0.5rem; padding-right: 0.5rem; }

/* ── Gold trend chart (7-day / 30-day / 1-year views) ──────────────────── */
.gtrend-wrap { position: relative; }
.gtrend-svg { width: 100%; height: auto; display: block; }
.gtrend-grid { stroke: var(--border, #e5e7eb); stroke-width: 1; stroke-dasharray: 3 4; }
.gtrend-ylabel { font-size: 11px; fill: var(--muted, #6b7280); }
.gtrend-xlabel { font-size: 11px; fill: var(--muted, #6b7280); }
.gtrend-lastdot { fill: var(--gold, #b45309); stroke: var(--panel, #fff); stroke-width: 2; }
.gtrend-hoverdot { fill: var(--panel, #fff); stroke: var(--gold, #b45309); stroke-width: 2.5; }
.gtrend-cross { stroke: var(--muted, #9ca3af); stroke-width: 1; stroke-dasharray: 2 3; }
.gtrend-tip {
  position: absolute; top: 0.35rem; transform: translateX(-6%);
  background: var(--panel, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem; box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  padding: 0.35rem 0.6rem; font-size: 0.82rem; pointer-events: none; white-space: nowrap;
}
.gtrend-tip-change.is-up { color: #059669; font-weight: 600; }
.gtrend-tip-change.is-down { color: #b91c1c; font-weight: 600; }
.dash-due-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.dash-panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.8rem; }
.dash-panel-title-row .dash-panel-title { margin-bottom: 0; }
.invoices-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.invoices-toolbar .invoices-search { flex: 1; min-width: 220px; max-width: 420px; margin-right: auto; }
.invoices-search-meta { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* Shop location (Settings): the hidden attribute must win over the
   .settings-form flex rows, so country-specific fields really disappear. */
.settings-form label[hidden] { display: none !important; }
.settings-form label .form-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0.1rem 0 0;
}

/* ── Requested items ─────────────────────────────────────────────────────── */

.request-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.request-item-list li {
  line-height: 1.35;
}

.request-item-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.request-item-note {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}

.request-customer-phone {
  color: var(--muted);
  font-size: 0.75rem;
}

.request-items-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.request-item-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem 0.35rem;
  background: var(--surface-soft);
}

.request-item-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.request-item-index {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--gold-soft);
  border-radius: 999px;
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.request-item-price {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}

.request-cart-btn {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.request-suggest-field {
  position: relative;
}

.request-item-linked {
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 600;
}

/* Inventory pick-list inside the request modal */
.request-inv-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 0.5rem;
}

.request-inv-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.request-inv-row:last-child { border-bottom: 0; }
.request-inv-row:hover { background: var(--gold-soft); }
.request-inv-row.is-selected { background: var(--gold-soft); }

.request-inv-row input[type="checkbox"] {
  flex: 0 0 auto;
  accent-color: var(--gold-btn);
  width: 1rem;
  height: 1rem;
}

.request-inv-name {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.request-inv-price {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Market gold price (shared server history) ───────────────────────── */
.market-price-head { margin-top: 1.75rem; }
.market-price-hint { margin: -0.25rem 0 0.9rem; }
.market-price-range { grid-template-columns: repeat(4, 1fr); }
.market-price-chart { min-height: 120px; }
.market-price-chart .goldprice-chart-header { margin-bottom: 0.5rem; }
.market-price-history { margin-top: 0.75rem; }
.market-price-history summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gold-dark);
  padding: 0.5rem 0;
}
.market-price-history summary span:last-child { color: var(--muted); font-weight: 500; }
.market-price-history .data-table td.num, .market-price-history .data-table th.num { text-align: right; white-space: nowrap; }
.market-price-history .data-table td.is-up { color: #15803d; }
.market-price-history .data-table td.is-down { color: #b91c1c; }
.market-price-history .table-wrap { max-height: 420px; overflow-y: auto; }
.market-price-empty { padding: 1.5rem 0.5rem; color: var(--muted); }

/* ── Deactivate store (Settings › Account) ─────────────────────────────── */
.settings-deactivate-card .settings-help { color: var(--muted, #6b6255); margin: 0 0 12px; }
.btn-danger-outline { border-color: #b3261e; color: #b3261e; }
.btn-danger-outline:hover { background: rgba(179, 38, 30, 0.08); }
.btn-danger { background: #b3261e; color: #fff; border-color: #b3261e; }
.btn-danger:hover { background: #962019; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }
.deactivation-locked { border: 1px solid #e0a800; background: #fff8e1; border-radius: 12px; padding: 14px 16px; }
.deactivation-locked p { margin: 0 0 10px; }
.deactivate-body .deactivate-steps { padding-left: 22px; margin: 8px 0 12px; }
.deactivate-steps li { margin-bottom: 8px; }
.deactivate-body label { display: block; margin-top: 14px; }
.deactivate-body label span { display: block; margin-bottom: 6px; font-weight: 600; }
.deactivate-body input { width: 100%; box-sizing: border-box; }
.deactivate-expected { display: block; font-size: 1.15rem; color: #7a5a12; margin: 2px 0 8px; }
.deactivate-hint { display: block; margin-top: 6px; color: #6b6255; }
.deactivate-hint.ok { color: #1f7a3a; }
.deactivate-hint.bad { color: #b3261e; }
.store-locked-banner { background: #fff3cd; color: #5c4400; border-bottom: 1px solid #e0a800; padding: 10px 16px; text-align: center; font-weight: 600; }
.store-locked-banner button { margin-left: 12px; }

/* ── Settings → How to use guide + Privacy & support ── */
.settings-guide-card .guide-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.guide-item { border: 1px solid var(--border, #e5e0d6); border-radius: 12px; background: var(--surface-2, rgba(0,0,0,0.02)); overflow: hidden; }
.guide-item summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.guide-item summary::-webkit-details-marker { display: none; }
.guide-item summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .55; transition: transform .15s ease; }
.guide-item[open] summary::after { transform: rotate(-135deg); }
.guide-step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold, #c9a227); color: #fff; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.guide-item ol { margin: 0; padding: 0 16px 14px 52px; line-height: 1.55; color: var(--muted, #6b6255); }
.guide-item ol li { margin-bottom: 6px; }
.guide-item ol li:last-child { margin-bottom: 0; }
.settings-legal-links { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.settings-legal-links a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.settings-legal-card .settings-help { color: var(--muted, #6b6255); margin: 0; font-size: .9rem; }

.auth-page-footer { margin: 18px 0 0; text-align: center; font-size: .82rem; color: var(--muted, #6b6255); }
.auth-page-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.auth-page-footer a:hover { color: var(--gold, #b45309); }


/* ══════════════════════════════════════════════════════════════════════════
   POS screen — managed layout (Sept 2026)
   Steps: 1 Customer → 2 Products (left)  ·  3 Current Sale (sticky right)
   ══════════════════════════════════════════════════════════════════════════ */
.pos-page-header { margin-bottom: 1.1rem; }

.pos-view .pos-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.25rem;
}

.pos-view .pos-main {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Cards on the left */
.pos-card {
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.pos-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.pos-card-head .pos-block-title {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
  min-width: 0;
}

.pos-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--gold-soft, rgba(212, 175, 55, 0.18));
  color: var(--gold-dark, #8a6d0b);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
}

.pos-card-hint {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.pos-customer-set-hint {
  display: none;
  color: #166534;
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.3);
}

[data-theme="dark"] .pos-customer-set-hint {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
}

#pos-customer-card:has(#pos-customer-display:not([hidden])) .pos-customer-empty-hint { display: none; }
#pos-customer-card:has(#pos-customer-display:not([hidden])) .pos-customer-set-hint { display: inline-block; }

/* Customer toolbar: search · PAN · add — one tidy row */
.pos-customer-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 1.6fr) minmax(160px, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
}

.pos-customer-toolbar .pos-customer-pan-row { margin: 0; }
.pos-customer-toolbar .pos-customer-pan-row input { width: 100%; box-sizing: border-box; }
.pos-customer-toolbar .add-customer-pos-btn { white-space: nowrap; }

.pos-customer-display {
  margin-top: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem 1rem;
  padding: 0.8rem 2.4rem 0.8rem 0.95rem;
}

.pos-customer-display-head {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  margin: 0;
}

.pos-customer-display-row {
  grid-template-columns: 1fr;
  gap: 0.1rem;
}

.pos-customer-display-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Catalog */
.pos-card .catalog-toolbar { margin-bottom: 0.75rem; }
.pos-card .pos-catalog-meta { margin: 0; }
.pos-card .pos-item-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.pos-card .pos-product-list.catalog-grid { margin: 0; }
.pos-card .pos-catalog-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: min(62vh, 640px);
  overflow: auto;
}

.pos-item-list thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
}

.pos-item-list td:nth-child(2),
.pos-item-list td:nth-child(3),
.pos-item-list td:nth-child(4),
.pos-item-list td:nth-child(5),
.pos-item-list td:nth-child(6) { white-space: nowrap; }

.pos-item-list th,
.pos-item-list td { padding: 0.65rem 0.7rem; }
.pos-item-list .pos-item-name-cell { min-width: 150px; }
.pos-item-list .pos-list-action-col { width: 42px; padding-left: 0.25rem; }
.pos-item-list td.pos-item-price { text-align: right; }
.pos-item-list th:nth-child(6) { text-align: right; }

/* Quick add lives under the catalog on the left now */
.pos-main .quick-suggestions { margin: 0; }

/* ── Current Sale (right) ── */
.pos-sidebar {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 2rem);
  padding: 0;
}

.sale-panel {
  padding: 0;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.sale-panel-head {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.sale-panel-head-text {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.sale-panel-head h2 { font-size: 1.05rem; }

.sale-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.9rem 1.1rem 1rem;
}

.sale-panel .sale-customer { margin: 0 0 0.85rem; }

.sale-section { margin: 0; }
.sale-section + .sale-section,
.sale-summary .sale-section + .sale-section { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px dashed var(--border); }

.sale-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sale-section-items .cart-lines {
  max-height: none;
  overflow: visible;
}

/* Cart line: name + meta on top, controls in one row underneath */
.sale-panel .cart-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  padding: 0.6rem 0;
}
.sale-panel .cart-line:first-child { padding-top: 0; }
.sale-panel .cart-line-actions {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.sale-panel .cart-line-total { order: 0; margin-left: auto; }
.sale-panel .cart-remove {
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: var(--radius);
}
.sale-panel .cart-remove:hover { background: rgba(220, 38, 38, 0.08); }

.sale-section-items .cart-empty {
  padding: 1.1rem 0.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.sale-summary {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.sale-summary .summary-row { align-items: center; margin-bottom: 0.45rem; }
.sale-summary .summary-row:last-child { margin-bottom: 0; }

.sale-summary .skillfee-toggle input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--gold-dark, #92400e); }

.sale-summary .pos-tradein-block {
  border-top: 0;
  padding: 0;
}

.sale-summary .summary-row.total {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-top: 0;
  border-radius: var(--radius);
  background: var(--gold-soft, rgba(212, 175, 55, 0.14));
  color: var(--gold-dark, #8a6d0b);
  font-size: 1.25rem;
}

.sale-summary .sale-payment {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.sale-summary .pos-bill-details { margin-top: 0.85rem; }

/* Actions pinned to the bottom of the panel */
.sale-panel .sale-actions {
  margin: 0;
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex: none;
}

.sale-panel .sale-actions .btn { padding-block: 0.65rem; }

/* Responsive */
@media (max-width: 1240px) {
  .pos-view .pos-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 1100px) {
  .pos-view .pos-layout { grid-template-columns: 1fr; }
  .pos-sidebar {
    position: static;
    max-height: none;
    border-top: 0;
  }
  .sale-panel { max-height: none; }
  .sale-panel-body { overflow: visible; }
  .sale-panel .sale-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06);
  }
}

@media (max-width: 960px) {
  .pos-customer-toolbar { grid-template-columns: 1fr 1fr; }
  .pos-customer-toolbar .add-customer-pos-btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 720px) {
  .pos-customer-toolbar { grid-template-columns: 1fr; }
  .pos-card { padding: 0.85rem; }
  .pos-card .pos-catalog-table-wrap { max-height: none; }
  /* Small screens: drop Metal + Status columns so price and Add stay visible */
  .pos-item-list th:nth-child(3), .pos-item-list td:nth-child(3),
  .pos-item-list th:nth-child(5), .pos-item-list td:nth-child(5) { display: none; }
  .pos-item-list .pos-item-name-cell { min-width: 120px; }
}

/* ── Inventory → Print tags dialog ─────────────────────────────────────── */
.tag-print-modal { width: min(640px, calc(100vw - 2rem)); }
.tag-print-modal > div { padding: 1.1rem 1.25rem 1.25rem; }
.tag-section { margin: 0.9rem 0 0; }
.tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.9rem; }
.tag-grid label { display: grid; gap: 0.2rem; font-size: 0.8rem; color: var(--muted); }
.tag-grid label > span { font-weight: 600; }
.tag-grid input, .tag-grid select { width: 100%; box-sizing: border-box; font: inherit; color: var(--text); }
.tag-span2 { grid-column: 1 / -1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; margin-top: 0.7rem; font-size: 0.85rem; }
.tag-inline { display: inline-flex; align-items: center; gap: 0.4rem; }
.tag-inline input { width: 4.5rem; }
.tag-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.45rem 0.8rem; font-size: 0.85rem; }
.tag-check { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.tag-check input { width: auto; margin: 0; accent-color: var(--gold-dark, #92400e); }
.tag-note { margin: 0.6rem 0 0; font-size: 0.78rem; }
.tag-preview-wrap { margin-top: 1rem; padding: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); }
.tag-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; font-size: 0.85rem; }
.tag-preview-head select { padding: 0.3rem 0.5rem; font: inherit; font-size: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.tag-preview { overflow: auto; }
@media (max-width: 560px) { .tag-grid { grid-template-columns: 1fr; } }
.tag-note-top { margin: 0 0 0.5rem; }
.tag-check-all { margin-bottom: 0.45rem; padding-bottom: 0.45rem; border-bottom: 1px dashed var(--border); width: 100%; }
.tag-details-mode { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.tag-details-mode select { flex: 1; min-width: 0; padding: 0.35rem 0.5rem; font: inherit; font-size: 0.85rem; font-weight: 400; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
#tag-details-options[hidden], #tag-details-hint[hidden] { display: none; }

/* Per-item tag dialog */
.item-tag-modal { width: min(720px, calc(100vw - 2rem)); }
.item-tag-toolbar { margin: 0.2rem 0 0.8rem; }
.item-tag-toolbar select { padding: 0.35rem 0.5rem; font: inherit; font-size: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.item-tag-fields { margin-bottom: 0.8rem; padding: 0.8rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.item-tag-fields[hidden] { display: none; }
.item-tag-strip { display: flex; gap: 0.9rem; overflow-x: auto; overflow-y: hidden; padding: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); scroll-snap-type: x proximity; }
.item-tag-strip.is-single { justify-content: center; }
.item-tag-cell { flex: none; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.item-tag-cell-code { font-size: 0.75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-tag-strip::-webkit-scrollbar { height: 10px; }
.item-tag-strip::-webkit-scrollbar-thumb { background: var(--border-strong, #c7cbd1); border-radius: 999px; }
#tag-which-items[hidden] { display: none; }
.tag-preview .item-tag-strip { background: transparent; border: 0; padding: 0.2rem 0 0.6rem; }
.tag-inline input:disabled { opacity: 0.5; }

/* ── Customer link (settings card + selections panel) ─────────────────── */
.cl-url-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.6rem; }
.cl-url { flex: 1 1 260px; min-width: 0; font: inherit; font-size: 0.82rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); color: var(--text); }
.cl-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.cl-since { margin: 0; font-size: 0.78rem; }
.cl-qr { margin-top: 0.9rem; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.cl-qr-svg { width: 220px; height: 220px; background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.cl-qr-svg svg { width: 100%; height: 100%; }
.cl-modal-body { padding: 1.1rem 1.25rem 1.25rem; }
.customer-selections-panel { margin-bottom: 1rem; }
.customer-selections-panel .panel-head-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.customer-selections-search { min-width: 240px; font: inherit; font-size: 0.85rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.cl-customer { padding: 0.7rem 0; border-top: 1px dashed var(--border); }
.cl-customer:first-child { border-top: 0; }
.cl-customer-head { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.cl-customer-phone { color: var(--muted); font-size: 0.85rem; }
.cl-customer-count { font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--gold-soft); color: var(--gold-dark); }
.cl-customer-time { margin: 0 0 0 auto; font-size: 0.75rem; }
.cl-customer-items { margin: 0.4rem 0 0; padding: 0 0 0 1.1rem; font-size: 0.88rem; }
.cl-customer-items li { margin: 0.15rem 0; }
.cl-customer-items span { color: var(--muted); font-size: 0.8rem; }
.cl-customer-items { list-style: none; padding: 0; }
.cl-item { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.35rem 0; border-top: 1px dotted var(--border); }
.cl-item:first-child { border-top: 0; }
.cl-item-main { min-width: 0; flex: 1 1 240px; }
.cl-item-actions { display: flex; gap: 0.4rem; flex: none; }
.cl-counts { margin: -0.3rem 0 0.6rem; font-size: 0.8rem; }
.cl-customer[data-status="cancelled"] .cl-item-main { opacity: 0.6; }
.cl-item-actions { flex-wrap: wrap; }
.cl-item-actions .btn.danger { color: var(--danger, #b91c1c); border-color: currentColor; }
/* Customer selections page */
.cl-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.cl-search-wrap { flex: 1 1 360px; max-width: 520px; }
.cl-search-wrap input { width: 100%; box-sizing: border-box; }
.cl-tab-count { display: inline-block; min-width: 1.3em; padding: 0 0.35em; margin-left: 0.2em; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: rgba(0,0,0,0.08); }
.order-group-tab.is-active .cl-tab-count { background: rgba(255,255,255,0.28); }
.cl-tab-count:empty { display: none; }
.cl-scroll { max-height: min(62vh, 720px); overflow-y: auto; padding-right: 0.4rem; border-top: 1px solid var(--border); }
.cl-scroll .cl-customer-head { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 0.45rem 0; }
.cl-customer { padding-top: 0; }
@media (max-width: 720px) { .cl-scroll { max-height: none; } .cl-search-wrap { flex-basis: 100%; max-width: none; } }

#view-requests .page-header-text { flex: 1 1 480px; min-width: 0; max-width: 720px; }

/* ── Inventory card view (inventory-cards.js) ─────────────────────────────── */
.inventory-filter-bar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.inventory-filter-bar input[type="search"] { flex: 1 1 260px; width: auto; }
.inventory-view-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.inventory-view-btn { display: inline-flex; align-items: center; gap: 0.35rem; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.5rem 0.75rem; cursor: pointer; }
.inventory-view-btn + .inventory-view-btn { border-left: 1px solid var(--border-strong); }
.inventory-view-btn svg { width: 15px; height: 15px; }
.inventory-view-btn[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold); }
.inventory-view-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.inventory-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.ic-empty { color: var(--muted); text-align: center; padding: 2.5rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.ic-dim { color: var(--muted); font-weight: 400; font-size: 0.85em; }

.ic-shelf-head { display: flex; align-items: baseline; gap: 0.6rem; margin: 0.6rem 0 0.35rem; }
.ic-shelf-head h2 { font-size: 0.95rem; font-weight: 700; margin: 0; }
.ic-shelf-count { font-size: 0.78rem; color: var(--muted); }
.ic-shelf-page { margin-left: auto; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ic-shelf { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 0.4rem; }
.ic-arrow { width: 40px; height: 72px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius); font-size: 1.35rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.ic-arrow:disabled { opacity: 0.3; cursor: default; }
.ic-track { display: flex; gap: 0.8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.3rem 2px 0.7rem; scrollbar-width: none; }
.ic-track::-webkit-scrollbar { display: none; }

.ic-tile { flex: 0 0 196px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.6rem; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.ic-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.ic-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ic-tile.is-sold { opacity: 0.6; }
.ic-tile-select { position: relative; }
.ic-select-box { position: absolute; top: 0.5rem; left: 0.5rem; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-strong); background: rgba(255,255,255,.9); z-index: 2; }
.ic-tile-select.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.ic-tile-select.is-selected .ic-select-box { background: var(--gold); border-color: var(--gold); }
.ic-tile-select.is-selected .ic-select-box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.inventory-select-bar { display: flex; align-items: center; gap: 0.9rem; padding: 0.55rem 0.8rem; margin-bottom: 0.75rem; background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.inventory-select-bar #inventory-select-count { min-width: 1.4rem; }

.ic-pic { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-soft); }
.ic-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ic-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; background: repeating-linear-gradient(45deg, rgba(217, 119, 6, 0.06) 0 12px, rgba(217, 119, 6, 0.13) 12px 24px); color: #b8860b; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.ic-placeholder svg { width: 40px; height: 40px; }
.ic-qty { position: absolute; top: 6px; left: 6px; background: rgba(17, 24, 39, 0.78); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ic-karat { position: absolute; top: 6px; right: 6px; background: var(--surface); color: var(--gold); font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--border); }

.ic-name { font-size: 0.86rem; font-weight: 600; line-height: 1.3; color: var(--info); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ic-weight { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ic-price { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ic-per { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.ic-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; width: max-content; }
.ic-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ic-status.in { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.ic-status.low { background: rgba(217, 119, 6, 0.14); color: var(--warning); }
.ic-status.out { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.ic-status.reserved { background: rgba(37, 99, 235, 0.12); color: var(--info); }

/* details dialog */
.item-details-modal { width: min(840px, calc(100vw - 2rem)); padding: 0; }
.ic-details { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.ic-details .ic-pic { aspect-ratio: auto; min-height: 300px; border-radius: 0; border-right: 1px solid var(--border); }
.ic-details .ic-placeholder { min-height: 300px; }
.ic-details .ic-placeholder svg { width: 56px; height: 56px; }
.ic-details-body { position: relative; display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem 1.25rem 1rem; min-width: 0; }
.ic-close { position: absolute; top: 0.6rem; right: 0.6rem; }
.ic-details-title { font-size: 1.2rem; font-weight: 700; line-height: 1.25; margin: 0; padding-right: 2.2rem; }
.ic-subline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.ic-chip { padding: 2px 7px; border-radius: 4px; font-size: 0.74rem; font-weight: 700; background: rgba(184, 134, 11, 0.13); color: #b8860b; }
.ic-details-price { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ic-details-price .ic-per { font-size: 0.78rem; }
.ic-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem 0.9rem; padding-top: 0.75rem; border-top: 1px dashed var(--border); }
.ic-spec .k { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.ic-spec .v { font-size: 0.86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ic-breakdown { background: var(--surface-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.ic-bd-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; }
.ic-bd-row.is-total { border-top: 1px solid var(--border); margin-top: 0.25rem; padding-top: 0.45rem; font-weight: 700; color: var(--gold); font-size: 0.9rem; }
.ic-note { margin: 0; font-size: 0.8rem; color: var(--muted); font-style: italic; }
.ic-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.ic-actions .link-btn.danger { margin-left: auto; }

/* photo field in the item form */
.item-photo-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.item-photo-row { display: flex; gap: 0.9rem; align-items: flex-start; }
.item-photo-preview { flex: 0 0 112px; width: 112px; height: 112px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-soft); }
.item-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-photo-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.item-photo-pick { cursor: pointer; }
.item-photo-actions .form-hint { margin: 0; }
#item-photo-remove[hidden] { display: none; }
.item-photo-buttons { display: flex; gap: 0.4rem; flex-wrap: wrap; }
/* "Take photo" opens the camera straight away; only useful where there is one (phones/tablets). */
.item-photo-camera { display: none; }
@media (hover: none) and (pointer: coarse) { .item-photo-camera { display: inline-flex; } } /* .btn's display would otherwise beat [hidden] */

/* horizontal shelf → vertical list on narrow screens */
@media (max-width: 640px) {
  .ic-shelf { grid-template-columns: minmax(0, 1fr); }
  .ic-arrow, .ic-shelf-page { display: none; }
  .ic-track { flex-direction: column; overflow: visible; scroll-snap-type: none; gap: 0.6rem; }
  .ic-tile { flex: none; display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto auto auto auto; column-gap: 0.75rem; align-items: start; }
  .ic-tile .ic-pic { grid-row: 1 / 5; }
  .ic-name { min-height: 0; }
  .ic-details { grid-template-columns: minmax(0, 1fr); }
  .ic-details .ic-pic { border-right: 0; border-bottom: 1px solid var(--border); min-height: 220px; }
  .ic-details .ic-placeholder { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) { .ic-tile { transition: none; } }

/* POS catalog in card mode (inventory-cards.js) */
.pos-product-list.catalog-grid.has-products.is-cards { padding: 0.25rem 0.75rem 0.5rem; }
.ic-pos-shelves { max-height: min(560px, 60vh); overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.ic-pos-shelves .ic-shelf-head { margin-top: 0.4rem; }
/* The catalog column is narrow, so POS tiles wrap into a grid under each metal
   heading instead of paging sideways; the vertical scroll box holds them all. */
.ic-pos-shelves .ic-shelf { grid-template-columns: minmax(0, 1fr); }
.ic-pos-shelves .ic-arrow, .ic-pos-shelves .ic-shelf-page { display: none; }
.ic-pos-shelves .ic-track { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; gap: 0.6rem; padding: 0.2rem 2px 0.4rem; }
.ic-pos-shelves .ic-tile { flex: 1 1 148px; max-width: 200px; }
.ic-tile-pos { position: relative; padding-bottom: 2.9rem; }
.ic-tile-pos .ic-cart-btn { position: absolute; right: 0.6rem; bottom: 0.6rem; width: 36px; height: 36px; background: var(--gold-btn); border-color: var(--gold-btn); color: #fff; box-shadow: var(--shadow); }
.ic-tile-pos .ic-cart-btn:hover { background: var(--gold-btn-hover); }
.ic-tile-pos:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ic-actions .ic-add-cart { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; }
.ic-actions .ic-add-cart svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .ic-pos-shelves { max-height: none; overflow: visible; }
  .ic-pos-shelves .ic-tile { max-width: none; flex: none; }
  .ic-tile-pos { padding-bottom: 0.6rem; }
  .ic-tile-pos .ic-cart-btn { position: static; grid-column: 2; justify-self: start; margin-top: 0.2rem; }
}

/* ── Collapsible sidebar (desktop) ──────────────────────────────────────── */
.sidebar-toggle {
  margin-left: auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text);
  cursor: pointer;
  flex: none;
}
.sidebar-toggle svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 768px) { .sidebar-toggle { display: none; } }

@media (min-width: 769px) {
  .app { transition: grid-template-columns 0.2s ease; }
  .sidebar { transition: width 0.18s ease, padding 0.18s ease, box-shadow 0.18s ease; }
  body.sidebar-collapsed .app { grid-template-columns: 76px 1fr; }
  /* Collapsed = icon rail. Hovering the rail expands it as an overlay
     (content underneath does not move); leaving collapses it again. */
  body.sidebar-collapsed .sidebar:not(:hover) { padding-left: 0.55rem; padding-right: 0.55rem; }
  body.sidebar-collapsed .sidebar:not(:hover) .brand { flex-direction: column; gap: 0.5rem; padding: 0.4rem 0 0.8rem; align-items: center; }
  body.sidebar-collapsed .sidebar:not(:hover) .brand strong { display: none; }
  body.sidebar-collapsed .sidebar:not(:hover) .sidebar-toggle { margin-left: 0; }
  body.sidebar-collapsed .sidebar:not(:hover) .nav-btn,
  body.sidebar-collapsed .sidebar:not(:hover) .settings-nav-btn { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
  body.sidebar-collapsed .sidebar:not(:hover) .nav-btn > span:not(.nav-icon),
  body.sidebar-collapsed .sidebar:not(:hover) .settings-nav-btn > span:not(.nav-icon) { display: none; }
  body.sidebar-collapsed .sidebar:not(:hover) .metal-rates { display: none; }
  body.sidebar-collapsed .sidebar:not(:hover) .sidebar-actions { justify-content: center; }
  body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
  body.sidebar-collapsed .sidebar:hover {
    position: fixed; left: 0; top: 0;
    width: 272px; height: 100vh; height: 100dvh;
    z-index: 90;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
  }
  body.sidebar-collapsed .sidebar:hover .sidebar-toggle svg { transform: rotate(180deg); }
  body.sidebar-collapsed.sidebar-no-hover .sidebar:hover { position: sticky; width: auto; box-shadow: none; }
}

/* ── Guide figures ── */
.guide-fig { margin: 0 16px 10px 52px; }
.guide-fig img { display: block; width: 100%; max-width: 860px; height: auto; border: 1px solid var(--border, #e5e0d6); border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.guide-fig figcaption { margin-top: 6px; font-size: 0.8rem; color: var(--muted, #6b6255); }
.guide-fig + .guide-fig { margin-top: 12px; }
@media (max-width: 640px) { .guide-fig { margin-left: 16px; } }

/* ── Customer selections as photo cards ── */
.cl-cards { display: flex; gap: 0.7rem; overflow-x: auto; padding: 0.5rem 0.1rem 0.6rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cl-card { flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.3rem; padding: 0.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.cl-card .ic-pic { position: relative; }
.cl-card.is-sold .ic-pic, .cl-card.is-sold .ic-name, .cl-card.is-sold .ic-weight { opacity: 0.55; }
.cl-card-sold { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-12deg); padding: 0.15rem 0.5rem; background: var(--danger, #b91c1c); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 999px; white-space: nowrap; }
.cl-card-meta { font-size: 0.75rem; color: var(--muted); }
.cl-card .cl-item-actions { margin-top: auto; padding-top: 0.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.cl-card .cl-item-actions .btn { width: 100%; justify-content: center; white-space: nowrap; padding-inline: 0.4rem; }
.cl-card .cl-item-actions .btn[data-cl-cart] { grid-column: 1 / -1; }
.cl-customer[data-status="cancelled"] .cl-card { opacity: 0.7; }
@media (max-width: 640px) { .cl-card { flex-basis: 170px; } }

/* Tag preview only: outline the blank 45 mm tail of the Phomemo T-shaped
   jewellery label so it is obvious which part is the printable head. Print
   output has no such border (the print HTML never uses .tag-preview-label). */
.tag-preview-label .tail { border: 0.2mm dotted #b8bcc2; border-top: 0; margin: 0 9mm; }

.tag-offset input { width: 4.2rem; }
.tag-preview-selects { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
