/* ==========================================================================
   StockDesk — stylesheet
   Palette follows the company blue: #003F87 / #0066CC / #E8F0F8
   ========================================================================== */

:root {
  --brand:      #003F87;
  --brand-2:    #0066CC;
  --brand-tint: #E8F0F8;

  --bg:      #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text:    #14243a;
  --muted:   #6b7c93;
  --border:  #dde4ed;

  --ok:     #1a8f4c;
  --ok-bg:  #e6f5ec;
  --warn:   #b47100;
  --warn-bg:#fdf1dd;
  --danger: #c0392b;
  --danger-bg:#fbeae8;
  --info-bg: #e8f0f8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,36,58,.06), 0 4px 12px rgba(20,36,58,.06);
  --shadow-lg: 0 12px 40px rgba(20,36,58,.18);
  --side-w: 236px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

/* Dark palette. Applied when the device asks for it, unless something has
   explicitly asked for light; and always when something explicitly asks
   for dark. Keeping both selectors means a manual theme switch wins over
   the operating system setting, in either direction. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #0e1520;
    --surface: #161f2d;
    --surface-2:#1c2736;
    --text:    #e6edf6;
    --muted:   #93a3b8;
    --border:  #2a3648;
    --brand-tint: #16283f;
    --ok-bg:  #12301f;
    --warn-bg:#332508;
    --danger-bg:#3a1a17;
    --info-bg:#16283f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  }
}

:root[data-theme="dark"] {
  --bg:      #0e1520;
  --surface: #161f2d;
  --surface-2:#1c2736;
  --text:    #e6edf6;
  --muted:   #93a3b8;
  --border:  #2a3648;
  --brand-tint: #16283f;
  --ok-bg:  #12301f;
  --warn-bg:#332508;
  --danger-bg:#3a1a17;
  --info-bg:#16283f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Login ---------------------------------------------------- */

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0,102,204,.22), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0,63,135,.25), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.login-brand h1 { font-size: 20px; }
.login-brand p { font-size: 13px; color: var(--muted); margin-top: 2px; }

