.ticket-customer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}
.ticket-customer input {
  padding: 9px;
  font-size: 13px;
}
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}
.date-range,
.export-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.date-range input {
  width: auto;
}
.admin-grid {
  grid-template-columns: minmax(430px, 480px) minmax(0, 1fr);
}
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.user-row > span {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.user-row > div {
  display: flex;
  gap: 5px;
}
.user-row button,
.mini {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.color-dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.panel + .panel {
  margin-top: 14px;
}
.tab-card button {
  margin-top: 12px;
  width: 100%;
}
.tab-card-detail {
  display: block;
  margin-top: 0 !important;
  padding: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}
.tab-card-detail span,
.tab-card-detail small,
.tab-card-detail em {
  display: block;
}
.tab-card-detail em {
  margin-top: 8px;
  color: var(--blue);
  font-style: normal;
  font-weight: 700;
}
.settle-tab {
  margin-top: 12px !important;
}
.gift-history {
  max-height: 55vh;
  overflow: auto;
}
.gift-history-entry {
  border-top: 1px solid var(--border);
  padding: 5px 0;
}
.gift-history-entry small,
.gift-purchase-detail small {
  display: block;
  color: #64748b;
}
.gift-purchase-detail {
  margin: 0 0 10px 14px;
  padding: 8px 10px;
  background: #f4f8fa;
  border-radius: 10px;
}
.gift-purchase-detail .list-row {
  padding: 7px 0;
}
.gift-debit {
  color: #b42318;
}
.gift-credit {
  color: #237a3b;
}
@media (max-width: 1050px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .ticket-customer {
    grid-template-columns: 1fr;
  }
  .user-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  nav {
    overflow-x: auto;
    justify-content: flex-start;
  }
  nav button {
    flex: 0 0 auto;
  }
}
@media (max-width: 560px) {
  .user-row {
    grid-template-columns: 1fr;
  }
  .user-row > div {
    width: 100%;
  }
  .user-row button {
    flex: 1;
  }
  .gift-purchase-detail {
    margin-left: 0;
    padding: 7px;
  }
}
.cart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cart-heading h2 {
  margin: 0;
}
.cart-toggle {
  display: none;
  min-height: 34px;
  padding: 0 10px;
  background: #eaf1f5;
  font-size: 12px;
}
.test-badge {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-style: normal;
  vertical-align: middle;
}
.status-pill {
  display: inline-block;
  background: #e8eef2;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}
.status-pill.on {
  background: #dcfce7;
  color: #166534;
}
.status-pill.off {
  background: #f1f5f9;
  color: #64748b;
}
.test-actions {
  display: grid;
  gap: 8px;
}
.test-actions button {
  width: 100%;
}
@media (max-width: 800px) {
  .cart-toggle {
    display: block;
  }
  .cart {
    transition: max-height 0.2s ease;
  }
  .cart:not(.expanded) .ticket-details {
    display: none;
  }
  .cart.expanded {
    max-height: 72vh;
  }
  .cart.expanded .ticket-details {
    display: block;
    min-height: 0;
    overflow: hidden;
  }
  .cart.expanded .cart-items {
    display: block;
    max-height: 35vh;
    overflow: auto;
  }
  .cart.expanded .ticket-customer {
    display: grid;
  }
  .cart-heading {
    min-height: 34px;
  }
}
.app-version {
  display: inline-block;
  background: #0955a5;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}
.calculate-change {
  width: 100%;
  margin-top: 9px;
}
.cash-total,
.change-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  margin: 12px 0;
}
.cash-total {
  background: #eaf3ff;
}
.cash-total strong {
  font-size: 25px;
  color: #0955a5;
}
.cash-quick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.cash-quick button {
  min-height: 50px;
}
.change-box {
  background: #dcfce7;
}
.change-box strong {
  font-size: 30px;
  color: #166534;
}
.change-box strong.insufficient {
  color: #b42318;
}
.cash-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  margin-top: 12px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 480px) {
  .cash-quick {
    grid-template-columns: repeat(2, 1fr);
  }
  .change-box strong {
    font-size: 25px;
  }
}
.offered-detail-row td {
  background: #fff8e7;
  padding: 10px 14px;
}
.offered-detail-row summary {
  cursor: pointer;
  color: #9a5b00;
  font-weight: 700;
}
.offered-list {
  margin: 8px 0 0;
  padding-left: 22px;
}
.offered-list li {
  margin: 4px 0;
}
.movement-table {
  overflow-x: auto;
  margin-top: 10px;
}
.movement-table table {
  min-width: 760px;
}
.movement-table th {
  background: #fff1cc;
}
.offered-detail-row h4 {
  margin: 14px 0 4px;
  color: #9a5b00;
}
.sales-overview {
  display: grid;
  grid-template-columns: minmax(280px, 520px) auto;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
}
.sales-main-card {
  background: linear-gradient(135deg, #0955a5, #087e9b);
  color: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 8px 24px #0955a52b;
}
.sales-main-card span,
.sales-main-card small {
  display: block;
}
.sales-main-card strong {
  display: block;
  font-size: 42px;
  margin: 7px 0;
}
.sales-overview > button {
  min-width: 220px;
}
.sales-overview + .panel {
  margin-top: 0;
}
@media (max-width: 700px) {
  .sales-overview {
    grid-template-columns: 1fr;
  }
  .sales-main-card strong {
    font-size: 36px;
  }
  .sales-overview > button {
    min-height: 58px;
  }
}
.session-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.session-line small {
  white-space: nowrap;
}
.pos-selector {
  width: auto;
  max-width: 180px;
  min-height: 28px;
  padding: 3px 26px 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0955a5;
  background: #eaf3ff;
}
.stock-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stock-table-wrap {
  overflow-x: auto;
}
.stock-table-wrap table,
#stockMovements table {
  min-width: 690px;
}
.stock-qty {
  font-size: 18px;
  font-weight: 800;
}
.stock-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.stock-status.ok {
  background: #dcfce7;
  color: #166534;
}
.stock-status.low {
  background: #fef3c7;
  color: #92400e;
}
.stock-status.out {
  background: #fee2e2;
  color: #991b1b;
}
.stock-negative {
  color: #b42318;
  font-weight: 800;
}
.stock-positive {
  color: #166534;
  font-weight: 800;
}
#stockCards {
  margin-bottom: 14px;
}
#stockMovements {
  overflow-x: auto;
}
form label input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}
@media (max-width: 800px) {
  .session-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .pos-selector {
    max-width: 205px;
  }
  .stock-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .stock-actions .primary {
    grid-column: 1/-1;
  }
  .stock-actions button {
    min-height: 52px;
  }
  #view-stock .section-head > div:first-child {
    width: 100%;
  }
}
.smtp-success {
  color: #166534;
  font-weight: 700;
}
dialog.wide {
  width: min(1100px, 96vw);
  max-height: 92vh;
}
.stock-book-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stock-book-table {
  overflow: auto;
  max-height: 58vh;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stock-book-table table {
  min-width: 820px;
}
.stock-book-table th {
  position: sticky;
  top: 0;
  background: #eaf3ff;
  z-index: 1;
}
.stock-book-table td {
  padding: 6px 9px;
}
.book-number {
  min-width: 125px;
  padding: 8px;
}
.stock-book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stock-book-footer button {
  min-width: 260px;
}
@media (max-width: 700px) {
  dialog.wide {
    width: 98vw;
    padding: 14px;
  }
  .stock-book-head {
    grid-template-columns: 1fr;
  }
  .stock-book-table {
    max-height: 55vh;
  }
  .stock-book-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .stock-book-footer button {
    width: 100%;
    min-width: 0;
  }
}
.sales-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.closure-reopened {
  opacity: 0.65;
  text-decoration: line-through;
}
.closure-reopened td {
  background: #fff1f1;
}
@media (max-width: 650px) {
  .sales-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
  .sales-actions button {
    min-height: 50px;
  }
}
#view-accounting,
#view-accounting .panel {
  min-width: 0;
}
#closureList {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}
#closureList table {
  min-width: 1050px;
}
@media (max-width: 700px) {
  #view-accounting .panel {
    overflow: hidden;
    padding: 12px;
  }
  #closureList {
    border: 1px solid var(--border);
    border-radius: 10px;
  }
  #closureList:before {
    content: "← Faites glisser le tableau pour voir toutes les colonnes →";
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    min-width: 100%;
    padding: 8px 10px;
    background: #eaf3ff;
    color: #0955a5;
    font-size: 12px;
    font-weight: 700;
  }
  #closureList th,
  #closureList td {
    white-space: nowrap;
    padding: 8px;
  }
}
.receipt-preview {
  max-width: 380px;
  margin: 12px auto;
  padding: 14px;
  background: #fff;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  color: #111;
}
.receipt-preview h2 {
  text-align: center;
  margin: 0 0 8px;
}
.receipt-preview p {
  font-size: 13px;
}
.receipt-lines {
  border-top: 1px dashed #64748b;
  border-bottom: 1px dashed #64748b;
  padding: 6px 0;
}
.receipt-lines > div,
.receipt-payments > div,
.receipt-total,
.receipt-vat {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.receipt-lines span {
  max-width: 72%;
}
.receipt-lines small {
  color: #d93f83;
}
.receipt-total {
  font-size: 18px;
  margin-top: 6px;
}
.receipt-footer {
  text-align: center;
}
.receipt-actions {
  display: grid;
  gap: 10px;
}
.receipt-actions > button,
.receipt-actions form button {
  width: 100%;
}
.print-frame {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  border: 0;
}
.customer-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 9px 0;
  background: #fff;
  overflow: hidden;
}
.customer-stat summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  background: #f5f9fb;
}
.customer-stat > div,
.customer-stat > h4 {
  margin-left: 14px;
  margin-right: 14px;
}
.customer-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.customer-stat-cards span {
  padding: 9px;
  background: #eef5f8;
  border-radius: 8px;
}
.customer-stat-cards b {
  display: block;
  margin-top: 4px;
}
.responsive-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.responsive-table table {
  min-width: 680px;
}
#printSettingsForm input[type="checkbox"] {
  width: auto;
}
@media (max-width: 700px) {
  .customer-stat summary {
    display: block;
  }
  .customer-stat summary > span {
    display: block;
    margin-bottom: 5px;
  }
  .customer-stat-cards {
    grid-template-columns: 1fr 1fr;
  }
  .receipt-preview {
    padding: 10px;
  }
  .responsive-table {
    border: 1px solid var(--border);
    border-radius: 8px;
  }
}
