/* =========================================================
   Invoice Generator — styles.css
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root{
  --sidebar-w: 372px;
  --brand:       #16171c;
  --brand-soft:  #eef0f4;
  --brand-line:  #d9dce3;

  --ink:         #16171c;
  --ink-soft:    #4b4f57;
  --muted:       #7b818c;
  --faint:       #9299a3;

  --bg:          #e6e7ee;
  --surface:     #f2f3f7;
  --surface-2:   #e9eaf1;
  --card:        #ffffff;
  --field:       #f4f5f9;

  --line:        #e4e6ec;
  --line-strong: #d6d9e2;

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 13px;

  --sh-card:  0 1px 2px rgba(16,20,26,.04), 0 10px 26px rgba(16,20,26,.05);
  --sh-sheet: 0 2px 6px rgba(16,20,26,.06), 0 26px 64px rgba(16,20,26,.16);
}

html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02' 1, 'cv03' 1, 'cv04' 1, 'cv11' 1;
}

.sr-only{
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================
   SHELL
   ========================================================= */

.shell{
  height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shell-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 2px 8px 0;
}

.brand{ display: flex; align-items: center; gap: 10px; }

.brand-dot{
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px var(--brand-soft);
  flex: none;
}

.brand h1{
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.022em;
}

.brand-sub{
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub:empty { display: none; }

.top-actions{ display: flex; align-items: center; gap: 10px; }

/* ---------- Mobile overflow menu (hidden on desktop) ---------- */

.mobile-menu{ display: none; position: relative; }

.mobile-menu > summary{
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
}
.mobile-menu > summary::-webkit-details-marker{ display: none; }
.mobile-menu > summary::marker{ content: ''; }

.mobile-menu-panel{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(16,20,26,.18), 0 2px 6px rgba(16,20,26,.06);
  padding: 6px;
  z-index: 60;
}

.mobile-menu-panel button{
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background .14s ease;
}
.mobile-menu-panel button:hover,
.mobile-menu-panel button:focus-visible{ background: var(--field); }

/* ---------- Mobile tabs (hidden on desktop) ---------- */

.mobile-tabs{ display: none; }

/* ---------- Mobile bottom bar (hidden on desktop) ---------- */

.mobile-bar{ display: none; }

/* =========================================================
   BUTTONS
   ========================================================= */

.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease,
              color .16s ease, transform .06s ease, box-shadow .16s ease;
}
.pill:active{ transform: translateY(1px); }

