/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --primary: #111111;
  --primary-active: #242424;
  --ink: #111111;
  --body: #374151;
  --muted: #6b7280;
  --muted-soft: #898989;
  --hairline: #e5e7eb;
  --hairline-soft: #f3f4f6;
  --canvas: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-card: #f5f5f5;
  --surface-strong: #e5e7eb;
  --surface-dark: #101010;
  --on-primary: #ffffff;
  --on-dark: #ffffff;
  --on-dark-soft: #a1a1aa;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --badge-orange: #fb923c;
  --badge-pink: #ec4899;
  --badge-violet: #8b5cf6;
  --badge-emerald: #34d399;

  --brand: #1E3799;
  --brand-active: #14266b;
  --brand-soft: #eef1fb;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 32px rgba(0,0,0,.12);
  --shadow-xl: 0 20px 48px rgba(0,0,0,.18);

  --ease: cubic-bezier(.32,.72,0,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --tabbar-h: 76px;
  --topbar-h: 56px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; background: var(--canvas); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}
button, a, .btn, .icon-btn, .tab, .filter-chip, .product-row, .event-card, .log-item {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; fill: currentColor; }

/* ─── Typography ─────────────────────────────────────────── */
.display-md { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -1px; }
.display-sm { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.5px; }
.title-lg { font-size: 18px; font-weight: 600; line-height: 1.4; }
.title-md { font-size: 16px; font-weight: 600; line-height: 1.4; }
.body-md { font-size: 14px; font-weight: 400; line-height: 1.5; }
.muted { color: var(--muted); }
.caption { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--muted); }

/* ─── Auth Screen ────────────────────────────────────────── */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: var(--s-xl) var(--s-lg);
  z-index: 1000;
}
.auth-content {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.auth-logo {
  height: 38px;
  margin: 0 auto 56px;
  color: var(--brand);
}
.auth-logo svg { height: 100%; width: auto; fill: currentColor; }
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
}
.auth-submit {
  margin-top: var(--s-xs);
}
.auth-error {
  color: var(--error);
  font-size: 13px;
  text-align: center;
  padding: var(--s-xs);
  margin-top: var(--s-xs);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  height: 44px;
  padding: 0 var(--s-lg);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background-color .15s var(--ease-out), transform .1s var(--ease-out), opacity .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); }
.btn-primary:disabled { background: var(--surface-strong); color: var(--muted); }
.btn-secondary { background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); }
.btn-secondary:active { background: var(--surface-card); }
.btn-danger { background: var(--error); color: var(--on-primary); }
.btn-danger:active { background: #dc2626; }
.btn-success { background: var(--ink); color: var(--on-primary); }
.btn-brand { background: var(--brand); color: var(--on-primary); }
.btn-brand:active { background: var(--brand-active); }
.btn svg { fill: currentColor; flex-shrink: 0; }
.btn .btn-icon { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; }
.btn .btn-icon svg { width: 100%; height: 100%; fill: currentColor; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:active { background: var(--surface-card); }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background-color .15s;
}
.icon-btn:active { background: var(--surface-card); }

/* ─── Inputs ─────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
}
.field-optional {
  color: var(--muted-soft);
  font-weight: 400;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-sm);
}
.field-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 var(--s-md);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.input::placeholder { color: var(--muted-soft); }
.textarea {
  height: auto;
  min-height: 88px;
  padding: 12px var(--s-md);
  resize: none;
  line-height: 1.5;
}
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

/* ─── Toggle ─────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-md);
  background: var(--surface-card);
  border-radius: var(--r-lg);
}
.toggle-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  display: inline-block;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-strong);
  border-radius: var(--r-pill);
  transition: background .2s var(--ease-out);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--canvas);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease-out);
}
.toggle input:checked ~ .toggle-track { background: var(--primary); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ─── App Shell ──────────────────────────────────────────── */
.app-shell {
  display: none;
  flex-direction: column;
  height: 100dvh;
  background: var(--canvas);
}
.app-shell.on { display: flex; }

.topbar {
  height: var(--topbar-h);
  padding: 0 var(--s-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas);
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-btn {
  height: 36px;
  padding: 0 var(--s-sm);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color .15s, background-color .15s;
}
.topbar-btn:active { background: var(--surface-card); color: var(--ink); }

.content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ─── Tabbar ─────────────────────────────────────────────── */
.tabbar {
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline-soft);
  background: var(--canvas);
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  transition: color .18s var(--ease-out);
  position: relative;
  padding: 6px 4px;
}
.tab.on { color: var(--ink); }
.tab-icon { display: flex; width: 26px; height: 26px; }
.tab-icon svg { width: 100%; height: 100%; fill: currentColor; }
.tab-label { font-size: 11px; font-weight: 500; letter-spacing: 0; }
.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 0 0 2px 2px;
  transition: transform .25s var(--ease-out);
}
.tab.on::before { transform: translateX(-50%) scaleX(1); }
.tab:active { background: var(--surface-card); }