.login-logo, .side-logo {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .5px;
  flex: none;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.login-tab {
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.login-tab.on { background: var(--surface); color: var(--brand-2); box-shadow: var(--shadow); }

.login-err {
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.login-hint {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.login-switch { text-align: center; font-size: 13px; margin: 2px 0 0; }
.login-switch a { color: var(--brand-2); font-weight: 600; text-decoration: none; }
.login-switch a:hover { text-decoration: underline; }
.fld-optional { text-transform: none; font-weight: 400; color: var(--muted); }

/* ---------- App shell ------------------------------------------------ */

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100dvh;
  overflow: hidden;
}

.side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.side-logo { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
.side-name {
  font-weight: 650;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav { padding: 10px; overflow-y: auto; flex: 1; display: grid; gap: 2px; align-content: start; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  width: 100%;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--brand-tint); color: var(--brand-2); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .badge { margin-left: auto; }

.side-foot { border-top: 1px solid var(--border); padding: 12px; display: grid; gap: 10px; }
.logout-icon { width: 16px; height: 16px; flex: none; display: none; }
#logoutBtn { display: flex; align-items: center; justify-content: center; gap: 7px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-2);
  display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none;
}
.who-txt { min-width: 0; line-height: 1.3; }
.who-txt b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-txt span { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: none;
}
.topbar h2 { font-size: 19px; margin-right: auto; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.view { padding: 20px 22px 40px; overflow-y: auto; flex: 1; }

.tabbar { display: none; }

/* ---------- Buttons -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; background: var(--danger); }

.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { opacity: .88; background: var(--ok); }

.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  border: 0; background: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 22px; color: var(--muted); line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Sidebar Sign out covers desktop and tablet. On phone the sidebar is gone
   entirely, so this topbar twin is the only way to sign out there — shown
   only at that width so there is one visible control per screen size. */
.mobile-signout { display: none; }

/* ---------- Cards / KPI ---------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.danger-zone { border-color: var(--danger); }
.danger-zone .card-head { border-bottom-color: var(--danger); background: var(--danger-bg); }
.danger-zone .card-head h3 { color: var(--danger); }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; margin-right: auto; }
.card-body { padding: 16px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px;
  display: grid;
  gap: 4px;
}
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kpi-note { font-size: 12.5px; color: var(--muted); }
.kpi.alert .kpi-value { color: var(--danger); }
.kpi.warn  .kpi-value { color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-2 .card + .card { margin-top: 0; }

/* ---------- Toolbar / filters ---------------------------------------- */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .search { flex: 1 1 220px; min-width: 160px; }
.toolbar select, .toolbar input {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 0;
}

/* ---------- Tables --------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 5px; font-size: 15px; }

/* ---------- Badges --------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.ok     { background: var(--ok-bg);     color: var(--ok); }
.badge.warn   { background: var(--warn-bg);   color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info   { background: var(--info-bg);   color: var(--brand-2); }

/* ---------- Forms ---------------------------------------------------- */

.fld { display: grid; gap: 5px; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fld input, .fld select, .fld textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  width: 100%;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: 2px solid var(--brand-2);
  outline-offset: -1px;
  border-color: var(--brand-2);
}
.fld textarea { resize: vertical; min-height: 66px; }
.fld-hint { font-size: 12px; color: var(--muted); }

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

fieldset.lines {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 0;
}
fieldset.lines legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.line-row { display: grid; grid-template-columns: 1fr 92px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ---- request line: searchable item + qty + live stock hint ---- */

.req-line {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.req-line-top { display: flex; gap: 8px; align-items: flex-start; }
.req-line-top .ipick { flex: 1; min-width: 0; }
.req-line-bottom { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.req-line-bottom .lQty { width: 90px; flex: none; }
.req-line-avail { flex: 1; }
.req-line-avail.warn { color: var(--warn); font-weight: 600; }

.ipick { position: relative; }
.ipick-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.ipick-input:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: var(--brand-2); }
.ipick-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.ipick-opt {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.ipick-opt:last-child { border-bottom: 0; }
.ipick-opt:hover { background: var(--surface-2); }
.ipick-qty { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ipick-qty.zero { color: var(--danger); font-weight: 600; }
.ipick-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Modal ---------------------------------------------------- */

.modal-back {
  position: fixed; inset: 0;
  background: rgba(10,20,35,.55);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; margin-right: auto; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
}

/* ---------- Toast ---------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ---------- Misc ----------------------------------------------------- */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 14px; }
.detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.detail-list div span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.detail-list div b { font-weight: 600; font-size: 14.5px; }

.note {
  background: var(--info-bg);
  border-left: 3px solid var(--brand-2);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ==========================================================================
   Responsive — tablet
   ========================================================================== */

@media (max-width: 1024px) {
  :root { --side-w: 68px; }
  .side-name, .who-txt, .nav-item span { display: none; }
  .side-brand { justify-content: center; padding: 16px 8px; }
  .nav-item { justify-content: center; padding: 11px; position: relative; }
  .nav-item .badge {
    position: absolute; top: 4px; right: 4px; margin: 0;
    min-width: 17px; padding: 1px 4px; font-size: 10px;
  }
  .side-foot { justify-items: center; }
  .who { justify-content: center; }

  /* The label collapses away, but Sign out must never fully disappear —
     it becomes an icon-only circle instead of vanishing with the text. */
  #logoutBtn { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
  #logoutBtn span { display: none; }
  .logout-icon { display: block; }
}

/* ==========================================================================
   Responsive — phone: sidebar becomes a bottom tab bar,
   tables collapse into stacked cards.
   ========================================================================== */

@media (max-width: 720px) {
  body { font-size: 15px; }

  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { display: none; }

  /* The sidebar and its Sign out button are gone at this width — this is
     the only sign-out control left, so it must show. */
  .mobile-signout { display: grid; }

  .topbar { padding: 12px 14px; position: sticky; top: 0; z-index: 20; }
  .topbar h2 { font-size: 17px; }
  .topbar-actions .btn { padding: 7px 11px; font-size: 13px; }

  .view { padding: 14px 14px 26px; }

  .tabbar {
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .tab {
    border: 0; background: none; cursor: pointer;
    display: grid; justify-items: center; gap: 3px;
    padding: 5px 6px; border-radius: var(--radius-sm);
    color: var(--muted); font-size: 10.5px; font-weight: 600;
    flex: 1; min-width: 0; position: relative;
  }
  .tab svg { width: 21px; height: 21px; }
  .tab.on { color: var(--brand-2); }
  .tab .dot {
    position: absolute; top: 2px; right: 22%;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
  }

  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 21px; }
  .kpi-label { font-size: 11px; }

  .grid-2 { grid-template-columns: 1fr; gap: 14px; }

  /* stacked-card tables */
  .table-wrap { overflow-x: visible; }
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 0 0 10px;
    padding: 4px 0;
    background: var(--surface);
  }
  table.tbl tr:hover { background: var(--surface); }
  table.tbl td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: 0;
    padding: 6px 12px;
    text-align: right;
  }
  table.tbl td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    text-align: left;
    flex: none;
  }
  table.tbl td[data-label=""]::before { content: none; }
  table.tbl td.cell-main {
    font-weight: 650;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 9px;
    margin-bottom: 3px;
  }
  .row-actions { justify-content: flex-end; }

  .line-row { grid-template-columns: 1fr 78px 34px; }
  .modal { max-height: 94dvh; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .toolbar > * { flex: 1 1 130px; }
}

/* ==========================================================================
   Printable documents — request slips, issue vouchers, gate passes.
   Rendered into #printArea, which is invisible on screen and the only
   thing that reaches the paper.
   ========================================================================== */

#printArea { display: none; }

.pdoc {
  color: #000;
  background: #fff;
  font-family: var(--font);
  font-size: 11.5pt;
  line-height: 1.45;
}
.pdoc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16pt;
  border-bottom: 2pt solid #000;
  padding-bottom: 8pt;
  margin-bottom: 12pt;
}
.pdoc-co { font-size: 16pt; font-weight: 700; letter-spacing: -.01em; }
.pdoc-sub { font-size: 9.5pt; text-transform: uppercase; letter-spacing: .12em; margin-top: 2pt; }
.pdoc-title { font-size: 13pt; font-weight: 700; text-align: right; text-transform: uppercase; letter-spacing: .04em; }
.pdoc-no { font-size: 10.5pt; text-align: right; margin-top: 3pt; font-family: var(--mono); }

.pdoc-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8pt 14pt;
  margin-bottom: 12pt;
}
.pdoc-meta div span {
  display: block;
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #444;
}
.pdoc-meta div b { font-size: 11pt; font-weight: 600; }

.pdoc-purpose { border: 0.75pt solid #000; padding: 6pt 8pt; margin-bottom: 12pt; font-size: 10.5pt; }

table.pdoc-tbl { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin-bottom: 14pt; }
table.pdoc-tbl th, table.pdoc-tbl td { border: 0.75pt solid #000; padding: 5pt 7pt; text-align: left; }
table.pdoc-tbl th { background: #eee; font-size: 9pt; text-transform: uppercase; letter-spacing: .05em; }
table.pdoc-tbl td.n, table.pdoc-tbl th.n { text-align: right; }
table.pdoc-tbl td.c, table.pdoc-tbl th.c { text-align: center; width: 26pt; }
table.pdoc-tbl tfoot td { font-weight: 700; background: #f4f4f4; }

.pdoc-sign {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14pt;
  margin-top: 26pt;
}
.pdoc-sign div {
  border-top: 0.75pt solid #000;
  padding-top: 4pt;
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: .05em;
  min-height: 34pt;
}
.pdoc-sign div b { display: block; font-size: 8.5pt; color: #444; font-weight: 600; }

.pdoc-foot {
  margin-top: 16pt;
  border-top: 0.5pt solid #999;
  padding-top: 5pt;
  font-size: 8.5pt;
  color: #444;
  display: flex;
  justify-content: space-between;
}

@media print {
  @page { size: A4; margin: 14mm; }

  /* Printing a document: nothing but the document. */
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block !important; }

  /* Printing a report straight off the screen. */
  .side, .tabbar, .topbar-actions, .toolbar, .row-actions { display: none !important; }
  .app { display: block; height: auto; overflow: visible; }
  .view { overflow: visible; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  table.pdoc-tbl tr, .pdoc-sign { break-inside: avoid; }
}
