*{box-sizing:border-box}
:root{
  --bg:#eef1f4;
    --card:#fff;
    --text:#18212b;
    --muted:#6e7885;
  --line:#dfe4ea;
    --navy:#17324f;
    --navy2:#244f78;
  --accent:#ff8a1f;
    --danger:#d64a4a
}
html,body{
  margin:0;min-height:100%;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--text);background:var(--bg)
}
button,a{font:inherit}
a{text-decoration:none;color:inherit}
.hidden{display:none!important}

.bar-page{overflow:hidden}
.bar-app{height:100vh;display:flex;flex-direction:column}
.bar-header{
  height:64px;flex:0 0 64px;display:flex;align-items:center;gap:14px;
  padding:0 16px;color:#fff;
  background:linear-gradient(135deg,var(--navy),var(--navy2))
}
.brand{font-size:21px;font-weight:900}.brand span{color:var(--accent)}
.session-status{
  display:flex;align-items:center;gap:7px;padding:8px 11px;
  border-radius:11px;background:rgba(255,255,255,.11);
  font-size:12px;font-weight:800
}
.status-dot{width:8px;height:8px;border-radius:50%;background:#adb8c4}
.session-status.open .status-dot{background:#65d28d}
.header-actions{margin-left:auto;display:flex;gap:9px}
.header-btn{
  padding:9px 12px;border:0;border-radius:10px;color:#fff;
  background:rgba(255,255,255,.12);font-size:12px;font-weight:900;
  cursor:pointer
}
.header-btn-primary{background:var(--accent)}
.header-btn-danger{background:#a93838}
.bar-main{
  flex:1;min-height:0;display:grid;
  grid-template-columns:minmax(0,1fr) 300px
}



.ticket-zone{
  width:300px;min-width:300px;display:flex;flex-direction:column;
  min-height:0;border-left:1px solid var(--line);background:#fff
}
.ticket-header{padding:14px;border-bottom:1px solid var(--line)}
.ticket-header strong,.ticket-header small{display:block}
.ticket-header small{margin-top:2px;color:var(--muted)}
.ticket-lines{flex:1;min-height:0;overflow:auto;padding:10px 14px}
.ticket-empty{padding:35px 10px;text-align:center;color:var(--muted);font-size:13px}
.ticket-line{
  display:grid;grid-template-columns:30px 1fr auto;gap:8px;align-items:center;
  padding:8px 0;border-bottom:1px solid #edf0f3;font-size:13px
}
.ticket-qty{
  width:27px;height:27px;border-radius:8px;display:grid;place-items:center;
  background:#eef2f6;color:var(--navy);font-weight:900
}
.ticket-footer{
  padding:12px 14px 14px;border-top:1px solid var(--line);background:#fafbfc
}
.ticket-total{display:flex;justify-content:space-between;align-items:end;margin-bottom:10px}
.ticket-total span{color:var(--muted)}
.ticket-total strong{font-size:28px}
.payment-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pay-button,.cancel-order{border:0;border-radius:12px;cursor:pointer;font-weight:900}
.pay-button{padding:13px 10px}.pay-cash{background:#edf1f5}
.pay-sumup{color:#fff;background:var(--accent)}
.cancel-order{
  width:100%;margin-top:8px;padding:9px;color:#a52f2f;background:#fff0f0;
  font-size:12px
}
.bar-lock{
  position:fixed;inset:64px 0 0 0;z-index:20;display:flex;
  align-items:center;justify-content:center;background:rgba(238,241,244,.97)
}
.lock-card{
  width:min(460px,80vw);padding:28px;border:1px solid var(--line);
  border-radius:20px;background:#fff;text-align:center
}
.lock-icon{
  width:68px;height:68px;margin:0 auto 14px;border-radius:20px;
  display:grid;place-items:center;background:#eef2f6;font-size:30px
}
.lock-card h1{margin:0 0 7px;font-size:22px}
.lock-card p{color:var(--muted);font-size:13px}
.open-session-button{
  margin-top:8px;padding:13px 18px;border:0;border-radius:12px;color:#fff;
  background:var(--navy);font-weight:900;cursor:pointer
}
.modal{
  position:fixed;inset:0;z-index:100;display:none;align-items:center;
  justify-content:center;background:rgba(6,16,28,.52)
}
.modal.open{display:flex}
.modal-card{
  width:min(420px,85vw);padding:24px;border-radius:20px;background:#fff;
  text-align:center
}
.payment-loader{
  width:42px;height:42px;margin:0 auto 15px;border:4px solid #e8edf2;
  border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite
}
.payment-result-icon{display:none;margin-bottom:10px;font-size:42px}
.payment-amount{margin:8px 0;font-size:30px;font-weight:900}
.modal-card p{color:var(--muted)}
.modal-button{
  width:100%;margin-top:13px;padding:12px;border:0;border-radius:11px;
  color:#fff;background:var(--navy);font-weight:900;cursor:pointer
}
@keyframes spin{to{transform:rotate(360deg)}}

.admin-header{
  min-height:64px;display:flex;align-items:center;gap:14px;padding:10px 16px;
  color:#fff;background:var(--navy)
}
.admin-header strong,.admin-header small{display:block}
.admin-header small{opacity:.72}
.back-link{
  padding:8px 10px;border-radius:9px;background:rgba(255,255,255,.12);
  font-weight:800
}
.admin-content{padding:18px}
.admin-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px
}
.admin-card{
  min-height:150px;padding:18px;border:1px solid var(--line);border-radius:18px;
  background:#fff;display:flex;flex-direction:column;justify-content:flex-end
}
.admin-card span{margin-bottom:auto;font-size:30px}
.admin-card strong{font-size:16px}
.admin-card small{margin-top:4px;color:var(--muted)}

.validate-order {
    width: 100%;

    padding: 15px;

    border: 0;
    border-radius: 13px;

    color: #fff;
    background: var(--navy);

    font-size: 16px;
    font-weight: 900;

    cursor: pointer;
}


.checkout-total {
    margin: 12px 0 18px;

    font-size: 34px;
    font-weight: 900;
}


.checkout-methods {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;
}


.checkout-choice {
    min-height: 95px;

    border: 1px solid var(--line);
    border-radius: 15px;

    background: #f8fafb;

    cursor: pointer;
}


.checkout-choice span {
    display: block;

    margin-bottom: 8px;

    font-size: 28px;
}


.checkout-choice strong {
    font-size: 13px;
}


.pending-form {
    margin-top: 15px;

    padding-top: 15px;

    border-top:
        1px solid var(--line);

    text-align: left;
}


.pending-form label {
    display: block;

    margin-bottom: 6px;

    font-size: 12px;
    font-weight: 900;
}


.pending-form input {
    width: 100%;

    padding: 12px;

    border:
        1px solid var(--line);

    border-radius: 11px;

    font-size: 15px;
}


.pending-confirm {
    width: 100%;

    margin-top: 9px;

    padding: 12px;

    border: 0;
    border-radius: 11px;

    color: #fff;
    background: var(--accent);

    font-weight: 900;
}


.modal-return,
.modal-cancel-order {
    width: 100%;

    margin-top: 9px;

    padding: 10px;

    border: 0;
    border-radius: 10px;

    font-weight: 800;

    cursor: pointer;
}


.modal-return {
    background: #edf1f5;
}


.modal-cancel-order {
    color: #a52f2f;
    background: #fff0f0;
}

.pending-header-button {
    position: relative;
}


.pending-badge {
    min-width: 20px;
    height: 20px;

    margin-left: 5px;
    padding: 0 6px;

    display: inline-grid;
    place-items: center;

    border-radius: 999px;

    color: #fff;
    background: var(--accent);

    font-size: 11px;
    font-weight: 900;
}


.pending-modal-card {
    width: min(
        620px,
        90vw
    );

    max-height: 80vh;

    display: flex;
    flex-direction: column;

    text-align: left;
}


.pending-modal-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 12px;
}


.pending-modal-header h2 {
    margin: 0;
}


.pending-modal-header small {
    color: var(--muted);
}


.pending-close {
    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 10px;

    background: #edf1f5;

    cursor: pointer;
}


.pending-list {
    overflow: auto;

    display: grid;

    gap: 9px;
}


.pending-item {
    width: 100%;

    padding: 13px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #f8fafb;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 12px;

    text-align: left;

    cursor: pointer;
}


.pending-item-title {
    display: block;

    font-size: 15px;
    font-weight: 900;
}


.pending-item-resume {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.pending-item-total {
    align-self: center;

    font-size: 18px;
    font-weight: 900;
}


.pending-empty {
    padding: 35px 15px;

    text-align: center;

    color: var(--muted);
}


.pending-pay-resume {
    margin-bottom: 15px;

    color: var(--muted);

    font-size: 12px;
}



.admin-card {
    border: 1px solid var(--line);
    cursor: pointer;
    text-align: left;
}


.admin-card:disabled {
    opacity: .45;
    cursor: default;
}


.admin-products {
    max-width: 950px;
    margin: 0 auto;
}


.admin-section-header {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 18px;
}


.admin-section-header h1 {
    margin: 0;
}


.admin-section-header small {
    color: var(--muted);
}


.admin-back-button {
    width: 42px;
    height: 42px;

    border: 0;
    border-radius: 11px;

    background: #e8edf2;

    font-size: 20px;

    cursor: pointer;
}


.admin-primary-button {
    padding: 11px 16px;

    border: 0;
    border-radius: 11px;

    color: #fff;
    background: var(--navy);

    font-weight: 900;

    cursor: pointer;
}


.admin-section-header
.admin-primary-button {
    margin-left: auto;
}


.admin-products-list {
    display: grid;
    gap: 9px;
}


.admin-product-row {
    display: grid;

    grid-template-columns:
        62px
        minmax(150px, 1fr)
        100px
        100px
        105px
        90px;

    gap: 12px;

    align-items: center;

    padding: 10px 12px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #fff;
}


.admin-product-row.inactive {
    opacity: .5;
}


.admin-product-image {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #f1f3f5;

    overflow: hidden;
}


.admin-product-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.admin-product-image-empty {
    color: var(--muted);

    font-size: 10px;
}


.admin-product-name strong {
    display: block;
}


.admin-product-name small {
    display: block;

    margin-top: 3px;

    color: var(--muted);
}


.admin-product-price {
    font-weight: 900;
}


.admin-product-stock {
    font-weight: 900;
}


.admin-product-actions {
    display: flex;
    gap: 6px;

    justify-content: flex-end;
}


.admin-icon-button {
    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 9px;

    background: #edf1f5;

    cursor: pointer;
}


.admin-icon-button.danger {
    color: #a52f2f;
    background: #fff0f0;
}


.admin-icon-button.success {
    color: #147344;
    background: #e9f8ef;
}


/* EDIT PRODUIT */

.product-editor {
    width: min(
        580px,
        90vw
    );

    text-align: left;
}


.product-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}


.product-editor-header h2 {
    margin: 0;
}


.product-editor-header small {
    color: var(--muted);
}


.product-image-editor {
    width: 150px;
    height: 110px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px dashed var(--line);
    border-radius: 14px;

    background: #f8fafb;

    overflow: hidden;

    cursor: pointer;
}


.product-image-editor img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.product-image-placeholder {
    text-align: center;
}


.product-image-placeholder strong,
.product-image-placeholder small {
    display: block;
}


.product-image-placeholder small {
    margin-top: 4px;

    color: var(--muted);

    font-size: 10px;
}


.admin-form-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;
}


.admin-field {
    margin-bottom: 13px;
}


.admin-field label {
    display: block;

    margin-bottom: 6px;

    font-size: 12px;
    font-weight: 900;
}


.admin-field input,
.admin-field select {
    width: 100%;

    padding: 11px;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: #fff;

    font-size: 15px;
}

.product-stock-info {
    margin: 5px 0 16px;

    padding: 11px;

    border-radius: 11px;

    background: #f1f4f7;
}


.product-stock-info small {
    display: block;

    margin-top: 3px;

    color: var(--muted);
}


.product-save-button {
    width: 100%;
}


/* =====================================================
   BAR - PRODUITS
===================================================== */

.products-zone {
    padding: 14px;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none;
}

.products-zone::-webkit-scrollbar {
    display: none;
}


/*
 * Catégories :
 * Bières
 * Softs
 * Snacks
 */
#productsGrid {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 16px;
}


.product-category {
    width: 100%;
}


.product-category-title {
    margin: 0 0 7px 2px;

    color: var(--navy);

    font-size: 15px;
    font-weight: 900;
}


/*
 * Produits d'une catégorie :
 * horizontal
 */
.product-category .products-grid {
    width: 100%;

    display: grid;
    
    grid-template-columns: repeat(4, 1fr);

    gap: 10px;
}


/*
 * CARD
 */
.product-card {
    position: relative;

    height: 148px;

    padding: 0;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #fff;

    overflow: hidden;

    text-align: left;

    display: flex;
    flex-direction: column;

    cursor: pointer;
}


.product-card:active {
    transform: scale(.98);
}


/*
 * Grande image comme sur la caisse foot.
 */
.product-image {
    width: 100%;
    height: 92px;

    flex: 0 0 92px;

    overflow: hidden;

    background: #f3f4f5;
}


.product-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/*
 * Nom
 */
.product-card > strong {
    display: block;

    padding: 7px 9px 0;

    font-size: 13px;
    font-weight: 900;

    line-height: 1.15;
}


/*
 * Prix + stock
 */
.product-bottom {
    margin-top: 2px;

    padding: 0 9px 7px;

    display: flex;
    align-items: end;
    justify-content: space-between;

    gap: 5px;
}


.product-bottom b {
    color: var(--navy);

    font-size: 17px;
    font-weight: 900;
}


.product-bottom small {
    color: var(--muted);

    font-size: 9px;

    white-space: nowrap;
}


/*
 * Quantité dans le panier
 */
.product-count {
    position: absolute;

    top: 6px;
    right: 6px;

    z-index: 5;

    min-width: 28px;
    height: 28px;

    padding: 0 7px;

    border-radius: 999px;

    display: none;
    place-items: center;

    color: #fff;
    background: var(--accent);

    font-size: 13px;
    font-weight: 900;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, .25);
}


