:root {
  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --gold-pale: #F5EDD6;
  --dark: #0F0F1A;
  --dark2: #1A1A2E;
  --dark3: #252540;
  --ink: #1C1C2E;
  --muted: #8888AA;
  --surface: #F8F7F4;
  --white: #FFFFFF;
  --green: #2ECC71;
  --green-bg: #E8FAF0;
  --red: #E74C3C;
  --red-bg: #FDECEA;
  --blue: #3498DB;
  --blue-bg: #EBF5FB;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(15, 15, 26, 0.10);
  --shadow-lg: 0 8px 40px rgba(15, 15, 26, 0.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--surface); color: var(--ink); min-height: 100vh; }
h1, h2, h3, h4, h5 { font-family: 'Syne', sans-serif; }

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 240px; background: var(--dark2); z-index: 100; display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(.4, 0, .2, 1); overflow: hidden; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.sidebar-logo { flex-shrink: 0; padding: 24px 20px 20px; border-bottom: 1px solid rgba(201, 168, 76, 0.15); }
.sidebar-logo-text { min-width: 0; }
.logo-badge { min-width: 42px; height: 42px; padding: 0 8px; background: var(--gold); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.logo-badge-text { font-family: 'Syne', sans-serif; font-weight: 800; color: var(--dark); font-size: 15px; line-height: 1; letter-spacing: 0.06em; }
.logo-text { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--white); font-size: 13px; line-height: 1.2; }
.logo-sub { font-size: 10px; color: var(--gold); font-weight: 400; letter-spacing: 1px; text-transform: uppercase; }
.nav-section { padding: 16px 12px 4px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin: 2px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; color: #AAAACC; font-size: 14px; font-weight: 500; text-decoration: none; }
.nav-item:hover { background: rgba(201, 168, 76, 0.10); color: var(--gold-light); }
.nav-item.active { background: var(--gold); color: var(--dark2); }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; }
.nav-badge { margin-left: auto; background: var(--red); color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.sidebar-footer { flex-shrink: 0; margin-top: auto; padding: 16px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.user-chip { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 10px 12px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-weight: 700; color: var(--dark2); font-size: 13px; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.user-role { font-size: 11px; color: var(--muted); }
.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: -4px -6px -4px 0;
  border-radius: 8px;
  font-size: 15px;
  color: var(--red);
  text-decoration: none;
}
.logout-link:hover {
  color: var(--white);
  background: var(--red);
}
.logout-link i { font-size: 15px; }

/* ── TOP BAR ───────────────────────────────────── */
.topbar { position: fixed; top: 0; left: 240px; right: 0; height: 64px; background: var(--white); border-bottom: 1px solid rgba(0, 0, 0, 0.07); display: flex; align-items: center; padding: 0 24px; gap: 16px; z-index: 90; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }
.topbar-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); }
.topbar-sub { font-size: 12px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn-gold { background: var(--gold); color: var(--dark2); border: none; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; padding: 9px 20px; border-radius: 10px; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201, 168, 76, 0.4); color: var(--dark2); }
.btn-gold:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline-gold { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; padding: 8px 16px; border-radius: 10px; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-outline-gold:hover { background: var(--gold-pale); color: var(--gold); }
.btn-danger-soft { background: var(--red-bg); color: var(--red); border: none; font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; padding: 8px 16px; border-radius: 10px; cursor: pointer; }
.btn-danger-soft:hover { background: var(--red); color: var(--white); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid rgba(0, 0, 0, 0.10); background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; color: var(--muted); font-size: 15px; }
.icon-btn:hover { background: var(--gold-pale); color: var(--gold); border-color: var(--gold); }
.hamburger { display: none; }

/* ── MAIN CONTENT ─────────────────────────────── */
.main { margin-left: 240px; padding-top: 64px; min-height: 100vh; }
.page { padding: 28px 24px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── STAT CARDS ───────────────────────────────── */
.stat-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, 0.05); position: relative; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-accent { position: absolute; top: 0; right: 0; width: 80px; height: 80px; border-radius: 0 var(--radius) 0 100%; opacity: 0.12; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat-value--money {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}
.stat-currency {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}
.stat-amount {
  font-family: 'Syne', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-value--count .stat-amount { font-size: 20px; }
.stat-meta { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ── CARDS ────────────────────────────────────── */
.card-block { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, 0.05); }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── TABLE ────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid rgba(0, 0, 0, 0.07); text-align: left; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface); }
.badge-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--green-bg); color: #1a8a50; }
.badge-warning { background: #FFF8E1; color: #B7860A; }
.badge-danger { background: var(--red-bg); color: #c0392b; }
.badge-info { background: var(--blue-bg); color: #2471A3; }
.product-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--gold-pale); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb-lg { width: 56px; height: 56px; border-radius: 12px; }

/* ── FORMS ────────────────────────────────────── */
.form-label-custom { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.form-control-custom { width: 100%; padding: 11px 14px; border: 1.5px solid rgba(0, 0, 0, 0.12); border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--ink); background: var(--white); transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.form-control-custom[readonly] { background: var(--surface); color: var(--muted); cursor: default; }
.inv-product-name-link:hover { color: var(--gold) !important; text-decoration: underline !important; }
.cust-name-link:hover { color: var(--gold) !important; text-decoration: underline !important; }
.form-select-custom { width: 100%; padding: 11px 14px; border: 1.5px solid rgba(0, 0, 0, 0.12); border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--ink); background: var(--white); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; outline: none; transition: border-color 0.2s; }
.form-select-custom:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15); }
.form-group { margin-bottom: 18px; }
.form-help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── MODAL ────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 15, 26, 0.65); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-sheet { background: var(--white); border-radius: 24px 24px 0 0; width: 100%; max-width: 540px; padding: 28px 24px 32px; transform: translateY(100%); transition: transform 0.35s cubic-bezier(.4, 0, .2, 1); max-height: 92vh; overflow-y: auto; }
.modal-overlay.show .modal-sheet { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: #E0E0E0; border-radius: 4px; margin: 0 auto 20px; }
.modal-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 22px; color: var(--ink); margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* ── PRODUCT PICKER GRID (cashier) ─────────────── */
.product-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; max-height: 280px; overflow-y: auto; overflow-x: hidden; padding: 2px 4px 6px 2px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
@media (max-width: 480px) { .product-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.product-picker .sale-cart-empty, .product-picker .product-picker-empty-msg { grid-column: 1 / -1; }
.product-pick-row { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; gap: 6px; min-width: 0; padding: 10px 6px 8px; border: 1.5px solid rgba(0, 0, 0, 0.10); border-radius: 16px; cursor: pointer; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s; background: var(--white); }
.product-pick-row:hover { border-color: var(--gold); background: rgba(245, 237, 214, 0.45); transform: translateY(-1px); }
.product-pick-row.selected { border-color: var(--gold); background: var(--gold-pale); box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25); }
.product-pick-row.disabled { opacity: 0.45; cursor: not-allowed; }
.pick-cover { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: 12px; flex-shrink: 0; transition: background 0.2s; overflow: hidden; }
.pick-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-cover .placeholder { font-size: 22px; color: var(--gold); }
.product-pick-row.selected .pick-cover { background: rgba(255, 255, 255, 0.65); }
.pick-text { width: 100%; min-width: 0; }
.pick-name { font-weight: 600; font-size: 11px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; hyphens: auto; }
.pick-price { font-size: 9px; color: var(--muted); line-height: 1.2; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-check { display: none; }
.pick-cart-cb { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; z-index: 2; }
.pick-qty-btn { touch-action: manipulation; }
.pick-qty-wrap { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 6px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, 0.85); }
.product-pick-row.selected .pick-qty-wrap { border-color: rgba(201, 168, 76, 0.5); background: rgba(255, 255, 255, 0.95); }
.pick-qty-btn { width: 28px; height: 30px; border: none; background: var(--surface); font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; line-height: 1; transition: background 0.15s; }
.pick-qty-btn:hover { background: var(--gold-pale); }
.pick-qty-val { flex: 1; min-width: 0; text-align: center; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 12px; }

/* Quantity stepper (large) */
.qty-stepper { display: flex; align-items: center; gap: 0; border: 1.5px solid rgba(0, 0, 0, 0.12); border-radius: 10px; overflow: hidden; }
.qty-btn { width: 38px; height: 38px; background: var(--surface); border: none; font-size: 18px; cursor: pointer; font-weight: 700; color: var(--ink); transition: background 0.15s; }
.qty-btn:hover { background: var(--gold-pale); }
.qty-val { width: 44px; text-align: center; font-weight: 700; font-size: 16px; font-family: 'Syne', sans-serif; }

.sale-total-chip { background: var(--dark2); border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; margin: 18px 0; }
.sale-total-label { font-size: 13px; color: #AAAACC; }
.sale-total-value { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 22px; color: var(--gold); }
.sale-cart-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sale-cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border-radius: 10px; border: 1px solid rgba(0, 0, 0, 0.08); font-size: 13px; }
.sale-cart-line .cart-line-main { flex: 1; min-width: 0; }
.sale-cart-line .cart-line-title { font-weight: 600; }
.sale-cart-line .cart-line-meta { font-size: 12px; color: var(--muted); }
.sale-cart-line .cart-line-total { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sale-cart-empty { font-size: 13px; color: var(--muted); padding: 14px; text-align: center; border: 1px dashed rgba(0, 0, 0, 0.12); border-radius: 10px; margin-bottom: 14px; }
.sale-breakdown { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.sale-breakdown div { display: flex; justify-content: space-between; padding: 4px 0; }
.sale-breakdown .bd-strong { color: var(--ink); font-weight: 600; }
.btn-add-line { width: 100%; margin-bottom: 16px; padding: 10px; border-radius: 10px; cursor: pointer; font-family: 'Syne', sans-serif; font-weight: 600; font-size: 13px; background: var(--surface); border: 1.5px dashed var(--gold); color: var(--gold); transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-add-line:hover { background: var(--gold-pale); }
.cart-remove { width: 32px; height: 32px; border: none; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-remove:hover { background: var(--red-bg); color: var(--red); }

/* ── SEARCH BAR ───────────────────────────────── */
.search-bar { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1.5px solid rgba(0, 0, 0, 0.10); border-radius: 12px; padding: 10px 14px; transition: border-color 0.2s; }
.search-bar:focus-within { border-color: var(--gold); }
.search-bar input { border: none; outline: none; font-family: 'DM Sans', sans-serif; font-size: 14px; flex: 1; color: var(--ink); background: transparent; }
.search-bar i { color: var(--muted); font-size: 14px; }

/* ── TOAST ────────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; pointer-events: none; }
.toast-msg { background: var(--dark2); color: var(--white); padding: 12px 24px; border-radius: 50px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); opacity: 0; transform: translateY(20px); transition: all 0.3s; }
.toast-msg.show { opacity: 1; transform: translateY(0); }
.toast-icon { font-size: 16px; }

/* ── INVOICE PREVIEW ──────────────────────────── */
.invoice-card { background: var(--white); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, 0.07); max-width: 620px; margin: 0 auto; }
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 16px; }
.invoice-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px; color: var(--dark2); }
.invoice-logo span { color: var(--gold); }
.invoice-brand-img { display: block; max-height: 52px; width: auto; max-width: 220px; object-fit: contain; object-position: left top; margin-bottom: 6px; }
.invoice-brand-address { font-size: 12px; color: var(--muted); margin-top: 4px; }
.invoice-actions { text-align: center; margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.invoice-num { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 24px; color: var(--muted); text-align: right; }
.invoice-divider { height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light), transparent); border-radius: 3px; margin: 20px 0; }
.inv-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.inv-value { font-size: 14px; font-weight: 500; color: var(--ink); }
.invoice-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.invoice-table th { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.10); text-transform: uppercase; letter-spacing: 0.5px; }
.invoice-table td { padding: 10px 0; font-size: 13px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.invoice-total-row td { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; padding-top: 14px; border: none; color: var(--ink); }
.inv-total-gold { color: var(--gold); font-size: 20px; }

/* Sales page — compact stat cards */
.sales-stat-compact { padding: 14px 12px !important; }
.sales-stat-value { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 17px; line-height: 1.2; color: var(--ink); }
@media (min-width: 768px) {
  .sales-stat-value { font-size: 19px; }
}
.sales-stat-value--green { color: var(--green); }
.sales-stat-value--gold { color: var(--gold); }
.sales-stat-value--warn { color: #B7860A; }
.sales-stat-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 6px; }
.sales-stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Invoice split layout */
.invoice-split-list { max-height: min(70vh, 560px); overflow-y: auto; }
.invoice-list-table tbody tr { cursor: pointer; }
.invoice-list-table tbody tr.invoice-row-active td { background: var(--gold-pale); }
.invoice-detail-panel { min-height: 280px; }

/* Filter chips */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1.5px solid rgba(0, 0, 0, 0.12); cursor: pointer; background: var(--white); color: var(--muted); transition: all 0.2s; }
.filter-chip.active { background: var(--gold); border-color: var(--gold); color: var(--dark2); }
.filter-chip:hover:not(.active) { border-color: var(--gold); color: var(--gold); }

