/* ---------- General look & feel ---------- */
body {
  background-color: #f4f6f9;
}

.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-icon {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  font-size: 2.25rem;
  opacity: 0.15;
}

.navbar-brand {
  letter-spacing: 0.02em;
}

.table code {
  background: #f1f3f5;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
}

.card {
  border-radius: 0.75rem;
}

/* ---------- Print report page (screen preview) ---------- */
.print-page {
  background: #f4f6f9;
}

/* ---------- Receipt / stock-report shell (shared look) ---------- */
.receipt-shell {
  max-width: 780px;
  background: #fff;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.receipt-wave-top, .receipt-wave-bottom {
  width: 100%;
  line-height: 0;
}
.receipt-wave-top svg, .receipt-wave-bottom svg {
  width: 100%;
  height: 70px;
  display: block;
}
.receipt-inner {
  padding: 1rem 2.5rem 2rem;
}
.receipt-logo-box {
  width: 96px;
  height: 96px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.receipt-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Item photo (form upload box + list/POS thumbnails) ---------- */
.item-photo-box {
  width: 90px;
  height: 90px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-photo-box i {
  font-size: 1.75rem;
}
.item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.item-thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #eef1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
}
.pos-card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #eef1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  color: #94a3b8;
  font-size: 1.5rem;
}
.pos-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.receipt-title-block {
  text-align: right;
}
.receipt-title {
  font-size: 2.25rem;
  font-weight: 300;
  color: #1e293b;
  letter-spacing: 0.02em;
}
.receipt-business-info {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.receipt-meta-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 0;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.receipt-meta-label {
  font-weight: 600;
  color: #334155;
  font-size: 0.85rem;
}
.receipt-meta-value {
  color: #475569;
  font-size: 0.95rem;
}
.receipt-status-paid {
  color: #16a34a;
  font-weight: 700;
  white-space: nowrap;
}
.receipt-status-pending {
  color: #d97706;
  font-weight: 700;
  white-space: nowrap;
}
.receipt-table {
  font-size: 0.92rem;
}
.receipt-table thead th {
  border-bottom: 2px solid #e2e8f0;
  color: #334155;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.receipt-table td, .receipt-table th {
  border-color: #eef1f5;
}
.receipt-table td:first-child,
.receipt-table td:nth-child(2) {
  white-space: nowrap;
}
.receipt-totals {
  max-width: 320px;
  margin-left: auto;
  padding: 1rem 0;
  color: #334155;
}
.receipt-totals > div {
  padding: 0.25rem 0;
}
.receipt-paid-bar {
  display: flex;
  align-items: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 1rem;
}
.receipt-paid-badge {
  background: #152a6e;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
}
.receipt-paid-badge.pending {
  background: #b45309;
}
.receipt-paid-amount {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.9rem 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1e293b;
  background: #f8fafc;
}

/* ---------- POS screen ---------- */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 991px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.pos-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.9rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}
.pos-card:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  border-color: #93c5fd;
}
.pos-card:active {
  transform: scale(0.97);
}
.pos-card-maxed {
  animation: pos-shake 0.4s;
  border-color: #f87171 !important;
}
@keyframes pos-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.pos-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #1e293b;
  margin-bottom: 0.15rem;
}
.pos-card-sku {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}
.pos-card-price {
  font-weight: 700;
  color: #0f766e;
}
.pos-card-stock {
  font-size: 0.72rem;
  color: #94a3b8;
}

.pos-cart {
  position: sticky;
  top: 80px;
}
.pos-cart-items {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.5rem 1rem;
}
.pos-cart-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.pos-cart-row-info {
  flex: 1;
  min-width: 0;
}
.pos-cart-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-cart-row-qty {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.pos-cart-row-amount {
  font-weight: 600;
  font-size: 0.88rem;
  min-width: 70px;
  text-align: right;
}

/* ---------- POS split-payment rows ---------- */
.payment-method-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.payment-method-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.payment-method-row .form-check {
  width: 110px;
  flex-shrink: 0;
}
.payment-method-row .pay-method-amount {
  flex: 1;
}
#paymentRemaining.text-success {
  color: #16a34a !important;
}
#paymentRemaining.text-danger {
  color: #dc2626 !important;
}

/* ---------- POS thermal-style receipt ---------- */
.pos-receipt {
  max-width: 320px;
  margin: 0 auto;
  background: #fff;
  font-family: 'Courier New', Courier, monospace;
  padding: 1.25rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.pos-receipt hr {
  border-top: 1px dashed #94a3b8;
}
.pos-receipt .pr-center {
  text-align: center;
}
.pos-receipt .pr-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.pos-receipt .pr-total-row {
  font-weight: 700;
  font-size: 1rem;
}

/* ---------- Sales reports (simple CSS bar chart) ---------- */
.report-bar-row {
  margin-bottom: 0.85rem;
}
.report-bar-row:last-child {
  margin-bottom: 0;
}
.report-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}
.report-bar-track {
  background: #eef1f5;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}
.report-bar-fill {
  height: 100%;
  background: #0d6efd;
  border-radius: 6px;
  transition: width 0.3s ease;
}
.report-bar-value {
  text-align: right;
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.15rem;
}

/* ---------- Login page ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #f4f6f9 60%);
}
.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}
.login-card {
  border-radius: 14px;
}

/* ---------- Print media rules ---------- */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
  }
  .container, .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  table {
    font-size: 11px;
  }
  .card {
    box-shadow: none !important;
    border: none !important;
  }
  .receipt-shell {
    box-shadow: none !important;
    max-width: 100% !important;
  }
  @page {
    margin: 1.2cm;
  }
}
