/* =========================================================
   OrderDesk · Sales & Order Management
   1. Tokens  2. Base  3. Components  4. Login  5. App shell
   6. Dashboard  7. Placeholders  8. Responsive
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --navy-950: #070f22;
  --navy-900: #0b1a3a;
  --navy-800: #112450;
  --navy-700: #1a3269;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --line: #e2e8f0;
  --surface: #ffffff;
  --canvas: #f4f6fb;
  --green: #059669;
  --green-bg: #d1fae5;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;

  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --sidebar-w: 268px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; flex: none; width: 20px; height: 20px; } /* default icon size; components override */
:focus-visible { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 2px; }

[data-icon] svg, .icon svg { width: 20px; height: 20px; }

/* ---------- 3. Components ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy-900); z-index: 100; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent; font-weight: 700; font-size: 14.5px;
  transition: background .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease), border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .7); }
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 10px 20px -8px rgba(37, 99, 235, .8); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-700); }
.btn-ghost:hover { border-color: var(--blue-500); color: var(--blue-600); background: var(--blue-50); }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); border: 0; background: transparent;
  display: inline-grid; place-items: center; color: inherit; transition: background .2s;
}
.icon-btn:hover { background: rgba(100, 116, 139, .14); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--blue-600); color: #fff; font-weight: 800; font-size: 15px;
}

.logo-mark {
  width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center;
  background: var(--blue-600); color: #fff; box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .9);
}
.logo-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: var(--blue-50); color: var(--blue-600);
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: #eef2f7; color: var(--ink-500); }

.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; }
.toast {
  background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  box-shadow: var(--shadow-md); font-weight: 600; font-size: 14px;
  animation: toast-in .3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 4. Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) 1fr; }

.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: 44px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--navy-900);
}
.login-brand::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -200px; bottom: -220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, .5), transparent 68%);
  pointer-events: none;
}
.brand-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-pitch { position: relative; z-index: 1; max-width: 520px; }
.login-pitch h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; }
.login-pitch p { margin-top: 18px; color: #b6c4e2; font-size: 16px; max-width: 460px; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; z-index: 1; color: #d6e0f5; font-weight: 500; }
.login-points li { display: flex; align-items: center; gap: 12px; }
.login-points li > span { width: 24px; height: 24px; border-radius: 50%; background: rgba(59, 130, 246, .28); color: #9cc2ff; display: grid; place-items: center; }
.login-points svg { width: 14px !important; height: 14px !important; }

.login-panel { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login-card { width: 100%; max-width: 410px; display: grid; gap: 20px; }
.login-card header h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-card header p { color: var(--ink-500); margin-top: 4px; }

.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--canvas); border-radius: var(--r-md); }
.role-switch input { position: absolute; opacity: 0; pointer-events: none; }
.role-switch label {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px;
  border-radius: 9px; font-weight: 700; color: var(--ink-500); cursor: pointer; transition: all .2s var(--ease);
}
.role-switch label svg { width: 18px; height: 18px; }
.role-switch label:hover { color: var(--ink-900); }
.role-switch input:checked + label { background: var(--surface); color: var(--blue-600); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.role-switch input:focus-visible + label { outline: 3px solid rgba(59, 130, 246, .55); }

.field { display: grid; gap: 7px; }
.field > label { font-weight: 700; font-size: 14px; color: var(--ink-700); }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%; height: 48px; padding: 0 46px 0 44px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap input::placeholder { color: #94a3b8; }
.input-wrap input:hover { border-color: var(--ink-300); }
.input-wrap input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .16); }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-500); display: grid; pointer-events: none; }
.input-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-500); display: grid; place-items: center;
}
.input-action:hover { background: var(--canvas); color: var(--blue-600); }

.form-row { display: flex; align-items: center; justify-content: space-between; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-700); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; }
.check .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--ink-300); display: grid; place-items: center;
  transition: all .15s var(--ease); background: var(--surface);
}
.check input:checked + .box { background: var(--blue-600); border-color: var(--blue-600); }
.check input:checked + .box::after {
  content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg);
}
.check input:focus-visible + .box { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 2px; }

.form-error {
  padding: 11px 14px; border-radius: var(--r-sm); background: var(--red-bg); color: #991b1b; font-weight: 600; font-size: 14px;
}
.form-error.info { background: var(--blue-50); color: var(--navy-700); }
.login-hint { text-align: center; color: var(--ink-500); font-size: 13.5px; }
.login-hint strong { color: var(--ink-700); }

/* ---------- 5. App shell ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  background: var(--navy-900); color: #c9d5ef; display: flex; flex-direction: column;
  transition: transform .3s var(--ease);
}
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; }
.sidebar-close { display: none; margin-left: auto; color: #c9d5ef; }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: grid; gap: 3px; align-content: start; }
.nav-group { padding: 14px 12px 6px; font-size: 12.5px; font-weight: 700; color: #6f84b3; }

.nav-link {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 14px;
  border: 0; border-radius: 10px; background: transparent; color: #c9d5ef; text-align: left; text-decoration: none;
  font-weight: 600; font-size: 14.5px; transition: background .2s var(--ease), color .2s, transform .2s var(--ease);
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.nav-link.active { background: var(--blue-600); color: #fff; box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 1); }
.nav-link svg { width: 20px; height: 20px; opacity: .92; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.user-meta { display: grid; line-height: 1.25; min-width: 0; }
.user-meta strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 12.5px; color: #8ea2cf; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; background: rgba(244, 246, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.topbar-title p { color: var(--ink-500); font-size: 13.5px; }
.content { padding: 28px 32px 48px; outline: none; max-width: 1400px; width: 100%; }
.scrim { position: fixed; inset: 0; background: rgba(7, 15, 34, .55); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }

/* ---------- 6. Dashboard ---------- */
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.welcome h2 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.welcome p { color: var(--ink-500); margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.stat { padding: 20px; display: flex; align-items: center; gap: 16px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-100); }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.stat-icon svg { width: 25px; height: 25px; }
.stat.dark { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.stat.dark .stat-icon { background: rgba(59, 130, 246, .25); color: #9cc2ff; }
.stat.dark .stat-label { color: #a9b9dc; }
.stat-label { color: var(--ink-500); font-weight: 600; font-size: 14px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-top: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.panel-head h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.panel-head span { color: var(--ink-500); font-size: 13.5px; }
.panel-body { padding: 16px 22px 22px; }

.chart { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; align-items: end; height: 210px; padding-top: 12px; }
.chart::before {
  content: ""; position: absolute; inset: 12px 0 28px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%);
}
.bar-col { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar {
  width: 100%; max-width: 44px; min-height: 6px; border-radius: 8px 8px 3px 3px; background: var(--blue-100);
  transition: background .2s, height .6s var(--ease);
}
.bar.has-value { background: var(--blue-600); }
.bar-col:hover .bar { background: var(--navy-700); }
.bar-label { font-size: 12.5px; color: var(--ink-500); font-weight: 600; }
.chart-note { text-align: center; color: var(--ink-500); font-size: 13.5px; margin-top: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--ink-500); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-weight: 500; white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--canvas); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--canvas); }
.alert-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); flex: none; }
.alert-item .dot.out { background: var(--red); }
.alert-item strong { display: block; font-size: 14px; }
.alert-item small { color: var(--ink-500); }
.alert-item .badge { margin-left: auto; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-weight: 700; font-size: 14px;
  transition: all .2s var(--ease);
}
.action span.icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); transition: all .2s; }
.action:hover { border-color: var(--blue-500); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action:hover span.icon { background: var(--blue-600); color: #fff; }

.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 26px 12px; color: var(--ink-500); }
.empty .empty-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; }
.empty strong { color: var(--ink-900); }
.empty p { max-width: 300px; font-size: 14px; }

