/* Cairo Local Font Configuration */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/cairo-arabic-400-normal.woff2') format('woff2'),
       url('/fonts/cairo-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/cairo-arabic-700-normal.woff2') format('woff2'),
       url('/fonts/cairo-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/cairo-arabic-700-normal.woff2') format('woff2'),
       url('/fonts/cairo-latin-700-normal.woff2') format('woff2');
}

/* Global Font Override - Only font-family, no global sizes */
body, html, input, button, select, textarea, span, div, p, a, h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif !important;
}

/* Preserve original quantity input width */
input.form-control.input-sm.qty {
    width: 100px;
}

.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar {
    width: 11px !important;
    background-color: #e4e2eb !important;
}

/* POS Scoped Styling - Keeps Sidebar & Navbar untouched */
.pos-wrapper {
    background-color: #f8fafc;
    padding: 15px;
    border-radius: 12px;
}

/* Scoped Card Styles */
.pos-wrapper .card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
    background: #ffffff !important;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0 !important;
}

.pos-wrapper .card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 20px 24px !important;
}

.pos-wrapper .card-title {
    color: #0f172a !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Category Grid & Buttons */
.pos-wrapper .scientific-buttons {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
}

.pos-wrapper .scientific-btn {
    width: 100% !important;
    height: 60px !important;
    margin: 0 !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px !important;
    cursor: pointer !important;
}

.pos-wrapper .scientific-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1) !important;
    border-color: #6366f1 !important;
    color: #6366f1 !important;
}

.pos-wrapper .scientific-btn.active-category {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3) !important;
}

/* Tables Redesign */
.pos-wrapper table {
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    width: 100% !important;
}

.pos-wrapper table thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
}

.pos-wrapper table tbody tr {
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease-in-out !important;
}

.pos-wrapper table tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    background-color: #faf5ff !important;
}

.pos-wrapper table tbody td {
    padding: 14px 16px !important;
    border: none !important;
    vertical-align: middle !important;
    color: #334155 !important;
    font-size: 15px !important;
}

/* Datatable search */
.pos-wrapper .dataTables_filter input {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    outline: none;
    transition: all 0.2s;
    background-color: #ffffff !important;
}

.pos-wrapper .dataTables_filter input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* Cart receipt style */
.pos-wrapper #invoice {
    background: #fafafa !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 15px !important;
}

.pos-wrapper #order_product_list {
    border-bottom: 2px dashed #cbd5e1 !important;
    margin-bottom: 15px !important;
}

.pos-wrapper #order_product_list tr {
    border-bottom: 1px dashed #e2e8f0 !important;
}

/* Qty Adjustment controls */
.pos-wrapper .qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px 4px;
    height: 38px;
}

.pos-wrapper .qty-control .qty-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #f1f5f9;
    color: #334155;
    font-size: 15px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pos-wrapper .qty-control .qty-btn:hover {
    background-color: #cbd5e1;
}

.pos-wrapper .qty-control input.qty {
    width: 65px !important;
    height: 30px !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    border: none !important;
    background: transparent !important;
    padding: 0 4px !important;
    margin: 0 !important;
}

/* Row total editable input - Large and clear */
.pos-wrapper input.row-total {
    width: 100% !important;
    min-width: 110px !important;
    max-width: 140px !important;
    height: 38px !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    padding: 4px 8px !important;
    margin: 0 auto !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease !important;
}

.pos-wrapper input.row-total:hover {
    border-color: #94a3b8 !important;
}

.pos-wrapper input.row-total:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    background-color: #ffffff !important;
    outline: none !important;
}

.pos-wrapper #order_product_list td {
    padding: 8px 6px !important;
    vertical-align: middle !important;
}

.pos-wrapper #order_product_list th {
    padding: 10px 6px !important;
    text-align: center !important;
}

.pos-wrapper #order_product_list td.product-price {
    min-width: 120px !important;
    text-align: center !important;
}

.pos-wrapper #order_product_list td.unit-price {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    text-align: center !important;
}