.product-count.show {
    display: grid;
}

/* =====================================================
   ADMIN - STOCK
===================================================== */

.admin-stock {
    max-width: 950px;
    margin: 0 auto;
}


.admin-stock-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.stock-category-title {
    margin: 0 0 8px;

    color: var(--navy);

    font-size: 15px;
    font-weight: 900;
}


.stock-category-products {
    display: grid;
    gap: 8px;
}


.stock-product-row {
    width: 100%;

    display: grid;

    grid-template-columns:
        62px
        minmax(0, 1fr)
        90px
        90px;

    gap: 12px;

    align-items: center;

    padding: 9px 12px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #fff;

    text-align: left;

    cursor: pointer;
}


.stock-product-row:active {
    transform: scale(.995);
}


.stock-product-name strong {
    display: block;

    font-size: 15px;
}


.stock-product-name small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


.stock-product-value {
    text-align: right;
}


.stock-product-value strong {
    display: block;

    color: var(--navy);

    font-size: 24px;
    font-weight: 900;
}


.stock-product-value small {
    display: block;

    color: var(--muted);

    font-size: 10px;
}


.stock-product-action {
    padding: 8px 10px;

    border-radius: 9px;

    background: #edf1f5;

    color: var(--navy);

    text-align: center;

    font-size: 11px;
    font-weight: 900;
}