/* ─── Screens ────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0,0,0);
}
.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .14s var(--ease-out);
}

/* ─── Scanner ────────────────────────────────────────────── */
.screen-scan { background: #000; }
.scanner-reader {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: #000 !important;
}
.scanner-reader video { object-fit: cover !important; width: 100% !important; height: 100% !important; }
.scanner-reader img { display: none !important; }
.scanner-reader > * { border: none !important; }
.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.scanner-frame {
  position: relative;
  width: 240px;
  height: 240px;
}
.scanner-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
}
.scanner-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.scanner-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.scanner-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.scanner-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 4px 0; }
.scanner-line {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff 20%, #fff 80%, transparent);
  top: 50%;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255,255,255,.5);
  animation: scanLine 2.4s ease-in-out infinite;
}
@keyframes scanLine {
  0%, 100% { transform: translateY(-95px); opacity: 0; }
  10%, 90% { opacity: 1; }
  50% { transform: translateY(95px); opacity: 1; }
}
.scanner-hint {
  position: absolute;
  bottom: max(40px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 500;
  background: rgba(0,0,0,.4);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.scanner-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.scanner-flash.flash { animation: flashAnim .35s ease-out; }
@keyframes flashAnim {
  0% { opacity: 0; }
  20% { opacity: .85; }
  100% { opacity: 0; }
}

/* ─── Search Bar ─────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin: var(--s-sm) var(--s-md) 0;
  flex-shrink: 0;
}
.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  display: flex;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }
.search-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--s-md) 0 42px;
  background: var(--surface-card);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, background-color .15s;
}
.search-input:focus { background: var(--canvas); border-color: var(--ink); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.filter-row {
  display: flex;
  gap: var(--s-xs);
  padding: var(--s-sm) var(--s-md) 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 6px 14px;
  background: var(--surface-card);
  color: var(--body);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background-color .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-chip.on { background: var(--primary); color: var(--on-primary); }
.filter-chip:active { transform: scale(.96); }

/* ─── Products List ──────────────────────────────────────── */
.products-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-sm) var(--s-md) calc(80px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--s-xs);
}
.product-row {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-md);
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  transition: background-color .15s, transform .1s var(--ease-out);
}
.product-row:active { background: var(--surface-card); transform: scale(.99); }
.product-row.archived { opacity: .55; }
.product-info { flex: 1; min-width: 0; }
.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.product-meta-dot { color: var(--surface-strong); }
.product-stock {
  text-align: right;
  flex-shrink: 0;
  min-width: 64px;
}
.product-stock-num { font-size: 22px; font-weight: 700; line-height: 1; }
.product-stock-num.danger { color: var(--error); }
.product-stock-num.warn { color: var(--warning); }
.product-stock-num.ok { color: var(--success); }
.product-stock-label { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-orange { background: #fff7ed; color: #ea580c; }
.badge-yellow { background: #fefce8; color: #a16207; }
.badge-green { background: #f0fdf4; color: #15803d; }
.badge-gray { background: var(--surface-card); color: var(--body); }
.badge-soft { background: var(--surface-card); color: var(--muted); }

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  background: var(--surface-card);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.brand-chip-logo { display: flex; height: 14px; color: currentColor; }
.brand-chip-logo svg { height: 100%; width: auto; fill: currentColor; }

/* ─── Sheet (Product Card) ───────────────────────────────── */
.sheet-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease-out);
  z-index: 200;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sheet-backdrop.on, .modal-backdrop.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85dvh;
  background: var(--canvas);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transform: translateY(110%);
  transition: transform .32s var(--ease);
  z-index: 210;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-xl);
  padding-bottom: max(var(--s-lg), env(safe-area-inset-bottom));
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
}
.sheet.on { transform: translateY(0); visibility: visible; pointer-events: auto; }
.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--hairline);
  border-radius: var(--r-pill);
  margin: 12px auto 8px;
}
.sheet-body { padding: var(--s-md) var(--s-md) var(--s-lg); }

.product-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-md);
  margin-bottom: var(--s-sm);
}
.product-detail-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.5px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 4px;
}
.product-detail-sub {
  font-size: 13px;
  color: var(--muted);
}
.product-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s-sm);
  margin-bottom: var(--s-md);
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xs);
  margin-bottom: var(--s-md);
}
.stat-cell {
  background: var(--surface-card);
  border-radius: var(--r-lg);
  padding: var(--s-md);
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0;
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.5px;
  color: var(--ink);
}
.stat-value.danger { color: var(--error); }
.stat-value.warn { color: #ea580c; }
.stat-value.ok { color: var(--success); }
.stat-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-sm);
  padding: var(--s-sm) 0;
  border-top: 1px solid var(--hairline-soft);
  font-size: 14px;
}
.detail-row:first-of-type { border-top: none; }
.detail-row-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 3px;
}
.detail-row-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }
.detail-row-content { flex: 1; min-width: 0; }
.detail-row-label { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.detail-row-value { color: var(--ink); font-size: 14px; }

.kb-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s-md);
  padding: 14px var(--s-md);
  background: var(--surface-card);
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color .15s;
}
.kb-link:active { background: var(--surface-strong); }
.kb-link-arrow { width: 18px; height: 18px; color: var(--muted); }
.kb-link-arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xs);
  margin-top: var(--s-md);
}
.action-row .btn { width: 100%; }

