/* ============================================================
   Tracker — Research Lab Dashboard
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

:root {
  --navy-dark:  #0a1830;
  --navy-mid:   #1B2951;
  --navy-light: #243561;
  --red:        #C8102E;
  --red-hover:  #d62839;
  --gold:       #C9A961;
  --gold-dark:  #A9802B;
  --white:      #ffffff;
  --gray-50:    #f8f9fa;
  --gray-100:   #f1f3f5;
  --gray-200:   #e9ecef;
  --gray-400:   #ced4da;
  --gray-600:   #6c757d;
  --gray-800:   #343a40;
  --text:       #1a202c;
  --sidebar-w:  240px;
  --radius:     6px;
  --shadow:     0 1px 4px rgba(0,0,0,.12);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--gray-100);
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 12px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
.sidebar-logo img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.sidebar-label {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 4px 20px 20px;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
  padding: 0 0 16px;
}

.sidebar-nav li { padding: 0; }

.nav-divider {
  height: 1px;
  background: var(--navy-light);
  margin: 10px 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover {
  background: var(--navy-mid);
  color: var(--white);
  text-decoration: none;
  border-left-color: var(--gold);
}
.nav-item.active {
  background: var(--navy-mid);
  color: var(--white);
  border-left-color: var(--red);
}
.nav-admin { color: var(--gold); }
.nav-icon { font-size: 9px; opacity: .6; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--navy-light);
}
.sidebar-user {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-bottom: 8px;
  word-break: break-all;
}
.btn-logout {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  padding: 4px 0;
}
.btn-logout:hover { color: var(--red-hover); text-decoration: none; }

/* ── Main content ─────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.page-title { font-size: 22px; color: var(--navy-dark); }

.research-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: #fff7e6;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 3px 12px;
}

.page-body {
  padding: 28px 32px;
  flex: 1;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 16px;
  color: var(--navy-dark);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

/* ── Forms ─────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: .03em;
  text-transform: uppercase;
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=number], select, textarea {
  padding: 8px 12px;
  border: 1px solid var(--gray-400);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(27,41,81,.12);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .9; }

.btn-primary   { background: var(--navy-mid); color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-danger    { background: var(--red); color: var(--white); }
.btn-danger:hover { background: var(--red-hover); }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-400); }
.btn-gold      { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-dark); color: var(--white); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--gray-50);
  color: var(--gray-800);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
tr:hover td { background: var(--gray-50); }
.td-actions { white-space: nowrap; display: flex; gap: 6px; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Filter bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 18px;
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar .form-group { min-width: 160px; }
.filter-bar label { margin-bottom: 2px; }

/* ── Calculator ─────────────────────────────────────────── */
.calc-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.calc-section h3 {
  font-size: 15px;
  color: var(--navy-dark);
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.calc-result {
  background: var(--navy-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.8;
}
.calc-result .result-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}
.calc-formula {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  font-family: 'Courier New', monospace;
}

/* ── Login page ─────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-dark);
}
.login-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { max-width: 180px; height: auto; }
.login-title {
  text-align: center;
  font-size: 20px;
  color: var(--navy-dark);
  margin-bottom: 6px;
}
.login-sub {
  text-align: center;
  font-size: 11px;
  color: var(--gray-600);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* ── Detail view ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.detail-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-600);
  margin-bottom: 2px;
}
.detail-field .val {
  font-size: 14px;
  color: var(--text);
}
.detail-field.full { grid-column: 1 / -1; }

/* ── Dashboard stats ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border-top: 3px solid var(--navy-mid);
}
.stat-card.accent { border-top-color: var(--red); }
.stat-card.gold   { border-top-color: var(--gold); }
.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
  font-weight: 500;
}
.stat-card-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  text-decoration: none;
}
.stat-card-link .stat-number { color: var(--navy-dark); }
.stat-card-link .stat-label  { color: var(--gray-600); }

/* ── Upload area ─────────────────────────────────────────── */
.file-list { list-style: none; margin-top: 10px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
}

/* ── Status badges ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-active    { background: #d4edda; color: #155724; }
.badge-low_stock { background: #fff3cd; color: #856404; }
.badge-depleted  { background: #f8d7da; color: #721c24; }
.badge-expired   { background: #e2e3e5; color: #383d41; }

/* ── Mobile top bar ──────────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--navy-dark);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}
.mobile-app-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: var(--gold);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Hamburger button ────────────────────────────────────── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

/* ── Mobile drawer ───────────────────────────────────────── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
}
.mobile-nav-overlay.open { display: block; }

.mobile-drawer {
  position: fixed;
  top: 0; right: -280px;
  width: 280px;
  height: 100%;
  background: var(--navy-dark);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transition: right .25s ease;
  overflow-y: auto;
}
.mobile-drawer.open { right: 0; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--navy-light);
}
.drawer-user {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  word-break: break-all;
  flex: 1;
  padding-right: 10px;
}
.drawer-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.drawer-close:hover { color: var(--white); }

.drawer-nav {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}
.drawer-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  font-weight: 500;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.drawer-nav li a:hover {
  background: var(--navy-mid);
  color: var(--white);
  border-left-color: var(--gold);
}
.drawer-admin { color: var(--gold) !important; }
.drawer-divider {
  height: 1px;
  background: var(--navy-light);
  margin: 8px 20px;
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--navy-light);
}
.drawer-logout {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  text-decoration: none;
}
.drawer-logout:hover { color: var(--red-hover); text-decoration: none; }

/* ── Comments ────────────────────────────────────────────── */
.comment-list { list-style: none; margin: 0; }
.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 12px;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-mid);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 11px; color: var(--gray-600); margin-bottom: 4px; }
.comment-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.comment-form { margin-top: 16px; border-top: 1px solid var(--gray-200); padding-top: 16px; }

