:root { font: 16px system-ui, sans-serif; color: #142a41; background: #edf3f7; }
* { box-sizing: border-box; }
body { margin: 0; }
header { position: sticky; top: 0; z-index: 2; background: #173858; color: white; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.header-actions { display: flex; gap: .35rem; }
#home-link { color: inherit; text-decoration: none; }
#home-link:hover { text-decoration: underline; }
#active-company { display: block; font-size: .9rem; }
main { max-width: 48rem; padding: 0 1rem 2rem; margin: auto; }
section { background: white; border-radius: .8rem; padding: 1rem; box-shadow: 0 2px 8px #142a4112; }
h1 { font-size: 1.4rem; margin: .5rem 0 1rem; overflow-wrap: anywhere; }
form { display: grid; gap: .75rem; margin: .75rem 0; }
[hidden] { display: none !important; }
label { display: grid; gap: .3rem; font-weight: 600; }
input, textarea, button { font: inherit; min-height: 44px; border-radius: .45rem; padding: .55rem .75rem; }
input, textarea { width: 100%; border: 1px solid #8296a9; background: white; color: inherit; }
button { border: 0; background: #1d527b; color: white; cursor: pointer; text-align: left; }
button:disabled { opacity: .55; }
.back { background: #e5eef5; color: #173858; }
.row { padding: .65rem; margin: .45rem 0; border: 1px solid #d7e3ee; border-radius: .45rem; overflow-wrap: anywhere; }
.progress-empty { border-left: .45rem solid #b42318; background: #fff1f0; }
.progress-partial { border-left: .45rem solid #98600b; background: #fff5d6; }
.progress-done { border-left: .45rem solid #16734e; background: #ecf9f1; }
h2 { font-size: 1.15rem; }
.history-round { border: 1px solid #d7e3ee; border-radius: .45rem; margin-top: .65rem; padding: .75rem; overflow-wrap: anywhere; }
.history-round summary { cursor: pointer; min-height: 44px; padding: .4rem 0; }
.history-round time { display: block; margin-left: 1rem; color: #465d72; font-size: .9rem; }
.history-round h3 { font-size: 1rem; margin-bottom: .4rem; }
.history-round p, .history-round ul { margin-top: .3rem; }
.history-divergences { border-left: 2px solid #d7e3ee; padding-left: .75rem; }
.history-divergences h3 { font-size: .95rem; }
#shipment-list button { width: 100%; margin-top: .5rem; }
#archive-list button { width: 100%; margin-bottom: .5rem; }
#menu { display: flex; flex-wrap: wrap; gap: .35rem; padding: .65rem max(1rem, calc((100vw - 46rem) / 2)); background: #e0ecf5; }
#menu button { flex: 1 1 8rem; text-align: center; background: white; color: #173858; }
#menu button[aria-current="page"] { color: white; background: #173858; }
#menu #close-menu, #open-menu { display: none; }
#inventory-bar { position: sticky; top: var(--header-height, 76px); z-index: 1; background: #e0ecf5;
  border: 1px solid #b9d0e1; border-radius: .55rem; padding: .65rem; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: .45rem; overflow-wrap: anywhere; }
#inventory-bar button { min-height: 44px; }
#inventory-discrepancies { color: #813710; }
#inventory-scan input, #inventory-gs1 input { scroll-margin-top: calc(var(--header-height, 76px) + 9rem); }
dialog { max-width: min(92vw, 28rem); border: 1px solid #8296a9; border-radius: .65rem; color: inherit; }
dialog::backdrop { background: #142a4190; }
#tracking-clients button, #inventory-list button { display: block; width: 100%; margin-bottom: .45rem; }
#tracking-detail { margin-top: 1rem; }
#tracking-balances summary, #tracking-pending summary { cursor: pointer; }
.back-button { color: #173858; background: #e0ecf5; margin-bottom: .7rem; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.card-actions a { padding: .45rem 0; color: #1d527b; font-weight: 600; }
.inline-check { display: flex; align-items: center; }
.inline-check input { width: 1.15rem; min-height: 1.15rem; margin-inline-end: .35rem; }
#product-list details summary { cursor: pointer; padding: .5rem 0; }
@media (max-width: 640px) {
  #open-menu:not([hidden]) { display: block; }
  #menu { display: none; }
  #menu.open { display: flex; position: fixed; inset: 0; z-index: 5; flex-direction: column; flex-wrap: nowrap;
    justify-content: safe center; align-items: center; padding: 4rem 1rem 1rem; overflow: auto; }
  #menu.open button { flex: none; width: min(100%, 20rem); }
  #menu.open #close-menu { display: block; position: absolute; top: 1rem; right: 1rem; width: auto; }
  body.menu-open { overflow: hidden; }
}
select { min-height: 44px; font: inherit; }
#status { min-height: 1.4rem; color: #813710; overflow-wrap: anywhere; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #d9812c; outline-offset: 2px; }
