* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
    font-size: 16px;
}

h1 {
    margin-top: 0;
}

a {
    transition: 0.2s;
    color: #5b31c6;
    text-decoration: none;
}

a:hover {
    opacity: 0.8;
}

.mb20 {
    margin-bottom: 20px;
}

.mb30 {
    margin-bottom: 30px;
}

.alignright {
    text-align: right;
}

.wrap {
    background: #f7f7fb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    min-height: 100vh;
}

.wrap > .container{
    flex: 1;
}

.dashboard-card, .card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.content {
    padding: 30px;
}

.success {
    padding: 12px;
    background: #e4f5e8;
    border-left: 4px solid #2f8f46;
}

.error {
    padding: 12px;
    background: #f8dddd;
    border-left: 4px solid #b42318;
}

.back {
    margin-top: 0;
}

.back img {
    width: 30px;
}

.back a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* form */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

textarea {
    width: 100%;
    padding: 12px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
} 

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

input[type=checkbox] {
    width: unset;
}

button, .xl-btn  {
    padding: 12px 20px;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    background: #000;
    color: #fff;
    transition: 0.2s;
}

button:hover {
    opacity: 0.8;
}

.xl-btn {
    padding: 20px 25px;
    font-size: 16px;
    font-weight: 600;
}

.redborder-btn {
    background-color: transparent;
    border: 1px solid #e54347;
    color: #e54347;
}

.redborder-btn:hover {
    background-color: #e54347;
    color:#fff;
}

/* table */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background: #f4f6f8;
}


/* sidebar */

.dashboard-links {
    width: 200px;
    background: #142236;
    flex-shrink: 0;
}

.dashboard-links h2 {
    color: #fff;
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.dashboard-links h2 img {
    width: 30px;
}

.dashboard-links .container {
    padding: 25px;
    position: sticky;
    top: 0;
}

.dashboard-links ul {
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 10px;
}

.dashboard-links a {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 4px;
    text-decoration: none;
    transition: 0.2s;
    color: #fff;
    display: block;
}

.dashboard-links a:hover {
    background-color: #1f3554;
}

.active a{
    background-color: #5b31c6 !important;
    color: #fff;
}

/* page header */
.page-header {
    border-bottom: 1px solid #e8eaf0;
    background-color: #fff;
}

.page-header > div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 30px;
    align-items: center;
}

.page-header h1 {
    margin-bottom: 0;
}

.page-header p {
    margin: 0
}

.page-header p {    
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-header p img {
    width: 30px;
}

/* dashboard */ 
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-card h2 {
    margin-top: 0;
    font-size: 18px;
}

.dashboard-number {
    margin-bottom: 0;
    font-size: 26px;
    font-weight: bold;
}

@media (max-width: 800px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* login */

.login-page {
    max-width: 500px;
    margin: 80px auto;
}

/*  prodcut */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.all-products {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.product-search-form {
    display: flex;
    gap: 10px;
}

.product-search-form #search {
    width: 250px;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* pos */
table input[type="number"] {
    width: 80px;
}

.cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.cart-actions .button-link {
    background: #5b31c6;
}

/* pos search */
.product-search-wrapper {
    position: relative;
}

.product-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

.product-result {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.product-result:hover {
    background: #f5f5f5;
}

.product-result span {
    font-size: 14px;
}

/* success */
.product-details-table th{
    background: #fff;
}
.total-rows th {
    border: 0; 
    background: #fff;
    font-weight: 400;
    padding: 3px;
}
.total-rows tr:first-child th {
    font-weight: bold;
}
.footer-receipt-table {
    border-top: 1px solid #ddd;
}
.emptyrow td {
    padding-bottom: 0px; 
    border: 0;
}
.centeritem {
    text-align: center;
}
.bolditem {
    font-weight: bold;
}
.rightitem {
    text-align: right;
}

.product-details-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.receipt-print {
    width: 100%;
    font-size: 14px;
    margin: 0  auto 0 auto;
}

.receipt-print-inner {
    padding: 20px 20px;
}

.receipt-print-inner td, .receipt-print-inner th {
    border-color: #000;
}

.receipt-header {
    font-size: 18px;
    line-height: 1.3;
}

.receipt-meta {
    font-size: 16px;
}

@media print {

    @page {
        size: 80mm auto;
        margin: 0;
    }

    body * {
        visibility: hidden;
    }

    .receipt-print,
    .receipt-print * {
        visibility: visible;
    }

    .receipt-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .product-details-table {
        font-size: 14px;
        border-top: 1px solid #ddd;
    }

}

/* pagination */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #5b31c6;
    text-decoration: none;
}

.pagination .active {
    background-color: #5b31c6;
    color: #fff;
}


/* checkout */
.payment-options {
    display: flex;
    gap: 15px;
}

.payment-option {
    flex: 1;
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-option span {
    display: block;
    padding: 18px 25px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.payment-option input:checked + span {
    border-color: #222;
    background: #222;
    color: #fff;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
    max-width: 300px;
}

.number-pad button {
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.checkout-page {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.checkout-page .table-wrapper {
    margin-bottom: 0;
}

.checkout-summary {
    font-weight: 400;
}

.checkout-form button.xl-btn {
    background-color: #5b31c6;
}

@media (max-width: 767px) {
    .checkout-page {
        grid-template-columns: 1fr;
    }
}