body.page-tools-invoice {
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 320px);
}
body.page-tools-invoice .reveal {
  opacity: 1 !important;
  transform: none !important;
}

.inv-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 960px) {
  .inv-layout {
    grid-template-columns: 1fr minmax(300px, 380px);
    align-items: start;
  }
}

.inv-hero {
  border-radius: 20px;
  padding: 22px 20px;
  background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 55%, #f8fafc 100%);
  border: 1px solid #93c5fd;
  margin-bottom: 20px;
}
.inv-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  color: #1e3a8a;
}
.inv-hero-lead {
  margin: 0;
  color: #374151;
  font-size: 0.94rem;
  line-height: 1.5;
  max-width: 560px;
}

.inv-field {
  margin-bottom: 12px;
}
.inv-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.inv-field input,
.inv-field textarea,
.inv-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.inv-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .inv-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.inv-section-title {
  margin: 16px 0 10px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e40af;
}

.inv-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.inv-items-table th,
.inv-items-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.inv-items-table input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.inv-items-table .inv-num {
  text-align: right;
}
.inv-row-del {
  border: none;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}
.inv-btn {
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1e40af;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.inv-btn--primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.inv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.inv-preview-wrap {
  position: sticky;
  top: 76px;
}
.inv-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* Printable invoice card — mirrors app InvoiceShareCard */
#inv-print-root {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #bfdbfe;
  padding: 20px;
  color: #111;
  font-size: 12px;
  line-height: 1.35;
}
#inv-print-root .inv-shop-name {
  font-size: 20px;
  font-weight: 900;
  color: #1e40af;
  margin: 0 0 6px;
}
#inv-print-root .inv-shop-meta {
  color: #4b5563;
  font-size: 12px;
  margin: 0 0 2px;
}
#inv-print-root .inv-meta-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 14px 0;
}
#inv-print-root .inv-meta-label {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.08em;
}
#inv-print-root .inv-meta-no {
  font-size: 15px;
  font-weight: 800;
}
#inv-print-root .inv-items {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 11px;
}
#inv-print-root .inv-items th,
#inv-print-root .inv-items td {
  border: 1px solid #e2e8f0;
  padding: 6px;
}
#inv-print-root .inv-items th {
  background: #f1f5f9;
  font-weight: 800;
  color: #475569;
  font-size: 10px;
}
#inv-print-root .inv-total-box {
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-top: 8px;
}
#inv-print-root .inv-total-box span:last-child {
  font-size: 16px;
  font-weight: 900;
}
#inv-print-root .inv-note {
  margin-top: 10px;
  padding: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 11px;
}
#inv-print-root .inv-qr {
  text-align: center;
  margin-top: 14px;
}
#inv-print-root .inv-qr img {
  max-width: 160px;
  height: auto;
}
#inv-print-root .inv-footer {
  text-align: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 11px;
}
#inv-print-root .inv-foot-brand {
  font-size: 9px;
  color: #9ca3af;
  margin-top: 6px;
}

@media print {
  body.page-tools-invoice * {
    visibility: hidden;
  }
  body.page-tools-invoice #inv-print-root,
  body.page-tools-invoice #inv-print-root * {
    visibility: visible;
  }
  body.page-tools-invoice #inv-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    border-radius: 0;
  }
}