/* ---------- 7. Module placeholders ---------- */
.placeholder { display: grid; place-items: center; min-height: calc(100vh - 190px); }
.placeholder-card { max-width: 560px; width: 100%; text-align: center; padding: 48px 32px; display: grid; justify-items: center; gap: 14px; }
.placeholder-ico { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-100); }
.placeholder-ico svg { width: 38px; height: 38px; }
.placeholder-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.placeholder-card > p { color: var(--ink-500); max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 10px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--canvas); border: 1px dashed var(--ink-300); color: var(--ink-700); font-size: 13px; font-weight: 600; }

/* ---------- 8. Responsive ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; gap: 22px; }
  .login-points, .login-pitch p { display: none; }
  .login-pitch h1 { font-size: 26px; }
  .login-panel { padding: 28px 20px 40px; align-items: start; }

  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .app.sidebar-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .app.sidebar-open .scrim { opacity: 1; pointer-events: auto; }
  .sidebar-close, .menu-btn { display: inline-grid; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .stat-value { font-size: 22px; }
  .chart { gap: 6px; }
  .welcome h2 { font-size: 22px; }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .toasts { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   9. Customers / Shops module
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; box-shadow: 0 10px 22px -8px rgba(37, 99, 235, .75); }
.btn-lg:hover { transform: translateY(-1px); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { color: var(--red); }
.btn-danger-ghost:hover { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.btn svg { width: 18px; height: 18px; }

.module-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.module-bar p { color: var(--ink-500); max-width: 480px; }
.module-bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.amber { background: var(--amber-bg); color: var(--amber); }

.list-card { margin-top: 18px; overflow: hidden; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 260px; }
.search .control { padding-left: 42px; }
.toolbar select.control { flex: 0 1 190px; }

.control {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea.control { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.45; }
select.control {
  appearance: none; padding-right: 38px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.control::placeholder { color: #94a3b8; }
.control:hover { border-color: var(--ink-300); }
.control:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .16); }
.control.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); }

.ctable th { background: #f8fafc; padding: 12px 16px; }
.ctable td { padding: 14px 16px; vertical-align: middle; }
.shop-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.shop-link strong { display: block; line-height: 1.25; transition: color .2s; }
.shop-link small { color: var(--ink-500); font-weight: 600; }
.shop-link:hover strong { color: var(--blue-600); }
.shop-avatar, .avatar-lg {
  display: grid; place-items: center; flex: none; background: var(--blue-50); color: var(--blue-600);
  font-weight: 800; box-shadow: inset 0 0 0 1px var(--blue-100);
}
.shop-avatar { width: 40px; height: 40px; border-radius: 12px; }
.avatar-lg { width: 68px; height: 68px; border-radius: 20px; font-size: 28px; }
.cell-addr { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-700); }
.owes { color: var(--red); font-weight: 800; }
.clear { color: var(--green); font-weight: 700; }
.row-actions { display: inline-flex; gap: 4px; }
.row-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-500); text-decoration: none; transition: background .15s, color .15s;
}
.row-btn svg { width: 18px; height: 18px; }
.row-btn:hover { background: var(--blue-50); color: var(--blue-600); }
.row-btn.danger:hover { background: var(--red-bg); color: var(--red); }
.result-count { padding: 12px 20px 16px; color: var(--ink-500); font-size: 13.5px; border-top: 1px solid var(--line); }
.empty.big { padding: 56px 16px; }
.empty.big .btn { margin-top: 8px; }

/* modal dialogs */
dialog.modal {
  border: 0; padding: 0; background: transparent; color: var(--ink-900); max-width: none; max-height: none;
  width: min(640px, calc(100vw - 24px)); overflow: visible;
}
dialog.modal::backdrop { background: rgba(7, 15, 34, .6); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .22s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-card {
  display: flex; flex-direction: column; max-height: calc(100vh - 32px); background: var(--surface);
  border-radius: var(--r-lg); box-shadow: 0 30px 70px -20px rgba(7, 15, 34, .55); overflow: hidden;
}
.modal-sm { width: min(440px, calc(100vw - 24px)); margin: 0 auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.modal-head p { color: var(--ink-500); font-size: 13.5px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: #f8fafc; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: 1 / -1; }
.req { color: var(--red); }
.field-error { color: var(--red); font-weight: 600; font-size: 13px; }
.field-error:empty { display: none; }
.field-hint { color: var(--ink-500); font-size: 12.5px; }
.role-switch { position: relative; }
.role-switch.seg label { height: 44px; }
.confirm { padding: 28px 24px 22px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.confirm h3 { font-size: 19px; font-weight: 800; }
.confirm p { color: var(--ink-500); }
.confirm-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); margin-bottom: 4px; }
.confirm-ico.danger { background: var(--red-bg); color: var(--red); }
.confirm-ico svg { width: 26px; height: 26px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; width: 100%; }
.modal-actions .btn { flex: 1; }

/* customer detail */
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--ink-500); font-weight: 700; text-decoration: none; transition: color .2s, transform .2s; }
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--blue-600); transform: translateX(-2px); }
.profile { display: flex; align-items: center; gap: 18px; padding: 22px; flex-wrap: wrap; margin-bottom: 18px; }
.profile-id h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.profile-id p { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.code { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-500); font-weight: 600; font-size: 13.5px; }
.code svg { width: 15px; height: 15px; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 2.2fr; gap: 18px; margin-top: 18px; align-items: start; }
.dl { display: grid; gap: 16px; margin: 0; }
.dl dt { color: var(--ink-500); font-size: 13px; font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.dl a { color: var(--blue-600); text-decoration: none; }
.dl a:hover { text-decoration: underline; }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 16px 12px; border: 0; background: none; white-space: nowrap;
  font-weight: 700; color: var(--ink-500); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s;
}
.tab:hover { color: var(--ink-900); }
.tab[aria-selected="true"] { color: var(--blue-600); border-color: var(--blue-600); }
.tab .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--canvas); font-size: 12px; text-align: center; }
.tab[aria-selected="true"] .count { background: var(--blue-50); }
.tab-panel { padding-top: 18px; }
.note-form { display: grid; gap: 10px; justify-items: end; margin-bottom: 16px; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.note-item { padding: 14px 16px; border-radius: var(--r-md); background: var(--canvas); }
.note-item p { white-space: pre-wrap; word-break: break-word; }
.note-item > div { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--ink-500); }