.stock-product-row.low-stock {
    border-color: #e0a54f;

    background: #fffaf2;
}


.stock-product-row.low-stock
.stock-product-value strong {
    color: #b66b00;
}


.product-stock-options {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;

    margin-bottom: 14px;
}


.product-stock-option {
    min-height: 72px;

    padding: 12px;

    display: flex;
    align-items: center;

    gap: 10px;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: #f8fafb;

    cursor: pointer;
}


.product-stock-option input {
    width: 20px;
    height: 20px;

    flex: 0 0 20px;

    accent-color: var(--navy);
}


.product-stock-option span,
.product-stock-option strong,
.product-stock-option small {
    display: block;
}


.product-stock-option strong {
    font-size: 12px;
}


.product-stock-option small {
    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;
}

/* =====================================================
   CHOIX BIERE
===================================================== */

.stock-choice-modal-card {
    width: min(560px, 90vw);

    text-align: left;
}


.stock-choice-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}


.stock-choice-button {
    min-height: 90px;

    padding: 10px;

    display: grid;

    grid-template-columns:
        70px minmax(0, 1fr);

    gap: 12px;

    align-items: center;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #fff;

    text-align: left;

    cursor: pointer;
}


.stock-choice-button:disabled {
    opacity: .4;

    cursor: default;
}