/* Page section title */
.section-heading { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.section-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* ── SKELETON ─────────────────────────────────── */
@keyframes skeletonShimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skel { display: inline-block; background: linear-gradient(90deg, #ECECEC 0%, #F8F8F8 50%, #ECECEC 100%); background-size: 200px 100%; background-repeat: no-repeat; border-radius: 6px; animation: skeletonShimmer 1.2s infinite linear; color: transparent !important; }
.skel-line { height: 14px; border-radius: 6px; }
.skel-line.lg { height: 20px; }
.skel-circle { border-radius: 50%; }
.skel-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, 0.05); }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.skel-row:last-child { border-bottom: none; }
.skel-tile { background: var(--white); border: 1.5px solid rgba(0, 0, 0, 0.08); border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
[hidden].is-skeleton { display: none !important; }

/* ── PRODUCT GALLERY (admin form) ─────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 8px; }
.gallery-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface); border: 1.5px solid rgba(0, 0, 0, 0.08); }
.gallery-item.is-cover { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item .gallery-badge { position: absolute; top: 6px; left: 6px; background: var(--gold); color: var(--dark2); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.gallery-item .gallery-actions { position: absolute; bottom: 6px; right: 6px; display: flex; gap: 4px; }
.gallery-item .gallery-actions button { width: 26px; height: 26px; border: none; border-radius: 6px; background: rgba(0, 0, 0, 0.65); color: var(--white); font-size: 11px; cursor: pointer; }
.gallery-item .gallery-actions button:hover { background: var(--gold); color: var(--dark2); }
.gallery-upload { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed rgba(0, 0, 0, 0.18); border-radius: 12px; background: var(--surface); cursor: pointer; transition: all 0.2s; }
.gallery-upload:hover { border-color: var(--gold); color: var(--gold); }
.gallery-upload input { display: none; }

/* ── EMPTY STATES ─────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 36px; color: rgba(0, 0, 0, 0.18); margin-bottom: 12px; }
.empty-state .empty-title { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--ink); margin-bottom: 4px; }

/* ── LOGIN PAGE ───────────────────────────────── */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, var(--dark2) 0%, var(--dark) 100%); }
.login-card { background: var(--white); border-radius: 20px; padding: 40px 32px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.login-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 24px; }
.login-logo--with-image { flex-direction: column; gap: 0; text-align: center; }
.login-brand-img { display: block; max-height: 56px; width: auto; max-width: 260px; object-fit: contain; object-position: center; }
.login-brand-text { text-align: left; }
.login-brand-name { font-family: 'Syne', sans-serif; font-weight: 800; color: var(--ink); font-size: 16px; line-height: 1.2; }
.login-card .login-logo .logo-badge { margin: 0; }
.login-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 22px; text-align: center; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }
.login-error { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-card .form-control-custom { padding: 13px 16px; font-size: 15px; }

/* ── MOBILE ───────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .topbar { left: 0; }
  .main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 99; display: none; }
  .sidebar-overlay.show { display: block; }
  .stat-amount { font-size: 17px; }
  .stat-value--count .stat-amount { font-size: 18px; }
  .page { padding: 18px 14px; }
  .topbar { padding: 0 14px; }
  .invoice-card { padding: 20px 16px; }
}
@media (min-width: 768px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 20px; margin: 24px; }
}

/* Dashboard — top products & week chart */
.dash-top-item { margin-bottom: 14px; }
.dash-top-item:last-child { margin-bottom: 0; }
.dash-top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.dash-top-name { min-width: 0; }
.dash-top-sku { color: var(--muted); font-size: 11px; font-weight: 500; }
.dash-top-qty { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.dash-top-bar-track {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.dash-top-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.35s ease;
}
.chart-bar-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 128px;
  padding-top: 4px;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  min-width: 0;
}
.chart-bar-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.chart-bar-slot {
  flex: 1;
  width: 100%;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
}
.chart-bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  transition: height 0.35s ease;
}
.chart-bar-day {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.chart-bar-note { font-size: 11px; color: var(--muted); margin-top: 10px; text-align: center; }

/* Finance — expenses & P&L */
.fin-metric-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.fin-metric-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.fin-metric-card--gold { border-left: 4px solid var(--gold); }
.fin-metric-card--green { border-left: 4px solid var(--green); }
.fin-metric-card--danger-soft { border-left: 4px solid var(--red); background: linear-gradient(135deg, var(--white) 0%, rgba(231, 76, 60, 0.04) 100%); }
.fin-metric-card--muted { opacity: 0.95; }
.fin-metric-card--net { border-left: 4px solid var(--dark2); }
.fin-metric-card--net-positive { border-left-color: var(--green); background: linear-gradient(135deg, var(--white) 0%, rgba(39, 174, 96, 0.06) 100%); }
.fin-metric-card--net-negative { border-left-color: var(--red); background: linear-gradient(135deg, var(--white) 0%, rgba(231, 76, 60, 0.06) 100%); }
.fin-metric-card__icon { font-size: 18px; margin-bottom: 8px; color: var(--gold); }
.fin-metric-card__kicker { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); margin-bottom: 4px; }
.fin-metric-card__value { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; color: var(--ink); line-height: 1.15; }
.fin-metric-card__value--lg { font-size: 22px; }
.fin-metric-card__value--xl { font-size: 24px; }
.fin-metric-card__label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fin-metric-card__hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.35; }

