.orders-toolbar {
    margin-bottom: 16px;
}

#orders .orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

#orders .order-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-card);
    align-items: stretch;
}

#orders .order-card-completed {
    opacity: 0.88;
}

#orders .order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

#orders .order-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

#orders .order-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

#orders .order-status-new { background: rgba(99, 102, 241, 0.18); color: #818cf8; }
#orders .order-status-processing { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
#orders .order-status-completed { background: rgba(16, 185, 129, 0.18); color: #34d399; }
#orders .order-status-cancelled { background: rgba(239, 68, 68, 0.16); color: #f87171; }

#orders .order-client {
    font-size: 0.86rem;
    margin-top: 4px;
}

#orders .order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 10px;
    font-size: 0.86rem;
}

#orders .order-amount {
    font-weight: 700;
    color: var(--text-main);
}

#orders .order-deadline,
#orders .order-date {
    color: var(--text-muted);
}

#orders .order-items-note,
#orders .order-notes {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

#orders .order-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

#orders .order-delete-btn {
    color: var(--danger);
}

#orders .order-complete-btn {
    color: var(--success);
}

#order-modal .order-modal-dialog {
    max-width: min(720px, 94vw);
}

#order-modal .order-modal-inline-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#order-modal .order-textarea {
    min-height: 72px;
    resize: vertical;
}

#order-modal .order-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#order-modal .order-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 36px;
    gap: 8px;
    align-items: center;
}

#order-modal .order-item-picker-cell {
    min-width: 0;
}

#order-modal .order-item-product-btn {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    cursor: pointer;
}

#order-modal .order-item-product-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#order-modal .order-item-picker-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
}

.order-item-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5300;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 12px 12px;
    background: rgba(0, 0, 0, 0.45);
}

.order-item-picker-overlay.open {
    display: flex;
}

.order-item-picker-panel {
    width: min(560px, 95vw);
    max-height: 78vh;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.order-item-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.order-item-picker-body {
    overflow-y: auto;
    max-height: calc(78vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-item-picker-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: transparent;
    color: inherit;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.order-item-picker-row:hover {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.08);
}

.order-item-picker-row-name {
    min-width: 0;
}

.order-item-picker-stock {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.order-item-picker-empty {
    color: var(--text-muted);
    margin: 12px 0;
}

@media (max-width: 720px) {
    #order-modal .order-modal-inline-row,
    #order-modal .order-item-row {
        grid-template-columns: 1fr;
    }
}