.stock-choice-image {
    width: 70px;
    height: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 10px;

    background: #f3f4f5;
}


.stock-choice-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


.stock-choice-info strong,
.stock-choice-info small {
    display: block;
}


.stock-choice-info strong {
    font-size: 15px;
    font-weight: 900;
}


.stock-choice-info small {
    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
}


.ticket-source {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;
}

/* =====================================================
   ADMIN - INVENTAIRE
===================================================== */

.admin-inventory {
    max-width: 950px;
    margin: 0 auto;
}


.inventory-list {
    display: grid;

    gap: 8px;
}


.inventory-row {
    display: grid;

    grid-template-columns:
        62px
        minmax(0, 1fr)
        120px
        80px;

    gap: 14px;

    align-items: center;

    padding: 10px 12px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #fff;
}


.inventory-product strong,
.inventory-product small {
    display: block;
}


.inventory-product strong {
    font-size: 15px;
}


.inventory-product small {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


.inventory-count label {
    display: block;

    margin-bottom: 4px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 800;
}


.inventory-count input {
    width: 100%;

    padding: 9px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: #fff;

    text-align: center;

    font-size: 17px;
    font-weight: 900;
}


.inventory-difference {
    min-width: 60px;

    padding: 9px;

    border-radius: 9px;

    text-align: center;

    font-size: 18px;
    font-weight: 900;
}


.inventory-difference.zero {
    color: var(--muted);

    background: #f1f3f5;
}


.inventory-difference.positive {
    color: #147344;

    background: #e9f8ef;
}


.inventory-difference.negative {
    color: #a52f2f;

    background: #fff0f0;
}

/* =====================================================
   ADMIN - SESSION
===================================================== */

.admin-session {
    max-width: 850px;
    margin: 0 auto;
}


.session-current-card,
.session-empty-card {
    padding: 24px;

    border: 1px solid var(--line);
    border-radius: 18px;

    background: #fff;
}


.session-empty-card {
    text-align: center;
}


.session-empty-card strong,
.session-empty-card small {
    display: block;
}


.session-empty-card small {
    margin-top: 5px;

    color: var(--muted);
}


.session-state-icon {
    margin-bottom: 8px;

    font-size: 36px;
}


.session-current-header h2 {
    margin:
        10px 0
        4px;
}


.session-current-header small {
    color: var(--muted);
}


.session-state-badge {
    display: inline-flex;

    padding:
        6px 10px;

    border-radius: 999px;

    background: #e9f8ef;
    color: #147344;

    font-size: 11px;
    font-weight: 900;
}


.session-state-badge.warning {
    background: #fff3dc;
    color: #a86800;
}


.session-current-stats {
    display: grid;

    grid-template-columns:
        1.4fr 1fr 1fr;

    gap: 10px;

    margin-top: 22px;
}


.session-stat {
    padding: 15px;

    border-radius: 13px;

    background: #f3f5f7;
}


.session-stat small,
.session-stat strong {
    display: block;
}


.session-stat small {
    margin-bottom: 4px;

    color: var(--muted);

    font-size: 11px;
}


.session-stat strong {
    font-size: 20px;
}


.session-stat-main strong {
    font-size: 27px;
}


.session-close-button {
    width: 100%;

    margin-top: 20px;
    padding: 13px;

    border: 0;
    border-radius: 11px;

    background: #a52f2f;
    color: #fff;

    font-weight: 900;

    cursor: pointer;
}


.session-close-modal-card {
    width: min(
        460px,
        90vw
    );

    text-align: left;
}


.session-close-summary {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin: 15px 0;

    padding: 16px;

    border-radius: 12px;

    background: #f3f5f7;
}


.session-close-summary strong {
    font-size: 24px;
}


.session-close-warning {
    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;
}


.session-close-actions {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;

    margin-top: 20px;
}


.session-cancel-button,
.session-confirm-close-button {
    padding: 12px;

    border: 0;
    border-radius: 10px;

    font-weight: 900;

    cursor: pointer;
}


.session-cancel-button {
    background: #edf1f5;
}


.session-confirm-close-button {
    background: #a52f2f;
    color: #fff;
}


/* TOAST APPLICATION */

.admin-toast {
    position: fixed;

    left: 50%;
    bottom: 24px;

    z-index: 9999;

    max-width: 90vw;

    padding:
        11px 18px;

    border-radius: 11px;

    background: #18232e;
    color: #fff;

    font-size: 13px;
    font-weight: 800;

    opacity: 0;
    pointer-events: none;

    transform:
        translate(
            -50%,
            20px
        );

    transition:
        .18s ease;
}


.admin-toast.show {
    opacity: 1;

    transform:
        translate(
            -50%,
            0
        );
}


.admin-toast.error {
    background: #a52f2f;
}


/* SESSION VISIBLE SUR ACCUEIL */

#openSessions.session-open {
    border: 2px solid #36a269;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #eefaf3
        );

    box-shadow:
        0 5px 18px
        rgba(20, 115, 68, .12);
}