.pos-wrapper #order_product_list th:first-child,
.pos-wrapper #order_product_list td:first-child {
    text-align: right !important;
}

/* إخفاء أسهم الأرقام الافتراضية في كافة حقول الأرقام لعدم حجب الأرقام والكسور */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}
input[type="number"] {
    -moz-appearance: textfield !important;
}

/* Keypad block */
.pos-wrapper .number-buttons-grid {
    display: grid !important;
    grid-template-columns: repeat(11, 1fr) !important;
    gap: 5px !important;
    margin-bottom: 15px !important;
}

.pos-wrapper .btn-number {
    height: 36px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    cursor: pointer;
    transition: all 0.1s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.pos-wrapper .btn-number:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.pos-wrapper .btn-number:active {
    transform: scale(0.95);
    background-color: #e2e8f0 !important;
}

/* Segmented Controls (Radios styled like buttons) */
.pos-wrapper .segmented-control {
    display: flex !important;
    background-color: #f1f5f9 !important;
    padding: 3px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 12px !important;
}

.pos-wrapper .segmented-control input[type="radio"] {
    display: none !important;
}

.pos-wrapper .segmented-control label {
    flex: 1 !important;
    text-align: center !important;
    padding: 8px 6px !important;
    margin: 0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    color: #64748b !important;
    transition: all 0.15s ease !important;
    font-size: 13px !important;
}

.pos-wrapper .segmented-control input[type="radio"]:checked + label {
    background-color: #ffffff !important;
    color: #4f46e5 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
}

/* Total Price Badge */
.pos-wrapper .total-price-wrapper {
    background-color: #ecfdf5;
    border-right: 5px solid #10b981;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-wrapper .total-price-label {
    font-size: 16px !important;
    color: #065f46 !important;
    font-weight: 700 !important;
}

.pos-wrapper .total-price {
    font-size: 24px !important;
    color: #047857 !important;
    font-weight: 800 !important;
}

/* Cart Actions */
.pos-wrapper .cart-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.pos-wrapper .btn-checkout {
    flex: 2;
    padding: 10px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    background-color: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
}

.pos-wrapper .btn-checkout:hover {
    background-color: #059669 !important;
}

.pos-wrapper .btn-clear-cart {
    flex: 1;
    padding: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
}

/* Stats Cards */
.pos-wrapper .pos-stat-card {
    border: none !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    padding: 20px !important;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    transition: transform 0.2s;
}

.pos-wrapper .pos-stat-card:hover {
    transform: translateY(-2px);
}

.pos-wrapper .pos-stat-card .stat-icon {
    font-size: 32px !important;
    opacity: 0.2;
    position: absolute;
    left: 15px;
    top: 15px;
    color: #ffffff !important;
}

.pos-wrapper .pos-stat-card h6 {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 14px !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;
}

.pos-wrapper .pos-stat-card h5 {
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    margin: 0 !important;
}

/* Active cart row selection */
.pos-wrapper .order-list tr.selected {
    background-color: #f5f3ff !important;
    border-right: 4px solid #8b5cf6 !important;
}

/* Custom Gradient Theme for 5 POS Stats Cards */
.pos-wrapper .pos-stat-cash {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
}

.pos-wrapper .pos-stat-bank {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
}

.pos-wrapper .pos-stat-ocash {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

.pos-wrapper .pos-stat-income {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
}

.pos-wrapper .pos-stat-net-income {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%) !important;
}

.pos-wrapper .pos-stat-profits {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%) !important;
}

