* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    margin: 0;
    background: #f4f5f7;
    color: #222;
}

.topbar {
    background: #1f2937;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    flex-wrap: wrap;
}
.brand { font-size: 20px; font-weight: bold; }
.nav a {
    color: #e5e7eb;
    text-decoration: none;
    margin-inline-start: 16px;
    font-size: 15px;
}
.nav a:hover { color: #fff; text-decoration: underline; }
.user-badge {
    margin-inline-start: 16px;
    background: #374151;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.logout { color: #f87171 !important; }

.language-switcher {
    display: flex;
    gap: 5px;
    align-items: center;
}

.lang-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    transition: 0.2s;
    text-decoration: none;
    color: #1f2937;
}

.lang-btn:hover {
    background: #e5e7eb;
    color: #2563eb;
}

.container { max-width: 1200px; margin: 24px auto; padding: 0 16px; }

.flash {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 14px;
}
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-success { background: #dcfce7; color: #166534; }

/* تسجيل الدخول */
.login-box {
    max-width: 380px;
    margin: 60px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.login-box h2 { margin-top: 0; text-align: center; }
.login-box label { display: block; margin: 12px 0 4px; font-size: 14px; }
.login-box input {
    width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 15px;
}
.login-box .hint { font-size: 13px; color: #6b7280; margin-top: 16px; text-align: center; }

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: #2563eb; color: white; }
.btn-success { background: #16a34a; color: white; }
.btn-secondary { background: #6b7280; color: white; }
.btn-danger { background: #dc2626; color: white; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
#btnCompleteSale:disabled { opacity: .55; cursor: not-allowed; }

/* شاشة الكاشير */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
@media (max-width: 800px) {
    .pos-layout { grid-template-columns: 1fr; }
    .mobile-cart-btn {
        display:flex;align-items:center;gap:6px;
        background:#2563eb;color:#fff;border:none;border-radius:10px;
        padding:10px 14px;font-size:16px;font-weight:700;cursor:pointer;flex-shrink:0;
    }
    .mobile-cart-btn span{background:#fff;color:#2563eb;border-radius:50%;min-width:20px;height:20px;
        display:flex;align-items:center;justify-content:center;font-size:12px;padding:0 4px;}
    .cart-panel{
        position:fixed;left:0;right:0;bottom:0;z-index:700;
        max-height:85vh;overflow-y:auto;border-radius:18px 18px 0 0;
        box-shadow:0 -10px 40px rgba(0,0,0,.25);transform:translateY(105%);
        transition:transform .25s ease;
    }
    .cart-panel.open{transform:translateY(0);}
}
.items-panel, .cart-panel {
    background: white;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.cat-title { margin: 18px 0 8px; color: #374151; }
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.item-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.15s;
}
.item-card:hover { background: #e0e7ff; border-color: #6366f1; }
.item-name { font-weight: 600; margin-bottom: 6px; }
.item-price { color: #16a34a; font-size: 14px; }

.cart-panel { position: sticky; top: 16px; align-self: flex-start; }
.cart-list { min-height: 100px; max-height: 400px; overflow-y: auto; margin-bottom: 12px; }
.empty-cart { color: #9ca3af; text-align: center; padding: 20px 0; }
.cart-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid #f0f0f0;
}
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-price { font-size: 12px; color: #6b7280; }
.cart-price-input {
    width: 86px; padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 6px;
    text-align: center; font-size: 13px; font-weight: 600; color: #16a34a;
}
.cart-price-input:focus { outline: 2px solid #3b82f6; border-color: #3b82f6; }
.qty-control { display: flex; align-items: center; gap: 6px; }
.qty-control button {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid #d1d5db;
    background: white; cursor: pointer; font-size: 16px;
}
.cart-item-total { font-weight: bold; width: 60px; text-align: left; }

.cart-totals { border-top: 1px solid #e5e7eb; padding-top: 10px; }
.cart-totals .row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 14px; }
.cart-totals input {
    width: 100px; padding: 5px; border: 1px solid #d1d5db; border-radius: 6px; text-align: center;
}
.total-row { font-size: 18px; font-weight: bold; color: #16a34a; }

/* الفاتورة */
.receipt-box {
    max-width: 420px;
    margin: 0 auto;
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.receipt-meta { color: #6b7280; font-size: 13px; }
.lang-en { font-size: 0.72em; font-weight: normal; color: #6b7280; }
.receipt-table th .lang-en, .receipt-table td .lang-en { font-size: 0.7em; color: #6b7280; }
.store-name { font-size: 20px; font-weight: bold; text-align: center; margin-bottom: 6px; }
.receipt-logo { display: block; max-height: 90px; max-width: 160px; margin: 0 auto 8px; object-fit: contain; }
.receipt-number { font-size: 34px; font-weight: bold; color: #2563eb; text-align: center; letter-spacing: 1px; }
.scheduled-badge { background: #fef3c7; border: 2px solid #f59e0b; border-radius: 10px; padding: 8px 10px; margin: 10px 0; text-align: center; color: #92400e; font-size: 15px; font-weight: bold; }
.scheduled-badge-day { font-size: 20px; color: #b45309; margin-top: 4px; }
.scheduled-badge-en { font-size: 14px; color: #92400e; }
.scheduled-badge-time { font-size: 18px; color: #b45309; margin-top: 2px; letter-spacing: 0.5px; }
.logo-preview { max-height: 60px; max-width: 120px; vertical-align: middle; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.receipt-table th, .receipt-table td { padding: 6px; text-align: right; }
.receipt-summary .row { display: flex; justify-content: space-between; padding: 4px 0; }
.thanks { text-align: center; margin-top: 16px; color: #6b7280; }
@media print {
    .topbar, .no-print { display: none !important; }
}

/* لوحة المدير */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
    background: white; padding: 20px; border-radius: 10px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-value { font-size: 28px; font-weight: bold; color: #2563eb; }
.stat-label { color: #6b7280; margin-top: 4px; font-size: 14px; }

.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: right; font-size: 14px; }
.data-table th { background: #f9fafb; }

/* إدارة القائمة */
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form input, .inline-form select { padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; flex: 1; }
.inline-form select { flex: 1; min-width: 140px; }
.address-form { flex-wrap: wrap; }
.address-form input, .address-form select { min-width: 110px; flex: 1; }
.item-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.item-form input, .item-form select { padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }
.tags-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tag {
    background: #e5e7eb; padding: 4px 10px; border-radius: 20px; font-size: 13px;
    display: flex; align-items: center; gap: 4px;
}
.tag-remove { border: none; background: none; cursor: pointer; color: #dc2626; font-weight: bold; }

/* بيانات الطلب في شاشة الكاشير */
.order-info-box {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}
.order-info-box h3 { margin: 0 0 10px; font-size: 15px; color: #374151; }
.field-row { margin-bottom: 8px; }
.field-row label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 3px; }
.field-row select, .field-row input {
    width: 100%; padding: 7px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.field-with-icon { display: flex; align-items: center; gap: 6px; }
.field-with-icon .field-icon { font-size: 17px; line-height: 1; }
.field-with-icon input { flex: 1; width: auto; }
.payment-ico { font-size: 18px; line-height: 1; }

/* التقارير */
.filter-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.filter-form label { display: flex; flex-direction: column; font-size: 13px; color: #6b7280; gap: 4px; }
.filter-form input, .filter-form select {
    padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.stat-highlight .stat-value { color: #16a34a; }

/* إدارة السائقين */
.td-actions { min-width: 380px; }
.inline-form.compact { gap: 4px; margin-bottom: 6px; }
.inline-form.compact input, .inline-form.compact select { padding: 5px; font-size: 13px; }
.active-check { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #374151; }

/* العملاء */
.customer-notes {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}
.address-list { list-style: none; padding: 0; }
.address-list li {
    background: white; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 8px 12px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center;
}
.address-list small { color: #6b7280; }

/* لوحة الطلبات */
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, 1fr); } }
.board-col { background: #f3f4f6; border-radius: 10px; padding: 10px; }
.board-head { font-weight: bold; padding: 8px; border-radius: 6px; margin-bottom: 10px; color: white; display: flex; justify-content: space-between; align-items: center; }
.board-new .board-head { background: #2563eb; }
.board-preparing .board-head { background: #d97706; }
.board-ready .board-head { background: #16a34a; }
.board-with_driver .board-head { background: #7c3aed; }
.board-delivered .board-head { background: #6b7280; }
.board-count { background: rgba(255,255,255,0.25); padding: 2px 8px; border-radius: 10px; }
.board-body { min-height: 80px; }
.order-card {
    background: white; border-radius: 8px; padding: 10px; margin-bottom: 10px;
    border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.order-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-time { color: #6b7280; font-size: 12px; }
.order-card-row { font-size: 13px; margin-bottom: 4px; color: #374151; }
.cake-text { background: #ede9fe; color: #6d28d9; padding: 3px 6px; border-radius: 4px; }
.notes-text { background: #fef3c7; color: #92400e; padding: 3px 6px; border-radius: 4px; }
.custom-badge { color: #be185d; font-weight: bold; }
.order-card-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.board-empty { color: #9ca3af; text-align: center; font-size: 13px; padding: 12px 0; }

/* الطلب المخصص */
.custom-toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.custom-block { background: #fdf2f8; border: 1px solid #f9a8d4; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }
.custom-block-title { font-weight: bold; color: #be185d; margin-bottom: 6px; }
.custom-block .row { justify-content: space-between; display: flex; padding: 2px 0; }

.badge-paid{background:#dcfce7;color:#166534;padding:2px 8px;border-radius:10px;font-size:12px;display:inline-block;}
.badge-pending{background:#fef9c3;color:#854d0e;padding:2px 8px;border-radius:10px;font-size:12px;display:inline-block;}
.badge-failed{background:#fee2e2;color:#991b1b;padding:2px 8px;border-radius:10px;font-size:12px;display:inline-block;}
.payment-row{display:flex;flex-wrap:wrap;gap:6px;}
.payment-option{display:inline-flex;align-items:center;gap:4px;font-size:13px;cursor:pointer;}
.payment-info{font-size:12px;}

/* ============ نظام إدارة الأصناف الاحترافي ============ */
.prod-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px;}
.prod-title{margin:0;font-size:22px;display:flex;align-items:center;gap:8px;}
.prod-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.prod-low-chip{background:#fef3c7;color:#92400e;border:1px solid #f59e0b;border-radius:20px;padding:6px 14px;font-weight:bold;text-decoration:none;font-size:13px;}
.prod-filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:10px 12px;margin-bottom:16px;}
.prod-search{flex:1;min-width:220px;padding:9px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;}
.prod-select{padding:9px 10px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;background:#fff;}
.prod-low-check{display:flex;align-items:center;gap:5px;font-size:13px;white-space:nowrap;}
.prod-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;}
.prod-card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.06);transition:transform .12s,box-shadow .12s;display:flex;flex-direction:column;}
.prod-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.10);}
.prod-card-img{position:relative;height:150px;background:#f9fafb;display:flex;align-items:center;justify-content:center;}
.prod-card-img img{width:100%;height:100%;object-fit:cover;}
.prod-noimg{font-size:44px;color:#cbd5e1;}
.prod-badge{position:absolute;top:8px;left:8px;font-size:11px;font-weight:bold;padding:3px 9px;border-radius:12px;color:#fff;}
.prod-badge-ok{background:#16a34a;}
.prod-badge-no{background:#dc2626;}
.prod-card-body{padding:12px;display:flex;flex-direction:column;gap:4px;flex:1;}
.prod-name{font-weight:bold;font-size:15px;}
.prod-name-en{color:#6b7280;font-size:12px;}
.prod-meta{color:#9ca3af;font-size:12px;}
.prod-row{display:flex;justify-content:space-between;align-items:center;margin-top:6px;}
.prod-price{color:#2563eb;font-weight:bold;font-size:15px;}
.prod-stock{background:#f3f4f6;color:#374151;border-radius:10px;padding:3px 9px;font-size:12px;}
.prod-stock-low{background:#fee2e2;color:#991b1b;font-weight:bold;}
.prod-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px;border-top:1px solid #f3f4f6;padding-top:10px;}
.prod-empty{grid-column:1/-1;text-align:center;color:#9ca3af;padding:40px 0;background:#fff;border-radius:12px;border:1px dashed #d1d5db;}

/* نموذج الصنف */
.pf-form{display:flex;flex-direction:column;gap:14px;}
.pf-section{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;}
.pf-section h3{margin:0 0 12px;font-size:16px;}
.pf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;align-items:end;}
.pf-grid label{display:block;font-size:13px;font-weight:600;margin-bottom:4px;color:#374151;}
.pf-grid input,.pf-grid select,.pf-grid textarea{width:100%;padding:9px 10px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;box-sizing:border-box;background:#fff;}
.pf-grid textarea{resize:vertical;}
.pf-full{grid-column:1/-1;}
.pf-hint{color:#6b7280;font-size:12px;margin:4px 0 8px;}
.pf-img-preview img{max-width:90px;max-height:90px;border-radius:8px;margin-top:8px;border:1px solid #e5e7eb;}
.pf-actions{display:flex;gap:10px;}
.mono{font-family:monospace;}

/* تفاصيل المنتج */
.pd-grid{display:grid;grid-template-columns:320px 1fr;gap:14px;align-items:start;}
@media(max-width:820px){.pd-grid{grid-template-columns:1fr;}}
.pd-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin-bottom:14px;}
.pd-card h3{margin:0 0 10px;font-size:16px;}
.pd-img{height:200px;background:#f9fafb;border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:10px;}
.pd-img img{width:100%;height:100%;object-fit:cover;}
.pd-cat{color:#9ca3af;font-size:13px;margin:2px 0;}
.pd-price{font-size:20px;color:#2563eb;font-weight:bold;margin:4px 0;}
.pd-desc{color:#4b5563;font-size:14px;margin-top:10px;border-top:1px dashed #e5e7eb;padding-top:10px;}
.pd-table{width:100%;border-collapse:collapse;font-size:13px;margin-top:8px;}
.pd-table th,.pd-table td{border-bottom:1px solid #f3f4f6;padding:7px 8px;text-align:right;}
.pd-table th{background:#f9fafb;font-size:12px;color:#6b7280;}
.pd-channels{margin-top:12px;border-top:1px dashed #e5e7eb;padding-top:10px;}
.pd-channels h4{margin:0 0 6px;font-size:14px;}
.pd-channels div{font-size:13px;display:flex;justify-content:space-between;padding:2px 0;color:#374151;}
.mv-neg{color:#dc2626;font-weight:bold;}
.mv-pos{color:#16a34a;font-weight:bold;}

/* التصنيفات */
.cat-layout{max-width:720px;}
.cat-list{list-style:none;padding:0;margin:10px 0;display:flex;flex-direction:column;gap:6px;}
.cat-item{display:flex;align-items:center;gap:8px;background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:8px 12px;}
.cat-item.cat-dragging{opacity:.5;}
.cat-grip{color:#9ca3af;cursor:grab;}
.cat-name{font-weight:bold;flex:1;}
.cat-count{color:#6b7280;font-size:12px;}
.cat-inline{display:flex;gap:4px;align-items:center;}
.cat-inline input{width:120px;padding:5px 8px;border:1px solid #d1d5db;border-radius:6px;}
.cat-item{flex-direction:column;align-items:stretch;}
.cat-head{display:flex;align-items:center;gap:10px;}
.cat-thumb{width:44px;height:44px;border-radius:8px;object-fit:cover;background:#f1f5f9;flex-shrink:0;}
.cat-thumb-empty{display:flex;align-items:center;justify-content:center;font-size:22px;}
.cat-thumb-sm{width:32px;height:32px;font-size:16px;}
.cat-en{display:block;color:#9ca3af;font-weight:500;font-size:11px;direction:ltr;}
.subcat-box{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:10px;margin-top:8px;}
.subcat-title{font-weight:700;color:#475569;margin-bottom:8px;display:flex;align-items:center;gap:8px;}
.subcat-list{list-style:none;padding:0;margin:0 0 8px;display:flex;flex-direction:column;gap:6px;}
.subcat-item{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:6px 10px;}
.subcat-item.cat-dragging{opacity:.5;}
.subcat-add{display:flex;gap:6px;flex-wrap:wrap;}
.subcat-add input{flex:1;min-width:100px;padding:6px 8px;border:1px solid #d1d5db;border-radius:6px;}
.subcat-active{display:flex;align-items:center;gap:4px;font-size:12px;color:#475569;white-space:nowrap;}

/* صفحة اختيار الواجهة */
.landing-wrap{max-width:900px;margin:40px auto;text-align:center;}
.landing-title{font-size:26px;margin:0 0 6px;}
.landing-subtitle{color:#6b7280;margin:0 0 26px;}
.landing-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;}
@media (max-width:800px){.landing-cards{grid-template-columns:1fr;}}
.landing-card{display:flex;flex-direction:column;align-items:center;gap:10px;padding:26px 18px;border:1px solid #e5e7eb;border-radius:16px;background:#fff;text-decoration:none;color:inherit;transition:.15s;box-shadow:0 1px 2px rgba(0,0,0,.04);}
.landing-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.1);border-color:#bfdbfe;}
.landing-card.landing-cashier .landing-icon{background:#eef2ff;color:#4f46e5;}
.landing-card.landing-manager .landing-icon{background:#ecfdf5;color:#059669;}
.landing-card.landing-kitchen .landing-icon{background:#fffbeb;color:#d97706;}
.landing-icon{width:64px;height:64px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:30px;}
.landing-card h3{margin:0;font-size:18px;}
.landing-card p{margin:0;font-size:13px;color:#6b7280;min-height:36px;}
.landing-go{color:#2563eb;font-weight:bold;font-size:14px;}

/* شاشة المطبخ */
.kitchen-toolbar{display:flex;align-items:center;gap:14px;margin-bottom:14px;flex-wrap:wrap;}
.kitchen-clock{font-size:18px;font-weight:bold;color:#374151;}
.kitchen-board{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;align-items:start;}
@media (max-width:900px){.kitchen-board{grid-template-columns:1fr;}}
.kitchen-refunds{background:#fffbeb;border:2px solid #f59e0b;border-radius:12px;padding:14px;margin-bottom:16px;}
.kitchen-refunds-head{display:flex;align-items:center;gap:10px;margin-bottom:6px;}
.kitchen-refunds-head h3{margin:0;}
.kitchen-refunds-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px;margin-top:10px;}
.kitchen-refund-card{background:#fff;border:1px solid #fcd34d;border-radius:10px;padding:10px;}
.kitchen-col{background:#f3f4f6;border-radius:10px;padding:10px;}
.kitchen-col-head{font-weight:bold;padding:8px;border-radius:6px;margin-bottom:10px;color:#fff;display:flex;justify-content:space-between;align-items:center;}
.kitchen-col-new .kitchen-col-head{background:#2563eb;}
.kitchen-col-preparing .kitchen-col-head{background:#d97706;}
.kitchen-col-ready .kitchen-col-head{background:#16a34a;}
.kitchen-count{background:rgba(255,255,255,.25);padding:2px 8px;border-radius:10px;}
.kitchen-col-body{min-height:80px;display:flex;flex-direction:column;gap:8px;}
.kitchen-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:10px;box-shadow:0 1px 2px rgba(0,0,0,.04);}
.kitchen-card-late{border-color:#dc2626;background:#fef2f2;box-shadow:0 0 0 1px #fecaca, 0 2px 6px rgba(220,38,38,.15);}
.kitchen-late-badge{background:#dc2626;color:#fff;font-size:11px;font-weight:bold;border-radius:10px;padding:2px 8px;animation:kitchen-late-pulse 1.2s infinite;}
@keyframes kitchen-late-pulse{0%,100%{opacity:1;}50%{opacity:.55;}}
.kitchen-flash{animation:kitchen-flash-bg .5s ease 3;}
@keyframes kitchen-flash-bg{0%,100%{background-color:transparent;}50%{background-color:#fde047;border-radius:8px;}}

/* ماسح الباركود بالكاميرا */
.barcode-row{display:flex;gap:8px;margin-bottom:8px;}
.barcode-row input{flex:1;}
.barcode-cam-btn{white-space:nowrap;}
.scanner-modal{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.75);display:flex;align-items:center;justify-content:center;padding:16px;}
.scanner-box{background:#fff;border-radius:14px;padding:16px;width:100%;max-width:420px;box-shadow:0 10px 40px rgba(0,0,0,.3);}
.scanner-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.scanner-hint{color:#374151;font-size:13px;margin-bottom:10px;min-height:18px;}
#scanner-container{position:relative;width:100%;border-radius:10px;overflow:hidden;background:#0f172a;min-height:220px;}
#scanner-container video,#scanner-container canvas{width:100%;display:block;object-fit:cover;}
.scanner-box .btn-block{margin-top:10px;}
@media (max-width:768px){
    .scanner-modal{padding:8px;}
    #scanner-container{min-height:46vh;}
}
.kitchen-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.kitchen-card-head strong{font-size:17px;}
.kitchen-order-time{color:#9ca3af;font-size:13px;}
.kitchen-card-row{font-size:13px;margin-bottom:4px;color:#374151;}
.kitchen-card-row.scheduled{color:#d97706;}
.kitchen-card-row.cake-text{color:#7c3aed;font-weight:bold;}
.kitchen-card-row.notes-text{color:#b45309;font-style:italic;}
.custom-badge{background:#fef3c7;border-radius:6px;padding:2px 8px;display:inline-block;font-size:12px;}
.kitchen-card-items{border-top:1px dashed #e5e7eb;margin-top:8px;padding-top:8px;display:flex;flex-direction:column;gap:3px;}
.kitchen-item{display:flex;gap:6px;font-size:14px;}
.kitchen-item-qty{font-weight:bold;color:#2563eb;}
.kitchen-item-name{flex:1;}
.kitchen-card-actions{margin-top:8px;}
.kitchen-btn-start{width:100%;}
.kitchen-btn-ready{width:100%;font-size:14px;padding:8px;}
.kitchen-btn-complete{width:100%;}
.kitchen-empty{color:#9ca3af;text-align:center;font-size:13px;padding:12px 0;}
.kitchen-done{margin-top:16px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;padding:10px 14px;}
.kitchen-done h3{margin:0 0 8px;font-size:14px;color:#15803d;}
.kitchen-done-list{display:flex;flex-wrap:wrap;gap:8px;}
.kitchen-done-item{background:#fff;border:1px solid #bbf7d0;border-radius:8px;padding:3px 10px;font-size:13px;}
.kitchen-done-item small{color:#6b7280;}

/* سجل العمليات */
.subtle{color:#6b7280;font-size:13px;}
.filter-bar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px;}
.filter-bar select,.filter-bar input{padding:7px 10px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;}
.filter-bar input{min-width:180px;}
.table-wrap{overflow-x:auto;background:#fff;border:1px solid #e5e7eb;border-radius:10px;}
.table{width:100%;border-collapse:collapse;font-size:13px;}
.table th,.table td{padding:9px 10px;border-bottom:1px solid #f3f4f6;text-align:right;vertical-align:top;}
.table th{background:#f9fafb;color:#6b7280;font-size:12px;white-space:nowrap;}
.table tr:hover td{background:#fafbfc;}
.nowrap{white-space:nowrap;}
.audit-details{color:#374151;max-width:320px;}
.center{text-align:center;color:#9ca3af;padding:24px 0;}

/* ---------- واجهة الكاشير (SPA) ---------- */
.pos-shell{display:flex;gap:16px;align-items:flex-start;}
.pos-sidebar{
    display:flex;flex-direction:column;gap:8px;
    background:#1e293b;padding:10px;border-radius:12px;
    min-width:88px;position:sticky;top:16px;flex-shrink:0;
}
.pos-sbtn{
    display:flex;flex-direction:column;align-items:center;gap:4px;
    background:transparent;border:1px solid transparent;border-radius:10px;
    color:#cbd5e1;padding:12px 6px;cursor:pointer;font-size:12px;font-weight:600;
    transition:all .15s;width:100%;line-height:1.2;
}
.pos-sbtn .pos-ico{font-size:24px;}
.pos-sbtn:hover{background:#334155;color:#fff;}
.pos-sbtn.active{background:#2563eb;border-color:#2563eb;color:#fff;}
.pos-sbtn.pos-home{background:#065f46;border-color:#10b981;color:#a7f3d0;}
.pos-sbtn.pos-home:hover{background:#047857;color:#fff;}
.pos-main{flex:1;min-width:0;}
.pos-panel{display:none;}
.pos-panel.active{display:block;}
.muted{color:#6b7280;font-size:13px;}

.items-toolbar{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap;}
.items-toolbar input{flex:1;min-width:180px;padding:10px;border:2px solid #e5e7eb;border-radius:8px;font-size:15px;}
.items-toolbar select{padding:10px;border:2px solid #e5e7eb;border-radius:8px;font-size:15px;background:#fff;}
.no-results{color:#9ca3af;text-align:center;padding:30px 0;}

/* ---------- الواجهة البصرية للأصناف ---------- */
.visual-toolbar{display:flex;gap:8px;margin-bottom:12px;align-items:center;}
.mobile-cart-btn{display:none;}
.visual-search{flex:1;min-width:0;}
.visual-scan{padding:10px 14px;border-radius:10px;font-size:16px;flex-shrink:0;}
.visual-crumb{
    display:flex;align-items:center;flex-wrap:wrap;gap:4px;
    background:#f1f5f9;border-radius:10px;padding:8px 12px;margin-bottom:14px;
    font-size:14px;min-height:38px;
}
.crumb-part{color:#2563eb;cursor:pointer;font-weight:600;padding:2px 6px;border-radius:6px;transition:.15s;}
.crumb-part:hover{background:#dbeafe;}
.crumb-last{color:#334155;cursor:default;}
.crumb-last:hover{background:transparent;}
.crumb-sep{color:#9ca3af;font-weight:700;margin:0 2px;}
.visual-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));}
.vitem-card{
    position:relative;background:#fff;border:1px solid #e5e7eb;border-radius:14px;
    overflow:hidden;cursor:pointer;transition:transform .15s,box-shadow .15s,border-color .15s;
    display:flex;flex-direction:column;text-align:center;padding-bottom:12px;
}
.vitem-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.10);border-color:#6366f1;}
.vitem-img{
    position:relative;width:100%;height:120px;background:#f3f4f6;
    display:flex;align-items:center;justify-content:center;overflow:hidden;
}
.vitem-img img{width:100%;height:100%;object-fit:cover;}
.vimg-empty .vimg-ph{font-size:40px;opacity:.45;}
.vimg-ph{display:block;}
.vimg-empty:has(img){display:flex;}
.vitem-name{font-weight:700;font-size:14px;color:#1f2937;padding:10px 8px 2px;line-height:1.3;}
.vitem-name small{display:block;color:#9ca3af;font-weight:500;font-size:11px;direction:ltr;}
.vitem-price{color:#16a34a;font-weight:700;font-size:15px;padding:2px 8px;}
.vitem-add{
    position:absolute;top:8px;left:8px;width:34px;height:34px;border:none;border-radius:50%;
    background:#2563eb;color:#fff;font-size:22px;line-height:1;cursor:pointer;
    box-shadow:0 3px 8px rgba(37,99,235,.4);transition:.15s;
}
.vitem-add:hover{background:#1d4ed8;transform:scale(1.1);}
.vcat-card{
    background:#fff;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;
    cursor:pointer;transition:transform .15s,box-shadow .15s,border-color .15s;
    display:flex;flex-direction:column;text-align:center;padding-bottom:12px;
}
.vcat-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.10);border-color:#f59e0b;}
.vcat-all{border-style:dashed;border-color:#9ca3af;}
.vcat-count{color:#6b7280;font-size:12px;padding:2px 8px;}

.panel-toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-bottom:12px;flex-wrap:wrap;}
.panel-toolbar input,.panel-toolbar select{padding:10px;border:2px solid #e5e7eb;border-radius:8px;font-size:14px;}

/* الباركود */
.barcode-panel{
    background:white;padding:30px;border-radius:12px;box-shadow:0 2px 8px rgba(0,0,0,.06);
    max-width:560px;margin:0 auto;text-align:center;
}
.barcode-panel h2{color:#1e293b;margin-bottom:8px;}
/* حقل مسح الباركود فقط (لا يمس حقول صفحة طباعة الباركود) */
#barcodeInput,
.barcode-row input{
    width:100%;padding:18px;font-size:22px;border:3px solid #2563eb;border-radius:10px;
    background:#f0f9ff;font-weight:bold;letter-spacing:2px;margin:16px 0;text-align:center;
}
#barcodeInput:focus,
.barcode-row input:focus{outline:none;box-shadow:0 0 0 3px rgba(37,99,235,.3);}

/* صفحة طباعة الباركود: مساحة أوسع للصفوف بدل العمود الضيق */
#panel-printbc .barcode-panel{
    max-width:1100px;
    width:100%;
    padding:20px;
    text-align:right;
}
.barcode-status{margin:10px 0 16px;font-size:15px;min-height:24px;}
.ok-chip{color:#16a34a;font-weight:bold;}
.err-chip{color:#dc2626;font-weight:bold;}

.printbc-list{text-align:right;max-height:60vh;overflow-y:auto;margin-top:14px;display:flex;flex-direction:column;gap:8px;}
.printbc-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:10px 12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:10px 14px;text-align:right;}
.printbc-img{width:56px;height:56px;flex:0 0 auto;border-radius:8px;overflow:hidden;background:#f1f5f9;display:flex;align-items:center;justify-content:center;}
.printbc-img img{width:100%;height:100%;object-fit:cover;}
.printbc-img-empty{font-size:24px;color:#94a3b8;}
.printbc-info{flex:1 1 200px;min-width:180px;display:flex;flex-direction:column;gap:3px;}
.printbc-info .item-name{font-weight:700;line-height:1.4;overflow-wrap:anywhere;word-break:break-word;}
.printbc-info .item-price{color:#15803d;font-weight:800;line-height:1.4;white-space:nowrap;}
.printbc-code{font-family:monospace;color:#2563eb;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:break-all;}
.printbc-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px;flex:0 1 auto;margin-inline-start:auto;max-width:100%;}
.printbc-actions .btn{padding:7px 12px;font-size:13px;white-space:nowrap;}
.printbc-qty{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#334155;white-space:nowrap;}
.printbc-qty input{width:64px;padding:7px 6px;border:1px solid #cbd5e1;border-radius:8px;font-size:15px;text-align:center;background:#fff;color:#0f172a;}

/* الهواتف وشاشات اللمس: الأزرار والعدد في سطر مستقل تحت الاسم والسعر */
@media (max-width: 820px), (pointer: coarse) {
    .printbc-row{padding:12px;gap:10px 12px;}
    .printbc-img{width:52px;height:52px;}
    .printbc-info{flex:1 1 160px;min-width:150px;}
    .printbc-info .item-name{font-size:15px;}
    .printbc-info .item-price{font-size:14px;}
    .printbc-actions{
        flex:1 1 100%;
        width:100%;
        justify-content:flex-start;
        margin-inline-start:0;
        border-top:1px dashed #e2e8f0;
        padding-top:10px;
    }
    .printbc-actions .btn{min-height:44px;flex:0 0 auto;}
    .printbc-qty input{min-height:44px;width:72px;}
}

/* الشاشات الصغيرة جداً: العدد في سطر والأزرار الثلاثة في سطر واحد */
@media (max-width: 480px) {
    .printbc-actions{gap:6px;}
    .printbc-actions .btn{flex:0 0 auto;font-size:11px;padding:6px 8px;min-height:40px;min-width:0;}
    .printbc-qty{flex:1 1 100%;justify-content:flex-start;}
}

.pos-toast{
    position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);
    background:#1e293b;color:#fff;padding:12px 22px;border-radius:10px;font-size:15px;font-weight:600;
    opacity:0;pointer-events:none;transition:all .25s;z-index:2000;box-shadow:0 8px 24px rgba(0,0,0,.3);
}
.pos-toast.show{opacity:1;transform:translateX(-50%) translateY(0);}

/* العملاء */
.customer-list{display:flex;flex-direction:column;gap:8px;margin-top:12px;}
.customer-card{
    display:flex;justify-content:space-between;align-items:center;gap:10px;
    background:white;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;cursor:pointer;transition:.15s;
}
.customer-card:hover{border-color:#6366f1;background:#eef2ff;}
.customer-card-name{font-weight:700;font-size:15px;}
.customer-card-phone{color:#6b7280;font-size:13px;margin-top:2px;}
.customer-card-stats{display:flex;gap:14px;font-size:13px;color:#374151;flex-shrink:0;}
.customer-form{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:14px;margin-top:12px;display:flex;flex-direction:column;gap:8px;}
.customer-addr-box{background:white;border:1px solid #e5e7eb;border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}
.customer-addr-box h4{margin:0 0 4px;font-size:14px;color:#1e293b;}
.customer-addr-box select,.customer-addr-box input,.customer-addr-box textarea{width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;background:#fff;color:#1f2937;}
.customer-addr-box select:focus,.customer-addr-box input:focus,.customer-addr-box textarea:focus{outline:none;border-color:#0ea5e9;box-shadow:0 0 0 2px rgba(14,165,233,.15);}
.addr-mini{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;}
.customer-form .field-row select,.customer-form .field-row input,.customer-form .field-row textarea{width:100%;box-sizing:border-box;}
.customer-detail{background:white;border-radius:12px;padding:20px;box-shadow:0 2px 8px rgba(0,0,0,.06);}
.customer-stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:16px 0;}
.stat-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:12px;text-align:center;}
.stat-box span{display:block;color:#6b7280;font-size:12px;margin-bottom:4px;}
.stat-box b{font-size:16px;color:#1e293b;}
.customer-edit-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:14px;margin:14px 0;}

/* الطلبات */
.orders-list{display:flex;flex-direction:column;gap:8px;margin-top:12px;}
.order-card{
    background:white;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;cursor:pointer;transition:.15s;
}
.order-card:hover{border-color:#6366f1;background:#eef2ff;}
.order-card-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.order-card-info{display:flex;flex-wrap:wrap;gap:14px;font-size:13px;color:#374151;}
.order-card .btn-refund{margin-top:10px;display:inline-block;}
.refunds-box{max-width:760px;}
.refunds-hint{font-size:13px;color:#6b7280;margin:6px 0 12px;}
.refunds-subhead{margin:14px 0 8px;color:#374151;font-size:15px;}
.refund-req-card{background:white;border:1px solid #e5e7eb;border-radius:10px;padding:12px 14px;margin-bottom:10px;}
.refund-req-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.refund-req-info{display:flex;flex-wrap:wrap;gap:14px;font-size:13px;color:#374151;}
.refund-req-reason{background:#f8fafc;border:1px solid #e5e7eb;border-radius:8px;padding:8px;margin-top:8px;font-size:13px;color:#374151;}
.refund-req-reason.rejected{border-color:#fecaca;color:#b91c1c;background:#fef2f2;}
.order-detail{background:white;border-radius:12px;padding:20px;box-shadow:0 2px 8px rgba(0,0,0,.06);}
.order-meta{display:flex;flex-wrap:wrap;gap:14px;font-size:14px;color:#374151;margin:12px 0;}
.change-status-box,.assign-driver-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:14px;margin:12px 0;}
.change-status-box select,.assign-driver-box select{padding:10px;border:2px solid #e5e7eb;border-radius:8px;margin-right:8px;min-width:160px;}

/* السائقون */
.drivers-list{display:flex;flex-direction:column;gap:10px;}
.driver-card{background:white;border:1px solid #e5e7eb;border-radius:10px;padding:14px;box-shadow:0 2px 8px rgba(0,0,0,.05);}
.driver-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;}
.driver-name{font-weight:700;font-size:16px;}
.driver-phone{color:#6b7280;font-size:13px;}
.driver-type{font-size:12px;color:#2563eb;margin-top:2px;}
.driver-stats{display:flex;gap:20px;margin:12px 0;font-size:14px;color:#374151;}
.driver-actions{display:flex;gap:8px;flex-wrap:wrap;}

/* التقارير */
.report-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:20px;}
.reports-panel h4{margin:20px 0 8px;color:#374151;}

/* شارات الحالة */
.status-badge{display:inline-block;padding:4px 10px;border-radius:20px;font-size:12px;font-weight:700;color:#fff;}
.st-new{background:#f59e0b;}
.st-preparing{background:#f97316;}
.st-ready{background:#2563eb;}
.st-with_driver{background:#8b5cf6;}
.st-delivered{background:#16a34a;}
.st-cancelled{background:#dc2626;}
.st-completed{background:#059669;}
.st-available{background:#16a34a;}
.st-on_delivery{background:#2563eb;}
.st-offline{background:#6b7280;}
.status-ok{background:#16a34a;}
.status-error{background:#dc2626;}
.status-warn{background:#f59e0b;}
.badge-muted{color:#9ca3af;font-size:12px;margin-inline-start:4px;}
.webhook-payload{max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr;font-family:monospace;font-size:12px;}

@media (max-width:800px){
    .pos-shell{flex-direction:column;}
    .pos-sidebar{flex-direction:row;flex-wrap:wrap;position:static;width:100%;}
    .pos-sbtn{flex:1;min-width:90px;padding:10px 4px;}
    .customer-card{flex-direction:column;align-items:flex-start;}
    .customer-card-stats{flex-wrap:wrap;}
}

/* �?�?�?�?�?�?�?�?�? */
.pos-tabs{display:flex;gap:8px;margin-bottom:15px;flex-wrap:wrap;}
.pos-tab{flex:1;padding:10px 14px;border:2px solid #e5e7eb;background:#fff;border-radius:10px;font-size:15px;font-weight:bold;color:#374151;cursor:pointer;transition:all .15s;}
.pos-tab:hover{border-color:#93c5fd;color:#1d4ed8;}
.pos-tab.active{background:#2563eb;border-color:#2563eb;color:#fff;}
.pos-view{width:100%;}


/* بطاقات نوع الطلب (استلام من المحل / توصيل) */
.order-type-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.order-type-card {
    flex: 1 1 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 10px; border: 2px solid #d1d5db; border-radius: 14px;
    cursor: pointer; background: #ffffff; transition: all .15s ease;
    user-select: none; min-width: 0;
}
.otc-img { display: flex; align-items: center; justify-content: center; width: 100%; }
.otc-img img { width: 96px; height: 96px; object-fit: contain; display: block; }
.otc-label { font-size: 15px; font-weight: 800; color: #374151; text-align: center; line-height: 1.35; }
.order-type-card:hover { border-color: #9ca3af; }
.order-type-card.active { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.order-type-card.active .otc-label { color: #15803d; }
.order-type-card.active .otc-img img { transform: scale(1.05); }

/* خيارات تحميل رسوم التوصيل: العميل يدفع كامل التوصيل أو المحل يتحمله كاملاً */
.delivery-split-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; width: 100%; }
.split-opt {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border: 2px solid #d1d5db; border-radius: 12px; background: #fff;
    cursor: pointer; transition: all .15s ease; min-width: 0;
}
.split-opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: #16a34a; }
.split-opt-ico { font-size: 24px; line-height: 1; }
.split-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.split-opt-text b { font-size: 15px; font-weight: 800; color: #0f172a; line-height: 1.3; }
.split-opt-text small { font-size: 12px; color: #64748b; line-height: 1.4; }
.split-opt:has(input:checked) { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.split-opt:has(input:checked) .split-opt-text b { color: #15803d; }

/* نوع السداد: دفع كامل أو آجل (الباقي معلّق) */
.settle-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.settle-opt {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 14px; border: 2px solid #d1d5db; border-radius: 14px; background: #fff;
    cursor: pointer; transition: all .15s ease; min-width: 0;
}
.settle-opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: #2563eb; }
.settle-ico { font-size: 26px; line-height: 1; }
.settle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settle-text b { font-size: 16px; font-weight: 800; color: #0f172a; line-height: 1.3; }
.settle-text small { font-size: 12px; color: #64748b; line-height: 1.4; }
.settle-opt.active { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.settle-opt.active .settle-text b { color: #1d4ed8; }
.credit-pending-box {
    background: #fffbeb; border: 2px solid #fbbf24; border-radius: 12px;
    padding: 12px 14px; margin: 0 0 14px;
}
.credit-pending-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 800; color: #92400e; }
.credit-pending-row strong { font-size: 20px; }
.credit-pending-note { margin: 6px 0 0; font-size: 12px; color: #92400e; line-height: 1.5; }
.credit-customer-warn {
    margin: 8px 0 0; padding: 8px 10px; border-radius: 8px;
    background: #fef2f2; border: 1.5px solid #fca5a5; color: #b91c1c;
    font-size: 12px; font-weight: 700; line-height: 1.5;
}

@media (max-width: 520px) {
    .otc-img img { width: 76px; height: 76px; }
}

/* ===== الترجمة الذكية التلقائية (AI Translate) ===== */
.ai-en-wrap { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.ai-badge { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; line-height: 1.6; }
.ai-badge-ai { background: #e6f4ea; color: #137333; }
.ai-badge-manual { background: #fef3c7; color: #92400e; }
.ai-badge-busy { background: #e8f0fe; color: #1a56db; animation: ai-pulse 1.1s ease-in-out infinite; }
.ai-regen { border: 1px solid #d1d5db; background: #f9fafb; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1; padding: 3px 6px; }
.ai-regen:hover { background: #eef2ff; border-color: #a5b4fc; }
.ai-note { font-size: 11px; font-weight: 500; width: 100%; }
.ai-note-error { color: #b3261e; }
.ai-note-success { color: #137333; }

.ai-confirm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ai-confirm-box {
    background: #fff; border-radius: 12px; padding: 20px; max-width: 440px; width: 100%;
    box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center;
}
.ai-confirm-box p { margin: 0 0 16px; font-size: 15px; font-weight: 600; color: #111827; }
.ai-confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes ai-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---- PHASE 5: ??????? HR ---- */
.btn-warning { background: #d97706; color: white; }
.btn-info { background: #0284c7; color: white; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.list-group { list-style: none; padding: 0; margin: 8px 0; }
.list-group-item { padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 6px; background: #fff; }
.form-control { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; box-sizing: border-box; }
.form-label { display: block; margin-bottom: 4px; font-size: 13px; color: #374151; }
.table-hover tbody tr:hover { background: #f9fafb; }
.card .muted { color: #6b7280; }

/* ============================================================
   نظام الصفحات المستقلة وزر الرجوع (Single-Page Steps + Back)
   ============================================================ */
.topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.topbar-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}
.topbar-start, .topbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.topbar-back-btn {
    background: #334155 !important;
    color: #fff !important;
    border: 1.5px solid #64748b !important;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
}
.topbar-menu-btn {
    background: #2563eb !important;
    color: #fff !important;
    border: 1.5px solid #60a5fa !important;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
}
.global-nav-page {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.96);
    z-index: 3000;
    overflow-y: auto;
    padding: 20px 16px;
}
.global-nav-page-inner {
    max-width: 960px;
    margin: 0 auto;
}
.global-nav-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #334155;
    color: #fff;
    font-size: 18px;
}
.global-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}
.global-nav-grid a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 64px;
    padding: 14px 12px !important;
    background: #1e293b !important;
    color: #f8fafc !important;
    border: 1.5px solid #334155 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    margin: 0 !important;
}
.global-nav-grid a:hover, .global-nav-grid a:active {
    background: #2563eb !important;
    border-color: #60a5fa !important;
}

/* شاشة الكاشير: عرض الأقسام كصفحة رئيسية مستقلة أو عرض الصفحة المفتوحة لوحدها */
#posShell {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px;
}
#posShell .pos-main {
    order: 1;
    width: 100%;
}
#posShell .pos-sidebar {
    order: 2;
    width: 100% !important;
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 14px !important;
    background: transparent !important;
    padding: 4px 0 !important;
    box-shadow: none !important;
}
#posShell .pos-sidebar .pos-sbtn {
    min-height: 110px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 16px 12px !important;
}
#posShell .pos-sidebar .pos-sbtn .pos-ico {
    font-size: 34px !important;
}
#posShell .pos-sidebar .pos-sbtn:hover,
#posShell .pos-sidebar .pos-sbtn:active {
    border-color: #2563eb !important;
    background: #eff6ff !important;
}
#posShell[data-view="home"] .pos-panel {
    display: none !important;
}
#posShell[data-view="panel"] .pos-sidebar {
    display: none !important;
}

/* شريط الصفحة وزر الرجوع داخل الكاشير */
.pos-step-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #1e293b;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}
.pos-step-title {
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    flex: 1;
}
.pos-back-btn {
    min-height: 48px !important;
    padding: 10px 18px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
}
.pos-home-btn {
    min-height: 48px !important;
    padding: 10px 16px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
}

/* خطوات البيع كصفحات مستقلة تماماً */
#panel-sale .pos-layout {
    display: block !important;
    width: 100% !important;
}
#panel-sale #saleCartPanel {
    position: static !important;
    transform: none !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    z-index: 1 !important;
}
#panel-sale[data-sale-step="browse"] #saleCartPanel {
    display: none !important;
}
#panel-sale[data-sale-step="cart"] #saleStepBrowse,
#panel-sale[data-sale-step="info"] #saleStepBrowse,
#panel-sale[data-sale-step="payment"] #saleStepBrowse {
    display: none !important;
}
.pos-step-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1.5px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pos-next-btn {
    min-height: 56px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
}
.payment-summary-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 2px solid #22c55e;
    color: #15803d;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    font-size: 20px;
    font-weight: 800;
}

/* أزرار الدفع: مساحة لمس مريحة على شاشة iMin */
#saleStepPayment .payment-option {
    min-height: 56px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
}
#saleStepPayment .payment-option:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}
#saleStepPayment .payment-ico { font-size: 22px; }
#saleStepPayment #btnCompleteSale {
    min-height: 64px;
    font-size: 20px;
    font-weight: 800;
    border-radius: 14px;
    margin-top: 6px;
}

/* ---- Nav drawer fix (2026-11-10) ----
   .topbar uses backdrop-filter, which makes it the containing block for
   position:fixed descendants. #globalNavDrawer is rendered inside .topbar,
   so the drawer was clipped to the topbar height (~72px) instead of the
   viewport. Disable the blur only while the drawer is open. */
body.global-nav-open .topbar,
body.global-nav-open .topbar-main-row {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}