#openSessions.session-old {
    border-color: #e49a24;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #fff6e7
        );
}


#sessionHomeStatus.open {
    color: #147344;

    font-weight: 900;
}


#sessionHomeStatus.warning {
    color: #a86800;

    font-weight: 900;
}


/* ATTENTES */

.session-pending-warning {
    margin-top: 18px;

    padding: 14px 16px;

    border: 1px solid #efc26f;
    border-radius: 12px;

    background: #fff6e7;
    color: #8a5800;
}


.session-pending-warning strong,
.session-pending-warning small {
    display: block;
}


.session-pending-warning strong {
    font-size: 14px;
}


.session-pending-warning small {
    margin-top: 4px;

    line-height: 1.4;
}


.session-close-button:disabled,
.session-close-button.disabled {
    background: #c8cdd2;

    color: #737b83;

    cursor: not-allowed;

    opacity: .75;
}

.session-current-card {
    border: 2px solid #36a269;

    box-shadow:
        0 5px 18px
        rgba(20, 115, 68, .10);
}


.session-state-badge {
    padding: 7px 12px;

    font-size: 12px;
}

/* =====================================================
   STOCK - MOUVEMENT RAPIDE
===================================================== */

.stock-movement-card {
    width: min(
        480px,
        92vw
    );
}


.stock-current-big {
    margin: 18px 0;

    padding: 18px;

    border-radius: 15px;

    background: #f3f5f7;

    text-align: center;
}


.stock-current-big small {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;
}


.stock-current-big strong {
    display: block;

    font-size: 40px;
    line-height: 1;
}


.stock-action-buttons {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 7px;

    margin-bottom: 18px;
}


.stock-action-button {
    padding:
        12px 5px;

    border:
        1px solid var(--line);

    border-radius: 11px;

    background: #fff;

    font-size: 12px;
    font-weight: 900;

    cursor: pointer;
}


.stock-action-button span {
    display: block;

    margin-bottom: 3px;

    font-size: 19px;
}


.stock-action-button.active {
    border-color: #1d6fdc;

    background: #edf5ff;

    color: #1256aa;
}


#stockMovementQuantity {
    width: 100%;

    padding: 13px;

    border:
        1px solid var(--line);

    border-radius: 11px;

    text-align: center;

    font-size: 25px;
    font-weight: 900;
}


.stock-result-preview {
    margin-top: 12px;

    padding: 11px;

    border-radius: 10px;

    background: #edf8f2;

    color: #147344;

    text-align: center;
}


.stock-result-preview strong {
    margin-left: 5px;

    font-size: 20px;
}


.stock-result-preview.invalid {
    background: #fff0f0;

    color: #a52f2f;
}


.stock-submit-button {
    width: 100%;

    margin-top: 15px;
}

/* =====================================================
   SESSION - VENTES
===================================================== */

.session-sales {
    margin-top: 24px;

    padding-top: 20px;

    border-top:
        1px solid var(--line);
}


.session-sales-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}


.session-sales-header > div:first-child strong,
.session-sales-header > div:first-child small {
    display: block;
}


.session-sales-header > div:first-child strong {
    font-size: 17px;
}


.session-sales-header > div:first-child small {
    margin-top: 2px;

    color: var(--muted);
}


.session-sales-items {
    text-align: right;
}


.session-sales-items small,
.session-sales-items strong {
    display: block;
}


.session-sales-items small {
    color: var(--muted);

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
}


.session-sales-items strong {
    margin-top: 2px;

    font-size: 20px;
}


.session-sales-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


.session-sale-card {
    overflow: hidden;

    border:
        1px solid var(--line);

    border-radius: 12px;

    background: #fff;
}


