:root {
  --color-navy: #1c2b26;
  --color-navy-dark: #13201c;
  --color-teal: #2a7a4b;
  --color-teal-dark: #1f5e39;
  --color-light: #efe8d8;
  --color-grey: #5c564c;
  --color-amber: #a66b2b;
  --color-danger: #9f3a2f;
  --color-success: #2a7a4b;
  --color-white: #fffdf8;
  --color-border: #ddd3c2;
  --color-muted: #8a8274;
  --color-brass: #9a7d4f;
  --color-cream: #f4efe6;
  --color-paper: #fffdf8;
  --font-base: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --radius-base: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 10px 28px rgba(44, 38, 28, 0.06);
  --shadow-btn: 0 1px 0 rgba(255,255,255,0.22) inset, 0 8px 18px rgba(42, 122, 75, 0.2);
  --sidebar-w: 236px;
  --sidebar-collapsed-w: 72px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --ease: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-base);
  background-color: var(--color-cream);
  background-image:
    radial-gradient(1100px 520px at 100% -8%, rgba(42, 122, 75, 0.07), transparent 52%),
    radial-gradient(800px 460px at -8% 90%, rgba(154, 125, 79, 0.07), transparent 46%);
  color: var(--color-navy);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100%;
  letter-spacing: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.app-shell, .auth-wrap { position: relative; z-index: 1; }

