/* Packing station.
   Hand-written rather than built with Tailwind: this screen is the one thing
   that must render on a bench tablet with no build step on the server, and its
   layout is specific enough that utility classes would not have saved anything.
   Sizes assume a 10-inch tablet at arm length. */

:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #1d4ed8;
    --ok: #15803d;
    --ok-bg: #dcfce7;
    --bad: #b91c1c;
    --bad-bg: #fee2e2;
    --warn: #b45309;
    --warn-bg: #fef3c7;
    --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; }

a { color: inherit; }

/* ---------------------------------------------------------------- structure */

.pack-shell { max-width: 1400px; margin: 0 auto; padding: 16px; }

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.topbar .brand { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.topbar .brand span { color: var(--brand); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 15px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 360px 1fr; align-items: start; }

@media (max-width: 900px) {
    .grid.two { grid-template-columns: 1fr; }
}

/* Below a tablet the 220px photo column would leave no room for the name. */
@media (max-width: 620px) {
    .line { grid-template-columns: 120px 1fr; }
    .line img, .line .noimg { width: 120px; height: 120px; }
    .line .qty { grid-column: 1 / -1; text-align: left; }
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.card h2 { margin: 0 0 4px; font-size: 20px; }
.card .sub { color: var(--muted); font-size: 15px; margin: 0 0 16px; }

/* -------------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
    padding: 0 26px;
    border: 0;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    font-size: 19px;
    font-weight: 650;
    cursor: pointer;
    font-family: inherit;
}

.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

.btn.huge { min-height: 96px; width: 100%; font-size: 26px; border-radius: 18px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: var(--bad); }
.btn.success { background: var(--ok); }
.btn.small { min-height: 46px; font-size: 16px; padding: 0 18px; }

/* After the variants, so a disabled success button still looks disabled.
   A green "Meg hianyzik 3 db" button reads as "press me". */
.btn[disabled],
.btn[disabled]:hover {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* --------------------------------------------------------------------- login */

.login-wrap { max-width: 820px; margin: 6vh auto; }

.packer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.packer-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 26px 16px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: inherit;
}

.packer-tile:hover { border-color: var(--brand); }

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 700;
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 340px; margin: 0 auto; }

.keypad button {
    min-height: 74px;
    font-size: 26px;
    font-weight: 600;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

.keypad button:hover { background: #f8fafc; }

.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 22px 0; }
.pin-dots i { width: 18px; height: 18px; border-radius: 999px; background: var(--line); display: block; }
.pin-dots i.on { background: var(--brand); }

/* --------------------------------------------------------------------- queue */

.queue-list { display: grid; gap: 12px; }

.queue-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.queue-row .num { font-weight: 700; font-size: 19px; }
.queue-row .meta { color: var(--muted); font-size: 15px; }

.shopdot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
    background: #f1f5f9;
    color: var(--muted);
}

.pill.cod { background: var(--bad-bg); color: var(--bad); }
.pill.foreign { background: var(--warn-bg); color: var(--warn); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.stat {
    flex: 1 1 140px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 18px;
}

.stat .n { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- pack order */

.order-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.order-head .num { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.order-head .customer { font-size: 18px; margin-top: 6px; }
.order-head .addr { color: var(--muted); font-size: 15px; }

.cod-banner {
    margin-top: 14px;
    padding: 14px 18px;
    background: var(--bad-bg);
    color: var(--bad);
    border-radius: 14px;
    font-size: 22px;
    font-weight: 700;
}

.note-banner {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--warn-bg);
    color: var(--warn);
    border-radius: 14px;
    font-size: 16px;
}

.lines { display: grid; gap: 14px; }

.line {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 16px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s, background .15s;
}

.line.done { border-color: var(--ok); background: var(--ok-bg); }
.line.flash-ok { animation: flashOk .7s ease-out; }
.line.flash-bad { animation: flashBad .7s ease-out; }

@keyframes flashOk {
    0% { background: #86efac; border-color: var(--ok); }
    100% { background: var(--ok-bg); }
}

@keyframes flashBad {
    0% { background: #fca5a5; border-color: var(--bad); }
    100% { background: var(--card); }
}

.line img,
.line .noimg {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.line .noimg { display: grid; place-items: center; color: #94a3b8; font-size: 13px; text-align: center; padding: 8px; }

.line .name { font-size: 22px; font-weight: 650; line-height: 1.3; }
.line .codes { margin-top: 10px; color: var(--muted); font-size: 16px; display: flex; gap: 14px; flex-wrap: wrap; }
.line .bin { font-weight: 700; color: var(--ink); background: #e0e7ff; padding: 2px 10px; border-radius: 8px; }

.line .qty { text-align: center; min-width: 130px; }
.line .qty .big { font-size: 34px; font-weight: 750; line-height: 1; }
.line .qty .big em { font-style: normal; color: var(--muted); font-size: 22px; }
.line .qty .l { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------------------------------------------------------------- scan strip */

.scanbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: var(--card);
    border: 2px solid var(--brand);
    border-radius: var(--radius);
}

.scanbar .icon { font-size: 26px; }
.scanbar .hint { font-weight: 650; font-size: 18px; }
.scanbar .sub { color: var(--muted); font-size: 14px; }

.scanbar.state-ok { border-color: var(--ok); background: var(--ok-bg); }
.scanbar.state-bad { border-color: var(--bad); background: var(--bad-bg); }

.scan-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.progress-line {
    height: 10px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    margin-top: 14px;
}

.progress-line i { display: block; height: 100%; background: var(--ok); transition: width .25s; }

/* -------------------------------------------------------------------- modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: grid;
    place-items: center;
    z-index: 60;
    padding: 20px;
}

.modal {
    background: var(--card);
    border-radius: 20px;
    padding: 28px;
    width: min(560px, 100%);
}

.modal h3 { margin: 0 0 6px; font-size: 24px; }
.modal p { margin: 0 0 20px; color: var(--muted); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 650; margin-bottom: 6px; }

.field input,
.field select {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    font-size: 19px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    color: inherit;
    background: #fff;
}

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 22px; font-weight: 650; color: var(--ink); margin-bottom: 8px; }


/* ------------------------------------------------------------ webshop choice */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.shop-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 0 18px;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 14px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.shop-tile:hover { border-color: var(--brand); }
.shop-tile.active { border-color: var(--brand); background: #eff6ff; }
.shop-tile .shopdot { width: 16px; height: 16px; flex: 0 0 auto; }

/* A queue row that is also a button: the whole row is the target, because a
   packer taps this with a scanner in the other hand. */
.queue-row.as-button {
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}

.queue-row.as-button:hover { border-color: var(--brand); background: #f8fafc; }

/* -------------------------------------------------------------- order tabs */

.order-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.order-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 650;
    color: var(--muted);
    cursor: pointer;
}

.order-tab:hover { border-color: var(--brand); }
.order-tab.active { border-color: var(--brand); background: #eff6ff; color: var(--brand); }

.order-tab .count {
    background: var(--line);
    color: var(--ink);
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 14px;
}

.order-tab.active .count { background: var(--brand); color: #fff; }

/* ---------------------------------------------------------- selection bar */

.selection-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.queue-row .select {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    cursor: pointer;
}

.queue-row.with-select { grid-template-columns: auto auto 1fr auto; }

.kbd {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #fff;
    font-family: ui-monospace, monospace;
    font-size: 14px;
    font-weight: 600;
}

/* ----------------------------------------------------------- product warning */

/* Deliberately loud. This is the one modal a packer must not dismiss on
   autopilot, so it does not look like the others. */
.precaution-backdrop { background: rgba(69, 10, 10, 0.72); }

.modal.precaution {
    border: 4px solid var(--bad);
    text-align: center;
    max-width: 620px;
}

.modal.precaution h3 { font-size: 30px; color: var(--bad); margin-bottom: 2px; }
.modal.precaution .product { font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 18px; }

.precaution-icon { font-size: 56px; line-height: 1; margin-bottom: 6px; }

.precaution-text {
    font-size: 21px;
    line-height: 1.45;
    padding: 18px 20px;
    background: var(--bad-bg);
    border-radius: 14px;
    color: #7f1d1d;
}

/* The same text, quietly, on the line itself — so it is visible again after
   the modal is gone. */
.precaution-inline {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bad-bg);
    color: var(--bad);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
}
