* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", sans-serif;
    background: #f5f5f5;
    color: #000;
    padding-bottom: 30px;
}

/* ---- Header ---- */
.header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    font-size: 24px;
    cursor: pointer;
    text-decoration: none;
    color: #000;
    line-height: 1;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

/* ---- Tabs ---- */
.tabs {
    background: white;
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 57px;
    z-index: 99;
}

.tab-btn {
    flex: 1;
    padding: 12px 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    user-select: none;
    line-height: 1.3;
}

.tab-btn.active {
    color: #007c00;
    border-bottom-color: #007c00;
}

/* ---- Skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin: 10px 15px 0;
    height: 70px;
}

/* ---- Order cards (index) ---- */
.order-list {
    padding: 10px 15px;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s;
}

.order-card:active {
    transform: scale(0.98);
}

.order-card-left .order-number {
    font-size: 15px;
    font-weight: 700;
    color: #007c00;
    margin-bottom: 4px;
}

.order-card-left .shop-name {
    font-size: 13px;
    color: #444;
}

.order-card-left .delivery-date {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

.order-card-right {
    font-size: 20px;
    color: #ccc;
}

/* ---- Empty ---- */
.empty {
    text-align: center;
    padding: 70px 20px;
    color: #999;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 15px;
}

/* ================= SHOW PAGE ================= */
.show-body {
    padding-bottom: 200px;
}

/* Info section */
.info-section {
    background: white;
    border-radius: 12px;
    margin: 12px 15px 0;
    overflow: hidden;
}

.info-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #007c00;
    padding: 12px 15px 6px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 9px 15px;
    border-top: 1px solid #f5f5f5;
    gap: 12px;
}

.info-label {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.badge-new      { background: #dbeafe; color: #1d4ed8; }
.badge-sent     { background: #fef3c7; color: #b45309; }
.badge-closed   { background: #dcfce7; color: #166534; }

/* ---- Product items (show) ---- */
.products-section {
    margin: 12px 15px 0;
}

.products-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    padding: 0 2px;
}

.product-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.product-img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 13px;
    color: #007c00;
    font-weight: 600;
    margin-bottom: 2px;
}

.product-weight {
    font-size: 12px;
    color: #888;
}

.product-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-ctrl {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #007c00;
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.2s;
    flex-shrink: 0;
}

.btn-ctrl:active { transform: scale(0.88); }
.btn-ctrl:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ctrl.btn-minus { background: #ff4757; }

.item-qty {
    min-width: 36px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}

.item-qty.zero { color: #ff4757; }

/* ---- Comment section ---- */
.comment-section {
    margin: 12px 15px 0;
}

.comment-label {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.comment-label.required-hint {
    color: #ff4757;
}

.comment-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: "Open Sans", sans-serif;
    font-size: 13px;
    resize: none;
    height: 80px;
    background: white;
    transition: border-color 0.2s;
}

.comment-textarea:focus {
    outline: none;
    border-color: #007c00;
}

.comment-textarea.error {
    border-color: #ff4757;
}

/* ---- Delivery price input ---- */
.delivery-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.delivery-price-label {
    font-size: 13px;
    color: #333;
}

.delivery-price-value {
    font-size: 13px;
    font-weight: 700;
    color: #007c00;
}

.delivery-price-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: "Open Sans", sans-serif;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
}

.delivery-price-input:focus {
    outline: none;
    border-color: #007c00;
}

/* ---- Bottom checkboxes & button ---- */
.bottom-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 12px 15px;
    z-index: 90;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #007c00;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-row.rejected-row input[type="checkbox"] {
    accent-color: #ff4757;
}

.checkbox-label {
    font-size: 14px;
    font-weight: 500;
}

.checkbox-divider {
    height: 1px;
    background: #f0f0f0;
}

.btn-close-order {
    width: 100%;
    background: #007c00;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-close-order:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-start-delivery {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #007c00;
    color: white;
    border: none;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 90;
    transition: opacity 0.2s;
}

.btn-start-delivery:disabled { opacity: 0.5; }

/* ---- Rejected overlay on products ---- */
.product-item.rejected-item {
    opacity: 0.45;
    pointer-events: none;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-sheet {
    background: white;
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-header {
    padding: 16px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.modal-subtitle {
    font-size: 13px;
    color: #888;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.modal-no-source {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #888;
}

.modal-source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.modal-source-item:active,
.modal-source-item.selected {
    background: #f0fff0;
}

.modal-source-num {
    font-size: 14px;
    font-weight: 700;
    color: #007c00;
}

.modal-source-shop {
    font-size: 13px;
    color: #555;
    margin-top: 2px;
}

.modal-source-qty {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px 10px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

.btn-modal-cancel {
    flex: 1;
    padding: 13px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-confirm {
    flex: 2;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: #007c00;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-modal-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 220px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: #007c00; }
.toast.error   { background: #ff4757; }