/* printing (customer details) */
#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  body { background: #fff; }
  #printArea { display: block !important; font-family: var(--font); color: #000; padding: 8mm; }
  #printArea h1 { font-size: 24px; margin-bottom: 2px; }
  #printArea h2 { font-size: 15px; margin: 20px 0 8px; }
  .print-sub, .print-empty { color: #555; font-size: 12.5px; margin-bottom: 12px; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .print-table th, .print-table td { border: 1px solid #ccc; padding: 6px 9px; text-align: left; white-space: normal; }
  .print-kv th { width: 32%; background: #f1f5f9; }
}

@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .module-bar-actions { width: 100%; }
  .module-bar-actions .btn { flex: 1; }
  .toolbar { padding: 14px 16px; }
  .toolbar select.control { flex: 1 1 140px; }
  .ctable thead { display: none; }
  .ctable, .ctable tbody, .ctable tr, .ctable td { display: block; }
  .list-card .table-wrap { padding: 14px 14px 2px; }
  .ctable tbody tr { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
  .ctable td { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border: 0; text-align: right; white-space: normal; max-width: none; }
  .ctable td::before { content: attr(data-label); color: var(--ink-500); font-weight: 600; text-align: left; flex: none; }
  .ctable td.cell-main { display: block; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); text-align: left; }
  .ctable td.cell-main::before, .ctable td.cell-actions::before { display: none; }
  .ctable td.cell-actions { justify-content: flex-end; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
  .result-count { border-top: 0; padding-top: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot .btn { flex: 1; }
  .profile-actions { margin-left: 0; width: 100%; }
  .profile-actions .btn { flex: 1 1 calc(50% - 8px); }
  .profile-id h2 { font-size: 21px; }
}

/* =========================================================
   10. First-time setup & auth feedback
   ========================================================= */
.form-error.success { background: var(--green-bg); color: #065f46; }
.input-wrap input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); }
.input-wrap + .field-hint, .input-wrap + .field-error { margin-top: 0; }
.strength { display: flex; align-items: center; gap: 6px; height: 14px; }
.strength span { flex: 1; max-width: 56px; height: 5px; border-radius: 3px; background: var(--line); transition: background .25s; }
.strength em { margin-left: 4px; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--ink-500); min-width: 44px; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--red); }
.strength[data-level="2"] span:nth-child(-n+2) { background: #f59e0b; }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--blue-500); }
.strength[data-level="4"] span:nth-child(-n+4) { background: var(--green); }
#setupForm { gap: 16px; }
#setupForm .login-hint { margin-top: -4px; }

/* =========================================================
   11. Products, Orders, Notes, Staff
   ========================================================= */
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--blue-600); text-decoration: underline; }
.muted { color: var(--ink-500); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat.dark .stat-icon.red { background: rgba(248, 113, 113, .22); color: #fca5a5; }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
.hint-inline { color: var(--ink-500); font-size: 13px; font-weight: 500; }
.hint-inline.pad { padding: 12px; }
.tag-admin { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: 11.5px; font-weight: 700; }
.inline-input { display: flex; gap: 8px; align-items: center; }
.inline-input .control { flex: 1; min-width: 0; }
.inline-input select.control { flex: 0 0 84px; }
.inline-input .btn { flex: none; }
.toolbar.flat { padding: 0 0 14px; border: 0; }
.date-f { display: flex; align-items: center; gap: 8px; color: var(--ink-500); font-weight: 600; font-size: 13.5px; }
.date-f .control { width: 156px; }

/* product catalogue */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; padding: 20px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-100); }
.pimg, .mini-img, .cart-thumb, .img-preview { position: relative; display: grid; place-items: center; background: var(--canvas); overflow: hidden; }
.pimg { aspect-ratio: 4 / 3; }
.pimg img, .mini-img img, .cart-thumb img, .img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { display: grid; place-items: center; color: var(--ink-300); }
.noimg svg { width: 38px; height: 38px; }
.pstock { position: absolute; top: 10px; right: 10px; }
.pstock .badge { box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.pbody { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcat { color: var(--blue-600); font-size: 12.5px; font-weight: 700; }
.pbody h4 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.psku { color: var(--ink-500); font-size: 12.5px; font-weight: 600; }
.pdesc { color: var(--ink-500); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.pprice { margin-top: auto; padding-top: 10px; }
.pprice strong { font-size: 20px; font-weight: 800; color: var(--navy-900); letter-spacing: -.02em; }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-500); font-size: 13px; }
.pmeta b { color: var(--ink-900); }
.pmeta .cost b { color: var(--amber); }
.pactions { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--line); background: #f8fafc; }
.img-zone { display: flex; gap: 16px; align-items: center; }
.img-preview { width: 104px; height: 104px; border-radius: 14px; border: 1.5px dashed var(--ink-300); flex: none; }
.img-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.img-actions small { flex-basis: 100%; color: var(--ink-500); font-size: 12.5px; }
.img-actions label.btn { cursor: pointer; }

/* notes */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px 0; }
.fchip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13.5px; color: var(--ink-700); transition: all .2s var(--ease); }
.fchip span { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--canvas); font-size: 12px; text-align: center; }
.fchip:hover { border-color: var(--blue-500); color: var(--blue-600); }
.fchip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.fchip[aria-pressed="true"] span { background: rgba(255, 255, 255, .18); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 20px; }
.ncard { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.ncard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ncard.pinned { border-color: var(--blue-500); background: linear-gradient(var(--blue-50), var(--surface) 70%); }
.ncard header, .ncard footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ncard h4 { margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.nbody { color: var(--ink-700); white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ncard footer { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-500); }
.pin-btn.on { color: var(--blue-600); background: var(--blue-100); }
.pin-btn.on svg { fill: currentColor; }

/* staff */
.switch { position: relative; width: 44px; height: 26px; border: 0; border-radius: 999px; background: var(--ink-300); vertical-align: middle; transition: background .2s; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"] span { transform: translateX(18px); }
.switch-label { margin-left: 8px; font-weight: 700; font-size: 13.5px; color: var(--ink-500); }
.switch-label.on { color: var(--green); }
.uname { padding: 3px 8px; border-radius: 6px; background: var(--canvas); font-size: 13px; font-weight: 600; }
.access-box { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); display: grid; gap: 10px; background: #f8fafc; }
.access-list { max-height: 210px; overflow-y: auto; display: grid; gap: 2px; }
.acc-item { padding: 8px 10px; border-radius: 8px; align-items: flex-start; font-weight: 600; }
.acc-item:hover { background: var(--surface); }
.acc-item small { display: block; color: var(--ink-500); font-weight: 500; }
.acc-item .box { margin-top: 1px; flex: none; }
.cred { display: grid; gap: 8px; margin: 10px 0 0; width: 100%; text-align: left; padding: 14px; border-radius: var(--r-md); background: var(--canvas); }
.cred div { display: flex; justify-content: space-between; gap: 12px; }
.cred dt { color: var(--ink-500); font-weight: 600; }
.cred dd { margin: 0; font-weight: 700; }
.cred code { font-size: 14px; word-break: break-all; }

/* orders */
.status-row { display: flex; gap: 10px; }
.status-row .control { flex: 1; }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.builder-main { display: grid; gap: 18px; min-width: 0; }
.builder-side { position: sticky; top: 88px; }
.builder-side .panel-body { display: grid; gap: 16px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 520px; overflow-y: auto; padding: 2px; }
.mini { display: flex; flex-direction: column; gap: 8px; padding: 8px; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: all .2s var(--ease); }
.mini:hover:not(:disabled) { border-color: var(--blue-500); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mini:disabled { opacity: .55; cursor: not-allowed; }
.mini.in { border-color: var(--blue-600); background: var(--blue-50); }
.mini-img { aspect-ratio: 1; border-radius: 9px; }
.mini-qty { position: absolute; top: 6px; left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--blue-600); color: #fff; font-size: 12.5px; }
.mini-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-row { display: flex; flex-direction: column; gap: 0; }
.mini-row strong { font-size: 15px; }
.mini-row small { color: var(--ink-500); font-weight: 600; }
.sel-cust { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-md); background: var(--blue-50); border: 1px solid var(--blue-100); }
.sel-cust > div { flex: 1; min-width: 0; }
.sel-cust small { display: block; color: var(--ink-500); font-weight: 600; }
.pick-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; text-align: left; border: 0; border-radius: 10px; background: transparent; transition: background .15s; }
.pick-item:hover, .pick-item:focus-visible { background: var(--blue-50); }
.pick-item small { display: block; color: var(--ink-500); font-weight: 600; }
.pick-empty { padding: 14px; color: var(--ink-500); text-align: center; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 340px; overflow-y: auto; }
.cart-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: start; }
.cart-thumb { width: 48px; height: 48px; border-radius: 10px; }
.cart-info { display: grid; gap: 2px; min-width: 0; }
.cart-info strong { font-size: 14px; line-height: 1.3; }
.cart-info small { color: var(--ink-500); }
.cart-line { display: grid; justify-items: end; gap: 4px; }
.cart-empty { display: flex; align-items: center; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--canvas); color: var(--ink-500); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; margin-top: 6px; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; }
.stepper button { width: 32px; height: 32px; border: 0; background: var(--canvas); font-size: 18px; font-weight: 700; line-height: 1; transition: background .15s; }
.stepper button:hover:not(:disabled) { background: var(--blue-100); color: var(--blue-600); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper input { width: 46px; height: 32px; border: 0; text-align: center; font-weight: 700; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-fields { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.totals { display: grid; gap: 8px; margin: 0; padding: 14px; border-radius: var(--r-md); background: var(--canvas); }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--ink-500); font-weight: 600; }
.totals dd { margin: 0; font-weight: 700; }
.totals .grand { padding-top: 8px; border-top: 1px solid var(--ink-300); font-size: 17px; }
.totals .grand dt { color: var(--ink-900); font-weight: 800; }
.totals .bal dd { font-size: 16px; }
.totals.wide { margin-top: 16px; max-width: 380px; margin-left: auto; }
.cart-actions { display: grid; gap: 10px; }

/* invoice (printed from #printArea) */
@media print {
  .invoice { font-size: 13px; color: #111; }
  .inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 14px; border-bottom: 3px solid #0b1a3a; }
  .inv-head h1 { font-size: 26px; margin: 0; color: #0b1a3a; }
  .inv-head p { margin: 2px 0 0; color: #555; letter-spacing: .04em; }
  .inv-meta { border-collapse: collapse; }
  .inv-meta th { text-align: left; color: #555; font-weight: 600; padding: 2px 14px 2px 0; }
  .inv-meta td { font-weight: 700; padding: 2px 0; }
  .inv-bill { margin: 18px 0; }
  .inv-bill h2, .inv-notes h2 { margin: 0 0 4px; font-size: 12px; color: #555; text-transform: none; letter-spacing: .02em; }
  .inv-bill p, .inv-notes p { margin: 1px 0; }
  .inv-items { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
  .inv-items th { background: #0b1a3a; color: #fff; padding: 8px 10px; text-align: left; font-size: 12px; }
  .inv-items td { padding: 8px 10px; border-bottom: 1px solid #ddd; }
  .inv-items .r, .inv-totals td { text-align: right; }
  .inv-totals { margin-left: auto; min-width: 260px; border-collapse: collapse; }
  .inv-totals th { text-align: left; padding: 5px 16px 5px 0; color: #555; font-weight: 600; }
  .inv-totals td { padding: 5px 0; font-weight: 700; }
  .inv-totals .strong th, .inv-totals .strong td { font-size: 15px; color: #0b1a3a; border-top: 1px solid #999; padding-top: 7px; }
  .inv-notes { margin-top: 18px; }
  .inv-foot { margin-top: 36px; padding-top: 10px; border-top: 1px solid #ccc; text-align: center; color: #666; }
  .inv-items, .inv-items tr { break-inside: avoid; }
}

@media (max-width: 1100px) {
  .builder { grid-template-columns: 1fr; }
  .builder-side { position: static; }
  .stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .pgrid, .note-grid { padding: 14px; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .note-grid { grid-template-columns: 1fr; }
  .chip-row { padding: 12px 16px 0; }
  .date-f { flex: 1 1 140px; }
  .date-f .control { width: 100%; }
  .img-zone { flex-direction: column; align-items: flex-start; }
  .mini-grid { max-height: 420px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .stats.stats-3 { grid-template-columns: 1fr; }
  .switch-label { display: none; }
  .ctable td .switch { margin-left: auto; }
  .status-row { flex-direction: column; }
}

.input-icon svg { width: 18px; height: 18px; }
.cart-empty svg, .empty-ico svg { width: 22px; height: 22px; }

/* =========================================================
   12. Expenses, Reports, Analytics
   ========================================================= */
.stat > div:last-child { min-width: 0; }
.stat-value { overflow-wrap: anywhere; }
.stat-value.sm { font-size: 22px; }
.stat-value.neg { color: var(--red); }
.stat.dark .stat-value.neg { color: #fca5a5; }
.statbtn { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.fin-row { margin-top: 18px; }
.block { display: block; }
.seg-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--canvas); border-radius: 10px; }
.seg-tabs button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--ink-500); white-space: nowrap; transition: all .2s var(--ease); }
.seg-tabs button:hover:not(:disabled) { color: var(--ink-900); }
.seg-tabs button[aria-selected="true"] { background: var(--surface); color: var(--blue-600); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.sum-wrap { max-height: 420px; overflow-y: auto; }
.sum-wrap tr.cur td { background: var(--blue-50); }
.sum-wrap tfoot td { font-weight: 800; border-top: 2px solid var(--line); }

.rpt-picker { padding: 16px 20px; display: grid; gap: 14px; margin-bottom: 20px; }
.rpt-group h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-500); font-weight: 700; }
.rpt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rchip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--ink-700); transition: all .2s var(--ease); }
.rchip svg { width: 17px; height: 17px; color: var(--blue-600); }
.rchip:hover { border-color: var(--blue-500); color: var(--blue-600); transform: translateY(-1px); }
.rchip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.rchip[aria-pressed="true"] svg { color: #9cc2ff; }
.rpt-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rpt-title h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.rpt-title p { color: var(--ink-500); }
.range-pill { padding: 6px 12px; border-radius: 999px; background: var(--blue-50); color: var(--blue-600); font-weight: 700; font-size: 13.5px; }
#rptSummary, #anKpis { margin-bottom: 18px; }
.rpt-note { margin: 0; padding: 10px 20px; background: var(--blue-50); color: var(--navy-700); font-size: 13.5px; font-weight: 600; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; white-space: nowrap; }
.th-sort:hover { color: var(--blue-600); }
.rtable tfoot td { font-weight: 800; background: #f8fafc; border-top: 2px solid var(--line); }
.rtable tr.k-head td { background: #f8fafc; font-weight: 800; color: var(--ink-500); }
.rtable tr.k-total td { font-weight: 800; border-top: 1px solid var(--ink-300); }
.rtable tr.k-grand td { font-weight: 800; font-size: 16px; background: var(--navy-900); color: #fff; }

.an-filter { align-items: center; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-700); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hb-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 14px; }
.hb-top b { color: var(--ink-700); white-space: nowrap; }
.hb-track { height: 9px; border-radius: 6px; background: var(--canvas); overflow: hidden; margin: 6px 0 2px; }
.hb-track span { display: block; height: 100%; border-radius: 6px; transition: width .6s var(--ease); }
.hbars small { color: var(--ink-500); }
.cmp-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.cmp-row div { display: grid; gap: 3px; padding: 12px; border-radius: 12px; background: var(--canvas); align-content: start; }
.cmp-row small { color: var(--ink-500); font-weight: 600; }
.cmp-row strong { overflow-wrap: anywhere; }
.delta { display: inline-block; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #eef2f7; color: var(--ink-500); }
.delta.up { background: var(--green-bg); color: var(--green); }
.delta.down { background: var(--red-bg); color: var(--red); }

@media print {
  .print-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
  .print-sum div { border: 1px solid #bbb; padding: 6px 12px; min-width: 130px; }
  .print-sum small { display: block; color: #555; font-size: 11px; }
  .print-sum strong { font-size: 14px; }
  .print-table .r { text-align: right; }
  .print-table tr.b td { font-weight: 700; background: #f1f5f9; }
  .print-table thead { display: table-header-group; }
  .print-table tr { break-inside: avoid; }
}
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cmp-row { grid-template-columns: 1fr 1fr; }
  .seg-tabs { width: 100%; }
  .seg-tabs button { flex: 1; padding: 8px 6px; }
  .an-filter { width: 100%; }
  .rpt-picker { padding: 14px; }
  .rchip { padding: 7px 10px; font-size: 13px; }
  .ctable tfoot tr { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #f8fafc; }
  .rtable tfoot td { border: 0; background: transparent; }
  .rtable tbody tr.k-head, .rtable tbody tr.k-grand { padding: 8px 14px; }
  .rtable tr.k-grand { background: var(--navy-900); }
  .rpt-note { padding: 10px 16px; }
}

/* grid children may shrink below their content width (prevents sideways scrolling on phones) */
.dash-grid > *, .detail-grid > *, .builder > *, .chart-grid > * { min-width: 0; }
.bar-col { min-width: 0; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.stack { grid-template-columns: minmax(0, 1fr); }

/* =========================================================
   13. Categories, POS order screen, product catalog
   ========================================================= */
.no-scroll { overflow: hidden; }
.lbl { display: block; color: var(--ink-500); font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.stack-actions { display: grid; gap: 10px; width: 100%; margin-top: 12px; }
.pinactive { position: absolute; top: 10px; left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 700; }
.pcard.inactive { opacity: .72; }

/* category manager */
.cat-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.cat-info { flex: 1; min-width: 0; display: grid; }
.cat-info small { color: var(--ink-500); }
.cat-row.editing { background: var(--blue-50); border-color: var(--blue-100); }
.cat-row.editing form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; width: 100%; align-items: start; }
.held-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.held-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.held-row small { display: block; color: var(--ink-500); }

/* POS screen */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 18px; align-items: start; }
.pos-main { min-width: 0; display: grid; gap: 14px; }
.pos-top { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.pos-cust { padding: 14px 16px; position: relative; z-index: 6; }
.pos-cust .sel-cust { padding: 0; background: none; border: 0; }
.cust-search { position: relative; }
.cust-drop { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 30; }
.cust-search:focus-within .cust-drop { display: block; }
.pos-search { position: relative; }
.pos-search .control { height: 52px; padding-left: 44px; border-radius: 14px; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.pos-cats .fchip { flex: none; padding: 9px 16px; }
.pos-cats .fchip[aria-pressed="true"], .cat-chips .fchip[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pcard-pos { position: relative; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; outline: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.pcard-pos:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-500); }
.pcard-pos:focus-visible { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 2px; }
.pcard-pos:active { transform: scale(.98); }
.pcard-pos.in { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.pcard-pos.out { opacity: .78; }
.pcard-pos.out .pp-img img { filter: grayscale(.85); }
.pcard-pos.flash { animation: card-flash .55s var(--ease); }
@keyframes card-flash { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .65); transform: scale(.97); } 60% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); transform: scale(1.02); } 100% { box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); transform: none; } }
.pp-img { position: relative; aspect-ratio: 4 / 3; background: var(--canvas); display: grid; place-items: center; overflow: hidden; }
.pp-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pp-badge { position: absolute; top: 8px; left: 8px; padding: 2px 11px; border-radius: 999px; background: var(--blue-600); color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: 0 4px 10px rgba(37, 99, 235, .45); }
.pp-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.pp-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pp-row strong { line-height: 1.3; font-size: 14.5px; }
.pp-row b { color: var(--blue-600); white-space: nowrap; }
.pp-sku { color: var(--ink-500); font-weight: 600; }
.pp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.pp-add { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); transition: all .2s; }
.pcard-pos:hover:not(.out) .pp-add { background: var(--blue-600); color: #fff; }
.pcard-pos.maxed .pp-add { background: var(--canvas); color: var(--ink-300); }
.pp-fix { border: 1px solid var(--blue-500); background: var(--blue-50); color: var(--blue-600); font-weight: 700; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; }
.pp-fix:hover { background: var(--blue-600); color: #fff; }

.pos-cart { position: sticky; top: 88px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-head h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cart-tools { display: flex; align-items: center; gap: 6px; }
.cart-tools b { margin-left: 2px; color: var(--blue-600); }
.cart-count, .fab-count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--blue-600); color: #fff; font-size: 13px; display: inline-grid; place-items: center; }
.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45); } }
.pos-close { display: none; }
.cart-cust { padding: 10px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.cart-cust-name { display: flex; align-items: center; gap: 8px; }
.cart-cust-name svg { width: 18px; height: 18px; color: var(--blue-600); }
.cart-cust-pick { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border: 1.5px dashed var(--blue-500); border-radius: 10px; background: var(--blue-50); color: var(--blue-600); font-weight: 700; }
.pos-cart .cart-list { flex: 1; min-height: 110px; max-height: none; padding: 14px 16px; overflow-y: auto; }
.cart-item.new-line { animation: line-in .9s var(--ease); }
@keyframes line-in { 0% { background: var(--blue-100); } 100% { background: transparent; } }
.price-edit { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: var(--ink-500); font-weight: 700; }
.price-edit input { width: 96px; height: 30px; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 8px; font-weight: 700; outline: none; }
.price-edit input:focus { border-color: var(--blue-500); }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 12px; background: #fff; max-height: 56vh; overflow-y: auto; }
.cart-foot .cart-fields { padding-top: 0; border-top: 0; gap: 10px; grid-template-columns: 1fr 1fr; }
.cart-foot .cart-fields .field:last-child, .cart-foot .cart-fields .field:nth-child(3):not(:nth-last-child(2)) { grid-column: 1 / -1; }
.cart-foot .totals { padding: 12px; }
.cart-fab { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 45; align-items: center; gap: 10px; padding: 12px 18px 12px 16px; border: 0; border-radius: 999px; background: var(--blue-600); color: #fff; font-weight: 800; box-shadow: 0 14px 30px -8px rgba(37, 99, 235, .85); }
.fab-count { background: #fff; color: var(--blue-600); }
.cart-scrim { display: none; }

/* invoice header with business details */
@media print {
  .inv-biz { display: flex; gap: 14px; align-items: center; }
  .inv-logo { width: 64px; height: 64px; object-fit: contain; }
  .inv-head p { margin: 1px 0 0; letter-spacing: 0; }
}

/* full-screen product catalog (dark) */
.catalog { position: fixed; inset: 0; z-index: 90; overflow-y: auto; color: #e6edf8; background:
  radial-gradient(1100px 560px at 85% -10%, rgba(14, 116, 194, .30), transparent 60%),
  radial-gradient(900px 520px at -10% 35%, rgba(79, 70, 229, .18), transparent 60%),
  repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 14px), #050b1a; animation: cat-in .3s var(--ease); }
@keyframes cat-in { from { opacity: 0; transform: scale(.985); } }
.cat-inner { max-width: 1320px; margin: 0 auto; padding: 22px 24px 64px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid rgba(148, 163, 184, .18); }
.cat-brand { display: flex; align-items: center; gap: 14px; }
.cat-logo { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, #0ea5e9, #2563eb); box-shadow: 0 10px 30px -8px rgba(14, 165, 233, .65); }
.cat-logo img { width: 100%; height: 100%; object-fit: cover; }
.cat-logo svg { width: 28px; height: 28px; color: #fff; }
.cat-brand h1 { margin: 0; font-size: clamp(20px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; color: #fff; }
.cat-brand p { margin: 0; color: #8fa3c4; }
.cat-contact { display: flex; flex-wrap: wrap; gap: 8px 20px; flex: 1; color: #9fb2d1; font-size: 14px; font-weight: 600; }
.cat-contact a, .cat-contact span { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; }
.cat-contact svg { width: 16px; height: 16px; color: #38bdf8; }
.cat-contact a:hover { color: #fff; }
.cat-actions { display: flex; gap: 8px; }
.cat-btn, .cat-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .3); background: rgba(15, 27, 54, .8); color: #dbe6f7; font-weight: 700; font-size: 14px; transition: all .2s; }
.cat-btn svg, .cat-link svg { width: 16px; height: 16px; }
.cat-btn:hover, .cat-link:hover { background: #0284c7; border-color: #0284c7; color: #fff; }
.cat-search { position: relative; margin-bottom: 14px; }
.cat-search .input-icon { left: 18px; color: #7e92b4; }
.cat-search input { width: 100%; height: 56px; padding: 0 18px 0 50px; border-radius: 16px; border: 1px solid rgba(148, 163, 184, .25); background: rgba(15, 27, 54, .9); color: #fff; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.cat-search input::placeholder { color: #7e92b4; }
.cat-search input:focus { border-color: #38bdf8; box-shadow: 0 0 0 4px rgba(56, 189, 248, .18); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-chips .fchip { background: rgba(15, 27, 54, .8); border-color: rgba(148, 163, 184, .25); color: #c8d5ea; }
.cat-chips .fchip span { background: rgba(255, 255, 255, .1); }
.cat-chips .fchip:hover { border-color: #38bdf8; color: #fff; }
.cat-chips .fchip[aria-pressed="true"] { background: #0284c7; border-color: #0284c7; color: #fff; }
.cat-count { color: #8fa3c4; margin-bottom: 16px; }
.cat-count strong { color: #fff; font-size: 20px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 22px; }
.ccard { border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, #0f1b36, #0a1327); border: 1px solid rgba(148, 163, 184, .16); transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.ccard:hover { transform: translateY(-6px); border-color: rgba(56, 189, 248, .55); box-shadow: 0 24px 50px -18px rgba(14, 165, 233, .5); }
.cimg { position: relative; aspect-ratio: 4 / 3; background: #0b1429; overflow: hidden; display: grid; place-items: center; }
.cimg img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.ccard:hover .cimg img { transform: scale(1.07); }
.cimg .noimg { color: #2d4166; }
.cimg .noimg svg { width: 54px; height: 54px; }
.ctag { position: absolute; top: 12px; left: 12px; padding: 3px 12px; border-radius: 999px; background: rgba(2, 132, 199, .88); color: #fff; font-size: 12.5px; font-weight: 700; backdrop-filter: blur(4px); }
.cout { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(127, 29, 29, .88); color: #fecaca; font-size: 12px; font-weight: 700; }
.cbody { padding: 16px 18px 20px; }
.cbody h3 { margin: 0; font-size: 19px; font-weight: 800; color: #fff; line-height: 1.3; }
.cbody p { margin: 6px 0 0; color: #8fa3c4; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cprice { margin-top: 14px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: #38bdf8; }
.cat-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 70px 16px; color: #8fa3c4; text-align: center; }
.cat-empty svg { width: 40px; height: 40px; color: #38bdf8; }
.cat-empty strong { color: #fff; font-size: 18px; }

@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr); padding-bottom: 84px; }
  .pos-top { grid-template-columns: 1fr; }
  .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; max-height: 90vh; border-radius: 20px 20px 0 0; border-bottom: 0; transform: translateY(105%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s; box-shadow: 0 -20px 50px rgba(7, 15, 34, .35); }
  .pos.cart-open .pos-cart { transform: none; visibility: visible; transition: transform .3s var(--ease); }
  .pos-close { display: inline-grid; }
  .cart-fab { display: inline-flex; }
  .pos.cart-open .cart-fab { display: none; }
  .cart-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(7, 15, 34, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .pos.cart-open .cart-scrim { opacity: 1; pointer-events: auto; }
  .cart-foot { max-height: 46vh; }
}
@media (max-width: 760px) {
  .cat-add, .cat-row.editing form { grid-template-columns: 1fr; }
  .cat-row { flex-wrap: wrap; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pp-body { padding: 10px; }
  .pp-row { flex-direction: column; gap: 2px; }
  .pp-row strong { font-size: 13.5px; }
  .pp-foot .badge { font-size: 11px; padding: 2px 8px; }
  .cart-foot .cart-fields { grid-template-columns: 1fr; }
  .cart-tools .btn { padding: 0 10px; }
  .cat-inner { padding: 16px 14px 48px; }
  .cat-actions { margin-left: auto; }
  .cat-contact { flex-basis: 100%; order: 3; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cbody { padding: 12px; }
  .cbody h3 { font-size: 15px; }
  .cprice { font-size: 19px; margin-top: 8px; }
  .ctag { top: 8px; left: 8px; font-size: 11px; padding: 2px 9px; }
}
@media (max-width: 400px) { .cat-grid { grid-template-columns: 1fr; } }

@media (max-width: 1100px) { .toasts { top: 76px; bottom: auto; left: 16px; right: 16px; } .toast { padding: 10px 14px; } }

/* ---------- Ledger, stock adjustments, dashboard sub-stats ---------- */
.stat-sub { display: block; margin-top: 2px; color: var(--ink-500); font-size: 12.5px; font-weight: 600; }
.stat.dark .stat-sub { color: rgba(255, 255, 255, .7); }
.stats.fin-row + .stats.fin-row { margin-top: 18px; }

.ledger-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ledger-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex: 1 1 420px; }
.ledger-sum > div { background: var(--canvas); border-radius: var(--r-md); padding: 10px 14px; min-width: 0; }
.ledger-sum small { display: block; color: var(--ink-500); font-weight: 700; font-size: 12px; }
.ledger-sum strong { font-size: 15px; overflow-wrap: anywhere; }
.ledger-sum .due { background: var(--navy-900); }
.ledger-sum .due small { color: rgba(255, 255, 255, .7); }
.ledger-sum .due strong { color: #fff; }
.ledger-actions { display: flex; align-items: center; gap: 8px; }
.ledger tr.lg-open td { background: var(--blue-50); font-weight: 700; }
.ledger tr.lg-cancel td { color: var(--ink-500); }
.ledger tr.lg-cancel .cell-main a { text-decoration: line-through; }
.ledger .lg-cr { color: var(--green); font-weight: 700; }
.ledger tfoot td { font-weight: 800; background: var(--canvas); }

.adj-up { color: var(--green); }
.adj-down { color: var(--red); }
.adj-preview { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 18px; padding: 12px 16px; border-radius: var(--r-md); background: var(--canvas); }
.adj-preview small { display: block; color: var(--ink-500); font-weight: 700; font-size: 12px; text-align: center; }
.adj-preview strong { display: block; font-size: 22px; text-align: center; }
.adj-preview .arrow { font-weight: 800; font-size: 18px; color: var(--blue-600); }
.adj-preview p { flex-basis: 100%; margin: 0; text-align: center; color: var(--red); font-weight: 700; font-size: 13px; }
.adj-preview.bad { background: var(--red-bg); }
.adj-preview.bad strong { color: var(--red); }
.role-switch input:disabled + label { opacity: .4; cursor: not-allowed; }
#a-prod { margin-top: 8px; }
#a-error { margin: 0 24px 12px; }

@media (max-width: 760px) {
  .ledger-sum { grid-template-columns: 1fr 1fr; flex-basis: 100%; }
}

/* ledger: wrap text so Debit / Credit / Balance always stay visible beside the shop-details column */
.ledger th, .ledger td { padding: 11px 10px; white-space: normal; font-size: 13.5px; }
.ledger th.num, .ledger td.num { white-space: nowrap; }
.ledger td:first-child { white-space: nowrap; }

/* ---------- Daily closing, donut chart, chart tooltip ---------- */
.closing-bar { padding: 16px 20px; margin-bottom: 18px; display: grid; gap: 12px; }
.closing-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.closing-bar .rpt-note { padding: 10px 14px; border-radius: var(--r-md); }
.closing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; align-items: start; }
.closing-grid .panel-body { padding-top: 6px; }
.closing-empty { margin: 0; padding: 14px 4px; color: var(--ink-500); font-weight: 600; }
.closing-grid tfoot td, #closingBox tfoot td { font-weight: 800; background: var(--canvas); }
.act-cell { white-space: nowrap; }
#closingBox .list-card .panel-head { border-bottom: 1px solid var(--line, #e5e9f2); }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut-svg { width: 190px; height: 190px; flex: none; }
.donut-svg .seg { transition: opacity .15s; cursor: pointer; }
.donut-svg:hover .seg { opacity: .55; }
.donut-svg .seg:hover { opacity: 1; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1 1 200px; min-width: 0; }
.donut-legend li { display: grid; grid-template-columns: 12px 1fr auto 46px; align-items: center; gap: 8px; font-size: 13.5px; padding: 4px 6px; border-radius: 8px; }
.donut-legend li:hover { background: var(--canvas); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend small { color: var(--ink-500); font-weight: 700; text-align: right; }

.chart-svg .hit:hover { fill: rgba(37, 99, 235, .08); }
.hbars li { border-radius: 8px; transition: background .15s; }
.chart-tip { position: fixed; z-index: 9999; pointer-events: none; background: var(--navy-900); color: #fff; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; display: grid; gap: 2px; box-shadow: 0 8px 24px rgba(11, 26, 58, .3); max-width: 260px; }
.chart-tip[hidden] { display: none; }
.chart-tip b { font-size: 13px; margin-bottom: 2px; }
.chart-tip span { color: #dbe6ff; font-weight: 600; }
.chart-card:not(.wide) .cmp-row { grid-template-columns: 1fr 1fr; }

@media (max-width: 1100px) { .closing-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .closing-actions { margin-left: 0; width: 100%; }
  .closing-actions .btn { flex: 1; }
  .donut-svg { width: 160px; height: 160px; }
}
@media print {
  #printArea .sign-row { display: flex; justify-content: space-between; margin-top: 40px; font-size: 13px; }
  #printArea h2 { break-after: avoid; }
}
.donut-svg text { pointer-events: none; }
.closing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.closing-grid > .card, #closingBox > .card { min-width: 0; }
#closingBox .list-card .closing-empty { padding: 16px 22px; }
@media (max-width: 1100px) { .closing-grid { grid-template-columns: minmax(0, 1fr); } }
#closingBox .ctable th, #closingBox .ctable td { padding: 10px 8px; font-size: 13px; white-space: normal; }
#closingBox .ctable th.num, #closingBox .ctable td.num { white-space: nowrap; }
#closingBox .act-cell { white-space: nowrap; }


/* ===== Business Settings, Backup & Restore, invoice formats ===== */
.settings-form { display: grid; gap: 20px; max-width: 920px; }
.settings-form .panel-body { padding-top: 16px; }
.settings-form textarea.control { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; font: inherit; line-height: 1.5; }
.settings-actions { display: flex; justify-content: flex-end; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--canvas) 70%, transparent); }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.backup-grid .panel-body { display: grid; gap: 14px; padding-top: 14px; }
.backup-grid .muted, .restore-confirm .muted { color: var(--ink-500); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th, .mini-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { color: var(--ink-500); font-size: 12.5px; font-weight: 700; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.restore-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.restore-pick .muted { overflow-wrap: anywhere; font-size: 14px; }
.bk-check { border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.bk-check p, .bk-check ul { margin: 6px 0 0; }
.bk-check ul { padding-left: 18px; }
.bk-check.good { background: var(--green-bg); color: var(--green); }
.bk-check.bad { background: var(--red-bg); color: var(--red); }
.bk-msg { border-radius: var(--r-md); padding: 10px 14px; font-weight: 600; font-size: 14px; }
.bk-msg.ok { background: var(--green-bg); color: var(--green); }
.bk-msg.err { background: var(--red-bg); color: var(--red); }
.restore-confirm { max-width: 520px; }
.restore-confirm .table-wrap { max-height: 240px; overflow: auto; margin: 12px 0; text-align: left; }
.restore-confirm .form-error { text-align: left; }
.restore-safety { margin: 8px 0; text-align: left; }
.restore-confirm .field { text-align: left; margin-bottom: 8px; }
.restore-alt { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-500); font-size: 14px; }
@media (max-width: 860px) { .backup-grid { grid-template-columns: 1fr; } }

@media print {
  #printArea .inv-title td { font-size: 20px; font-weight: 800; color: #0b1a3a; text-align: right; padding-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }
  #printArea .inv-state { margin: 10px 0 0; font-weight: 800; letter-spacing: .08em; font-size: 13px; text-align: right; }
  #printArea .inv-state.paid { color: #047857; }
  #printArea .inv-state.part { color: #b45309; }
  #printArea .inv-state.unpaid { color: #b91c1c; }
  #printArea .pre { white-space: pre-line; }
  #printArea .inv-foot { white-space: pre-line; }

  /* Thermal receipt (80 mm): single column, compact type, no wide tables */
  #printArea.fmt-thermal { padding: 0; width: 74mm; font-size: 11px; }
  .invoice.thermal { font-size: 11px; line-height: 1.35; }
  .invoice.thermal .inv-head { display: block; padding-bottom: 8px; border-bottom: 1px dashed #000; text-align: center; }
  .invoice.thermal .inv-biz { display: block; text-align: center; }
  .invoice.thermal .inv-logo { width: 44px; height: 44px; margin: 0 auto 4px; display: block; }
  .invoice.thermal .inv-head h1 { font-size: 16px; }
  .invoice.thermal .inv-head p { font-size: 10.5px; color: #000; }
  .invoice.thermal .inv-meta { width: 100%; margin-top: 8px; }
  .invoice.thermal .inv-title td { text-align: center; font-size: 14px; }
  .invoice.thermal .inv-bill { margin: 8px 0; padding-bottom: 6px; border-bottom: 1px dashed #000; }
  .invoice.thermal .inv-items { margin-bottom: 8px; }
  .invoice.thermal .inv-items th { background: none; color: #000; border-bottom: 1px solid #000; padding: 3px 2px; font-size: 10.5px; }
  .invoice.thermal .inv-items td { padding: 3px 2px; border-bottom: 1px dotted #999; vertical-align: top; }
  .invoice.thermal .inv-items th:first-child, .invoice.thermal .inv-items td:first-child { display: none; }
  .invoice.thermal .inv-totals { width: 100%; min-width: 0; }
  .invoice.thermal .inv-totals .strong th, .invoice.thermal .inv-totals .strong td { font-size: 12px; color: #000; }
  .invoice.thermal .inv-state { text-align: center; }
  .invoice.thermal .inv-foot { margin-top: 12px; border-top: 1px dashed #000; font-size: 10.5px; color: #000; }
}

/* ===== Authentication: Sign in / Register tabs, forgot password, recovery key ===== */
.auth-stack { width: 100%; max-width: 410px; display: grid; gap: 22px; }
.link-btn { border: 0; background: none; padding: 4px 0; font: inherit; font-weight: 700; font-size: 14px; color: var(--blue-600); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 3px solid rgba(59, 130, 246, .55); border-radius: 6px; }
.link-btn[hidden] { display: none; }
.link-btn.center { justify-self: center; }
.auth-section { display: grid; gap: 16px; }
.auth-section[hidden] { display: none; }
#forgotForm { gap: 16px; }
.input-wrap input.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }

.key-card { max-width: 460px; }
.key-box {
  width: 100%; margin: 6px 0 2px; padding: 16px 12px; border-radius: var(--r-md); border: 1.5px dashed var(--blue-500); background: var(--blue-50);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(15px, 3.8vw, 19px); font-weight: 800; letter-spacing: .06em;
  color: var(--navy-700); text-align: center; overflow-wrap: anywhere; user-select: all;
}
.key-actions { margin-top: 4px; }
.key-saved { justify-content: center; margin: 6px 0 2px; text-align: left; }

.notice-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r-md);
  background: #fffbeb; border: 1px solid #fcd34d; color: #78350f;
}
.notice-bar p { flex: 1; margin: 0; font-size: 14.5px; }
.notice-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #fef3c7; color: #b45309; flex: none; }
.notice-ico svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .notice-bar { flex-wrap: wrap; } .notice-bar .btn { width: 100%; } }

.acct-card .panel-body { display: grid; gap: 4px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sec-row:last-child { border-bottom: 0; }
.sec-row small { display: block; margin-top: 3px; color: var(--ink-500); max-width: 520px; line-height: 1.5; }
.warn-text { color: #b45309; font-weight: 700; }
@media (max-width: 640px) { .sec-row { flex-direction: column; align-items: stretch; } }

.inline-input.wrap { flex-wrap: wrap; }
.inline-input.wrap .control { flex: 1 1 100%; }
.inline-input.wrap .btn { flex: 1 1 0; }

/* ---------- Online / offline status ---------- */
.login-panel { position: relative; }
.login-panel > .net-status { position: absolute; top: 16px; right: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.net-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 999px;
  border: 1px solid #a7f3d0; background: var(--green-bg); color: var(--green);
  font-size: 12.5px; font-weight: 700; line-height: 1; white-space: nowrap; user-select: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.net-status.is-offline { border-color: #fcd34d; background: var(--amber-bg); color: var(--amber); }
.net-status.is-offline .net-dot { animation: net-pulse 1.8s ease-in-out infinite; }
@keyframes net-pulse { 50% { opacity: .35; } }
@media (max-width: 560px) {
  .topbar-actions .net-label { display: none; }
  .topbar-actions .net-status { padding: 7px; }
}
@media (prefers-reduced-motion: reduce) { .net-status.is-offline .net-dot { animation: none; } }
@media print { .net-status { display: none !important; } }

/* ---------- Email code dialog ---------- */
.otp-input { text-align: center; letter-spacing: .4em; font-size: 20px; font-weight: 700; }

/* First screen: LOGIN / REGISTER */
.welcome-card { gap: 16px; margin-top: 28px; }
.welcome-card header { margin-bottom: 6px; }
.welcome-card .btn { height: 52px; font-size: 15px; letter-spacing: .08em; }
.welcome-card[hidden] { display: none; }

/* Cloud sync status pill (additive; shown only for cloud-enabled sessions) */
.od-sync-pill { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: calc(100vw - 24px);
  padding: 7px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: #0b1a3a; color: #fff; font: 600 12px/1.2 inherit;
  cursor: pointer; box-shadow: 0 4px 14px rgba(7,15,34,.25); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-sync-pill[data-kind="ok"] { background: #047857; }
.od-sync-pill[data-kind="warn"] { background: #b45309; }
.od-sync-pill[data-kind="err"] { background: #b91c1c; }
.od-sync-pill[data-kind="off"] { background: #475569; }
@media print { .od-sync-pill { display: none !important; } }

/* v3.3 reconciliation dialog */
.od-rec{width:100%;border-collapse:collapse;font-size:13px;margin:8px 0}
.od-rec th,.od-rec td{padding:6px 8px;border-bottom:1px solid var(--border,#d9dee8);text-align:left}
.od-rec th{font-weight:600}
.od-rec-list{margin:6px 0 10px 18px;padding:0;font-size:13px;max-height:160px;overflow:auto}
.od-rec-ok,.od-rec-warn,.od-rec-bad{padding:10px 12px;border-radius:8px;margin:10px 0;font-size:13px}
.od-rec-ok{background:#e7f6ee;color:#0b5132}
.od-rec-warn{background:#fff6e0;color:#6b4700}
.od-rec-bad{background:#fdeaea;color:#8a1c1c}
.od-rec-ok ul,.od-rec-warn ul,.od-rec-bad ul{margin:6px 0 0 18px;padding:0}

/* v3.3 profile menu + visible logout (Admin and Staff, mobile and desktop) */
.profile { position: relative; }
.avatar-btn { border: 0; cursor: pointer; padding: 0; font: inherit; font-weight: 800; font-size: 15px; transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.avatar-btn:hover { box-shadow: 0 0 0 4px rgba(37, 99, 235, .18); }
.avatar-btn:focus-visible, .profile-item:focus-visible, .topbar-logout:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 272px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 8px; display: grid; gap: 4px;
}
.profile-menu[hidden] { display: none; }
.profile-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-meta { min-width: 0; display: grid; }
.profile-meta strong { color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta span { color: var(--ink-500); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-700); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.profile-item:hover { background: var(--blue-50); color: var(--blue-600); }
.profile-item[hidden] { display: none; }
.profile-logout { color: #b91c1c; }
.profile-logout:hover { background: #fdeaea; color: #991b1b; }
.profile-item svg, .topbar-logout svg { width: 18px; height: 18px; flex: none; }
.topbar-logout { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; white-space: nowrap; }
@media (max-width: 560px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .topbar-actions { gap: 8px; }
  .topbar-logout { width: 40px; padding: 0; justify-content: center; }
  .topbar-logout .logout-label { display: none; }
  .profile-menu { position: fixed; right: 12px; left: auto; top: 64px; }
}
@media print { .profile, .topbar-logout { display: none !important; } }

/* v3.3 catalog selection + cart (additive; existing catalog styles untouched) */
.cbuy { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.cadd { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(56, 189, 248, .55); background: rgba(2, 132, 199, .18); color: #e0f2fe; font: inherit; font-weight: 800; cursor: pointer; transition: background .2s, border-color .2s; }
.cadd svg { width: 16px; height: 16px; }
.cadd:hover { background: #0284c7; border-color: #0284c7; color: #fff; }
.cqb { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(148, 163, 184, .35); background: rgba(15, 27, 54, .9); color: #fff; font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.cqb:hover { background: #0284c7; border-color: #0284c7; }
.cqb svg { width: 16px; height: 16px; }
.cqty { flex: 1; min-width: 0; height: 44px; text-align: center; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .35); background: rgba(15, 27, 54, .9); color: #fff; font: inherit; font-size: 17px; font-weight: 800; }
.cqty:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .22); }
.cbuy.small { margin: 0; }
.cbuy.small .cqb { width: 36px; height: 36px; font-size: 18px; }
.cqn { min-width: 28px; text-align: center; font-weight: 800; color: #fff; }
.cqb.rm { border-color: rgba(248, 113, 113, .45); color: #fca5a5; }
.cbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 95; width: min(560px, calc(100vw - 24px)); display: flex; gap: 8px; padding: 8px; border-radius: 999px; background: rgba(8, 18, 40, .96); border: 1px solid rgba(56, 189, 248, .5); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); backdrop-filter: blur(10px); }
.cbar[hidden], .csheet[hidden] { display: none; }
.cbar-main { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: #e6edf8; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.cbar-main svg { width: 20px; height: 20px; color: #38bdf8; flex: none; }
.cbar-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0; background: #0284c7; color: #fff; font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
.cbar-go svg { width: 17px; height: 17px; }
.cbar-go:hover { background: #0ea5e9; }
.cbar-go:disabled { opacity: .6; cursor: progress; }
.csheet { position: fixed; inset: 0; z-index: 96; background: rgba(2, 6, 18, .66); display: flex; align-items: flex-end; justify-content: center; }
.csheet-card { width: min(560px, 100%); max-height: 82vh; overflow: auto; background: #0b1429; border: 1px solid rgba(148, 163, 184, .25); border-radius: 22px 22px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px)); color: #e6edf8; }
.csheet-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.csheet-card h3 { margin: 0; font-size: 20px; color: #fff; }
.csheet-card h3 span { color: #8fa3c4; font-size: 14px; font-weight: 600; margin-left: 8px; }
.csheet-card ul { list-style: none; margin: 0; padding: 0; }
.csheet-card li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(148, 163, 184, .16); }
.csheet-card li > div:first-child { min-width: 0; display: grid; }
.csheet-card li strong { color: #fff; overflow: hidden; text-overflow: ellipsis; }
.csheet-card li small { color: #8fa3c4; }
.csheet-card footer { padding-top: 14px; }
.csheet-card footer p { margin: 6px 0 12px; color: #8fa3c4; font-size: 13px; }
.csum { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; color: #c8d5ea; }
.csum strong { font-size: 24px; color: #38bdf8; }
.cfoot-btns { display: flex; gap: 8px; }
.cfoot-btns .cbar-go { flex: 1; }
@media (max-width: 560px) { .cat-inner { padding-bottom: 110px; } }
@media print { .cbar, .csheet, .cbuy { display: none !important; } }
