/* ═══════════════════════════════════════════
   ORDERZ — Стили интерфейса сборки заказов
   ═══════════════════════════════════════════ */

/* ── Base ─────────────────────────────────── */
body {
    background: #f0f4f8;
    color: #1a202c;
    min-height: 100vh;
    margin: 0;
}

/* ── Cards ────────────────────────────────── */
.card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}

/* ── Bootstrap overrides ─────────────────── */
.btn-success  { background: #22c55e !important; border-color: #22c55e !important; }
.btn-warning  { background: #f59e0b !important; border-color: #f59e0b !important; color: #fff !important; }
.btn-outline-success { color: #22c55e !important; border-color: #22c55e !important; }
.btn-outline-success:hover { background: #22c55e !important; color: #fff !important; }
img.object-fit-cover { object-fit: cover; }

/* ── Item card layout ────────────────────── */
.item-card { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; margin-bottom: 10px; border: 1.5px solid #e2e8f0; background: #fff; order: 1; transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease; }
.item-card.done { opacity: 0.6; background: #f8fafc; order: 2; }
.item-card.missing { opacity: 0.7; background: #fff1f2; order: 3; }
.item-card.htmx-swapping { opacity: 0 !important; transform: translateY(30px) scale(0.95); }
.item-card.htmx-added { animation: flyIn 0.2s ease-out forwards; }
@keyframes flyIn { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
.item-card-main { display: flex; align-items: center; min-height: 90px; }
.item-info { flex-grow: 1; min-width: 0; padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.item-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; color: #1a202c; margin-bottom: 2px; word-wrap: break-word; }
.item-sku  { font-size: 0.75rem; color: #94a3b8; margin-bottom: 4px; word-wrap: break-word; }
.item-progress { font-size: 0.8rem; color: #64748b; }
.item-img-col { display: flex; flex-direction: column; align-items: center; width: 64px; margin-left: 12px; margin-top: 12px; margin-bottom: 12px; }
.item-image-thumb { object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; width: 60px; height: 60px; }
.item-qty-badge { background: #eef2ff; color: #1e3c72; font-size: 1.05rem; font-weight: 700; padding: 7px 16px; text-align: center; border-top: 1.5px solid #dbeafe; letter-spacing: 0.02em; }
.item-thumb-link { display: flex; align-items: center; cursor: pointer; }
.done-thumb { opacity: 0.5; }
.gallery-modal-img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; margin-bottom: 10px; display: block; }

/* ── [-] button ──────────────────────────── */
.btn-dec {
    width: 28px; height: 56px; flex-shrink: 0;
    margin: 12px 6px 12px 12px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #475569; border: none; font-size: 1.4rem; color: #fff;
    cursor: pointer; transition: background 0.15s, opacity 0.2s;
    user-select: none; text-decoration: none !important;
    box-shadow: 0 4px 6px rgba(71,85,105,0.35);
}
.btn-dec:hover { background: #dc2626; box-shadow: 0 4px 6px rgba(220,38,38,0.35); }
.hidden-dec { visibility: hidden; pointer-events: none; opacity: 0; }

/* ── [+] button ──────────────────────────── */
.btn-inc {
    width: 56px; height: 56px; flex-shrink: 0;
    margin: 12px 12px 12px 6px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #22c55e; border: none; font-size: 1.8rem; font-weight: bold; color: white;
    cursor: pointer; transition: background 0.15s;
    user-select: none; box-shadow: 0 4px 6px rgba(34,197,94,0.25);
    text-decoration: none !important;
}
.btn-inc:hover { background: #16a34a; }
.btn-inc.done-btn { width: 56px; height: 56px; background: #cbd5e1; color: #94a3b8; font-size: 1.4rem; box-shadow: none; pointer-events: none; }

/* ── Photo strip ─────────────────────────── */
dialog::backdrop { background: rgba(0,0,0,0.75); }
.photo-strip { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; margin-top: 8px; }
.photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid #e2e8f0; cursor: pointer; }
.photo-thumb:hover { border-color: #3b82f6; }

/* ── Action buttons ──────────────────────── */
.btn-back { display: inline-flex; align-items: center; padding: 6px 14px; background: #f1f5f9; color: #334155 !important; border: 1.5px solid #cbd5e1; border-radius: 8px; font-size: 0.9rem; font-weight: 500; cursor: pointer; text-decoration: none !important; transition: background 0.15s; }
.btn-back:hover { background: #e2e8f0; }

/* ── Photo buttons ───────────────────────── */
.btn-photo { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; cursor: pointer; text-decoration: none !important; transition: background 0.2s, border-color 0.2s, color 0.2s; white-space: nowrap; overflow: hidden; }
.btn-upload { background: #fff; color: #64748b !important; border: 1.5px solid #cbd5e1; }
.btn-upload:hover { background: #f1f5f9; color: #334155 !important; }
.btn-photo-cam { background: #f0fdf4; color: #15803d !important; border: 1.5px solid #86efac; }
.btn-photo-cam:hover { background: #dcfce7; border-color: #4ade80; }
.btn-photo-ready { background: #22c55e !important; border-color: #16a34a !important; color: #fff !important; box-shadow: 0 2px 8px rgba(34,197,94,0.35); }
.btn-photo-ready:hover { background: #16a34a !important; }
.btn-photo-taken { background: #bbf7d0 !important; border-color: #86efac !important; color: #166534 !important; }
.btn-photo-taken:hover { background: #86efac !important; }
.photo-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-photo-half { width: 100%; }
.btn-main-action { height: 56px; border-radius: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* ── Navbar — green theme ────────────────── */
nav.navbar,
.navbar.fixed-top,
.navbar.bg-body {
    --bs-body-bg: #587439;
    background-color: #587439 !important;
    border-bottom-color: rgba(255,255,255,0.15) !important;
}
.navbar .nav-link,
.navbar-nav .nav-link,
.fixed-top .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
}
.navbar .nav-link:hover,
.fixed-top .nav-link:hover { color: #fff !important; }
.navbar .nav-link.active,
.fixed-top .nav-link.active {
    background: rgba(255,255,255,0.18) !important;
    border-radius: 8px;
    color: #fff !important;
}
.navbar-brand { color: #fff !important; font-weight: 700; }
.navbar-toggler { border-color: rgba(255,255,255,0.4) !important; }
.navbar-toggler-icon { filter: invert(1) !important; }
.navbar-collapse { background: #587439; padding: 0 8px 8px; }

/* ── Mobile quick buttons ────────────────── */
@media (max-width: 991px) {
    .navbar-brand { display: none !important; }
    .mobile-quick-btns {
        display: flex !important; gap: 6px; flex-grow: 1;
        margin-right: 8px; justify-content: flex-end; align-items: center;
    }
    .mobile-quick-btns .btn { flex: 1; font-size: 0.85rem; font-weight: 600; padding: 0.4rem 0.2rem; }
}
@media (min-width: 992px) {
    .mobile-quick-btns { display: none !important; }
}