.pos-wrapper .pos-stat-net-profits {
    background: linear-gradient(135deg, #0284c7 0%, #0f766e 100%) !important;
}

.pos-wrapper .pos-stat-refund {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid #fecaca !important;
    border-top: 4px solid #ef4444 !important;
    color: #1e293b !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

.pos-wrapper .pos-stat-refund .stat-icon {
    color: #ef4444 !important;
    opacity: 0.25 !important;
}

.pos-wrapper .pos-stat-refund h6 {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

.pos-wrapper .pos-stat-refund h5 {
    color: #b91c1c !important;
    font-weight: 800 !important;
}

/* Modern Invoice Cards Design (matching OnePOS) */
.sales-history-container {
    direction: rtl;
}

.invoice-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.invoice-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05) !important;
    border-color: #cbd5e1 !important;
}

.invoice-card-header {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.invoice-header-meta {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    flex: 1 1 auto !important;
}

.invoice-header-meta > * {
    margin: 2px 0 !important;
}

/* Actions container and buttons */
.invoice-actions {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
    flex: 0 0 auto !important;
    margin: 2px 0 !important;
}

.invoice-actions .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    border-radius: 30px !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.2s ease !important;
    margin: 2px 0 !important;
    border: none !important;
    text-decoration: none !important;
    cursor: pointer;
}

.invoice-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
    filter: brightness(0.95);
}

.invoice-actions .btn:active {
    transform: translateY(0);
}

.invoice-actions .btn i {
    font-size: 0.82rem !important;
    margin: 0 !important;
    line-height: 1 !important;
}

@media (max-width: 991px) {
    .invoice-card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .invoice-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        padding-top: 8px !important;
        border-top: 1px dashed #e2e8f0 !important;
    }
}

.invoice-card-body {
    padding: 0 !important;
}

.invoice-card-footer {
    background-color: #fafbfc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 12px 20px !important;
}

.invoice-badge-payment {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 5px 12px !important;
    border-radius: 30px !important;
    display: inline-block;
}

.invoice-badge-cash {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}

.invoice-badge-credit {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
}

.invoice-badge-bank {
    background-color: #fce7f3 !important;
    color: #be185d !important;
}

.invoice-badge-ocash {
    background-color: #ccfbf1 !important;
    color: #0f766e !important;
}

.invoice-badge-other {
    background-color: #d1fae5 !important;
    color: #047857 !important;
}

.invoice-badge-multi {
    background-color: #f3e8ff !important;
    color: #7e22ce !important;
}

.invoice-badge-draft {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

/* ==========================================================================
   Offline Local Icons & Sidebar Navigation Enhancements
   ========================================================================== */

/* Font Awesome Compatibility with local FA 5 Free */
.fa-solid, .fas {
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
}

.fa-regular, .far {
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 400 !important;
}

.fa-brands, .fab {
    font-family: 'Font Awesome 5 Brands' !important;
    font-weight: 400 !important;
}

/* Sidebar Main Item Icons */
.side-menu .side-menu__item {
    display: flex;
    align-items: center;
    padding: 10px 18px !important;
    transition: all 0.25s ease;
    border-radius: 8px;
    margin: 3px 10px;
}

.side-menu .side-menu__icon {
    font-size: 15px !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
    text-align: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: 12px !important;
    margin-right: 0 !important;
    border-radius: 7px;
    background: rgba(1, 98, 232, 0.07);
    color: #0162e8 !important;
    transition: all 0.25s ease;
}

.side-menu .slide.active .side-menu__icon,
.side-menu .side-menu__item:hover .side-menu__icon {
    background: #0162e8;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(1, 98, 232, 0.35);
    transform: scale(1.05);
}

/* Submenu Styling & Local Icons */
.slide-menu {
    padding: 6px 12px 6px 0 !important;
}

.slide-menu .slide-item {
    display: flex !important;
    align-items: center !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #4b5563 !important;
    border-radius: 6px;
    margin: 2px 0 2px 14px;
    transition: all 0.2s ease-in-out;
}

.slide-menu .slide-item .sub-icon {
    font-size: 13px !important;
    width: 20px !important;
    margin-left: 10px !important;
    text-align: center;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.slide-menu .slide-item:hover,
.slide-menu .slide-item.active {
    color: #0162e8 !important;
    background: rgba(1, 98, 232, 0.08) !important;
    padding-right: 22px !important;
}

.slide-menu .slide-item:hover .sub-icon,
.slide-menu .slide-item.active .sub-icon {
    color: #0162e8 !important;
    transform: scale(1.2);
}