.pill-dark{
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,20,26,.16), 0 8px 20px rgba(16,20,26,.16);
}
.pill-dark:hover{ background: #24262d; }

.pill-ghost{
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
}
.pill-ghost:hover{ background: #f4f5f9; }

.pill-accent{
  background: var(--ink);
  color: #fff;
}
.pill-accent:hover{ background: #2e2e2e; }

.pill-sm{ padding: 7px 13px; font-size: 12px; }

/* =========================================================
   WORKSPACE
   ========================================================= */

.workspace{
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w, 372px) 14px minmax(0, 1fr);
  gap: 0;
}

.sidebar-handle{
  position: relative;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  outline: none;
}

.sidebar-handle::before{
  content: '';
  width: 3px;
  height: 100%;
  border-radius: 99px;
  background: transparent;
  transition: background .18s ease;
}

.sidebar-handle:hover::before,
.sidebar-handle:focus-visible::before,
body.is-resizing .sidebar-handle::before{
  background: #b9bfc9;
}

.sidebar-handle:focus-visible{
  outline: 2px solid var(--ink);
  outline-offset: -5px;
  border-radius: 99px;
}

body.is-resizing{
  user-select: none;
  -webkit-user-select: none;
}

.editor{
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}

.editor::-webkit-scrollbar{ width: 9px; }
.editor::-webkit-scrollbar-thumb{
  background: #ccd1da;
  border-radius: 99px;
  border: 3px solid var(--surface);
}

.card{
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px 17px;
  box-shadow: var(--sh-card);
  flex: none;
}

.card-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2{
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* ---------- Fields ---------- */

.field{ margin-bottom: 13px; }
.field-last{ margin-bottom: 0; }
.field-spaced{ margin-top: 13px; }

.field > label{
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.field > label em{
  font-style: normal;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--faint);
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea{
  width: 100%;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  outline: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

input::placeholder, textarea::placeholder{
  color: var(--faint);
  font-weight: 400;
}

input:focus, select:focus, textarea:focus{
  background: #fff;
  border-color: var(--brand-line);
  box-shadow: 0 0 0 3.5px rgba(22,23,28,.08);
}

input:user-invalid, textarea:user-invalid{
  border-color: #d6402f;
  background: #fff;
}

textarea{
  resize: vertical;
  min-height: 60px;
  line-height: 1.6;
}

select{
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%237b818c' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
input[type="number"]{ -moz-appearance: textfield; }

.grid-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- Line item rows ---------- */

.item-row{
  background: #f7f8fc;
  border: 1px solid #e9ebf3;
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color .16s ease, background .16s ease;
}
.item-row:focus-within{
  background: #fff;
  border-color: var(--brand-line);
}

.item-row-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.item-index-badge{
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--faint);
}

.icon-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #b3b8c3;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover{ background: #fdeceb; color: #d6402f; }

.item-row .in-title,
.item-row .in-desc{
  background: #fff;
  border-color: #e6e9f2;
  margin-bottom: 9px;
}

.item-row .in-title{ font-weight: 600; }

.item-row .in-desc{
  min-height: 52px;
  font-size: 12.5px;
  font-weight: 400;
}

.item-grid{
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 10px;
}

.mini-label{
  display: block;
  margin-bottom: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.item-grid input{
  background: #fff;
  border-color: #e6e9f2;
}

.amount-field{
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e6e9f2;
  border-radius: var(--r-md);
  padding: 0 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.amount-field:focus-within{
  border-color: var(--brand-line);
  box-shadow: 0 0 0 3.5px rgba(22,23,28,.08);
}

.amount-prefix{
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding-right: 7px;
  flex: none;
}

.amount-field input{
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 0;
  font-weight: 600;
}

.row-total-line{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed #dfe2ec;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.row-total-line strong{
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--ink);
}

/* =========================================================
   STAGE
   ========================================================= */

.stage{
  background: var(--surface-2);
  border-radius: var(--r-xl);
  overflow: auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}

.stage-inner{
  min-height: 100%;
  padding: 30px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.stage::-webkit-scrollbar{ width: 10px; height: 10px; }
.stage::-webkit-scrollbar-thumb{
  background: #c6cbd5;
  border-radius: 99px;
  border: 3px solid var(--surface-2);
}

/* =========================================================
   THE SHEET
   ========================================================= */

.sheet{
  width: 210mm;
  min-height: 297mm;
  flex: none;
  background: #fff;
  border-radius: 3px;
  box-shadow: var(--sh-sheet);
  color: #0a0a0a;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 11.5px;
  line-height: 1.5;
  font-feature-settings: 'cv02' 1, 'cv03' 1, 'cv04' 1, 'cv11' 1;

  padding: 15mm 14mm 12mm;
  display: flex;
  flex-direction: column;
}

/* ---------- HEADER ---------- */

.inv-header{ margin-bottom: 18px; }

.inv-brand{
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
  text-transform: uppercase;
  color: #0a0a0a;
  word-break: break-word;
}

.inv-meta-row{
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 18px;
  align-items: start;
}

.meta-col{ min-width: 0; }

.meta-cap{
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 2px;
  line-height: 1.3;
}

.meta-line{
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: #0a0a0a;
  word-break: break-word;
}

.meta-line.strong{ font-weight: 700; font-size: 11.5px; }
.meta-line.soft{ color: #5c5c5c; font-size: 10.5px; }

.meta-block{ margin-bottom: 10px; }
.meta-block:last-child{ margin-bottom: 0; }

.meta-col-title{ text-align: right; }

.inv-title{
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1;
  text-transform: uppercase;
  color: #0a0a0a;
}

/* ---------- ITEMS TABLE ---------- */

.inv-table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11px;
}

.inv-table thead th{
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #8a8a8a;
  text-align: left;
  padding: 0 0 6px;
  border-bottom: 1.5px solid #0a0a0a;
}

.inv-table td{
  padding: 10px 0;
  vertical-align: top;
  border-bottom: 1px solid #e8e8e8;
}

.col-desc{ width: auto; padding-right: 14px !important; }
.col-qty{ width: 46px;  text-align: center; color: #0a0a0a; }
.col-unit{ width: 84px; text-align: right;  color: #0a0a0a; }
.col-total{ width: 92px; text-align: right; color: #0a0a0a; font-weight: 600; }

.inv-table thead th.col-qty{ text-align: center; }
.inv-table thead th.col-unit,
.inv-table thead th.col-total{ text-align: right; }

.row-title{
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -.005em;
  line-height: 1.35;
  color: #0a0a0a;
}

.row-sub{
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #5c5c5c;
  padding-left: 2px;
}

.items-empty{
  padding: 20px 0;
  font-size: 11px;
  color: #a0a0a0;
  border-top: 1.5px solid #0a0a0a;
  border-bottom: 1px solid #e8e8e8;
  text-align: left;
}

/* ---------- SUMMARY ---------- */

.inv-summary{
  margin-top: 22px;
  margin-left: auto;
  width: 76mm;
  font-size: 10.5px;
}

.sum-row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 4px 0;
}

.sum-row .sum-label{
  font-weight: 600;
  letter-spacing: .02em;
  color: #0a0a0a;
  text-transform: uppercase;
  font-size: 10px;
}

.sum-row .sum-value{
  font-weight: 600;
  color: #0a0a0a;
  text-align: right;
  white-space: nowrap;
}

.sum-row.final{
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1.5px solid #0a0a0a;
  font-size: 12px;
}

.sum-row.final .sum-label,
.sum-row.final .sum-value{
  font-weight: 800;
  letter-spacing: -.005em;
}

.inv-spacer{ flex: 1 1 auto; min-height: 22px; }

/* ---------- PAYMENT ---------- */

.inv-payment{
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1.5px solid #0a0a0a;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-head{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-label{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin-right: auto;
  color: #0a0a0a;
}

.pay-badge{
  display: inline-block;
  border: 1px solid #0a0a0a;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0a0a0a;
  white-space: nowrap;
}

.payment-body{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38mm;
  gap: 22px;
  align-items: start;
}

.payment-body.no-qr{
  grid-template-columns: minmax(0, 1fr);
}

.payment-details{
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pay-line{
  font-size: 10px;
  font-weight: 500;
  line-height: 1.55;
  color: #0a0a0a;
  letter-spacing: .02em;
}

.pay-line.pay-key{
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 4px;
  font-size: 9px;
  color: #6a6a6a;
}

.pay-line.pay-key:first-child{ margin-top: 0; }

.pay-line.pay-value{
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -.005em;
}

.payment-qr{
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.payment-qr img{
  width: 38mm;
  height: 38mm;
  object-fit: contain;
  display: block;
}

.payment-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid #d8d8d8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #0a0a0a;
}

/* ---------- FOOTER ---------- */

.inv-footer{
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1.5px solid #0a0a0a;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.foot-col{ min-width: 0; }

.foot-title{
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0a0a0a;
  line-height: 1.35;
  word-break: break-word;
}

.foot-sub{
  margin-top: 2px;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: #6a6a6a;
  line-height: 1.4;
  word-break: break-word;
}

.foot-col.center{ text-align: center; }
.foot-col.right{ text-align: right; }

/* =========================================================
   RESPONSIVE — tablet & mobile (≤ 1080px)
   ========================================================= */

@media (max-width: 1080px){

  /* --- shell --- */
  .shell{
    height: auto;
    min-height: 100vh;
    padding: 12px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .shell-top{
    padding: 2px 2px 0;
    gap: 10px;
    align-items: center;
  }

  .brand-sub{ display: none; }

  .top-actions .pill-ghost,
  .top-actions .pill-dark{ display: none; }
  .top-actions .mobile-menu{ display: block; }

  /* --- mobile tabs --- */
  .mobile-tabs{
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--card);
    border-radius: 999px;
    box-shadow: var(--sh-card);
    position: sticky;
    top: 8px;
    z-index: 25;
  }

  .mobile-tab{
    flex: 1;
    padding: 11px 16px;
    border: none;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
  }
  .mobile-tab.is-active{
    background: var(--ink);
    color: #fff;
  }

  /* --- workspace --- */
  .workspace{
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .sidebar-handle{ display: none; }

  /* --- editor --- */
  .editor{
    overflow: visible;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    gap: 10px;
  }
  .editor::-webkit-scrollbar{ display: none; }

  /* --- stage --- */
  .stage{
    overflow: visible;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    min-height: 0;
  }
  .stage-inner{
    padding: 8px 4px 0;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
  }

  /* auto-fit the A4 sheet to the viewport width */
  .sheet{
    zoom: var(--sheet-zoom, 1);
  }

  /* --- view switching --- */
  body.view-edit .stage{ display: none; }
  body.view-preview .editor{ display: none; }

  /* --- bigger tap targets on mobile --- */
  .card{ padding: 15px 16px; }
  .icon-btn{
    width: 34px;
    height: 34px;
    margin: -5px -6px -5px 0;
  }
  .icon-btn svg{ width: 15px; height: 15px; }

  /* iOS: 16px input font prevents auto-zoom-on-focus */
  input[type="text"],
  input[type="date"],
  input[type="number"],
  select,
  textarea{
    font-size: 16px;
    padding: 12px 14px;
  }
  .item-row .in-desc{ font-size: 15px; }
  .amount-field input{ padding: 12px 0; }

  /* --- sticky bottom bar --- */
  .mobile-bar{
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
      to top,
      rgba(230,231,238,0.98) 0%,
      rgba(230,231,238,0.88) 70%,
      rgba(230,231,238,0) 100%
    );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 40;
    gap: 10px;
    pointer-events: none;
  }
  .mobile-bar .pill{
    flex: 1;
    justify-content: center;
    padding: 15px 20px;
    font-size: 14px;
    pointer-events: auto;
  }
}

@media (max-width: 560px){
  .grid-2{ grid-template-columns: 1fr; gap: 0; }
  .shell-top{ gap: 10px; }
  .item-grid{ grid-template-columns: 1fr 76px; }
}

/* =========================================================
   PRINT
   ========================================================= */

@page{
  size: A4;
  margin: 12mm 14mm;
}

@media print{
  html, body{
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .shell{
    display: block;
    height: auto;
    padding: 0;
    gap: 0;
  }

  .shell-top,
  .editor,
  .sr-only,
  .mobile-tabs,
  .mobile-bar,
  .mobile-menu{
    display: none !important;
  }

  .workspace{ display: block; }
  .sidebar-handle{ display: none !important; }

  .stage{
    background: #fff;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    display: block;
  }

  .stage-inner{
    display: block;
    padding: 0;
    min-height: 0;
  }

  /* override mobile zoom for the printed page */
  .sheet{
    zoom: 1 !important;
    width: auto;
    min-height: 273mm;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .inv-spacer{ flex: 1 1 auto; min-height: 14mm; }

  .inv-table tr,
  .inv-payment,
  .inv-footer,
  .sum-row.final{ break-inside: avoid; }

  *{
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}