
/* ── Page ────────────────────────────────────────────── */
.receipt-page {
  font-family: var(--font-body);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Container ───────────────────────────────────────── */
.receipt-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Receipt card ────────────────────────────────────── */
.receipt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Card header ─────────────────────────────────────── */
.receipt-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* .receipt-header-left — layout handled by parent flex */
.receipt-logo {
  height: 40px;
  width: auto;
  display: block;
  margin-bottom: 6px;
}

.receipt-company {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.receipt-company-sub {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

.receipt-header-right {
  text-align: right;
}

.receipt-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.receipt-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.receipt-meta-row {
  font-size: 13px;
  color: var(--text-muted);
}

.receipt-meta-row strong {
  color: var(--text);
  font-weight: 500;
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 6px;
}

/* ── Bill to / from ──────────────────────────────────── */
.receipt-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.receipt-address-block {
  padding: 20px 24px;
}

.receipt-address-block:first-child {
  border-right: 1px solid var(--border);
}

.receipt-address-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  display: block;
}

.receipt-address-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
}

.receipt-address-line {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Items table ─────────────────────────────────────── */
.receipt-items {
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.receipt-table thead tr {
  border-bottom: 1px solid var(--border);
}

.receipt-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  white-space: nowrap;
  background: var(--accent-light);
}

.receipt-table th:not(:first-child) {
  text-align: right;
}

.receipt-table td {
  padding: 14px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.receipt-table td:not(:first-child) {
  text-align: right;
}

.receipt-table tbody tr:last-child td {
  border-bottom: none;
}

.receipt-table .td-name {
  color: var(--text);
  font-weight: 500;
}

.receipt-table .td-size {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-light);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Totals ──────────────────────────────────────────── */
.receipt-totals {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.receipt-total-row:last-of-type {
  border-bottom: none;
}

.receipt-total-row.grand {
  padding: 14px 0 4px;
  margin-top: 6px;
  border-top: 2px solid var(--accent);
  border-bottom: none;
}

.receipt-total-row.grand .tlabel {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.receipt-total-row.grand .tamount {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.receipt-total-row .tdiscount {
  color: #27ae60;
}

/* ── Actions ─────────────────────────────────────────── */
.receipt-actions {
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition);
}

.btn-print:hover {
  opacity: 0.85;
}

.btn-print svg {
  width: 15px;
  height: 15px;
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary-action:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-light);
}

.btn-secondary-action svg {
  width: 14px;
  height: 14px;
}

/* ── Responsive: mobile ──────────────────────────────── */
@media (max-width: 560px) {
  .receipt-container {
    padding: 16px 14px 48px;
  }

  .receipt-header {
    padding: 18px 16px 16px;
    flex-direction: column;
    gap: 14px;
  }

  .receipt-header-right {
    text-align: left;
  }

  .receipt-title {
    font-size: 18px;
  }

  .receipt-addresses {
    grid-template-columns: 1fr;
  }

  .receipt-address-block:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .receipt-address-block {
    padding: 16px;
  }

  .receipt-table th,
  .receipt-table td {
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .receipt-totals {
    padding: 16px;
  }

  .receipt-actions {
    padding: 16px;
    flex-direction: column;
  }

  .btn-print,
  .btn-secondary-action {
    width: 100%;
    justify-content: center;
  }
}

/* ── Print styles ────────────────────────────────────── */
@media print {
  .receipt-breadcrumb,
  .receipt-actions {
    display: none !important;
  }

  body {
    background: white;
  }

  .receipt-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
