  :root{
    --sheet-radius: 22px;
    --sheet-shadow: 0 -12px 36px rgba(0,0,0,.18);
    --sheet-bg: #ffffff;
    --sheet-line: #eceef2;
    --sheet-handle: #cfd3da;
    --sheet-overlay: rgba(0,0,0,.42);
    --sheet-transition: .22s cubic-bezier(.2,.8,.2,1);
    --sheet-half-top: 50dvh;

    --sheet-form-width: 680px;
    --sheet-form-min-width: 420px;
    --sheet-form-max-width: calc(100vw - 24px);
    --sheet-form-min-height: 320px;
    --sheet-form-max-height: calc(100dvh - 10px);
  }

  .sheet-overlay{
    position: fixed;
    inset: 0;
    background: var(--sheet-overlay);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .sheet-overlay.show{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sheet{
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: 100dvh;
    background: var(--sheet-bg);
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    box-shadow: var(--sheet-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: none;
    will-change: transform, opacity;
    transform: translateY(100%);
    opacity: 0;
    transition: transform var(--sheet-transition), opacity .18s ease;
  }

  .sheet.show{
    opacity: 1;
  }

  .sheet.full.show{
    transform: translateY(0);
  }

  .sheet.half.show{
    transform: translateY(var(--sheet-half-top));
  }

  @media (min-width: 901px){
    body.has-sidebar-layout .sheet-overlay{
      left: var(--app-sidebar-width, 280px);
    }

    body.has-sidebar-layout .sheet.full:not(.form){
      left: var(--app-sidebar-width, 280px);
      width: auto;
      max-width: none;
    }
  }

  .sheet.form.show{
    transform: translateY(0);
  }

  .sheet.form.half.show{
    transform: translateY(var(--sheet-half-top));
  }

  .sheet-header{
    flex-shrink: 0;
    padding: 6px 12px;
    border-bottom: 1px solid var(--sheet-line);
    background: #fff;
    cursor: grab;
    user-select: none;
  }

  .sheet-header:active{
    cursor: grabbing;
  }

  .sheet-handle{
    width: 42px;
    height: 9px;
    border-radius: 999px;
    margin: 1px auto 6px;
   background: linear-gradient(180deg, #9e0000 0%, #9e0000 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(0,0,0,.08);
  }

  .sheet-bar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 30px;
  }

  .sheet-title{
    margin: 0;
    font-size: 18px;
    font-weight: bolder;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sheet-close{
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .sheet-body{
    flex: 1;
    overflow: auto;
    padding: 14px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
  }

  .sheet-footer{
    flex-shrink: 0;
    padding: 12px 14px 16px;
    border-top: 1px solid var(--sheet-line);
    background: #fff;
  }

  .sheet-resizer{
    display: none;
  }

  body.sheet-open{
    overflow: hidden;
  }

  @media (min-width: 900px){
    .sheet.form{
      left: 50%;
      right: auto;
      bottom: 0;
      width: min(var(--sheet-form-width), calc(100vw - 32px));
      min-width: var(--sheet-form-min-width);
      max-width: var(--sheet-form-max-width);
      height: 100dvh;
      min-height: var(--sheet-form-min-height);
      max-height: var(--sheet-form-max-height);
      border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
      transform: translate(-50%, 100%);
      opacity: 0;
      overflow: hidden;
    }

    .sheet.form.show{
      transform: translate(-50%, 0);
      opacity: 1;
    }

    .sheet.form.full.show{
      transform: translate(-50%, 0);
    }

    .sheet.form.half.show{
      transform: translate(-50%, var(--sheet-half-top));
    }

    .sheet.form .sheet-resizer{
      display: block;
      position: absolute;
      right: 0;
      bottom: 0;
      width: 24px;
      height: 24px;
      cursor: nwse-resize;
      z-index: 5;
    }

    .sheet.form .sheet-resizer::before{
      content: "";
      position: absolute;
      right: 6px;
      bottom: 6px;
      width: 12px;
      height: 12px;
      background:
        linear-gradient(135deg, transparent 0 45%, #cbd5e1 45% 55%, transparent 55% 100%),
        linear-gradient(135deg, transparent 0 62%, #94a3b8 62% 72%, transparent 72% 100%);
      opacity: .95;
    }
  }
 
    /* .sheetTabs{
      height:76px;
      background:#fff;
      border-top:1px solid #ddd;
      display:grid;
      grid-template-columns:repeat(5,1fr);
      width: inherit;
    } */

    /* give space so content doesn't hide */
    .sheet .sheet-body{
      padding-bottom:90px;
    }

    .sheetTabs{
        position:fixed;
        left:50%;
        transform:translateX(-50%);
        bottom:0;
        width:100%;
        height:84px;
        background:#fff;
        border-top:1px solid #ddd;
        display:flex;
        flex-wrap:nowrap;
        justify-content:center;
        align-items:center;
        gap:6px;
        padding:0 6px;
        box-shadow:0 -6px 18px rgba(0,0,0,.06);
        z-index:10;
      }

      .sheetTabs.sales-orders-tabs{
        grid-template-columns:repeat(6, minmax(0, 1fr));
      }
      
      .sheet-footer{
        flex-shrink: 0;
        padding: 12px 14px 16px;
        border-top: 1px solid var(--sheet-line);
        background: #fff;

        display: flex;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px;
      }   
    .tab-btn{
      border:none;
      background:transparent;
      display:flex;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      flex:1 1 0;
      max-width:160px;
      min-width:0;
      gap:5px;
      color:#7a0000;
      font-size:10px;
      font-weight:800;
      cursor:pointer;
    }

    .tab-btn > .tab-icon{
      display:flex;
      align-items:center;
      justify-content:center;
      margin:0 auto;
    }

    .tab-btn > span:last-child{
      display:block;
      width:100%;
      text-align:center;
      line-height:1.15;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .tab-icon{
      width:32px;
      height:32px;
      border-radius:50%;
      border:2px solid #7a0000;
      display:flex;
      align-items:center;
      justify-content:center;
      font-size:16px;
      font-weight:700;
      background:#fff;
    }

    .tab-btn.active{
      border-radius: 30%;
      
    }

    .tab-btn.active .tab-icon{
      border:4px solid #2f7a00;
      color: #2f7a00;
      width:38px;
      height:38px;
      box-shadow:0 0 0 4px rgba(58, 213, 7, 0.08);
    }

    .tab-btn.active span{
      color: #2f7a00;
      font-weight: bolder;
    }

    @media (max-width: 640px){
      
      .sheetTabs{
        width:100%;
        height:80px;
        border-radius:0;
        gap:4px;
        padding:0 4px;
      }

      .tab-btn{
        font-size:8px;
      }

      .tab-icon{
        width:28px;
        height:28px;
        font-size:14px;
      }

      .tab-btn.active .tab-icon{
        width:34px;
        height:34px;
      }
    }
/* FAB WRAPPER */
.fab{
  position:fixed;
  bottom:calc(84px + 5.25rem);
  z-index:20;
  display:flex;
  flex-direction:column;
  pointer-events:none;
}

.filter-fab{
  position:fixed;
  bottom:calc(84px + 1rem);
  z-index:20;
  display:flex;
  flex-direction:column;
  pointer-events:none;
}

.fab.filter-fab{
  bottom:calc(84px + 1rem);
  z-index:9997;
}

/* RIGHT FLOAT */
.fab.end{
  right:2%;
  align-items:flex-end;
}

/* LEFT FLOAT */
.fab.start{
  left:2%;
  align-items:flex-start;
}

/* MAIN FAB BUTTON */
.fab-toggle{
  width:52px;
  height:52px;
  border:2px solid #8b0000;
  border-radius:50%;
  background:#ffffff;
  color:#8b0000;
  font-size:22px;
  font-weight:700;
  cursor:pointer;
  position:relative;
  z-index:9999;
  box-shadow:0 10px 24px rgba(0,0,0,.15);
  pointer-events:auto;
}

.fab.filter-fab .fab-toggle{
  width:52px;
  height:52px;
}

.fab.filter-fab .fab-toggle i{
  pointer-events:none;
}

/* ACTION MENU */
.fab-menu{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:12px;
  position:relative;
  z-index:9999;
  opacity:0;
  visibility:hidden;
  transform:translateY(10px);

  transition:.25s ease;
  pointer-events:none;
}

/* ALIGN ITEMS BASED ON POSITION */
.fab.end .fab-menu{
  align-items:flex-end;
}

.fab.start .fab-menu{
  align-items:flex-start;
}

/* SHOW MENU */
.fab-menu.show{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  pointer-events:auto;
}

.input{
  border:1px solid #8b0000;
}

/* ACTION BUTTON */
.fab-item{
  border:none;
  border-radius:999px;
  background:#8b0000;
  color:#fff;
  padding:10px 16px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
  position:relative;
  z-index:9999;
  box-shadow:0 8px 20px rgba(0,0,0,.2);
  pointer-events:auto;
}

/* MOBILE */
@media (max-width:600px){

  .fab.end{ right:3%; }
  .fab.start{ left:3%; }

  .fab{ bottom:24%; }
  .fab.filter-fab{ bottom:16%; }

  .fab-toggle{
    width:48px;
    height:48px;
    font-size:20px;
  }

  .fab.filter-fab .fab-toggle{
    width:48px;
    height:48px;
    font-size:20px;
  }

}

    .loader-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 2147483646;
        pointer-events: auto;
        display: none;
    }

    .loader {
        position: fixed;
        inset: 0;
        background: linear-gradient(135deg,#a802020d,#d7959d6f,#f0706924);
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        z-index: 2147483647;
        pointer-events: none;
    }
    .container {
      max-width: 1280px;
      margin: 0 auto;
    }

    /* h1 {
      text-align: center;
      font-size: 2.8rem;
      font-weight: 700;
      margin-bottom: 50px;
      background: linear-gradient(90deg, #c0263e, #f5b3b8);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    } */

    .menu-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
      gap: 24px;
    }

    .card {
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(192, 38, 62, 0.2);
      border-radius: 20px;
      padding: 28px;
      transition: all 0.4s ease;
      backdrop-filter: blur(12px);
      display: flex;
      align-items: flex-start;
      gap: 20px;
      text-decoration: none;
      color: inherit;
      position: relative;
      overflow: hidden; 
      box-shadow: 0 20px 40px rgba(192, 38, 62, 0.25);

    }

    .card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background: linear-gradient(90deg, #c0263e, #e11d48);
      transform: scaleX(0);
      transition: transform 0.4s ease;
    }

    .card:hover {
      transform: translateY(-12px);
      background: rgba(255,255,255,0.09);
      border-color: #c0263e;
      box-shadow: 0 20px 40px rgba(192, 38, 62, 0.25);
    }

    .card:hover::before {
      transform: scaleX(1);
    }

    .icon {
      width: 68px;
      height: 68px;
      background: rgba(192, 38, 62, 0.15);
      border-radius: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 32px;
      flex-shrink: 0;
      transition: all 0.3s ease;
    }

    .card:hover .icon {
      background: #c0263e;
      transform: scale(1.1) rotate(8deg);
      color: white;
    }

    .content h3 {
      margin: 0 0 8px 0;
      font-size: 1.35rem;
      font-weight: 600;
      color: #f8d7d7;
    }

    .content p {
      margin: 0;
      color: #d4a3a3;
      line-height: 1.6;
      font-size: 1rem;
    }

    .arrow {
      margin-left: auto;
      font-size: 28px;
      color: #c0263e;
      opacity: 0.6;
      transition: all 0.3s ease;
    }

    .card:hover .arrow {
      opacity: 1;
      transform: translateX(8px);
    }

.popoverContainer{
  position:relative;
  /* display:inline-block; */
}

.popoverButton{
  width:36px;
  height:36px;
  border:none;
  border-radius:10px;
  background:#f5f7fb;
  font-size:20px;
  cursor:pointer;
  display:grid;
  place-items:center;
}

.popover{
  position:absolute;
  min-width:170px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  box-shadow:0 16px 40px rgba(0,0,0,.12);
  padding:6px;
  display:none;
  z-index:9999;
}

.popover.show{
  display:block;
}

.popover-item{
  width:100%;
  border:none;
  background:transparent;
  padding:10px 12px;
  text-align:left;
  border-radius:10px;
  font-size:14px;
  cursor:pointer;
  font-weight: bolder;
}

.popover-item:hover{
  background:#0a4b07f5;
  color:white;
}

.popover-item.danger{
  color:#dc2626;
}

/* SWITCHES  */
.switch{
  position:relative;
  display:inline-block;
  width:70px;
  height:26px;
}

.switch input{
  opacity:0;
  width:0;
  height:0;
}

.slider{
  position:absolute;
  inset:0;
  cursor:pointer;
  border-radius:999px;
  background:#d1d5db;
  transition:.2s;
  font-family:Arial, sans-serif;
}

/* OFF text */
.slider::after{
  content:"OFF";
  position:absolute;
  right:15px;
  top:50%;
  transform:translateY(-50%);
  font-size:10px;
  font-weight:700;
  color:rgb(199, 8, 14);
  letter-spacing:.2px;
  transition:.3s;
}

/* Thumb */
.slider::before{
  content:"";
  position:absolute;
  height:20px;
  width:20px;
  left:4px;
  top:4px;
  border-radius:50%;
  background:#e20808;
  box-shadow:0 2px 6px rgba(0,0,0,.25);
  transition:.3s;
}

/* ON state (green + glow) */
.switch input:checked + .slider{
  background:#22c55e;
  box-shadow:0 0 10px rgba(34,197,94,.6);
}

/* Move thumb */
.switch input:checked + .slider::before{
  transform:translateX(34px);
}

/* ON text */
.switch input:checked + .slider::after{
  content:"ON";
  left:10px;
  right:auto;
  color:#fff;
}
