/* Supermarket POS - stylesheet (no external fonts or CDNs: works offline) */
:root {
    --primary: #0d7a5f;
    --primary-dark: #0a5d49;
    --primary-soft: #e3f4ee;
    --accent: #f5b301;
    --bg: #f2f5f4;
    --card: #ffffff;
    --text: #1b2a27;
    --muted: #6b7b77;
    --border: #dbe3e0;
    --danger: #c62828;
    --danger-soft: #fdecea;
    --warn: #b26a00;
    --warn-soft: #fff4e0;
    --ok-soft: #e6f6ec;
    --sidebar: #12352b;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16, 40, 33, .08), 0 4px 14px rgba(16, 40, 33, .05);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
small, .muted { color: var(--muted); }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }

/* ----- top bar & layout ----- */
.topbar {
    position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .8rem;
    background: var(--sidebar); color: #fff; padding: .55rem 1rem; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand-logo { height: 36px; width: auto; max-width: 90px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.user-chip { font-size: .92rem; } .user-chip small { color: #a9c7bd; }
.menu-toggle { display: none; background: transparent; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; padding: 0 .4rem; }
.shell { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
    width: 220px; flex: 0 0 220px; background: #fff; border-right: 1px solid var(--border);
    padding: .8rem .6rem; position: sticky; top: 56px; align-self: flex-start; height: calc(100vh - 56px); overflow-y: auto;
}
.sidebar a {
    display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; margin-bottom: 2px;
    color: var(--text); text-decoration: none; border-radius: 10px; font-weight: 600;
}
.sidebar a .ico { width: 1.4rem; text-align: center; }
.sidebar a:hover { background: var(--primary-soft); }
.sidebar a.active { background: var(--primary); color: #fff; }
.content { flex: 1; min-width: 0; padding: 1.2rem 1.4rem 3rem; }
.content-pos { padding: .8rem; }

/* ----- cards & grids ----- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card h2 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; border-left: 6px solid var(--primary); }
.stat .label { color: var(--muted); font-size: .88rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.7rem; font-weight: 800; margin-top: .2rem; }
.stat.warn { border-left-color: var(--accent); } .stat.danger { border-left-color: var(--danger); }
.stat.blue { border-left-color: #1f6fb2; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ----- buttons ----- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.1rem; font-size: 1rem; font-weight: 700; font-family: inherit;
    border: 2px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none;
    background: #e8eeec; color: var(--text); min-height: 44px; transition: filter .1s, transform .05s;
}
.btn:hover { filter: brightness(.96); } .btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn { background: var(--accent); color: #2b2000; }
.btn-outline { background: #fff; border-color: var(--border); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.content .btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-sm { padding: .35rem .75rem; font-size: .9rem; min-height: 36px; }
.btn-lg { padding: 1rem 1.4rem; font-size: 1.25rem; min-height: 60px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ----- forms ----- */
label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .93rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email],
input[type=search], input[type=tel], input[type=file], select, textarea {
    width: 100%; padding: .65rem .8rem; font-size: 1rem; font-family: inherit; color: var(--text);
    background: #fff; border: 2px solid var(--border); border-radius: 10px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,122,95,.18); }
textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.field { margin-bottom: 1rem; } .form-row .field { margin-bottom: 0; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.check input { width: 22px; height: 22px; }

/* ----- alerts ----- */
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: #14532d; border-color: #bfe5cd; }
.alert-error { background: var(--danger-soft); color: #7f1d1d; border-color: #f5c2bd; }
.alert-warning { background: var(--warn-soft); color: #7a4a00; border-color: #f3d9a4; }
.alert-info { background: #e8f1fb; color: #123e6b; border-color: #c5d9f0; }

/* ----- tables ----- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .96rem; }
table.data th { text-align: left; background: #f0f5f3; color: #36504a; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .6rem .7rem; white-space: nowrap; }
table.data td { padding: .6rem .7rem; border-top: 1px solid var(--border); vertical-align: middle; }
table.data tr:hover td { background: #fafcfb; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.row-low td { background: var(--warn-soft); }
tr.row-out td { background: var(--danger-soft); }
tr.row-void td { color: var(--muted); text-decoration: line-through; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e8eeec; }
.badge-ok { background: var(--ok-soft); color: #14532d; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.pager { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: 1rem; }
.pg { padding: .4rem .8rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; background: #fff; }
.pg.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg.disabled { opacity: .45; } .pg-info { margin-left: .6rem; color: var(--muted); font-size: .85rem; }

/* ----- simple bar chart (dashboard) ----- */
.bars { display: flex; align-items: flex-end; gap: .6rem; height: 170px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 56px; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-col .bv { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.bar-col .bl { font-size: .78rem; margin-top: 4px; font-weight: 600; }

/* ----- login / install ----- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem;
    background: linear-gradient(135deg, #0a5d49, #12352b); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { text-align: center; margin-bottom: .2rem; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 1.4rem; }
.auth-logo { display: block; margin: 0 auto .8rem; max-height: 70px; }

/* ================== POS screen ================== */
.pos {
    display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: .8rem;
    height: calc(100vh - 56px - 1.6rem);
}
.pos-left, .pos-right { display: flex; flex-direction: column; min-height: 0; }
.pos-left { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; }
.pos-right { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; }
.scan-row { display: flex; gap: .5rem; }
#searchInput { font-size: 1.3rem; padding: .85rem 1rem; min-height: 58px; border-color: var(--primary); }
.scan-status { min-height: 1.5rem; font-weight: 700; margin: .35rem 0; }
.scan-status.ok { color: var(--primary-dark); } .scan-status.err { color: var(--danger); }
.cats { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .5rem; }
.cat-chip { flex: 0 0 auto; padding: .55rem 1rem; border-radius: 999px; border: 2px solid var(--border); background: #fff; font-weight: 700; cursor: pointer; font-size: .95rem; font-family: inherit; min-height: 44px; }
.cat-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.product-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; align-content: start; padding: 2px; }
.tile {
    text-align: left; background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: .7rem .8rem;
    cursor: pointer; font-family: inherit; display: flex; flex-direction: column; justify-content: space-between; min-height: 92px;
}
.tile:hover { border-color: var(--primary); background: var(--primary-soft); }
.tile .tn { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.tile .tp { font-size: 1.1rem; font-weight: 800; color: var(--primary-dark); margin-top: .3rem; }
.tile .ts { font-size: .78rem; color: var(--muted); }
.tile.low .ts { color: var(--warn); font-weight: 700; }
.tile.out { opacity: .5; cursor: not-allowed; }
.grid-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2rem 1rem; }
.cart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.cart-head h2 { margin: 0; }
.cart { flex: 1; overflow-y: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 120px; }
.cart-empty { color: var(--muted); text-align: center; padding: 2.5rem 1rem; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .6rem .2rem; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.ci-name { font-weight: 700; overflow-wrap: anywhere; }
.ci-total { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ci-unit { color: var(--muted); font-size: .85rem; }
.ci-ctrl { display: flex; align-items: center; gap: .3rem; justify-self: end; }
.qty-btn { width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 10px; background: #fff; font-size: 1.4rem; font-weight: 800; cursor: pointer; line-height: 1; font-family: inherit; }
.qty-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.qty-input { width: 62px; text-align: center; font-weight: 800; font-size: 1.1rem; padding: .3rem; min-height: 44px; }
.rm-btn { width: 44px; height: 44px; border: 2px solid #f1c4c0; color: var(--danger); background: #fff; border-radius: 10px; font-size: 1.2rem; cursor: pointer; font-family: inherit; }
.rm-btn:hover { background: var(--danger-soft); }
.totals { padding: .6rem .2rem .2rem; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; }
.total-line.grand { font-size: 1.9rem; font-weight: 800; }
.total-line.change { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }
.total-line.change.short { color: var(--danger); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .5rem 0; }
.pay-btn { padding: .7rem .3rem; border: 2px solid var(--border); background: #fff; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: .95rem; font-family: inherit; min-height: 48px; }
.pay-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
#amountPaid { font-size: 1.5rem; font-weight: 800; text-align: right; min-height: 56px; }
.quick-cash { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; margin: .4rem 0; }
.quick-cash button { padding: .5rem 0; border: 2px solid var(--border); background: #fff; border-radius: 8px; font-weight: 700; cursor: pointer; font-family: inherit; min-height: 44px; }
.quick-cash button:hover { background: var(--primary-soft); border-color: var(--primary); }
.kbd { font-size: .72rem; color: var(--muted); margin-top: .3rem; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 25, 20, .6); display: none; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 1.6rem; width: 100%; max-width: 440px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal .big { font-size: 2.6rem; font-weight: 800; color: var(--primary-dark); margin: .2rem 0 .6rem; }
.modal .check-ico { font-size: 3rem; color: var(--primary); }
.modal .actions { justify-content: center; margin-top: 1rem; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1b2a27; color: #fff; padding: .7rem 1.2rem; border-radius: 10px; z-index: 300; display: none; font-weight: 600; max-width: 90vw; }
.toast.show { display: block; } .toast.err { background: var(--danger); }

/* ----- responsive ----- */
@media (max-width: 1100px) {
    .pos { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .sidebar { position: fixed; top: 56px; left: 0; z-index: 60; height: calc(100vh - 56px); transform: translateX(-105%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
    .sidebar.open { transform: none; }
    .content { padding: .9rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .user-chip { display: none; }
    .pos { grid-template-columns: 1fr; height: auto; }
    .pos-left { height: 60vh; }
    .pos-right { min-height: 80vh; }
}

/* ----- print (reports) ----- */
@media print {
    .topbar, .sidebar, .no-print, .pager, .filters, .alert { display: none !important; }
    body { background: #fff; } .content { padding: 0; } .card, .stat { box-shadow: none; border: 1px solid #ccc; }
    .shell { display: block; }
}
.layout-pos .menu-toggle{display:none!important}

/* ===================== v3: bold writing everywhere ===================== */
body { font-weight: 600; }
h1, h2, h3 { font-weight: 800; }
label { font-weight: 700; }
input, select, textarea { font-weight: 600; }
.btn, .pay-btn, .cat-chip, .qty-btn { font-weight: 800; }
.sidebar a { font-weight: 700; }
table.data td { font-weight: 600; }
table.data th { font-weight: 800; }
.muted, small, .hint, .kbd { font-weight: 600; }
.tile .tn { font-weight: 800; }
.stat .value { font-weight: 900; }
.alert { font-weight: 700; }

/* ===================== v3: login page (zoomed in, bold) ===================== */
.login-body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-weight: 700;
    background: linear-gradient(rgba(8, 40, 31, .30), rgba(8, 40, 31, .50)), var(--bg-img) center / cover no-repeat fixed;
}
.dev-bar {
    display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .9rem 1rem;
    background: rgba(255, 255, 255, .94); box-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}
.dev-logo { height: 64px; max-width: 70vw; width: auto; object-fit: contain; }
.dev-name { font-size: 1.5rem; font-weight: 900; color: #12352b; letter-spacing: .02em; }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.login-card {
    width: 100%; max-width: 580px; background: rgba(255, 255, 255, .97); border-radius: 22px;
    padding: 2.6rem 2.4rem; box-shadow: 0 18px 60px rgba(0, 0, 0, .45); border-top: 10px solid var(--accent);
}
.login-shop-logo { display: block; margin: 0 auto 1rem; max-height: 96px; max-width: 60%; object-fit: contain; }
.login-title { text-align: center; font-size: 2.6rem; font-weight: 900; line-height: 1.1; margin: 0 0 .5rem; color: #0a3d30; letter-spacing: -.01em; }
.login-sub { text-align: center; font-size: 1.35rem; font-weight: 800; color: var(--primary); margin: 0 0 .3rem; }
.login-hint { text-align: center; font-size: 1.1rem; font-weight: 700; color: #3b4f49; margin: 0 0 1.6rem; }
.login-card label { font-size: 1.2rem; font-weight: 800; margin-bottom: .4rem; }
.login-card input[type=text], .login-card input[type=password] {
    font-size: 1.4rem; font-weight: 700; padding: 1rem 1.1rem; min-height: 62px; border-width: 3px; border-radius: 14px;
}
.login-card .field { margin-bottom: 1.3rem; }
.login-btn { font-size: 1.55rem; font-weight: 900; min-height: 70px; border-radius: 16px; letter-spacing: .02em; }
.login-card .alert { font-size: 1.1rem; }
@media (max-width: 520px) {
    .login-card { padding: 1.8rem 1.2rem; border-radius: 18px; }
    .login-title { font-size: 2.1rem; }
    .dev-logo { height: 52px; }
}

/* ===================== v3: dashboard banner ===================== */
.hero {
    position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 1rem; color: #fff; padding: 1.6rem 1.6rem;
    background: linear-gradient(90deg, rgba(8, 40, 31, .88), rgba(8, 40, 31, .35)), var(--bg-img) center / cover no-repeat;
    box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.hero h1 { margin: 0; font-size: 2rem; font-weight: 900; color: #fff; }
.hero p { margin: .2rem 0 0; font-size: 1.1rem; font-weight: 700; color: #e3f4ee; }

/* ===================== v4: dark checkout screen (GrayDesk style) ===================== */
.layout-pos { background: linear-gradient(160deg, #0b1b3a 0%, #102a5c 55%, #0a1733 100%); color: #eaf0ff; min-height: 100vh; }
.layout-pos .content-pos { padding: .6rem; }
.layout-pos .topbar { background: rgba(8, 18, 42, .92); }
.pos2 { display: grid; grid-template-columns: 96px minmax(0, 1fr) 420px; gap: .7rem; height: calc(100vh - 56px - 1.2rem); }
.pos2 .p-cats { display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; padding-right: 2px; }
.pos2 .cat-chip { border-radius: 14px; min-height: 64px; padding: .5rem .3rem; text-align: center; background: rgba(255,255,255,.08); color: #dbe6ff; border: 2px solid rgba(255,255,255,.15); font-size: .9rem; overflow-wrap: anywhere; }
.pos2 .cat-chip:hover { background: rgba(255,255,255,.16); }
.pos2 .cat-chip.active { background: #2f7bff; border-color: #7db0ff; color: #fff; box-shadow: 0 4px 14px rgba(47,123,255,.45); }
.pos2 .p-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pos2 .p-search input { width: 100%; font-size: 1.25rem; min-height: 56px; border-radius: 14px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; padding: .7rem 1rem; }
.pos2 .p-search input::placeholder { color: #9fb4e6; }
.pos2 .p-search input:focus { outline: none; border-color: #7db0ff; background: rgba(255,255,255,.16); }
.pos2 .scan-status { color: #cfe0ff; min-height: 1.4rem; margin: .3rem 0; }
.pos2 .scan-status.ok { color: #6ff0b0; } .pos2 .scan-status.err { color: #ff9a9a; }
.pos2 .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.pos2 .tile { background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.14); color: #fff; border-radius: 14px; padding: .5rem; align-items: stretch; justify-content: flex-start; gap: .15rem; min-height: 0; text-align: center; }
.pos2 .tile:hover { background: rgba(47,123,255,.28); border-color: #7db0ff; }
.pos2 .tpic { display: flex; align-items: center; justify-content: center; height: 86px; border-radius: 10px; background: rgba(255,255,255,.12); font-size: 2.2rem; font-weight: 900; color: #9fc0ff; overflow: hidden; margin-bottom: .2rem; }
.pos2 .tpic img { width: 100%; height: 100%; object-fit: cover; }
.pos2 .tile .tn { font-size: .95rem; line-height: 1.15; }
.pos2 .tile .tp { color: #ffd54a; font-size: 1.05rem; margin: 0; }
.pos2 .tile .ts { color: #a9bce6; }
.pos2 .tile.low .ts { color: #ffc266; } .pos2 .tile.out { opacity: .4; }
.pos2 .grid-empty { color: #a9bce6; }
.pos2 .more-btn { margin-top: .5rem; padding: .7rem; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: transparent; color: #fff; font-weight: 800; cursor: pointer; font-family: inherit; }
.pos2 .p-cart { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: rgba(6, 14, 34, .72); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; padding: .8rem; }
.pos2 .cart-head h2 { color: #fff; font-size: 1.2rem; }
.pos2 .cart-head small { color: #9fb4e6; }
.pos2 .cust-btn { background: rgba(255,255,255,.1); color: #fff; border: 2px solid rgba(255,255,255,.2); border-radius: 999px; padding: .4rem .8rem; font-weight: 800; cursor: pointer; font-family: inherit; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos2 .cart { border-color: rgba(255,255,255,.15); min-height: 150px; flex: 1 1 200px; }
.pos2 .cart-empty { color: #9fb4e6; padding: 1.4rem .5rem; }
.pos2 .cart-item { border-color: rgba(255,255,255,.1); padding: .4rem .2rem; align-items: center; grid-template-columns: minmax(0,1fr) auto 78px; gap: .1rem .5rem; }
.pos2 .ci-unit { color: #9fb4e6; }
.pos2 .ci-total { color: #ffd54a; }
.pos2 .ci-ctrl { grid-column: auto; grid-row: 1; grid-area: auto; order: 0; }
.pos2 .cart-item > .ci-total { grid-column: 3; grid-row: 1; }
.pos2 .cart-item > .ci-ctrl { grid-column: 2; grid-row: 1; }
.pos2 .qty-btn { width: 34px; height: 34px; font-size: 1.2rem; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.pos2 .qty-input { width: 46px; min-height: 34px; padding: .1rem; font-size: 1rem; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.pos2 .rm-btn { width: 34px; height: 34px; margin-left: .2rem; font-size: 1rem; background: transparent; border-color: rgba(255,120,120,.5); color: #ff8a8a; }
.pos2 .sum { padding: .5rem .1rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.pos2 .sum-line { display: flex; justify-content: space-between; align-items: center; padding: .15rem 0; font-size: 1rem; }
.pos2 .sum-line.grand { font-size: 1.8rem; font-weight: 900; color: #ffd54a; }
.pos2 .sum-line.change { font-size: 1.3rem; font-weight: 800; color: #6ff0b0; }
.pos2 .sum-line.change.short { color: #ff9a9a; }
.pos2 .disc-box { display: inline-flex; gap: .3rem; }
.pos2 .disc-box input { width: 90px; min-height: 36px; text-align: right; padding: .2rem .5rem; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.pos2 .disc-mode { min-width: 52px; border-radius: 8px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; font-weight: 800; cursor: pointer; font-family: inherit; }
.pos2 .pay-methods { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.pos2 .pay-btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); min-height: 42px; padding: .4rem .2rem; font-size: .85rem; }
.pos2 .pay-btn.active { background: #2f7bff; border-color: #7db0ff; }
.pos2 .cash-row { display: flex; align-items: center; gap: .6rem; }
.pos2 .cash-row label { color: #cfe0ff; white-space: nowrap; margin: 0; }
.pos2 #amountPaid, .pos2 #payRefInput { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); min-height: 46px; font-size: 1.3rem; }
.pos2 #payRefInput { font-size: 1rem; }
.pos2 #refBox label { color: #cfe0ff; }
.pos2 .quick-cash button { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); min-height: 38px; }
.pos2 .note { color: #cfe0ff; font-size: .85rem; margin: .4rem 0; }
.pos2 .kbd { color: #7f95c9; text-align: center; }
.pos2 .act-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; }
.pos2 .abtn { min-height: 54px; border: 0; border-radius: 12px; font-weight: 900; font-size: 1rem; color: #fff; cursor: pointer; font-family: inherit; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.pos2 .abtn:disabled { opacity: .4; cursor: not-allowed; }
.pos2 .abtn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.pos2 .b-hold { background: #2f7bff; } .pos2 .b-resume { background: #8a5cf6; } .pos2 .b-checkout { background: #1fa971; }
.pos2 .b-new { background: #f08a1c; } .pos2 .b-void { background: #e04848; } .pos2 .b-preview { background: #17a2c4; }
.pos2 .b-checkout { grid-column: auto; }
/* dialogs on the checkout screen */
.pick-list { display: flex; flex-direction: column; gap: .4rem; max-height: 50vh; overflow-y: auto; margin: .6rem 0; }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 2px solid var(--border); border-radius: 10px; background: #fff; font-family: inherit; text-align: left; }
.pick-btn { cursor: pointer; width: 100%; } .pick-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.pick-row.grand { font-size: 1.2rem; border-color: var(--primary); }
.pick-acts { display: flex; gap: .3rem; }
@media (max-width: 1100px) { .pos2 { grid-template-columns: 84px minmax(0, 1fr) 360px; } }
@media (max-width: 900px) {
    .layout-pos .content-pos { padding: .5rem; }
    .layout-pos .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: .4rem .6rem; }
    .layout-pos .brand span { font-size: 1.05rem; }
    .pos2 { grid-template-columns: minmax(0, 1fr); height: auto; gap: .6rem; padding-bottom: 70px; }
    .pos2 .p-cats { flex-direction: row; overflow-x: auto; padding-bottom: .2rem; }
    .pos2 .cat-chip { flex: 0 0 auto; min-width: 84px; min-height: 44px; padding: .4rem .9rem; }
    .pos2 .p-search input { font-size: 1.05rem; min-height: 50px; }
    .pos2 .product-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); grid-auto-rows: max-content; overflow: visible; max-height: none; flex: none; }
    .pos2 .tpic { height: 70px; font-size: 1.8rem; }
    .pos2 .p-cart { overflow: visible; }
    .pos2 .cart { flex: none; max-height: 40vh; }
    .pos2 .act-grid { grid-template-columns: repeat(2, 1fr); }
    .pos2 .b-checkout { grid-column: 1 / -1; order: -1; min-height: 62px; font-size: 1.15rem; }
    .pos2 .sum-line.grand { font-size: 1.6rem; }
}
@media (max-width: 380px) { .pos2 .product-grid { grid-template-columns: repeat(2, 1fr); } }
.pos2 .product-grid { grid-auto-rows: max-content; }
.mobbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: #0a1733; border-top: 2px solid #2f7bff; padding: .5rem .7rem; align-items: center; justify-content: space-between; gap: .6rem; color: #fff; font-weight: 800; }
.mobbar .mb-total { color: #ffd54a; font-size: 1.25rem; }
.mobbar button { background: #1fa971; color: #fff; border: 0; border-radius: 12px; padding: .7rem 1.1rem; font-weight: 900; font-size: 1rem; font-family: inherit; cursor: pointer; }
@media (max-width: 900px) { .mobbar { display: flex; } }

/* ===== v6: Password / Sign out live in the side menu on phones ===== */
.side-account { display: none; border-top: 2px solid var(--border); margin-top: .6rem; padding-top: .6rem; }
.side-user { padding: .4rem 1rem; font-weight: 800; } .side-user small { color: var(--muted); }
.side-out { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .75rem 1rem; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--danger); cursor: pointer; text-align: left; border-radius: 10px; }
.side-out:hover { background: var(--danger-soft); }
.side-out .ico { width: 1.4rem; text-align: center; }
@media (max-width: 900px) {
    .sidebar { overflow-y: auto; padding-bottom: 5rem; }
    .side-account { display: block; }
    .topbar-right.tb-app { display: none; }
}

/* ===== v7: landing page (Administrator / Sales person) ===== */
.landing-card { max-width: 640px; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .8rem; }
.role-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; padding: 1.4rem 1rem; border-radius: 16px; text-decoration: none; color: #fff; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .12s; }
.role-card:hover { transform: translateY(-3px); }
.role-admin { background: linear-gradient(145deg, #0d7a5f, #0a5d49); }
.role-sales { background: linear-gradient(145deg, #2f7bff, #1d4fb8); }
.role-ico { font-size: 2.8rem; line-height: 1; }
.role-name { font-size: 1.4rem; font-weight: 900; }
.role-desc { font-size: .9rem; font-weight: 700; opacity: .92; }
@media (max-width: 560px) { .role-grid { grid-template-columns: 1fr; } }

/* ===== v8: nothing may push the page wider than the screen ===== */
html, body { max-width: 100%; overflow-x: hidden; }
.alert, .card, .stat, td, th { overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.alert strong, .alert code { word-break: break-all; }
@media (max-width: 700px) {
    .content { padding: .8rem .7rem 3rem; }
    .page-head { flex-wrap: wrap; gap: .5rem; }
    .filters .field { flex: 1 1 100%; }
    .filters .btn { flex: 1 1 auto; }
    /* tables marked "stack" become one card per row on phones */
    table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
    table.stack thead { display: none; }
    table.stack tr { border: 2px solid var(--border); border-radius: 12px; margin-bottom: .7rem; padding: .3rem .6rem; background: #fff; }
    table.stack tr.row-out { border-color: #f1c4c0; }
    table.stack td { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; border-top: 0; padding: .4rem 0; text-align: right !important; }
    table.stack td::before { content: attr(data-label); font-weight: 800; color: var(--muted); text-align: left; flex: 0 0 38%; font-size: .85rem; text-transform: uppercase; }
    table.stack td:not([data-label])::before { content: none; }
    table.stack td:not([data-label]) { justify-content: flex-end; }
}

/* ===== v9: full-width pages on phones (nothing may widen the page) ===== */
.shell { overflow-x: clip; max-width: 100vw; }
.topbar { width: 100%; box-sizing: border-box; }
@media (max-width: 700px) {
    table.stack td, table.stack td * { white-space: normal !important; overflow-wrap: anywhere; min-width: 0; }
    table.stack td { min-width: 0; }
}

/* ===== v10: phone menu shows every page at once (two columns) ===== */
@media (max-width: 900px) {
    .sidebar { width: min(94vw, 440px); display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; align-content: start; padding: .6rem; overflow-y: auto; }
    .sidebar > a { margin: 0; padding: .65rem .6rem; gap: .5rem; font-size: .95rem; border: 2px solid var(--border); border-radius: 12px; min-width: 0; line-height: 1.15; }
    .sidebar > a.active { border-color: var(--primary); }
    .sidebar > a .ico { width: 1.3rem; flex: 0 0 1.3rem; }
    .side-account { grid-column: 1 / -1; margin-top: .3rem; padding-top: .4rem; }
    .side-account a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
    .side-user { padding: .2rem .8rem; }
}

/* ===== v11: messages page, progress bar, WhatsApp button ===== */
.progress { height: 14px; background: #e3eae7; border-radius: 999px; overflow: hidden; margin: .6rem 0; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.wa-float { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; align-items: center; gap: .5rem; background: #25d366; color: #fff; text-decoration: none; padding: .75rem 1.1rem; border-radius: 999px; font-weight: 900; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.wa-float svg { width: 26px; height: 26px; fill: #fff; flex: 0 0 26px; }
.wa-float small { display: block; font-weight: 700; font-size: .7rem; opacity: .95; }

/* ===== v12: WhatsApp inside the app, blinking copyright ===== */
.wa-up { bottom: 84px; }
.wa-pos { right: auto; left: 16px; }
@media (max-width: 900px) { .wa-pos { left: auto; right: 12px; bottom: 80px; } .wa-float { padding: .6rem .9rem; } }
@media print { .wa-float { display: none !important; } }
.copyright-bar { position: static; width: 100%; box-sizing: border-box; margin-top: auto; z-index: 70; background: rgba(8, 18, 12, .92); padding: .6rem 1rem; text-align: center; border-top: 2px solid #ffd54a; }
.copyright-bar .blink { color: #ffd54a; font-weight: 800; font-size: .95rem; line-height: 1.35; animation: smpos-blink 1.2s ease-in-out infinite; }
@keyframes smpos-blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .copyright-bar .blink { animation: none; } }
@media (max-width: 600px) { .copyright-bar .blink { font-size: .8rem; } .wa-up { bottom: 112px; } }
.owner-box { background: #fff8e1; border: 2px solid #ffd54a; border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; text-align: center; color: #3b2f00; }
.owner-num { font-size: 1.5rem; font-weight: 900; margin: .2rem 0 .5rem; letter-spacing: .03em; }
.owner-btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; }
.owner-line { color: #fff; font-weight: 800; font-size: .9rem; margin-bottom: .3rem; }
.owner-line a { color: #7ff0a8; }

.wa-inline { position: static; justify-content: center; margin: 1.1rem auto 0; max-width: 340px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.wa-up { bottom: 16px; }
.landing-body-fix { display: flex; flex-direction: column; }
