body{
    margin:0;
    padding:0;
    font-family:Arial,sans-serif;
    background:#f5f5f5;
}

.container{
    padding:20px;
}

.search-section{
    position:relative;
    margin-bottom:20px;
}

#searchBar{
    width:100%;
    padding:15px;
    font-size:18px;
    border:none;
    border-radius:10px;
    box-sizing:border-box;
}

#searchResults{
    background:white;
    border-radius:10px;
    margin-top:5px;
    overflow:hidden;
    box-shadow:0 2px 10px rgba(0,0,0,0.1);
}

.result-item{
    padding:15px;
    cursor:pointer;
    border-bottom:1px solid #eee;
}

.result-item:hover{
    background:#f0f0f0;
}

.cards-container{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
    gap:15px;
}

.card{
    background:white;
    padding:30px 20px;
    border-radius:15px;
    text-align:center;
    font-size:18px;
    font-weight:bold;
    cursor:pointer;
    box-shadow:0 2px 10px rgba(0,0,0,0.1);
}

.popup-overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    display:flex;
    justify-content:center;
    align-items:center;
    padding:20px;
    box-sizing:border-box;
    z-index:9999;
}

.popup-box{
    background:white;
    padding:20px;
    border-radius:10px;
    width:90%;
    max-width:500px;
    max-height:90vh;
    overflow-y:auto;
    box-sizing:border-box;
    position:relative;
    overflow:hidden;
}

.popup-box h2{
    margin-top:0;
}

.popup-box input{
    width:100%;
    padding:12px;
    margin-bottom:15px;
    box-sizing:border-box;
}

.popup-box button{
    width:100%;
    padding:12px;
    background:black;
    color:white;
    border:none;
    border-radius:10px;
    cursor:pointer;
}

.popup-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

#closePopup{
    font-size:28px;
    cursor:pointer;
}

.qty-container{
    display:flex;
    align-items:center;
    margin-bottom:15px;
    border:1px solid #ccc;
    border-radius:12px;
    overflow:hidden;
    height:55px;
}

.qty-container button{
    width:60px;
    height:100%;
    border:none;
    background:black;
    color:white;
    font-size:28px;
    cursor:pointer;
    font-weight:bold;
}

.qty-container button:active{
    background:#333;
}

.qty-container input{
    flex:1;
    height:100%;
    border:none;
    text-align:center;
    font-size:22px;
    outline:none;
}

.qty-container button:active{
    background:#ddd;
}

#unitText{
    text-align:center;
    margin-bottom:15px;
    color:#666;
}

#stockText{
    text-align:center;
    margin-bottom:20px;
    font-weight:bold;
    color:#222;
}

.result-icon{
    margin-right:10px;
    font-size:18px;
}

.stock-text{
    color:#666;
    font-size:14px;
    margin-left:10px;
}

#groupItemsContainer{
    margin-bottom:20px;
}

.group-item{
    padding:12px;
    border-radius:10px;
    margin-bottom:10px;
}

.stock-ok{
    background:#e8f7e8;
}

.stock-low{
    background:#ffe8e8;
}

.group-stock{
    font-size:14px;
    margin-top:5px;
}

.card-link{
    text-decoration:none;
    color:inherit;
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.materials-table{
    width:100%;
    border-collapse:collapse;
}

.materials-table th,
.materials-table td{
    border:1px solid #ddd;
    padding:12px;
    text-align:left;
}

.materials-table th{
    background:#f5f5f5;
}

.low-stock{
    background:#ffe5e5;
}

#materialsSearch{
    width:100%;
    padding:12px;
    margin-bottom:20px;
    border:1px solid #ddd;
    border-radius:6px;
}

.page-title-row{
    display:flex;
    align-items:center;
    gap:15px;
}

.back-btn{
    text-decoration:none;
    font-size:18px;
    color:black;
}

.page-search-input{
    width:100%;
    padding:14px;
    border:1px solid #ddd;
    border-radius:8px;
    font-size:16px;
    box-sizing:border-box;
    margin-bottom:15px;
}

.top-bar{
    display:flex;
    justify-content:flex-end;
    margin-bottom:20px;
}


.admin-btn{
    text-decoration:none;
    background:black;
    color:white;
    padding:10px 16px;
    border-radius:8px;
}


.cards-grid{
    display:grid;
    grid-template-columns:
    repeat(auto-fit, minmax(220px, 1fr));
    gap:20px;
}

.groups-layout{
    display:grid;
    grid-template-columns:300px 1fr;
    gap:20px;
    margin-top:20px;
}


.groups-sidebar{
    border:1px solid #ddd;
    border-radius:10px;
    padding:15px;
}


.group-details{
    border:1px solid #ddd;
    border-radius:10px;
    padding:15px;
    min-height:500px;
}


.groups-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
}


.group-item{
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
    margin-bottom:10px;
    cursor:pointer;
}


.group-item:hover{
    background:#f5f5f5;
}

.product-item{
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
    margin-bottom:10px;
    cursor:pointer;
}


.product-item:hover{
    background:#f5f5f5;
}

.product-dimensions-list{
    margin-top:20px;
}


.product-dimension-item{
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
    margin-bottom:10px;
    cursor:pointer;
}


