body {
    font-family: 'Noto Sans Arabic', sans-serif;
}

.full-width {
    width: 100%;
}
.right-align {
    text-align: right;
}
.btn-block {
    display: block;
    width: 100%;
}
.row-ok {
    background-color: #d4edda;
}
.row-over {
    background-color: #ffe5b4;
}
.row-missing {
    background-color: #f8d7da;
}
.list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
/* نام کالا فضای باقی‌مانده را بگیرد و مرتب نمایش داده شود */
.list-group-item > span:first-child {
    flex: 1 1 auto;
    word-break: break-word;
}
/* بج‌ها و دکمه‌ها فشرده نشوند */
.list-group-item > .order-qty-badge,
.list-group-item > .scan-state-badge,
.list-group-item > .discrepancy-type-badge,
.list-group-item > button {
    flex: 0 0 auto;
}
.top-section {
    margin-bottom: 20px;
}
.guide-box {
    border: 2px solid #000;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: right;
}
.color-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 10px;
}
.color-red {
    background-color: #f8d7da;
}
.color-green {
    background-color: #d4edda;
}
.color-orange {
    background-color: #ffe5b4;
}
.align-buttons {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}
.align-counts {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fixed-bottom {
    position: absolute;
    bottom: 10px;
    width: 100%;
}

ul:not(#brandCountList) {
    padding-inline-start: 0;
    max-height: 600px;
    min-height: 600px;
    overflow-y: auto;
}

form {
    min-height: 116px;
    display: flex;
    flex-direction: column;
}

form > button {
    margin-top: auto;
}

ul.discrepancy-list {
    margin-top: 156px;
}

/* پنل «آخرین اسکن» */
.last-scan-panel {
    border: 3px solid #ced4da;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s;
}
.last-scan-head {
    font-size: 0.9rem;
    color: #666;
}
.last-scan-barcode {
    font-size: 1.8rem;
    font-weight: bold;
    word-break: break-all;
}
.last-scan-status {
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 4px;
}
.last-scan-progress {
    font-size: 1rem;
    margin-top: 6px;
    color: #333;
}
.last-scan-panel.state-idle {
    background-color: #f1f3f5;
    border-color: #ced4da;
}
.last-scan-panel.state-ok {
    background-color: #d4edda;
    border-color: #28a745;
}
.last-scan-panel.state-ok .last-scan-status {
    color: #155724;
}
.last-scan-panel.state-missing {
    background-color: #f8d7da;
    border-color: #dc3545;
}
.last-scan-panel.state-missing .last-scan-status {
    color: #721c24;
}
.last-scan-panel.state-over {
    background-color: #ffe5b4;
    border-color: #fd7e14;
}
.last-scan-panel.state-over .last-scan-status {
    color: #8a4b00;
}

/* هایلایت موقت ردیف تازه اسکن‌شده */
.just-scanned {
    animation: flashRow 2.5s ease-out;
}
.just-scanned-ok {
    box-shadow: inset 4px 0 0 #28a745;
}
.just-scanned-missing {
    box-shadow: inset 4px 0 0 #dc3545;
}
.just-scanned-over {
    box-shadow: inset 4px 0 0 #fd7e14;
}
@keyframes flashRow {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

/* برچسب نوع مغایرت */
.discrepancy-type-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.type-shortage {            /* کسری (برداشته نشد) — آبی */
    background-color: #cfe2ff;
    color: #084298;
}
.type-extra {               /* اضافی (در سفارش نبود) — قرمز */
    background-color: #f8d7da;
    color: #721c24;
}
.type-overpick {            /* اضافی (بیش از سفارش) — نارنجی */
    background-color: #ffe5b4;
    color: #8a4b00;
}

/* بج تعداد در ستون سفارش */
.order-qty-badge {
    background-color: #cfe2ff;
    color: #084298;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* بج وضعیت ردیف در ستون اسکن‌شده‌ها */
.scan-state-badge {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    background-color: #fff;          /* خنثی تا آیکون و متن واضح دیده شوند */
    border: 1px solid #ccc;
}
.badge-ok {
    color: #155724;
    border-color: #28a745;
}
.badge-over {
    color: #8a4b00;
    border-color: #fd7e14;
}
.badge-missing {
    color: #721c24;
    border-color: #dc3545;
}