.action-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xs);
  margin-top: var(--s-xs);
}

/* ─── Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92dvh;
  background: var(--canvas);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transform: translateY(110%);
  transition: transform .32s var(--ease);
  z-index: 220;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
}
.modal.on { transform: translateY(0); visibility: visible; pointer-events: auto; }
.modal-tall { max-height: 92dvh; }
.modal-compact { padding-top: 8px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-md);
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.modal-body {
  padding: 0 var(--s-md) var(--s-md);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xs);
  padding: var(--s-md);
  padding-bottom: max(var(--s-md), env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline-soft);
  flex-shrink: 0;
}
.confirm-body { padding: var(--s-md); }
.confirm-text { color: var(--body); font-size: 14px; line-height: 1.5; margin-top: 8px; }

/* ─── Reservations ───────────────────────────────────────── */
.res-list { display: flex; flex-direction: column; }
.res-row {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  padding: var(--s-sm) 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.res-row:last-child { border-bottom: none; }
.res-info { flex: 1; min-width: 0; }
.res-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.res-meta { font-size: 12px; color: var(--muted); }
.qty-input {
  width: 72px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color .15s;
  background: var(--canvas);
}
.qty-input:focus { border-color: var(--ink); }

/* ─── Log ────────────────────────────────────────────────── */
.log-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-sm) var(--s-md) calc(80px + env(safe-area-inset-bottom));
}
.log-day-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin: var(--s-md) 0 var(--s-xs);
}
.log-day-header:first-child { margin-top: 0; }
.log-item {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: var(--s-sm) var(--s-md);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: var(--s-sm);
}
.log-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.log-icon svg { width: 16px; height: 16px; fill: currentColor; }
.log-icon.out { background: #fef2f2; color: #dc2626; }
.log-icon.in { background: #f0fdf4; color: #15803d; }
.log-content { flex: 1; min-width: 0; }
.log-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.log-meta { font-size: 12px; color: var(--muted); }
.log-comment {
  font-size: 12px;
  color: var(--body);
  margin-top: 4px;
  background: var(--surface-card);
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.log-qty {
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
.log-qty.out { color: #dc2626; }
.log-qty.in { color: #15803d; }

/* ─── Events ─────────────────────────────────────────────── */
.events-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-sm) var(--s-md) calc(80px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--s-xs);
}
.event-card {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: var(--s-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-sm);
  transition: background-color .15s;
}
.event-card:active { background: var(--surface-card); }
.event-card.inactive { opacity: .65; }
.event-info { flex: 1; min-width: 0; }
.event-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.event-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.event-dot.active { background: var(--success); }
.event-dot.inactive { background: var(--surface-strong); }
.event-date { font-size: 12px; color: var(--muted); }
.event-actions { display: flex; gap: 6px; flex-shrink: 0; }
.event-action-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-card);
  color: var(--ink);
  transition: background-color .15s;
}
.event-action-btn:active { background: var(--surface-strong); }
.event-action-btn.primary { background: var(--ink); color: var(--on-primary); }

/* ─── FAB ────────────────────────────────────────────────── */
.fab {
  position: fixed;
  right: var(--s-md);
  bottom: calc(var(--tabbar-h) + var(--s-md) + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transform: scale(.7) translate3d(0,0,0);
  pointer-events: none;
  transition: transform .22s var(--ease-out), opacity .18s, background-color .15s, visibility 0s .18s;
}
.fab.on {
  visibility: visible;
  opacity: 1;
  transform: scale(1) translate3d(0,0,0);
  pointer-events: auto;
  transition: transform .25s var(--ease-out), opacity .18s, background-color .15s;
}
.fab:active { transform: scale(.92); background: var(--primary-active); }
.fab-icon { display: flex; width: 22px; height: 22px; }
.fab-icon svg { width: 100%; height: 100%; fill: currentColor; }

/* ─── Empty States ───────────────────────────────────────── */
.empty {
  text-align: center;
  padding: var(--s-xxl) var(--s-lg);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-sm);
}
.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-xs);
}
.empty-icon svg { width: 24px; height: 24px; fill: var(--muted); }
.empty-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.empty-text { font-size: 13px; color: var(--muted); }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  min-width: 240px;
  max-width: calc(100% - 32px);
  background: var(--surface-dark);
  color: var(--on-dark);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transition: transform .35s var(--ease);
  pointer-events: none;
  text-align: center;
}
.toast.on { transform: translateX(-50%) translateY(0); }

/* ─── Misc ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--hairline-soft); margin: var(--s-sm) 0; }

::-webkit-scrollbar { display: none; }