.product-dimension-item:hover{
    background:#f5f5f5;
}

.dimension-options-list{
    margin-top:20px;
}


.dimension-option-item{
    padding:12px;
    border:1px solid #ddd;
    border-radius:8px;
    margin-bottom:10px;
    cursor:pointer;
}


.dimension-option-item:hover{
    background:#f5f5f5;
}

.products-cards-grid{
    display:grid;
    grid-template-columns:
    repeat(auto-fill, minmax(250px, 1fr));
    gap:20px;
    margin-top:20px;
}


.product-card{
    border:1px solid #ddd;
    border-radius:12px;
    padding:20px;
    background:#fff;
}


.product-card h3{
    margin-bottom:20px;
}


.product-card-actions{
    display:flex;
    gap:10px;
}


.product-card-actions button{
    flex:1;
    padding:10px;
    border:none;
    border-radius:8px;
    cursor:pointer;
}

.dimension-option-item-row{
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:10px;
}


.option-actions{
    display:flex;
    gap:5px;
}


.option-actions button{
    padding:8px 12px;
    border:none;
    border-radius:6px;
    cursor:pointer;
}

.product-dimension-item-row{
    display:flex;
    gap:10px;
    align-items:center;
    margin-bottom:10px;
}


.dimension-actions{
    display:flex;
    gap:5px;
}


.dimension-actions button{
    padding:8px 12px;
    border:none;
    border-radius:6px;
    cursor:pointer;
}

.option-tree-card{
    border:1px solid #ddd;
    border-radius:10px;
    margin-bottom:15px;
    overflow:hidden;
}


.option-tree-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px;
    background:#f8f8f8;
}


.option-left{
    display:flex;
    align-items:center;
    gap:10px;
}


.option-toggle{
    cursor:pointer;
    font-weight:bold;
}


.option-tree-body{
    padding:15px;
}

.group-code{
    font-size:12px;
    color:#777;
    margin-bottom:4px;
}

.group-item.active,
.product-dimension-item.active{
    background:#e8f0ff;
    border-radius:8px;
}

.group-top-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
}

.issue-cart-section{
    margin-top:30px;
    background:#fff;
    border-radius:12px;
    padding:20px;
}


.cart-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}


.cart-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px;
    border:1px solid #eee;
    border-radius:10px;
    margin-bottom:10px;
}


.cart-item-left{
    display:flex;
    flex-direction:column;
    gap:4px;
}


.cart-code{
    font-size:12px;
    color:#777;
}


.cart-actions{
    display:flex;
    align-items:center;
    gap:10px;
}


.cart-actions button{
    width:30px;
    height:30px;
    border:none;
    border-radius:6px;
    cursor:pointer;
}


.empty-cart-text{
    color:#777;
}

.issue-cart-footer{
    margin-top:20px;
    text-align:right;
}


#issueCartBtn{
    padding:12px 20px;
    border:none;
    border-radius:10px;
    cursor:pointer;
    font-size:16px;
}

.scanner-cart-wrapper{
    position:relative;
    display:inline-block;
}


.scanner-cart-badge{
    position:absolute;
    top:-10px;
    right:-10px;
    min-width:22px;
    height:22px;
    padding:0 6px;
    border-radius:999px;
    background:#ff4d4d;
    color:#fff;
    font-size:12px;
    font-weight:600;
    display:flex;
    align-items:center;
    justify-content:center;
}

.scan-success-flash{

    position:fixed;

    top:90px;

    left:50%;

    transform:translateX(-50%) scale(0.9);

    background:linear-gradient(
        135deg,
        #22c55e,
        #16a34a
    );

    color:white;

    padding:16px 28px;

    border-radius:18px;

    font-weight:700;

    font-size:18px;

    letter-spacing:0.3px;

    z-index:999999999;

    opacity:0;

    transition:0.25s;

    pointer-events:none;

    box-shadow:
    0 8px 24px rgba(34,197,94,0.35);

}


.scan-success-flash.show{

    opacity:1;

    transform:translateX(-50%) scale(1);

}

#scannerReader{

    min-height:300px;

    position:relative;

    background:#111;

    border-radius:12px;

    overflow:hidden;

}


#scannerLoading{

    position:absolute;

    top:50%;

    left:50%;

    transform:translate(-50%, -50%);

    color:#fff;

    font-size:18px;

    font-weight:600;

    z-index:10;

}

.issue-history-section{

    margin-top:30px;

    background:#fff;

    border-radius:12px;

    padding:20px;

}

.history-item{

    padding:12px 0;

    border-bottom:1px solid #eee;

}

.history-item:last-child{

    border-bottom:none;

}

.history-main{

    font-weight:600;

}

.history-meta{

    font-size:12px;

    color:#777;

    margin-top:4px;

}

.undo-history-btn{

    margin-top:8px;

    padding:6px 12px;

    border:none;

    border-radius:8px;

    cursor:pointer;

}

.history-undone{

    margin-top:8px;

    color:#16a34a;

    font-weight:600;

}

/* Remove browser number arrows */

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button{
    -webkit-appearance:none;
    margin:0;
}

input[type=number]{
    -moz-appearance:textfield;
}