/* ── Procurement ─────────────────────────────────────────── */
.proc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #d4edda;
  color: #155724;
}

/* ── Quick entry ─────────────────────────────────────────── */
.quick-entry {
  max-width: 600px;
  margin: 0 auto;
}
.quick-entry .form-group label {
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}
.quick-entry input,
.quick-entry select,
.quick-entry textarea {
  font-size: 16px; /* prevents iOS zoom */
  padding: 12px 14px;
}

/* ── Lot comparison ──────────────────────────────────────── */
.lot-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.compare-field {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  align-items: baseline;
}
.compare-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-600);
  letter-spacing: .04em;
}
.compare-val { font-size: 13px; }
.compare-diff { color: var(--red); font-weight: 600; }

/* ── Reports ─────────────────────────────────────────────── */
.report-section { margin-bottom: 32px; }
.report-section h3 {
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-200);
}

/* ── Dark mode toggle button ─────────────────────────────── */
.dark-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.6);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}
.dark-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* ── Dark mode ───────────────────────────────────────────── */
html.dark {
  --gray-50:   #1e2436;
  --gray-100:  #161b2e;
  --gray-200:  #2a3250;
  --gray-400:  #3d4d72;
  --gray-600:  #8899bb;
  --gray-800:  #c8d0e8;
  --text:      #dde3f4;
  --white:     #1e2436;
  --shadow:    0 1px 4px rgba(0,0,0,.35);
}
html.dark body { background: #161b2e; color: var(--text); }
html.dark .card { background: #1e2436; }
html.dark .page-header { background: #1e2436; border-bottom-color: #2a3250; }
html.dark .page-title { color: #c8d0e8; }
html.dark th { background: #252d45; color: #c8d0e8; border-bottom-color: #2a3250; }
html.dark td { border-bottom-color: #2a3250; }
html.dark tr:hover td { background: #252d45; }
html.dark input[type=text], html.dark input[type=email], html.dark input[type=password],
html.dark input[type=date], html.dark input[type=number], html.dark select, html.dark textarea {
  background: #252d45;
  border-color: #3d4d72;
  color: #dde3f4;
}
html.dark .filter-bar { background: #1e2436; }
html.dark .calc-section { background: #252d45; border-color: #3d4d72; }
html.dark .alert-success { background: #1a3a24; color: #6fcf8a; border-color: #2d6b40; }
html.dark .alert-error   { background: #3a1a1e; color: #f08090; border-color: #6b2d34; }
html.dark .alert-info    { background: #1a2f3a; color: #7bbfd4; border-color: #2d5064; }
html.dark .card-title { color: #c8d0e8; border-bottom-color: #2a3250; }
html.dark label { color: #8899bb; }
html.dark a { color: #7ea8e8; }
html.dark .btn-secondary { background: #2a3250; color: #c8d0e8; }
html.dark .btn-secondary:hover { background: #3d4d72; }
html.dark .badge-active    { background: #1a3a24; color: #6fcf8a; }
html.dark .badge-low_stock { background: #3a3010; color: #e0c060; }
html.dark .badge-depleted  { background: #3a1a1e; color: #f08090; }
html.dark .badge-expired   { background: #252d45; color: #8899bb; }
html.dark .stat-card { background: #1e2436; }
html.dark .stat-number { color: #c8d0e8; }
html.dark .comment-item { border-bottom-color: #2a3250; }
html.dark .comment-form { border-top-color: #2a3250; }
html.dark .compare-field { border-bottom-color: #2a3250; }
html.dark .report-section h3 { color: #c8d0e8; border-bottom-color: #2a3250; }
html.dark .login-card { background: #1e2436; }
html.dark .login-title { color: #c8d0e8; }

/* ── Print / Compound Sheet ──────────────────────────────── */
@media print {
  .sidebar, .mobile-topbar, .mobile-drawer, .mobile-nav-overlay,
  .action-bar, .no-print, .page-header { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  body { background: white !important; color: black !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
  a { color: black !important; text-decoration: none !important; }
}

.print-sheet { max-width: 760px; margin: 0 auto; }
.print-sheet .sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid var(--navy-dark);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.print-sheet .sheet-title {
  font-size: 24px;
  color: var(--navy-dark);
}
.print-sheet .sheet-sub {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
  font-family: 'Inter', sans-serif;
}
.qr-block { text-align: center; }
.qr-block img { width: 120px; height: 120px; }
.qr-block .qr-label { font-size: 10px; color: var(--gray-600); margin-top: 4px; }
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 20px;
  margin-bottom: 20px;
}
.sheet-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-600);
  display: block;
  margin-bottom: 2px;
}
.sheet-field .val { font-size: 13px; color: var(--text); }
.sheet-section { margin-bottom: 16px; }
.sheet-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy-mid);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 4px;
  margin-bottom: 10px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-top: 56px; max-width: 100vw; overflow-x: hidden; }
  .page-body { padding: 16px; overflow-x: hidden; }
  .page-header { padding: 14px 16px; flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-group { min-width: 100%; width: 100%; }
  .action-bar { flex-direction: column; align-items: flex-start; }
  .td-actions { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
  div[style*="grid-template-columns:1fr 1fr"] { display: block !important; }
  .card { overflow-x: hidden; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table { min-width: 0; }
  .calc-section { overflow-x: hidden; }
  input, select, textarea { max-width: 100%; }
  .lot-compare-grid { grid-template-columns: 1fr; }
  .sheet-grid { grid-template-columns: 1fr 1fr; }
  .print-sheet .sheet-header { flex-direction: column; gap: 12px; }
}