.session-sale-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;

    background: #f5f7f9;
}


.session-sale-header > div {
    display: flex;

    align-items: center;

    gap: 8px;
}


.session-sale-total {
    font-size: 16px;
}


.session-payment-badge {
    padding: 4px 7px;

    border-radius: 7px;

    font-size: 10px;
    font-weight: 900;
}


.session-payment-badge.cash {
    background: #edf1f5;

    color: #46515d;
}


.session-payment-badge.sumup {
    background: #fff1e4;

    color: #a95600;
}


.session-sale-lines {
    padding:
        3px 12px;
}


.session-sale-line {
    display: grid;

    grid-template-columns:
        32px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 7px;

    padding:
        8px 0;

    border-bottom:
        1px solid #edf0f3;
}


.session-sale-line:last-child {
    border-bottom: 0;
}


.session-sale-qty {
    color: var(--navy);

    font-weight: 900;
}


.session-sale-product strong,
.session-sale-product small {
    display: block;
}


.session-sale-product strong {
    font-size: 13px;
}


.session-sale-product small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}


.session-sale-line-total {
    font-size: 12px;
    font-weight: 800;
}


.session-sales-empty {
    padding:
        22px 12px;

    border:
        1px dashed var(--line);

    border-radius: 11px;

    color: var(--muted);

    text-align: center;

    font-size: 12px;
}


.session-sales-empty.error {
    color: #a52f2f;

    background: #fff0f0;
}


/* PRODUITS VENDUS */

.session-products-block {
    margin-top: 22px;
}


.session-products-block h3 {
    margin:
        0 0 9px;

    font-size: 15px;
}


.session-products-list {
    border:
        1px solid var(--line);

    border-radius: 12px;

    overflow: hidden;

    background: #fff;
}


.session-product-row {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;

    padding:
        10px 12px;

    border-bottom:
        1px solid #edf0f3;
}


.session-product-row:last-child {
    border-bottom: 0;
}


.session-product-row > div > strong {
    font-size: 13px;
}


.session-product-qty {
    min-width: 35px;

    color: var(--navy);

    text-align: right;

    font-size: 18px;
}


.session-product-sources {
    margin-top: 4px;
}


.session-product-sources small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}

.admin-sales {
    max-width: 1200px;
    margin: 0 auto;
}


.sales-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}


.sales-sessions,
.sales-detail {
    min-width: 0;
}


.sales-sessions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.sales-session-row {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}


.sales-session-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}


.sales-session-main strong,
.sales-session-main small {
    display: block;
}


.sales-session-main small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}


.sales-open-badge {
    height: fit-content;
    padding: 4px 7px;
    border-radius: 7px;
    background: #e9f8ef;
    color: #147344;
    font-size: 10px;
    font-weight: 900;
}


.sales-session-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px;
}


.sales-session-stats strong {
    margin-left: auto;
    color: var(--text);
    font-size: 15px;
}


.sales-detail {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}


.sales-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: flex-start;
}


.sales-detail-header h2 {
    margin: 0;
}


.sales-detail-header small {
    color: var(--muted);
}


.sales-big-total {
    font-size: 26px;
}


.sales-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 18px;
}


.sales-summary > div {
    padding: 12px;
    border-radius: 11px;
    background: #f3f5f7;
}


.sales-summary small,
.sales-summary strong {
    display: block;
}


.sales-summary small {
    color: var(--muted);
    font-size: 10px;
}


.sales-summary strong {
    margin-top: 3px;
    font-size: 16px;
}


.sales-title {
    margin: 22px 0 9px;
    font-size: 15px;
}


.sales-products,
.sales-tickets {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}


.sales-product-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}


.sales-product-row:last-child {
    border-bottom: 0;
}


.sales-product-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}


.sales-ticket {
    border-bottom: 1px solid var(--line);
}


.sales-ticket:last-child {
    border-bottom: 0;
}


.sales-ticket-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 9px 12px;
    background: #f5f7f9;
    font-size: 11px;
}


.sales-ticket-line {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
    padding: 8px 12px;
}


.sales-ticket-line small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}


.sales-empty {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}


@media (
    max-width: 800px
) {

    .sales-layout {
        grid-template-columns: 1fr;
    }


    .sales-summary {
        grid-template-columns:
            1fr 1fr;
    }
}


.admin-sales {
    max-width: 1200px;
    margin: 0 auto;
}


.sales-layout {
    display: grid;
    grid-template-columns:
        320px
        minmax(0, 1fr);

    gap: 18px;

    align-items: start;
}


/* CALENDRIER */

.sales-calendar {
    padding: 14px;

    border:
        1px solid var(--line);

    border-radius: 16px;

    background: #fff;
}


.sales-calendar-header {
    display: grid;

    grid-template-columns:
        38px
        1fr
        38px;

    align-items: center;

    gap: 6px;

    margin-bottom: 14px;
}


.sales-calendar-header strong {
    text-align: center;

    font-size: 15px;
}


.sales-calendar-header button {
    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 10px;

    background: #eef2f6;

    color: var(--navy);

    font-size: 24px;

    cursor: pointer;
}