a { color: var(--color-teal); text-decoration: none; }
a:hover { color: var(--color-teal-dark); }
img { max-width: 100%; display: block; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 28%),
    linear-gradient(180deg, #1a332c 0%, #142621 58%, #1c2b26 100%);
  color: #e4ddd0;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  transition: width var(--ease);
  z-index: 30;
}
.sidebar-brand {
  padding: 14px 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.sidebar-brand .mark {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  min-width: 0;
  flex: 1;
}
.sidebar-brand .mark:hover { color: #fff; }
.brand-logo {
  height: 38px;
  width: auto;
  max-width: 154px;
  object-fit: contain;
  background: #fffdf8;
  border-radius: 12px;
  padding: 4px 6px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1.15;
}
.brand-text small { display: block; color: #b7b09f; font-weight: 400; margin-top: 3px; font-size: 11px; font-family: var(--font-base); }
.sidebar nav { padding: 10px 8px 16px; overflow: auto; flex: 1; }
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ea0b0;
  padding: 10px 8px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #e4ddd0;
  margin-bottom: 2px;
  transition: background var(--ease), color var(--ease), transform var(--ease);
}
.nav-link:hover { background: rgba(255,253,248,0.08); color: #fffdf8; }
.nav-link.active {
  background: linear-gradient(180deg, #3b8f5c, #2a7a4b);
  color: #fff;
  box-shadow: 0 8px 16px rgba(20, 70, 42, 0.28);
}
.nav-ico { flex-shrink: 0; }
.nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav-group { margin-bottom: 2px; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #e4ddd0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--ease), color var(--ease);
}
.nav-group-toggle:hover { background: rgba(255,253,248,0.08); color: #fffdf8; }
.nav-group.is-current > .nav-group-toggle { color: #fff; }
.nav-caret { margin-left: auto; flex-shrink: 0; transition: transform var(--ease); opacity: 0.7; }
.nav-group.is-open > .nav-group-toggle .nav-caret { transform: rotate(180deg); }
.nav-group-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--ease);
}
.nav-group.is-open > .nav-group-items { grid-template-rows: 1fr; }
.nav-group-inner { overflow: hidden; padding: 2px 0 4px 10px; }
.nav-group-inner .nav-link { padding-left: 10px; }

html.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
html.sidebar-collapsed .brand-text,
html.sidebar-collapsed .nav-group-toggle .nav-text,
html.sidebar-collapsed > body .sidebar > nav > .nav-link .nav-text,
html.sidebar-collapsed .nav-caret,
html.sidebar-collapsed .nav-label { display: none; }
html.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 8px;
}
html.sidebar-collapsed .brand-logo {
  max-width: 40px;
  height: 40px;
  width: 40px;
  object-fit: cover;
  object-position: 12% center;
  padding: 2px;
}
html.sidebar-collapsed .sidebar-brand .mark { justify-content: center; }
html.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }
html.sidebar-collapsed .sidebar > nav > .nav-link,
html.sidebar-collapsed .nav-group-toggle { justify-content: center; padding: 9px 0; }
html.sidebar-collapsed .sidebar nav { padding: 8px 6px; overflow: visible; }
html.sidebar-collapsed .nav-group { position: relative; }
html.sidebar-collapsed .nav-group-items {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  width: 210px;
  background: #173029;
  border: 1px solid rgba(255,253,248,0.08);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(10, 18, 14, 0.32);
  z-index: 40;
}
html.sidebar-collapsed .nav-group.is-open > .nav-group-items,
html.sidebar-collapsed .nav-group:hover > .nav-group-items,
html.sidebar-collapsed .nav-group:focus-within > .nav-group-items {
  grid-template-rows: 1fr;
}
html.sidebar-collapsed .nav-group-inner { padding: 6px; }
html.sidebar-collapsed .nav-group-inner .nav-link { justify-content: flex-start; padding: 7px 8px; }
html.sidebar-collapsed .nav-group-inner .nav-text { display: inline; }

.sidebar-collapse { color: #c5d4de; margin-top: 2px; }
.sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,0.08); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 42, 0.45);
  z-index: 25;
  opacity: 0;
  transition: opacity var(--ease);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.navbar {
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(221, 211, 194, 0.8);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.navbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.navbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}
.navbar-meta { display: flex; align-items: center; gap: 8px; color: var(--color-grey); }
.signout-form { margin: 0; }
.branch-chip {
  font-size: 12px;
  color: var(--color-grey);
  background: rgba(239, 232, 216, 0.8);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(221, 211, 194, 0.8);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 232, 216, 0.8);
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  border: 1px solid rgba(221, 211, 194, 0.8);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(180deg, #3b8f5c, #2a7a4b); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.content { padding: 20px 22px 24px; flex: 1; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--color-brass);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}
.page-head p { margin: 0; color: var(--color-grey); font-size: 14px; max-width: 52ch; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, #fffefb 0%, #fbf7ef 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  box-shadow: var(--shadow);
  animation: rise 0.4s var(--ease) both;
}
.card-body { padding: 16px; }
.card-head {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(221, 211, 194, 0.85);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
}

.stat { padding: 16px 16px 15px; position: relative; overflow: hidden; }
.stat::after {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, #c4a46a, var(--color-teal));
}
.stat .label { color: var(--color-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 6px;
}
.stat .hint { color: var(--color-muted); font-size: 12px; margin-top: 5px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.icon-btn:hover { background: var(--color-light); }
.icon-btn.is-active {
  background: var(--color-teal);
  color: #fff;
}
.nav-burger { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(180deg, #3b8f5c, var(--color-teal));
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.btn:hover { background: linear-gradient(180deg, #2f7d4e, var(--color-teal-dark)); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-navy { background: linear-gradient(180deg, #2a3d37, var(--color-navy)); box-shadow: 0 8px 16px rgba(28, 43, 38, 0.18); }
.btn-navy:hover { background: var(--color-navy-dark); }
.btn-outline { background: rgba(255,253,248,0.8); color: var(--color-navy); border-color: var(--color-border); box-shadow: none; }
.btn-outline:hover { background: var(--color-light); color: var(--color-navy); }
.btn-amber { background: var(--color-amber); }
.btn-danger { background: var(--color-danger); box-shadow: none; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 10px 16px; font-size: 14px; }
.btn-block { width: 100%; }

.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
table.data th {
  font-size: 11px;
  color: var(--color-muted);
  font-weight: 600;
  background: #f6f0e4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.data tr { transition: background 140ms ease; }
table.data tr:hover td { background: #f7f2e8; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-teal { background: #dcefe3; color: var(--color-teal); }
.badge-navy { background: #e6e2d6; color: var(--color-navy); }
.badge-amber { background: #f6e6cf; color: var(--color-amber); }
.badge-danger { background: #f6ddd8; color: var(--color-danger); }
.badge-success { background: #dcefe3; color: var(--color-success); }
.badge-grey { background: #eee8dc; color: var(--color-grey); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 12px; }
input, select, textarea {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 9px 11px;
  font: inherit;
  color: var(--color-navy);
  background: #fffdf8;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 4px rgba(42, 122, 75, 0.14);
}
.help { color: var(--color-danger); font-size: 12px; }
.searchbar { display: flex; gap: 8px; flex: 1; min-width: 0; }
.searchbar input { flex: 1; }

.flash {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 500;
  animation: rise 0.28s var(--ease) both;
}
.flash-success { background: #dcf5e8; color: var(--color-success); }
.flash-error { background: #fde8e6; color: var(--color-danger); }
.flash-warning { background: #f8e8d2; color: var(--color-amber); }
.flash-info { background: #e4ebf3; color: var(--color-navy); }

.app-footer {
  padding: 12px 16px 18px;
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.02em;
}
.app-footer a { font-weight: 600; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 12% 18%, rgba(42, 122, 75, 0.1), transparent 55%),
    radial-gradient(800px 420px at 88% 82%, rgba(154, 125, 79, 0.1), transparent 50%),
    #efe7d6;
}
@media (min-width: 901px) {
  .auth-wrap { height: 100vh; }
}
.auth-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.auth-stage,
.auth-wrap > .auth-card,
.auth-wrap > .app-footer {
  position: relative;
  z-index: 1;
}
.auth-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 36px;
  align-items: center;
  padding: 32px 40px 16px;
  min-height: 0;
}
.auth-intro {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  animation: rise 0.5s var(--ease) both;
}
.auth-portrait {
  margin: 0;
  aspect-ratio: 3 / 4;
  width: 100%;
  max-height: min(68vh, 520px);
  border-radius: 24px;
  overflow: hidden;
  background: #1c2b26;
  box-shadow: 0 22px 50px rgba(28, 43, 38, 0.16);
  border: 1px solid rgba(255, 253, 248, 0.4);
}
.auth-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  display: block;
}
.auth-copy { max-width: 440px; }
.auth-copy .eyebrow { color: var(--color-brass); }
.auth-hero-logo {
  width: min(210px, 80%);
  background: #fffdf8;
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(44, 38, 28, 0.08);
}
.auth-copy h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--color-navy);
}
.auth-copy p {
  margin: 0;
  color: var(--color-grey);
  font-size: 15px;
  max-width: 42ch;
}
.auth-card {
  width: min(420px, 100%);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,254,251,0.94), rgba(248,243,233,0.94));
  border: 1px solid #e4dccb;
  border-radius: 22px;
  padding: 30px 28px;
  box-shadow: 0 18px 50px rgba(44, 38, 28, 0.1);
  backdrop-filter: blur(10px);
  animation: rise 0.45s 0.1s var(--ease) both;
}
.auth-card-logo {
  height: 42px;
  width: auto;
  margin-bottom: 16px;
}
.auth-card h2,
.auth-card h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}
.auth-card p.lead { color: var(--color-grey); margin: 0 0 18px; }
.auth-hint { margin: 16px 0 0; color: var(--color-muted); font-size: 12px; }
.auth-wrap > .auth-card { margin: auto; }
.auth-wrap > .app-footer { padding-bottom: 18px; }

.pos-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr); gap: 12px; align-items: start; }
.pos-toolbar { display: flex; align-items: center; gap: 8px; }
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--color-light);
  border-radius: 9px;
  flex-shrink: 0;
}
.pos-products { margin-top: 12px; }
.pos-products.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}
.pos-products.is-list { display: grid; gap: 6px; }
.pos-product {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, #fffefb, #f7f2e8);
  color: inherit;
  font: inherit;
  text-align: left;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease), background var(--ease);
}
.pos-product-main { display: grid; gap: 3px; min-width: 0; }
.pos-product-meta,
.pos-product-stock { color: var(--color-grey); font-size: 11px; }
.pos-product-side { text-align: right; flex-shrink: 0; }
.pos-product-price { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.pos-products.is-grid .pos-product {
  flex-direction: column;
  min-height: 118px;
  justify-content: space-between;
}
.pos-products.is-grid .pos-product-side { text-align: left; display: flex; justify-content: space-between; align-items: baseline; }
.pos-product:hover {
  border-color: #b9d4c2;
  box-shadow: 0 12px 24px rgba(42, 122, 75, 0.1);
  transform: translateY(-2px);
}
.pos-product:active { transform: scale(0.99); }
.pos-product:focus-visible { outline: 2px solid var(--color-teal); outline-offset: 2px; }
.pos-cart-card { position: sticky; top: 60px; }
.cart-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--color-border); animation: rise 0.22s var(--ease) both; }
.totals { display: grid; gap: 5px; margin-top: 10px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-family: var(--font-display); font-size: 20px; font-weight: 600; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
.pagination a, .pagination span {
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-navy);
}
.empty { padding: 22px; text-align: center; color: var(--color-grey); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--color-muted); }
.line-editor { margin-top: 18px; }
.line-table td { white-space: normal; vertical-align: middle; }
.line-table th.col-qty,
.line-table th.col-cost,
.line-table th.col-num,
.line-table td.col-qty,
.line-table td.col-cost,
.line-table td.col-num { width: 112px; }
.line-table th.col-action,
.line-table td.col-action { width: 88px; text-align: right; }
.line-table select,
.line-table input { width: 100%; min-width: 0; }
.line-table tfoot td {
  font-weight: 600;
  background: #f6f0e4;
  border-bottom: 0;
}
.line-editor-actions { padding: 10px 0 0; }

.app-modal-overlay[hidden] { display: none !important; }
.app-modal-overlay {
  position: fixed !important;
  inset: 0;
  z-index: 2000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 40, 63, 0.55);
  animation: fade 0.2s ease both;
}
.modal-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(90vh, 880px);
  overflow: auto;
  background: #fffdf8;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(28, 43, 38, 0.22);
  animation: rise 0.28s var(--ease) both;
}
.modal-dialog.wide { width: min(920px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.modal-title { margin: 0; font-size: 16px; font-family: var(--font-display); }
.modal-close {
  border: 0;
  background: var(--color-light);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-navy);
}
.modal-body { padding: 14px; }
.modal-body .page-head,
.modal-body .card { box-shadow: none; border: 0; animation: none; }
.modal-body .card-body { padding: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
body.modal-open { overflow: hidden; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes kenburns {
  from { transform: scale(1.04) translateY(0); }
  to { transform: scale(1.1) translateY(-1.5%); }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .auth-stage { grid-template-columns: 1fr 0.9fr; padding: 24px; }
  .auth-intro { grid-template-columns: minmax(150px, 220px) 1fr; }
}
@media (max-width: 900px) {
  .nav-burger { display: inline-grid; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-102%);
    width: min(var(--sidebar-w), 86vw);
    box-shadow: 12px 0 40px rgba(15, 28, 42, 0.2);
  }
  html.sidebar-open .sidebar { transform: none; }
  html.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }
  html.sidebar-collapsed .sidebar { width: min(var(--sidebar-w), 86vw); }
  html.sidebar-collapsed .brand-text,
  html.sidebar-collapsed .nav-group-toggle .nav-text,
  html.sidebar-collapsed > body .sidebar > nav > .nav-link .nav-text,
  html.sidebar-collapsed .nav-caret,
  html.sidebar-collapsed .nav-label { display: revert; }
  html.sidebar-collapsed .nav-link,
  html.sidebar-collapsed .nav-group-toggle { justify-content: flex-start; padding: 7px 8px; }
  html.sidebar-collapsed .sidebar nav { overflow: auto; }
  html.sidebar-collapsed .nav-group-items {
    position: static;
    width: auto;
    background: none;
    border: 0;
    box-shadow: none;
  }
  html.sidebar-collapsed .brand-logo { width: auto; height: 36px; max-width: 148px; object-fit: contain; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart-card { position: static; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .user-name { display: none; }
  .auth-wrap { height: auto; overflow: auto; }
  .auth-stage { grid-template-columns: 1fr; padding: 20px 18px 8px; }
  .auth-intro { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .auth-portrait { max-width: 220px; max-height: 280px; }
  .auth-copy { display: flex; flex-direction: column; align-items: center; }
  .auth-card { width: min(440px, 100%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.help-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.help-toc a {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 600;
}
.help-toc a:hover { border-color: var(--color-teal); color: var(--color-teal-dark); }
.help-acc {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  scroll-margin-top: 16px;
}
.help-acc > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--color-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.help-acc > summary::-webkit-details-marker { display: none; }
.help-acc > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform var(--ease);
  flex-shrink: 0;
}
.help-acc[open] > summary { border-bottom: 1px solid var(--color-border); }
.help-acc[open] > summary::after { transform: rotate(225deg); margin-bottom: 4px; }
.help-acc-body { padding: 12px 16px 16px; color: var(--color-grey); }
.help-acc-body h3 { color: var(--color-navy); font-size: 14px; margin: 14px 0 6px; }
.help-acc-body h3:first-child { margin-top: 0; }
.help-acc-body ul, .help-acc-body ol { padding-left: 18px; margin: 6px 0; }
.help-acc-body p { margin: 6px 0; }
.help-acc-body code {
  font-size: 12px;
  background: var(--color-cream);
  padding: 1px 5px;
  border-radius: 4px;
}
.help-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.help-public { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-cream); }
.help-public-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--color-navy);
}
.help-public-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
}
.help-public-brand img { height: 32px; width: auto; }
.help-public-bar .btn { background: var(--color-teal); color: #fff; }
.help-public-body { max-width: 920px; width: 100%; margin: 0 auto; padding: 24px 16px 40px; }

@media print {
  .sidebar, .navbar, .btn, .no-print, .app-modal-overlay, .sidebar-backdrop, .app-footer { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: none; animation: none; }
}
