/* Shared application theme; also loaded by generated browser/print views. */
:root {
  --font-family: Aptos, "Segoe UI", Arial, sans-serif;
  --font-page: 28px;
  --font-section: 20px;
  --font-card: 16px;
  --font-body: 14px;
  --font-table: 14px;
  --font-input: 14px;
  --font-button: 14px;
  --font-nav: 14px;
  --font-helper: 12px;
  --font-badge: 12px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  /* Non-content glyphs and compact physical QR labels. */
  --font-icon-small: 20px;
  --font-icon: 24px;
  --font-icon-large: 32px;
  --font-icon-hero: 38px;
  --font-pin: 28px;
  --font-print-url: 9px;
  --font-print-label: 9pt;
  --font-print-label-small: 6.5pt;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: var(--font-family);
  font-size: var(--font-body);
  font-weight: var(--weight-regular);
  line-height: 1.4;
}
button, input, select, textarea, code, pre {
  font-family: var(--font-family);
}
button { font-size: var(--font-button); font-weight: var(--weight-semibold); }
input, select, textarea { font-size: var(--font-input); font-weight: var(--weight-regular); }
b, strong { font-weight: var(--weight-semibold); }
.si-icon, .tick, .no-img { font-size: var(--font-body); }
.mx { font-size: var(--font-icon-small); }
.exp-btn .icon { font-size: var(--font-icon); }
.pin-lock-icon { font-size: var(--font-icon-large); }
.stock-tile b { font-size: var(--font-section); }
.stock-tile span, .col-chooser-title { font-size: var(--font-helper); font-weight: var(--weight-semibold); }
.scan-result, .pin-lock-msg { font-size: var(--font-body); font-weight: var(--weight-semibold); }
h1, .page-title, .auth-hero h1, #company-screen-title { font-size: var(--font-page); font-weight: var(--weight-semibold); }
h2, .auth-panel h2, .mt { font-size: var(--font-section); font-weight: var(--weight-semibold); }
h3, h4, .sec, .card-title, .history-title, .logo, .exp-sec h4, .exp-btn .lbl {
  font-size: var(--font-card); font-weight: var(--weight-semibold);
}
.auth-panel p, .flag-check, .col-chooser label { font-size: var(--font-body); font-weight: var(--weight-regular); }
table, .users-list table, .audit-table td, .audit-table th, .stock-movements table,
thead th, td.mono, .history-change, .audit-details, .qr-asset-card dl { font-size: var(--font-table); }
thead th, .qr-asset-card dt { font-weight: var(--weight-semibold); }
.fg label, .adv label { font-size: var(--font-body); font-weight: var(--weight-medium); }
.btn, .btn-sm, .btn-xs, .btn-helpdesk, .pg-btn, .flag-btn {
  font-size: var(--font-button); font-weight: var(--weight-semibold);
}
.badge, .history-source, .pin-session-badge, .pill, .user-chip, .company-chip {
  font-size: var(--font-badge); font-weight: var(--weight-medium);
}
.company-option { font-size: var(--font-nav); font-weight: var(--weight-medium); }
.auth-note, .auth-msg, .type-note, .history-meta, .audit-summary, .pg-info,
.qr-label, .qr-bulk-lbl, .exp-btn .sub, .pin-lock-timer {
  font-size: var(--font-helper); font-weight: var(--weight-regular);
}
.pin-digit { font-size: var(--font-pin); font-weight: var(--weight-semibold); }
.topbar { height: auto; min-height: 54px; flex-wrap: wrap; }
.topbar > *, .fg, .field-with-action > *, .linked-asset-row > * { min-width: 0; }
.tg, .mf { flex-wrap: wrap; }
.mt { overflow-wrap: anywhere; }
.auth-msg, .history-change, .audit-details { overflow-wrap: anywhere; }
.users-list { overflow-x: auto; }
@media (max-width: 640px) {
  .stock-form { grid-template-columns: 1fr; }
  .field-with-action { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-with-action > select { grid-column: 1 / -1; }
  .linked-asset-row { grid-template-columns: minmax(0, 1fr); }
  .topbar-user { width: 100%; }
  .mh { gap: 8px; }
  .mf .btn { white-space: normal; }
  .search-bar .si { min-width: 0 !important; flex-basis: 100% !important; }
  #company-access-panel .grid { grid-template-columns: minmax(0, 1fr) !important; }
}