.sales-calendar-weekdays,
.sales-calendar-days {
    display: grid;

    grid-template-columns:
        repeat(
            7,
            1fr
        );

    gap: 4px;
}


.sales-calendar-weekdays {
    margin-bottom: 5px;
}


.sales-calendar-weekdays span {
    padding: 4px 0;

    color: var(--muted);

    text-align: center;

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
}


.sales-calendar-day {
    position: relative;

    aspect-ratio: 1;

    border: 0;
    border-radius: 9px;

    background: transparent;

    color: #9ca4ad;

    font-weight: 700;
}


.sales-calendar-day:disabled {
    opacity: 1;
}


.sales-calendar-day.has-sales {
    background: #eef2f6;

    color: var(--navy);

    cursor: pointer;
}


.sales-calendar-day.has-sales:hover {
    background: #e2e8ee;
}


.sales-calendar-day.selected {
    color: #fff;

    background: var(--navy);
}


.sales-calendar-day i {
    position: absolute;

    left: 50%;
    bottom: 5px;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--accent);

    transform:
        translateX(-50%);
}


.sales-calendar-day.selected i {
    background: #fff;
}


.sales-calendar-day.empty {
    display: block;
}


.sales-calendar-loading {
    grid-column:
        1 / -1;

    padding: 25px;

    color: var(--muted);

    text-align: center;
}


/* DETAIL */

.sales-detail {
    padding: 18px;

    border:
        1px solid var(--line);

    border-radius: 16px;

    background: #fff;
}


.sales-detail-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;
}


.sales-detail-header small {
    color: var(--muted);

    font-size: 11px;
}


.sales-detail-header h2 {
    margin: 3px 0 0;

    font-size: 20px;
}


.sales-big-total {
    font-size: 28px;
}


.sales-summary {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            1fr
        );

    gap: 8px;

    margin-top: 18px;
}


.sales-summary > div {
    padding: 12px;

    border-radius: 11px;

    background: #f3f5f7;
}


.sales-summary small,
.sales-summary strong {
    display: block;
}


.sales-summary small {
    color: var(--muted);

    font-size: 10px;
}


.sales-summary strong {
    margin-top: 3px;

    font-size: 16px;
}


/* PRODUITS */

.sales-products-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-top: 22px;

    padding: 0 12px 7px;

    color: var(--muted);

    font-size: 10px;

    text-transform: uppercase;
}


.sales-products-header > div {
    display: grid;

    grid-template-columns:
        50px
        90px;

    text-align: right;
}


.sales-products {
    overflow: hidden;

    border:
        1px solid var(--line);

    border-radius: 12px;
}


.sales-product-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 11px 12px;

    border-bottom:
        1px solid #edf0f3;
}


.sales-product-row:last-child {
    border-bottom: 0;
}


.sales-product-values {
    display: grid;

    grid-template-columns:
        50px
        90px;

    align-items: center;

    text-align: right;
}


.sales-product-values span {
    color: var(--muted);
}


.sales-product-values strong {
    font-size: 14px;
}


.sales-empty {
    padding: 35px 15px;

    color: var(--muted);

    text-align: center;
}


@media (
    max-width: 800px
) {

    .sales-layout {
        grid-template-columns:
            1fr;
    }


    .sales-summary {
        grid-template-columns:
            1fr 1fr;
    }
}

/* =====================================================
   BAR - CATEGORIES SWIPE
===================================================== */

.products-zone {
    min-width: 0;
    min-height: 0;

    padding: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* BIÈRES / SOFTS / SNACKS */

.product-category-tabs {
    flex: 0 0 auto;

    display: grid;
    grid-template-columns:
        repeat(3, 1fr);

    padding:
        10px 14px 8px;

    gap: 6px;

    background: var(--bg);

    border-bottom:
        1px solid var(--line);
}


.product-category-tab {
    position: relative;

    padding:
        10px 8px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    color: var(--muted);

    font-size: 13px;
    font-weight: 900;

    cursor: pointer;
}


.product-category-tab.active {
    color: var(--navy);

    background: #fff;

    box-shadow:
        0 1px 5px
        rgba(0, 0, 0, .08);
}


.product-category-tab.active::after {
    content: '';

    position: absolute;

    left: 25%;
    right: 25%;
    bottom: 3px;

    height: 3px;

    border-radius: 10px;

    background: var(--accent);
}


/* TRACK DES 3 PAGES */

#productsGrid {
    flex: 1;

    min-width: 0;
    min-height: 0;

    width: 100%;

    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;

    align-items: stretch !important;

    gap: 0 !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    scroll-snap-type:
        x mandatory;

    scroll-behavior:
        smooth;

    overscroll-behavior-x:
        contain;

    scrollbar-width:
        none;

    -webkit-overflow-scrolling:
        touch;
}


#productsGrid::-webkit-scrollbar {
    display: none;
}


/* UNE CATEGORIE = UNE PAGE */

#productsGrid >
.product-category {
    flex:
        0 0 100% !important;

    width:
        100% !important;

    min-width:
        100% !important;

    max-width:
        100% !important;

    min-height: 0;

    margin:
        0 !important;

    padding:
        14px;

    overflow-x:
        hidden;

    overflow-y:
        auto;

    scroll-snap-align:
        start;

    scroll-snap-stop:
        always;
}


