/* Viyug Mobile WMS - one-hand, high-contrast, big touch targets */
:root {
    --ink: #0f172a;
    --ink2: #475569;
    --bg: #eef2f7;
    --card: #ffffff;
    --line: #d9e1ec;
    --brand: #1d4ed8;
    --ok: #15803d;
    --warn: #b45309;
    --err: #b91c1c;
    --top: #0f172a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
    font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.w-boot { display: flex; height: 100vh; align-items: center; justify-content: center; font-weight: 700; color: var(--ink2); }
.w-app { min-height: 100vh; padding-bottom: 150px; transition: background-color .2s; }
.w-flash-ok { background: #dcfce7; }
.w-flash-err { background: #fee2e2; }

.w-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px; background: var(--top); color: #fff; }
.w-title { flex: 1; min-width: 0; }
.w-h1 { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-h2 { font-size: 13px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-iconbtn { width: 48px; height: 48px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12);
    display: inline-flex; align-items: center; justify-content: center; color: inherit; flex: none; }
.w-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px;
    border: 0; background: #166534; color: #fff; font-size: 14px; font-weight: 700; }
.w-pill .w-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; }
.w-pill.w-off { background: #7c2d12; }
.w-pill.w-off .w-dot { background: #fb923c; }
.w-pill.w-warn { background: #92400e; }
.w-banner { padding: 10px 14px; font-size: 15px; font-weight: 600; }
.w-banner-off { background: #fed7aa; color: #7c2d12; }
.w-banner-err { background: #fecaca; color: #7f1d1d; }
.w-banner a { color: inherit; }

.w-main { padding: 12px; }
.w-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.w-tile { min-height: 104px; border: 0; border-radius: 18px; color: #fff; display: flex; flex-direction: column;
    align-items: flex-start; justify-content: space-between; padding: 14px; font-size: 19px; font-weight: 800; text-align: start; }
.w-tile svg { width: 34px; height: 34px; }
.w-tile-ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.w-foot-info { margin-top: 16px; text-align: center; color: var(--ink2); font-size: 13px; }

.w-prompt { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 10px; border-radius: 14px;
    background: #dbeafe; color: #1e3a8a; font-weight: 700; }
.w-prompt-xl { flex-direction: column; justify-content: center; min-height: 40vh; font-size: 22px; text-align: center; background: var(--card); color: var(--ink2); border: 3px dashed var(--line); }
.w-prompt-xl svg { width: 64px; height: 64px; }
.w-empty { padding: 28px 12px; text-align: center; color: var(--ink2); font-weight: 600; }
.w-muted { color: var(--ink2); font-size: 14px; }
.w-pad { padding: 8px 0; }
.w-small { font-size: 13px; }
.w-grow { flex: 1; }
.w-full { width: 100%; display: flex; justify-content: center; margin-top: 8px; text-decoration: none; }

.w-card { display: block; width: 100%; text-align: start; background: var(--card); border: 2px solid var(--line);
    border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.w-card-row { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.w-card-sub { color: var(--ink2); font-size: 14px; margin-top: 4px; }
.w-card-conflict { border-color: #f59e0b; }
.w-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.w-card-actions .w-btn { flex: 1; }
.w-progress { font-weight: 800; font-variant-numeric: tabular-nums; }
.w-bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.w-bar > div { height: 100%; background: var(--ok); }
.w-tag { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: #e0e7ff; color: #3730a3; }
.w-tag-red { background: #fee2e2; color: var(--err); }

.w-docbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 2px 10px; font-size: 18px; }
.w-current { background: var(--top); color: #fff; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.w-current-wait { background: #1e3a8a; }
.w-prompt-big { font-size: 21px; font-weight: 800; }
.w-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.w-chip { border: 0; border-radius: 10px; padding: 6px 10px; background: rgba(255,255,255,.14); color: inherit; font-size: 14px; font-weight: 600; }
.w-form .w-chip { background: #e2e8f0; color: var(--ink); }
.w-chip small { opacity: .7; font-weight: 500; }
.w-chip-strong, .w-form .w-chip-strong { background: #facc15; color: #111; }
.w-chip-x { background: rgba(255,255,255,.25); }
.w-ok-note { background: #dcfce7; color: #14532d; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-weight: 700; }

.w-lines { display: flex; flex-direction: column; gap: 8px; }
.w-line { display: flex; gap: 10px; align-items: center; width: 100%; text-align: start; background: var(--card);
    border: 2px solid var(--line); border-inline-start: 8px solid #94a3b8; border-radius: 14px; padding: 10px 12px; min-height: 64px; }
.w-line-done { border-inline-start-color: var(--ok); background: #f0fdf4; }
.w-line-part { border-inline-start-color: #f59e0b; }
.w-line-active { border-color: var(--brand); }
.w-line-main { flex: 1; min-width: 0; }
.w-line-name { font-weight: 700; font-size: 17px; }
.w-line-sub { color: var(--ink2); font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.w-line-sub svg { width: 15px; height: 15px; }
.w-line-lots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.w-mini { font-size: 12px; background: #f1f5f9; border-radius: 6px; padding: 2px 6px; }
.w-line-qty { text-align: end; font-variant-numeric: tabular-nums; min-width: 72px; }
.w-line-qty b { font-size: 24px; display: block; }
.w-line-qty small { color: var(--ink2); font-size: 13px; }

.w-bottom { position: fixed; inset-inline: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 68px); z-index: 4; display: flex; gap: 8px;
    padding: 8px 12px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.w-bottom .w-btn { flex: 1; }
.w-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; padding: 0 16px;
    border-radius: 14px; border: 2px solid transparent; font-weight: 800; font-size: 17px; }
.w-btn svg { width: 22px; height: 22px; }
.w-btn-main { background: var(--brand); color: #fff; }
.w-btn-danger { background: var(--err); }
.w-btn-sec { background: var(--card); color: var(--ink); border-color: var(--line); }
.w-btn[disabled] { opacity: .45; }

.w-scanbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 4; display: flex; gap: 8px; align-items: center;
    padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px); background: var(--top); color: #fff; }
.w-scanbtn { flex: 1; height: 52px; border: 0; border-radius: 26px; background: #facc15; color: #111; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

.w-form { display: flex; flex-direction: column; gap: 10px; }
.w-field { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.w-field small { color: var(--ink2); font-size: 13px; font-weight: 600; }
.w-field b { font-size: 18px; }
.w-field input[type=text], .w-field select, .w-sheet input[type=text], .w-sheet input[type=number], .w-sheet select {
    width: 100%; min-height: 50px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; }
.w-check { flex-direction: row; align-items: center; font-weight: 700; }
.w-check input { width: 26px; height: 26px; }
.w-help { margin: 0; color: var(--ink2); font-size: 13px; }
.w-stepper { display: flex; gap: 8px; align-items: stretch; }
.w-stepper button { width: 64px; min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: #f8fafc; font-size: 28px; font-weight: 800; }
.w-stepper input { flex: 1; min-width: 0; text-align: center; font-size: 26px; font-weight: 800; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.w-stepper-xl input { font-size: 34px; min-height: 72px; }
.w-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.w-kpis > div { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; }
.w-kpis small { color: var(--ink2); font-size: 12px; font-weight: 700; }
.w-kpis b { font-size: 24px; }

.w-overlay { position: fixed; inset: 0; z-index: 10; background: rgba(15,23,42,.55); display: flex; align-items: flex-end; justify-content: center; }
.w-sheet, .w-dialog { width: 100%; max-width: 560px; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    display: flex; flex-direction: column; gap: 10px; max-height: 92vh; overflow: auto; }
.w-dialog { border-radius: 22px; margin: auto 12px; }
.w-sheet-title { font-size: 20px; font-weight: 800; }
.w-sheet-actions { display: flex; gap: 8px; }
.w-sheet-actions .w-btn { flex: 1; }
.w-video { width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: 14px; object-fit: cover; }
.w-toast { position: fixed; z-index: 20; inset-inline: 12px; top: calc(env(safe-area-inset-top, 0px) + 74px); padding: 12px 14px; border-radius: 14px;
    background: var(--top); color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.w-toast-ok { background: var(--ok); }
.w-toast-warn { background: var(--warn); }
.w-toast-error { background: var(--err); }
[dir=rtl] .w-iconbtn svg { transform: scaleX(-1); }
.w-section { margin: 14px 2px 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); }
.w-card-run { border-color: var(--ok); background: #f0fdf4; }
.w-kpis b.w-small { font-size: 14px; }
