.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .42);
}

.drawer-mask.open {
  display: flex;
}

.invoice-drawer {
  width: 60vw;
  min-width: 760px;
  max-width: 1120px;
  height: 100vh;
  background: #fff;
  box-shadow: -18px 0 42px rgba(31, 42, 68, .20);
  display: grid;
  grid-template-rows: 64px 1fr 72px;
}

.drawer-head,
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #e4eaf3;
}

.drawer-foot {
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #e4eaf3;
  border-bottom: 0;
  background: #fbfcfe;
}

.drawer-title {
  margin: 0;
  color: #1f2a44;
  font-size: 18px;
  font-weight: 750;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 24px;
}

.drawer-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 0;
}

.drawer-info {
  overflow: auto;
  border-right: 1px solid #e4eaf3;
  background: #fff;
}

.drawer-section {
  padding: 22px 24px;
  border-bottom: 1px solid #edf1f7;
}

.drawer-section h3 {
  margin: 0 0 16px;
  padding-left: 8px;
  border-left: 3px solid #176bff;
  color: #1f2a44;
  font-size: 14px;
  font-weight: 750;
}

.kv {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  margin: 12px 0;
  color: #475467;
  font-size: 13px;
}

.kv strong {
  color: #1f2a44;
  font-weight: 650;
}

.record-lines {
  display: grid;
  gap: 4px;
  line-height: 1.45;
}

.audit-tip {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #b8d2ff;
  border-radius: 6px;
  color: #2f63c6;
  background: #f5f9ff;
  font-size: 12px;
  line-height: 1.6;
}

.audit-tip.warning {
  border-color: #ffd6a8;
  color: #b54708;
  background: #fff8f0;
}

.reject-box {
  margin-top: 16px;
}

.reject-box label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.reject-box textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid #d8e0ed;
  border-radius: 6px;
  padding: 10px 12px;
  color: #1f2a44;
  font: inherit;
  font-size: 13px;
}

.preview-pane {
  min-width: 0;
  padding: 22px 24px;
  background: #f5f8fc;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.preview-title {
  padding-left: 8px;
  border-left: 3px solid #176bff;
  color: #1f2a44;
  font-size: 14px;
  font-weight: 750;
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.mini-btn,
.drawer-btn {
  height: 36px;
  border: 1px solid #d8e0ed;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.drawer-btn.primary {
  border-color: #176bff;
  color: #fff;
  background: #176bff;
}

.mini-btn:hover,
.drawer-btn:not(:disabled):hover {
  border-color: #176bff;
  color: #176bff;
  background: #f7faff;
  box-shadow: 0 7px 16px rgba(23, 107, 255, .13);
  transform: translateY(-1px);
}

.drawer-btn.primary:not(:disabled):hover {
  color: #fff;
  background: #0f5bea;
  box-shadow: 0 9px 20px rgba(23, 107, 255, .26);
}

.drawer-btn.danger {
  border-color: #ff9b9b;
  color: #f04438;
  background: #fff;
}

.drawer-btn.danger:not(:disabled):hover {
  border-color: #f04438;
  color: #d92d20;
  background: #fff7f6;
  box-shadow: 0 7px 16px rgba(240, 68, 56, .12);
}

.mini-btn:active,
.drawer-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(31, 42, 68, .08);
}

.drawer-btn:disabled {
  color: #98a2b3;
  border-color: #e4eaf3;
  background: #f6f8fb;
  cursor: not-allowed;
}

.prototype-toast {
  position: fixed;
  right: 28px;
  bottom: 92px;
  z-index: 90;
  min-width: 220px;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid #b8d2ff;
  border-radius: 6px;
  color: #1f2a44;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 42, 68, .18);
  font-size: 14px;
  font-weight: 700;
}

.prototype-toast.success {
  border-color: #a8e7c8;
  color: #087443;
  background: #f0fbf6;
}

.prototype-toast.error {
  border-color: #ffb4ad;
  color: #b42318;
  background: #fff7f6;
}

.batch-dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .38);
}

@media (max-width: 1280px) {
  .invoice-drawer {
    width: 100vw;
    min-width: 0;
  }

  .drawer-body {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 860px) {
  .drawer-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .drawer-info {
    border-right: 0;
  }
}

.batch-dialog {
  width: min(460px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(31, 42, 68, .22);
  overflow: hidden;
}

.batch-dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px 12px;
}

.batch-dialog-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.batch-dialog-icon.pass {
  color: #176bff;
  background: #eaf2ff;
}

.batch-dialog-icon.reject {
  color: #f04438;
  background: #fff1f0;
}

.batch-dialog-title {
  margin: 0;
  color: #1f2a44;
  font-size: 17px;
  font-weight: 750;
}

.batch-dialog-body {
  padding: 0 22px 18px;
  color: #475467;
  font-size: 14px;
  line-height: 1.7;
}

.batch-dialog-list {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e4eaf3;
  border-radius: 6px;
  background: #f8fafd;
  color: #1f2a44;
  font-weight: 650;
}

.batch-dialog textarea {
  width: 100%;
  min-height: 92px;
  margin-top: 12px;
  resize: vertical;
  border: 1px solid #d8e0ed;
  border-radius: 6px;
  padding: 10px 12px;
  color: #1f2a44;
  font: inherit;
  font-size: 13px;
}

.batch-error {
  min-height: 18px;
  margin-top: 6px;
  color: #f04438;
  font-size: 12px;
}

.batch-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid #e4eaf3;
  background: #fbfcfe;
}

.pdf-card {
  height: calc(100vh - 186px);
  min-height: 520px;
  border: 1px solid #d8e0ed;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.pdf-toolbar {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  color: #fff;
  background: #27313f;
  font-size: 12px;
}

.pdf-paper {
  margin: 18px auto;
  width: 82%;
  min-height: 640px;
  padding: 26px;
  border: 1px solid #e6c8bd;
  color: #7a3b2b;
  background: #fffdfb;
  box-shadow: 0 8px 24px rgba(31, 42, 68, .08);
}

.invoice-title {
  text-align: center;
  color: #9a3b2f;
  font-size: 20px;
  letter-spacing: 2px;
}

.stamp {
  width: 86px;
  height: 86px;
  margin: 10px auto;
  display: grid;
  place-items: center;
  border: 3px solid #f04438;
  border-radius: 50%;
  color: #f04438;
  transform: rotate(-14deg);
  font-size: 12px;
  font-weight: 750;
}

.invoice-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.5fr .7fr .7fr .8fr;
  border: 1px solid #e6c8bd;
  font-size: 12px;
}

.invoice-grid div {
  min-height: 54px;
  padding: 10px;
  border-right: 1px solid #e6c8bd;
  border-bottom: 1px solid #e6c8bd;
}

@media (max-width: 960px) {
  .invoice-drawer { width: 100vw; }
  .drawer-body { grid-template-columns: 1fr; overflow: auto; }
  .pdf-card { height: 520px; }
}
