/* 
 * App Stylesheet
 * Refactored for professionalism and efficiency.
 * Grouped utility classes, removed duplications, and cleaned up redundant code.
 */

/* --- General & Layout Utilities --- */
.min-height-100hv { min-height: 100vh !important; }
.min-height-90hv { min-height: 90vh !important; }
.of-visible { overflow: visible !important; }
.ws-nowrap { white-space: nowrap; }
.d-inline-table { display: inline-table; }
.bg-transparent { background-color: transparent !important; }
.bg-white { background-color: #fff; }
.text-white { color: #fff; }
.text-bold { font-weight: bold; }
.cursor-pointer { cursor: pointer !important; }
.v-center { vertical-align: middle !important; }
.f-right { float: right; }
.f-left { float: left; }
.align-left { text-align: left; }
.align-right { text-align: right; }
.word-wrap { word-wrap: break-word !important; }
.font-17 { font-size: 17px !important; }
.font-23 { font-size: 23px !important; }
.font-30 { font-size: 30px !important; }
.fs-10 { font-size: 10px; }
.error { color: red !important; }
.spacer { margin-top: 20px; }
.disabled, [disabled] { cursor: not-allowed !important; }
[disabled] { opacity: 0.6; }

/* --- Spacing Utilities --- */
.pt-0 { padding-top: 0px; }
.pb-0 { padding-bottom: 0px !important; }
.pa-0 { padding: 0px !important; }
.p-4, .col-2px-padding { padding: 4px; }
.p-10, .padding-10 { padding: 10px !important; }
.padding-5 { padding: 5px !important; }
.p-5-5 { padding: 5px 5px !important; }
.padding-side-15 { /* Reserved for future use */ }

.mt-0 { margin-top: 0 !important; }
.mt-5 { margin-top: 5px !important; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-56 { margin-top: 56px !important; }

.mb-0 { margin-bottom: 0; }
.mb-5 { margin-bottom: 5px !important; }
.mb-10 { margin-bottom: 10px; }
.mb-12, .margin-bottom-12 { margin-bottom: 12px !important; }
.mb-40 { margin-bottom: 40px !important; }
.margin-bottom-20 { margin-bottom: 20px !important; }

.m-2 { margin: 2px !important; }
.m-4 { margin: 4px; }
.m-5 { margin: 5px; }
.m-8 { margin: 8px; }
.mr-8 { margin-right: 8px !important; }
.pr-12 { padding-right: 12px !important; }
.margin-left-10 { margin-left: 10px; }
.col-no-padding { padding-left: 0px; padding-right: 0px; }

/* --- Width Utilities --- */
.width-40 { width: 40% !important; }
.width-50 { width: 50% !important; }
.width-60 { width: 60% !important; }
.width-100 { width: 100% !important; }

/* --- Colors & Backgrounds --- */
.bg-danger { background-color: #f2dede !important; }
.bg-light-gray { background-color: #f8f8f8 !important; }
.bg-manufacturing { background-color: #ff851b; }
.bg-aqua-lite { background-color: #7FFFD4; }
.bg-light-green { background-color: #98D973 !important; color: #fff !important; }
.bg-lightgray { background-color: #F0EDED !important; }
.bg-info { background-color: #00c0ef !important; }
.bg-info > a { color: #FFFFFF !important; }
.bg-info>a:hover { background-color: #337ab7 !important; }
.bg-woocommerce { background-color: #9E458B !important; }
.bg-table { background-color: #464349 !important; color: #FFFFFF; }
.blue-heading { background-color: #357ca5; color: #fff; }
.color-555, .color-555 * { color: #555555 !important; }
.color-white { color: white !important; }
.text-muted-imp { color: #A3A3A3 !important; }

/* --- Header & Navigation --- */
@media (max-width: 767px) {
    .main-header .navbar-custom-menu { float: none !important; display: block !important; }
    .main-header .navbar-custom-menu .dropdown-menu { left: auto !important; }
    .skin-blue-light .main-header .navbar .dropdown-menu li a { color: #777; }
    .main-header .navbar { height: auto; }
}

.main-header .sidebar-toggle:before { content: "" !important; }
.skin-black .main-header, .skin-black-light .main-header { color: #525f7f !important; }
.skin-black .main-header .navbar .nav .open>a,
.skin-black .main-header .navbar .nav>li>a:hover,
.skin-black .main-header .navbar > .sidebar-toggle:hover { color: #999 !important; }

.navbar-nav>.user-menu>.dropdown-menu>li.user-header>img { border: none; height: auto; width: 100%; max-height: 120px; }
.navbar-nav>.notifications-menu>.dropdown-menu>li .menu { max-height: 350px; }
.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a { white-space: normal; }

.treeview-menu i { display: none !important; }
.treeview-menu a { padding-left: 25px !important; font-size: 95% !important; }
.treeview-menu a::before { content: "\2192 "; }

.menu-child-item { padding-right: 20px; }
.menu-child-item:before { content: "\25cf" !important; margin-left: 5px; }
.menu-child-item:hover { padding-right: 15px; transition: 0.5s; }

/* --- POS Layout & Elements --- */
.pos-form-actions {
  height: 120px;
  padding-top: 0px;
  padding-bottom: 10px;
  position: fixed;
  bottom: 0px;
  width: 100%;
  z-index: 1000;
}

.modal-xl {
  width: 90%;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media only screen and (max-width: 600px) {
  .pos-form-actions { margin-top: 20px; position: relative; height: auto; }
  .pos_product_div { margin-bottom: 300px; }
}

.pos-form-actions-mobile { margin-top: 20px; position: relative; height: auto; width: 100%; z-index: 1000; }

.pos_product_div { overflow-y: auto; margin-bottom: 50px; height: 50vh !important; }
.receipt_div { height: 80vh; }

.pos-total { padding: 8px 10px; vertical-align: middle; margin: 0 5px; }
.pos-total span.number { font-size: 26px; vertical-align: middle; font-weight: bolder; }
.pos-total span.text { font-weight: bolder; display: inline-block; width: 60px; vertical-align: middle; }

.pos-express-btn { font-size: 23px !important; overflow: hidden !important; height: 73px !important; white-space: normal; }
.pos_remove_row {
    padding: 10px !important;
    border: 1px solid #dddddd4d !important;
    border-radius: 4px !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: auto !important;
    color: #fff !important;
    background-color: #cd1a0e !important;
    box-shadow: 1px 1px 3px #00000069 !important;
    font-size: 20px !important;
}

/* POS Tabs */
div.pos-tab-container {
  z-index: 10; background-color: #ffffff; border-radius: 4px; border: 1px solid #ddd;
  margin-bottom: 28px; box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
div.pos-tab-menu { padding: 0; }
div.pos-tab-menu div.list-group { margin-bottom: 0; }
div.pos-tab-menu div.list-group>a { margin-bottom: 0; }
div.pos-tab-menu div.list-group>a .glyphicon, div.pos-tab-menu div.list-group>a .fa { color: #5A55A3; }
div.pos-tab-menu div.list-group>a:first-child { border-top-right-radius: 0; }
div.pos-tab-menu div.list-group>a:last-child { border-bottom-right-radius: 0; }

div.pos-tab-menu div.list-group > a.active,
div.pos-tab-menu div.list-group > a.active .glyphicon,
div.pos-tab-menu div.list-group > a.active .fa {
  background: linear-gradient(to right, #6366f1, #3b82f6); color: #ffffff; border-color: transparent;
}

div.pos-tab-content { background-color: #ffffff; padding-left: 20px; padding-top: 20px; }
div.pos-tab div.pos-tab-content:not(.active) { display: none; }

/* --- Tables & Data Grids --- */
.product-info-table td, .product-info-table th { font-size: 12px; }
.table-pdf { border-collapse: collapse; width: 100%; border-spacing: 8px 10px; }
.table-pdf thead tr { background-color: #357ca5 !important; color: #fff; }
.table-pdf thead tr th { color: #fff !important; }
.table-pdf .odd { background-color: #DCE6F1; }

.td-border td, .td-border th { border-bottom: 1px solid lightgrey; padding: 8px 5px; }
.table>tbody+tbody { border-top: 0; }
.table-pl-12 td, .table-pl-12 th { padding-left: 12px !important; }
table tbody td.pl-20-td { padding-left: 20px !important; }

.table-no-top-cell-border td, .table-no-top-cell-border th { border-top: 0 !important; border-bottom: 0 !important; }
.table-no-side-cell-border td, .table-no-side-cell-border th { border-left: 0 !important; border-right: 0 !important; }

table.table-border-center > tbody > tr > td:first-child, 
table.table-border-center > thead > tr > th:first-child,
table.table-border-center > tfoot > tr > td:first-child { border-right: 1px solid darkgray; }

table.table-border-center-col > tbody > tr > td:nth-child(2), 
table.table-border-center-col > thead > tr > th:nth-child(2),
table.table-border-center-col > tfoot > tr > td:nth-child(2) { border-right: 1px solid darkgray; border-left: 1px solid darkgray; }

.table-transparent, .table-transparent th { background-color: transparent !important; color: #000 !important; }
.table-slim>tbody>tr>td, .table-slim>tbody>tr>th, .table-slim>tfoot>tr>td, .table-slim>tfoot>tr>th, .table-slim>thead>tr>td, .table-slim>thead>tr>th { padding: 1px; }
.table-dark>thead>tr>th { background-color: #1f1616 !important; color: #FFFFFF !important; }

.add-product-price-table th, .table-th-green th { background-color: #5cb85c; color: white; }
.blue-header th { background-color: #3c8dbc; color: white; }

table.dataTable tbody>tr.selected { background-color: #B0BED9; }
tr.footer-total > td { vertical-align: middle !important; }
table.ajax_view tbody tr { cursor: pointer; }
table.table-text-center td, table.table-text-center th { vertical-align: middle !important; }

/* --- Products & Displays --- */
.img-thumbnail {
  position: relative; width: 70px; height: 70px; background-color: #fff; border: 1px solid #ddd; border-radius: 2px;
  transition: border .2s ease-in-out; padding: 4px; margin: 3px; text-align: center;
}
.img-thumbnail>.badge { position: absolute; top: -5px; right: -7px; font-size: 9px; font-weight: 400; cursor: pointer; }
.product-thumbnail-small { height: 50px; width: 50px; }

.product_list {
  flex: 0 0 25%;
  max-width: 25%;
  padding: 0 1px;
}

@media (max-width: 991px) {
  .product_list {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
}

@media (max-width: 767px) {
  .product_list {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 480px) {
  .product_list {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.product_box {
  width: 100%; margin-bottom: 10px; text-align: center; cursor: pointer; border: 1px solid #11aeb8;
  font-weight: 600; background-color: #fff; border-radius: 12px; padding: 8px;
}
.product_box .image-container { height: 65px; margin: auto; width: 100%; margin-bottom: 4px; }
.product_box .image-container img { height: 100%; width: 100%; border-radius: 12px; }
.product_box .text_div {
    margin-top: 3px; height: 63px; overflow: hidden; display: flex; justify-content: center; align-items: center; font-weight: 700;
}
.product_box .text {
    width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 1; line-height: 14px; max-height: 63px;
}
.product_name { overflow: visible !important; max-height: 63px !important; display: block !important; line-height: 20px !important; }
.product_list_price { color: #000; background-color: #fff; border-radius: 15px 15px 0 0; margin: -8px -8px 0; padding-bottom: 5px; }

.product_cell { height: 100px; padding: 1%; }
.product_cell_div { height: 100% !important; width: 100% !important; text-align: center; vertical-align: middle; padding-top: 5px; cursor: pointer; overflow: hidden; }

.eq-height-row { display: flex; flex-wrap: wrap; }
.eq-height-col { display: flex; }

.catigory_div { border: 1px solid #0FB1B4; }
.catigory_div:hover { background-color: #0b7dc6; color: #fff; }
.catigory_div:hover h4 { color: #fff; }

.main-category-2 { width: 100%; border-radius: 15px; padding: 7px; margin-top: 4px; text-align: center; }

/* --- Forms & Inputs --- */
.ui-autocomplete { max-height: 300px; overflow-y: auto; overflow-x: hidden; }
.input_inline { width: 100%; display: inline-flex; }
.input_inline input, .input_inline span { width: 50%; }
.input-number .btn-default { background-color: white; padding: 6px 9px; }
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input::placeholder { color: transparent; }

.option-div { padding: 15px; background-color: #d2d6de; color: #333; border: 1px solid #d2d6de; cursor: pointer; }
.option-div input[type="radio"] { display: none; }
.option-div-group .icon { color: #d33724; display: none; }
.option-div-group .option-div:hover { border: 1px solid gray; }
.option-div-group .active .icon { display: block; }

.icheckbox_square-blue, .iradio_square-blue { margin-right: 10px; }

/* --- Login & Wizard --- */
.wizard > .steps > ul > li { width: 33.33% !important; }
legend { color: #fff; margin-bottom: 6px; border-bottom: none; }

.left-col {
  background: linear-gradient(0deg, rgba(0,0,0,0.76), rgba(51,51,51,0.32)), url(../img/home-bg.jpg); 
  text-align: center; background-size: cover; background-position: center;
}
.left-col-content { color: #1A7BF9; width: 100%; }
.login-header { font-size: 27px; font-weight: 600; }
.login-header a { color: #fff; }
.form-header { font-size: 18px; margin: 16px 0; }
.right-col { background: linear-gradient(to right, #6366f1, #3b82f6); height: 100%; }

/* --- Components --- */
#online_indicator { font-size: 8px; vertical-align: middle; }
.discount-badge { position: absolute; top: 6px; right: 10px; font-size: 18px; padding: 7px; }
.discount-badge-small { position: absolute; top: -2px; left: 10px; font-size: 12px; padding: 6px; }
.catalogue { max-height: 127px; margin: auto; margin-bottom: 18px; }
.catalogue-title { display: inline-block; font-size: 18px; margin: 0; line-height: 1; margin-bottom: 10px; }
.label-round { font-size: 8px; border-radius: 44%; }
.label-secondary { background-color: brown; }
.user_avatar { border-radius: 50%; width: 25px; height: 25px; margin: 1px; }

.icon-link { text-align: center; display: block; margin-bottom: 18px; }
.icon-link > a { display: grid; }
.icon-link > .badge { position: absolute; top: 20px; right: 67px; }
.link-des { display: inline-block; text-align: left; }

.hover-q { font-size: 16px; margin-left: 3px; cursor: help; }
.input-group-addon .hover-q { margin-left: 0px; }
.tour .popover-content { padding: 18px 14px; }

/* Scroll Components */
.jquery-top-scrollbar, .jquery-top-scrollbar div { height: 6px !important; }
.scroll-top-bottom { width: 100%; overflow: scroll; }
.scroll-top-bottom::-webkit-scrollbar { height: 6px; }

.scrolltop { display: none; width: 100%; margin: 0 auto; position: fixed; bottom: 20px; right: 10px; }
.scroll {
  position: absolute; right: 20px; bottom: 20px; background: rgba(178,178,178,0.7);
  padding: 7px; text-align: center; cursor: pointer; transition: 0.5s; border-radius: 6px;
}
.scroll:hover { background: rgba(178,178,178,1.0); }
.scroll .fas { font-size: 25px; margin-top: -5px; transition: 0.5s; }

/* --- Font Faces & Arabic Support --- */
@font-face {
    font-family: 'SaudiRiyalSymbol';
    src: url('../fonts/saudi-font-files/saudiriyalsymbol.ttf') format('truetype');
}

.font-saudi-symbol, .contact_due, .return_due, .footer_contact_due,
.footer_contact_return_due, .total-paid, .final-total, .tw-font-semibold, 
.display_currency, .payment_due, .footer_sale_total, .footer_total_paid, 
.footer_total_remaining, .footer_total_sell_return_due, .footer_total_due, 
.footer_total_purchase_return_due, .balance, .footer_total_balance, .total_purchase, 
.purchase_inc_tax, .total_sell, .sell_inc_tax, .total_sell_return, 
.sell_minus_purchase, .difference_due, .purchase_due, .purchase_return_inc_tax, 
.sell_due, .lead, .footer_total, .gross-profit, .footer_purchase_total, 
.footer_total_debit, .footer_total_credit, .new_subscriptions,
.dataTable>tbody>tr>td {
    font-family: SaudiRiyalSymbol, sans-serif !important;
}

/* --- Animations & Effects --- */
.hvr-grow-shadow {
  display: inline-block; vertical-align: middle; transform: perspective(1px) translateZ(0);
  box-shadow: 0 0 1px rgba(0,0,0,0); transition-duration: 0.3s; transition-property: box-shadow, transform;
}
.hvr-grow-shadow:hover, .hvr-grow-shadow:focus, .hvr-grow-shadow:active {
  box-shadow: 0 10px 10px -10px rgba(0,0,0,0.5); transform: scale(1.1);
}

.loader {
  --d:22px; width: 4px; height: 4px; border-radius: 50%; color: #25b09b;
  position: absolute; top: 209px; right: 50%; z-index: 10000;
  box-shadow: 
      calc(1*var(--d))      calc(0*var(--d))     0 0,
      calc(0.707*var(--d))  calc(0.707*var(--d)) 0 1px,
      calc(0*var(--d))      calc(1*var(--d))     0 2px,
      calc(-0.707*var(--d)) calc(0.707*var(--d)) 0 3px,
      calc(-1*var(--d))     calc(0*var(--d))     0 4px,
      calc(-0.707*var(--d)) calc(-0.707*var(--d))0 5px,
      calc(0*var(--d))      calc(-1*var(--d))    0 6px;
  animation: l27 1s infinite steps(8);
}
@keyframes l27 { 100% { transform: rotate(1turn); } }

/* --- UI Overrides --- */
.swal-modal .swal-text { text-align: center; }
.fa-times { font-size: 30px; }
.tree-actions { margin-left: 20px; display: none; }
.jstree-hovered .tree-actions { display: inherit; }
.pace-active { display: none; }
.dataTables_processing_stop {
  position: absolute; top: 300px !important; left: 50%; background: #054f56; color: #fff;
  padding: 10px 20px; border: 1px solid #054f56 !important; border-radius: 5px; z-index: 10000; font-size: 20px;
}
.tw-dw-btn-outline.tw-dw-btn-info { color: #fff; }

/* --- Print Styles --- */
.print_section { display: none; }
@media print {
    .print_section { display: inline !important; }
    .modal-xl { width: 100% !important; }
    ::-webkit-scrollbar { display: none !important; }
    #toast-container { display: none; }
    a:after { content:''; }
    a[href]:after { content: none !important; }
}

#product_list_body {
    /* max-height: 485px; */
    max-height: 75vh;
    overflow-y: scroll;
    overflow-x: hidden;
    padding-bottom: 120px;
}