/*
 * Le titre est maintenant
 * dans les onglets du dessus.
 */
#productsGrid
.product-category-title {
    display:
        none !important;
}


/*
 * Plus de scroll horizontal
 * des produits eux-mêmes.
 *
 * Ils remplissent la page.
 */
#productsGrid
.product-category
.products-grid {
    width:
        100% !important;

    display:
        grid !important;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap:
        10px !important;

    overflow:
        visible !important;

    padding:
        0 !important;
}


/* CARD */

#productsGrid
.product-category
.product-card {
    width:
        100% !important;

    min-width:
        0 !important;

    max-width:
        none !important;

    flex:
        none !important;
}
.product-category-tabs {
    display: none !important;
}

.admin-product-category {
    display: grid;
    gap: 9px;
}


.admin-product-category
+ .admin-product-category {
    margin-top: 20px;
}


.admin-product-category-title {
    margin:
        0 0 2px;

    padding:
        0 2px 8px;

    border-bottom:
        2px solid var(--line);

    color:
        var(--navy);

    font-size:
        16px;

    font-weight:
        900;
}


.admin-product-category-list {
    display: grid;
    gap: 9px;
}



/* =====================================================
   CASIER
===================================================== */

.crate-modal-card {
    width: min(620px, 94vw);
    max-height: 90vh;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.crate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 14px;
}


.crate-header h2 {
    margin: 0 0 3px;
}


.crate-header small {
    color: var(--muted);

    font-weight: 700;
}


.crate-count {
    padding: 8px 11px;

    border-radius: 10px;

    background: #edf1f5;

    color: var(--navy);

    white-space: nowrap;
}


.crate-count.invalid {
    color: #a52f2f;

    background: #fff0f0;
}


.crate-products {
    min-height: 0;

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 14px;

    overflow-y: auto;
}
.crate-column {
    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;
}


.crate-column h3 {
    flex: 0 0 auto;

    margin: 0 0 8px;
    padding-bottom: 7px;

    border-bottom: 2px solid var(--line);

    color: var(--navy);

    font-size: 14px;
    font-weight: 900;
}


.crate-column-products {
    flex: 1;
    min-height: 0;

    display: grid;
    grid-auto-rows: max-content;
    align-content: start;

    gap: 7px;

    overflow-y: auto;
    overflow-x: hidden;
}

.crate-product-row {
    min-height: 52px;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr) auto;

    align-items: center;

    gap: 12px;

    padding: 8px 10px;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: #fff;    
}


.crate-product-row.insufficient {
    border-color: #e2a0a0;

    background: #fff6f6;
}


.crate-product-info {
    min-width: 0;
}


.crate-product-info strong,
.crate-product-info small {
    display: block;
}


.crate-product-info small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 11px;
}


.crate-product-controls {
    display: grid;

    grid-template-columns:
        36px 30px 36px;

    align-items: center;

    gap: 5px;

    text-align: center;
}


.crate-product-controls button {
    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 10px;

    background: #edf1f5;

    color: var(--navy);

    font-size: 20px;
    font-weight: 900;

    cursor: pointer;
}


.crate-product-controls button:disabled {
    opacity: .3;

    cursor: default;
}


.crate-product-base-qty {
    min-width: 35px;

    text-align: center;

    font-size: 18px;
}


.crate-stock-message {
    margin-top: 9px;

    padding: 9px 11px;

    border-radius: 10px;

    color: #a52f2f;

    background: #fff0f0;

    font-size: 12px;
    font-weight: 800;
}


.crate-summary {
    display: grid;
    gap: 6px;

    margin-top: 14px;

    padding: 11px 0;

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}


.crate-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}


.crate-summary span {
    color: var(--muted);

    font-size: 12px;
}


.crate-price-field {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 13px;

    font-weight: 900;
}


.crate-price-field > div {
    display: flex;
    align-items: center;

    gap: 5px;
}


.crate-price-field input {
    width: 105px;

    padding: 10px;

    border: 1px solid var(--line);
    border-radius: 10px;

    text-align: right;

    font-size: 17px;
    font-weight: 900;
}


.crate-actions {
    display: grid;

    grid-template-columns:
        1fr 1.5fr;

    gap: 8px;

    margin-top: 14px;
}


.crate-actions .modal-button {
    margin-top: 0;
}


.ticket-line-crate {
    cursor: pointer;
}

.crate-products {
    min-height: 0;
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 14px;

    overflow: hidden;
}


.crate-selected-base {
    flex: 0 0 auto;
}


.crate-selected-base > span {
    display: block;

    margin-bottom: 6px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 800;
}


.crate-selected-base
.crate-product-row {
    background: #f4f6f8;

    border-width: 2px;
}


.crate-columns {
    flex: 1;
    min-height: 0;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 14px;

    overflow: hidden;
}

.sales-product-name {
    min-width: 0;
}


.sales-product-name strong,
.sales-product-composition {
    display: block;
}


.sales-product-composition {
    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
}