body {
  background: #f4f6f9;
  color: #1f2937;
}

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4ff, #f8fafc);
}

.login-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  padding: 28px;
}

.login-wrapper {
  max-width: 960px;
}

.permissions-box {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
}

.navbar {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

.card,
.stat-card,
.receipt {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.stat-card {
  background: #ffffff;
  padding: 18px;
}

.stat-card span {
  display: block;
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.stat-card strong {
  display: block;
  color: #0d6efd;
  font-size: 1.6rem;
}

.credit-payment-form {
  max-width: 620px;
}

.credit-payment-amount {
  width: 110px;
}

.credit-payment-mode {
  width: 140px;
}

.credit-payment-note {
  width: 160px;
}

.sale-status-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.closure-message {
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.35;
  resize: vertical;
}

.summary-box {
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px;
}

.sale-summary {
  top: 20px;
}

.pos-product-search {
  max-width: 420px;
}

.pos-products-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
}

.pos-product-tile {
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #1f2937;
  min-height: 192px;
  padding: 10px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pos-product-tile:hover,
.pos-product-tile:focus {
  border-color: #0d6efd;
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.12);
  outline: 0;
  transform: translateY(-1px);
}

.pos-product-image {
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
  object-fit: cover;
  width: 100%;
}

.pos-product-name,
.pos-product-meta,
.pos-product-price {
  display: block;
}

.pos-product-name {
  font-weight: 700;
  line-height: 1.2;
  min-height: 38px;
}

.pos-product-meta {
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 4px;
}

.pos-product-price {
  color: #0d6efd;
  margin-top: 6px;
}

.pos-cart-card {
  top: 18px;
}

.pos-cart-list {
  display: grid;
  gap: 10px;
  max-height: 48vh;
  overflow: auto;
}

.pos-empty-cart {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  padding: 16px;
  text-align: center;
}

.pos-cart-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  padding: 8px;
}

.pos-cart-image {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.pos-cart-main {
  min-width: 0;
}

.pos-cart-main strong,
.pos-cart-main span {
  display: block;
}

.pos-cart-main strong {
  overflow-wrap: anywhere;
}

.pos-cart-main span {
  color: #64748b;
  font-size: 0.84rem;
}

.pos-cart-main .pos-cart-subtotal {
  color: #0f172a;
  font-weight: 700;
}

.pos-cart-actions {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 34px);
}

.pos-cart-actions .btn {
  height: 34px;
  padding: 0;
  width: 34px;
}

.pos-total-box strong {
  color: #0d6efd;
  font-size: 1.45rem;
}

.pos-submit {
  min-height: 52px;
}

@media (max-width: 767.98px) {
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }

  .pos-product-search {
    max-width: none;
  }

  .pos-cart-list {
    max-height: none;
  }
}

.product-thumb,
.product-form-image,
.sale-product-image {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  object-fit: cover;
}

.product-thumb {
  border-radius: 8px;
  height: 48px;
  width: 48px;
}

.product-form-image {
  border-radius: 8px;
  height: 96px;
  width: 96px;
}

.selected-product-preview {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 66px;
  padding: 8px;
}

.sale-product-image {
  border-radius: 8px;
  flex: 0 0 auto;
  height: 48px;
  width: 48px;
}

.selected-product-name,
.selected-product-meta {
  display: block;
}

.selected-product-name {
  font-size: 0.92rem;
}

.selected-product-meta {
  color: #64748b;
  font-size: 0.82rem;
}

.receipt {
  background: #ffffff;
  max-width: 720px;
  padding: 28px;
}

.ticket-receipt {
  max-width: 360px;
  font-size: 0.92rem;
}

.ticket-receipt .table {
  font-size: 0.84rem;
}

.print-sheet {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  padding: 28px;
}

.print-summary {
  border-bottom: 1px solid #dbe3ef;
  border-top: 1px solid #dbe3ef;
  padding: 10px 0;
}

.table thead th {
  background: #000000;
  color: #ffffff;
}

.table th {
  color: #475569;
  font-size: 0.88rem;
  font-weight: 700;
}

@media print {
  @page {
    margin: 10mm;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .navbar,
  .no-print,
  .alert {
    display: none !important;
  }

  main {
    padding: 0 !important;
  }

  .receipt,
  .print-sheet {
    border: 0;
    box-shadow: none;
    max-width: 100%;
    padding: 0;
  }

  .print-sheet {
    font-size: 11px;
  }

  .print-sheet .table {
    font-size: 10px;
  }

  .print-sheet h2 {
    font-size: 18px;
  }

  .ticket-receipt {
    width: 80mm;
    max-width: 80mm;
    margin: 0 !important;
    padding: 0;
    box-sizing: border-box;
    min-height: 0 !important;
    height: auto !important;
    page-break-after: avoid;
    break-after: avoid;
    color: #000000 !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-rendering: geometricPrecision;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .ticket-receipt h2 {
    color: #000000 !important;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
  }

  .ticket-receipt p,
  .ticket-receipt div {
    color: #000000 !important;
    line-height: 1.35;
  }

  .ticket-receipt .table {
    border-color: #000000;
    table-layout: fixed;
    width: 100%;
    color: #000000 !important;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
  }

  .ticket-receipt .table th,
  .ticket-receipt .table td {
    border-color: #000000;
    color: #000000 !important;
    padding: 3px 1px;
    vertical-align: top;
    word-break: break-word;
  }

  .ticket-receipt .table th {
    font-weight: 800;
  }

  .ticket-receipt strong {
    color: #000000 !important;
    font-weight: 800;
  }

  .ticket-receipt .table th:nth-child(1),
  .ticket-receipt .table td:nth-child(1) {
    width: 34%;
  }

  .ticket-receipt .table th:nth-child(2),
  .ticket-receipt .table td:nth-child(2) {
    width: 12%;
  }

  .ticket-receipt .table th:nth-child(3),
  .ticket-receipt .table td:nth-child(3),
  .ticket-receipt .table th:nth-child(4),
  .ticket-receipt .table td:nth-child(4) {
    width: 27%;
  }

  .ticket-receipt .text-muted {
    color: #000000 !important;
  }
}

.home-stat-card {
  background: linear-gradient(135deg, #38bdf8 0%, #22c55e 58%, #bbf7d0 100%) !important;
  border: 0;
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.18);
  color: #ffffff;
  min-height: 112px;
}

.home-stat-card span {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.home-stat-card strong {
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.18);
}
.bilan-stat-card {
  background: linear-gradient(135deg, #e0f2fe 0%, #7dd3fc 48%, #38bdf8 100%) !important;
  border: 0;
  box-shadow: 0 14px 28px rgba(56, 189, 248, 0.2);
  color: #0f172a;
  min-height: 112px;
}

.bilan-stat-card span {
  color: #075985;
  font-weight: 700;
}

.bilan-stat-card strong {
  color: #0f172a;
}
.yellow-stat-card {
  background: linear-gradient(135deg, #fff7d6 0%, #fde68a 48%, #facc15 100%) !important;
  border: 0;
  box-shadow: 0 14px 28px rgba(250, 204, 21, 0.2);
  color: #422006;
  min-height: 112px;
}

.yellow-stat-card span {
  color: #854d0e;
  font-weight: 700;
}

.yellow-stat-card strong {
  color: #422006;
}