.exp-steps { margin: 0; padding: 0; }
.exp-steps__item { font-size: 13px; color: var(--muted); margin-bottom: 10px; padding-left: 4px; line-height: 1.45; }
.exp-steps__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-pale);
  color: var(--dark2);
  font-size: 11px;
  font-weight: 800;
  margin-right: 8px;
  vertical-align: middle;
}
.exp-quick-card .filter-chips { margin-bottom: 0; }

.exp-cat-viz-row { margin-bottom: 14px; }
.exp-cat-viz-row:last-child { margin-bottom: 0; }
.exp-cat-viz-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.exp-cat-viz-name { font-weight: 600; font-size: 13px; min-width: 0; }
.exp-cat-viz-amt { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.exp-cat-viz-pct { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.exp-cat-viz-track { height: 8px; background: var(--surface); border-radius: 6px; overflow: hidden; }
.exp-cat-viz-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 0.35s ease; }
.exp-cat-viz-fill--muted { background: linear-gradient(90deg, #888, #bbb); opacity: 0.85; }

.pnl-segment-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pnl-segment {
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: var(--white);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.pnl-segment:hover { border-color: var(--gold); color: var(--gold); }
.pnl-segment.active { background: var(--gold); border-color: var(--gold); color: var(--dark2); }

.pnl-chart-legend { display: flex; gap: 20px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pnl-chart-legend i { margin-right: 6px; vertical-align: middle; }
.pnl-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 140px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.pnl-chart-day {
  flex: 1;
  min-width: 10px;
  max-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pnl-chart-bars {
  height: 110px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.pnl-chart-bar {
  flex: 1;
  min-width: 3px;
  max-width: 8px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.pnl-chart-bar--rev { background: linear-gradient(180deg, #52c082, var(--green)); }
.pnl-chart-bar--exp { background: linear-gradient(180deg, #f1948a, var(--red)); }
.pnl-chart-lbl { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.fin-flow-card .fin-flow { max-width: 340px; margin: 0 auto; }
.fin-flow__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.fin-flow__row--highlight {
  background: var(--gold-pale);
  border-color: rgba(201, 168, 76, 0.35);
  margin-top: 4px;
}
.fin-flow__label { font-size: 13px; color: var(--ink); }
.fin-flow__amt { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 15px; }
.fin-flow__amt--green { color: var(--green); }
.fin-flow__amt--red { color: var(--red); }
.fin-flow__minus, .fin-flow__eq {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--muted);
  padding: 6px 0;
}

.fin-pending-card { border-left: 4px solid var(--gold); }
.fin-pending-pill {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--gold);
  white-space: nowrap;
}

.fin-kpi-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 14px;
}
.fin-kpi-list__item:last-child { border-bottom: none; }
.fin-kpi-list__item strong { font-family: 'Syne', sans-serif; font-size: 15px; }

/* Helpers */
.flex-1 { flex: 1; }
.text-muted-soft { color: var(--muted); }
.tag-soft { background: var(--surface); color: var(--ink); padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; display: inline-block; }
